Skip to content

Commit

Permalink
Adds support for explore box plots (no SOM support yet). One bug in d…
Browse files Browse the repository at this point in the history
  • Loading branch information
amergin committed Mar 18, 2016
1 parent 48d38ef commit 9ede0c5
Show file tree
Hide file tree
Showing 7 changed files with 504 additions and 6 deletions.
25 changes: 24 additions & 1 deletion src/app/vis/menucomponents/new-graphmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ angular.module('plotter.vis.menucomponents.new-graphmenu',

case 2:
return { 'type': 'heatmap', 'data': $scope.heatmap.selection };

case 3:
return { 'type': 'boxplot', 'data': $scope.boxplot.selection };
}
}

Expand All @@ -54,6 +57,10 @@ angular.module('plotter.vis.menucomponents.new-graphmenu',
selection: []
};

$scope.boxplot = {
selection: []
};

// controllers of the menu dialog:
$scope.canSubmit = function() {
var selection = getSelection();
Expand All @@ -63,7 +70,11 @@ angular.module('plotter.vis.menucomponents.new-graphmenu',
else if($scope.tab.ind === 1) {
return _.size(selection.data.x) > 0 &&
_.size(selection.data.y) > 0;
} else if($scope.tab.ind === 2) {
}
else if($scope.tab.ind === 2) {
return selection.data.length > 0;
}
else if($scope.tab.ind === 3) {
return selection.data.length > 0;
}
};
Expand Down Expand Up @@ -100,6 +111,15 @@ angular.module('plotter.vis.menucomponents.new-graphmenu',
error = true;
}
}

else if(selection.type == 'boxplot') {
dimensionCount = DimensionService.getPrimary().availableDimensionsCount();
if(dimensionCount < selection.data.length) {
NotifyService.addSticky('Too many selected variables', 'Please select a maximum of ' + dimensionCount + ' variables. You can free variables by first closing unnecessary figure windows on this tab.',
'error', { referenceId: 'graphinfo' });
error = true;
}
}
return error;
}

Expand Down Expand Up @@ -134,6 +154,9 @@ angular.module('plotter.vis.menucomponents.new-graphmenu',
},
{
label: 'Heatmap'
},
{
label: 'Boxplot'
}
];

Expand Down
7 changes: 6 additions & 1 deletion src/app/vis/menucomponents/new.graphmenu.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<tab select="selectTab(0)">
<tab-heading>Histogram</tab-heading>
<h1>Histogram</h1>
<div class="multiple-variable-selection" re-selection="histogram.selection" re-mode="'multi'"></div>
<div class="multiple-variable-selection" re-selection="histogram.selection" re-mode="'multi'"></div>
</tab>
<tab select="selectTab(1)">
<tab-heading>Scatterplot</tab-heading>
Expand All @@ -23,6 +23,11 @@ <h1>Heatmap</h1>
</div>
</div>
</tab>
<tab select="selectTab(3)">
<tab-heading>Box plot</tab-heading>
<h1>Box plot</h1>
<div class="multiple-variable-selection" re-selection="boxplot.selection" re-mode="'multi'"></div>
</tab>
</tabset>
<div class="row col-sm-12 text-center">
<div growl inline="true" limit-messages="4" reference="graphinfo" class="am-fade"></div>
Expand Down
Loading

0 comments on commit 9ede0c5

Please sign in to comment.