Skip to content

Commit

Permalink
update proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Sep 5, 2018
1 parent 0b66d36 commit 751eef5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import React from 'react';
import TTestTable from './TTestTable';
import TTestTable, { dataPropType } from './TTestTable';
import './PairedTTest.css';

const propTypes = {
className: PropTypes.string,
metrics: PropTypes.arrayOf(PropTypes.string).isRequired,
groups: PropTypes.array.isRequired,
data: PropTypes.object.isRequired,
groups: PropTypes.arrayOf(PropTypes.string).isRequired,
data: PropTypes.objectOf(dataPropType).isRequired,
alpha: PropTypes.number,
liftValPrec: PropTypes.number,
pValPrec: PropTypes.number,
Expand Down Expand Up @@ -67,6 +67,8 @@ function adaptor(slice, payload) {
significance_level: alpha,
} = formData;

console.log('groups', groups, payload.data);

ReactDOM.render(
<PairedTTest
metrics={metrics}
Expand Down
12 changes: 10 additions & 2 deletions superset/assets/src/visualizations/PairedTTest/TTestTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ import React from 'react';
import { Table, Tr, Td, Thead, Th } from 'reactable';
import PropTypes from 'prop-types';

export const dataPropType = PropTypes.arrayOf(PropTypes.shape({
group: PropTypes.arrayOf(PropTypes.string),
values: PropTypes.arrayOf(PropTypes.shape({
x: PropTypes.number,
y: PropTypes.number,
})),
}));

const propTypes = {
metric: PropTypes.string.isRequired,
groups: PropTypes.array.isRequired,
data: PropTypes.array.isRequired,
groups: PropTypes.arrayOf(PropTypes.string).isRequired,
data: dataPropType.isRequired,
alpha: PropTypes.number,
liftValPrec: PropTypes.number,
pValPrec: PropTypes.number,
Expand Down

0 comments on commit 751eef5

Please sign in to comment.