Skip to content

Commit

Permalink
Feature: Paired t-test table visualization (#3473)
Browse files Browse the repository at this point in the history
* Feature: paired t-test table viz

* Added unit tests for viz
  • Loading branch information
Mogball authored and mistercrunch committed Sep 26, 2017
1 parent 7d934e7 commit c629282
Show file tree
Hide file tree
Showing 9 changed files with 582 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1370,5 +1370,26 @@ export const controls = {
description: t('The color scheme for rendering chart'),
schemes: ALL_COLOR_SCHEMES,
},

significance_level: {
type: 'TextControl',
label: 'Significance Level',
default: 0.05,
description: 'Threshold alpha level for determining significance',
},

pvalue_precision: {
type: 'TextControl',
label: 'p-value precision',
default: 6,
description: 'Number of decimal places with which to display p-values',
},

liftvalue_precision: {
type: 'TextControl',
label: 'Lift % precision',
default: 4,
description: 'Number of decimal places with which to display lift values',
},
};
export default controls;
18 changes: 18 additions & 0 deletions superset/assets/javascripts/explore/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,24 @@ export const visTypes = {
},
},
},

paired_ttest: {
label: 'Time Series - Paired t-test',
showOnExplore: true,
requiresTime: true,
controlPanelSections: [
sections.NVD3TimeSeries[0],
{
label: 'Paired t-test',
expanded: false,
controlSetRows: [
['significance_level'],
['pvalue_precision'],
['liftvalue_precision'],
],
},
],
},
};

export default visTypes;
Expand Down
1 change: 1 addition & 0 deletions superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"d3-tip": "^0.6.7",
"datamaps": "^0.5.8",
"datatables.net-bs": "^1.10.15",
"distributions": "^1.0.0",
"immutable": "^3.8.1",
"jed": "^1.1.1",
"po2json": "^0.4.5",
Expand Down
1 change: 1 addition & 0 deletions superset/assets/visualizations/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ const vizMap = {
world_map: require('./world_map.js'),
dual_line: require('./nvd3_vis.js'),
event_flow: require('./EventFlow.jsx'),
paired_ttest: require('./paired_ttest.jsx'),
};
export default vizMap;
67 changes: 67 additions & 0 deletions superset/assets/visualizations/paired_ttest.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.paired_ttest .scrollbar-container {
overflow: scroll;
}

.paired-ttest-table .scrollbar-content {
padding-left: 5px;
padding-right: 5px;
margin-bottom: 0;
}

.paired-ttest-table h1 {
margin-left: 5px;
}

.reactable-data tr,
.reactable-header-sortable {
-webkit-transition: ease-in-out 0.1s;
transition: ease-in-out 0.1s;
}

.reactable-data tr:hover {
background-color: #e0e0e0;
}

.reactable-data tr .false {
color: #f44336;
}

.reactable-data tr .true {
color: #4caf50;
}

.reactable-data tr .control {
color: #2196f3;
}

.reactable-data tr .invalid {
color: #ff9800;
}

.reactable-data .control td {
background-color: #eeeeee;
}

.reactable-header-sortable:hover,
.reactable-header-sortable:focus,
.reactable-header-sort-asc,
.reactable-header-sort-desc {
background-color: #e0e0e0;
position: relative;
}

.reactable-header-sort-asc:after {
content: '\25bc';
position: absolute;
right: 10px;
}

.reactable-header-sort-desc:after {
content: '\25b2';
position: absolute;
right: 10px;
}

.paired-ttest-table table {
margin-bottom: 0;
}
Loading

0 comments on commit c629282

Please sign in to comment.