Skip to content

Commit

Permalink
Fix: make default options apply to new visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Jul 2, 2015
1 parent e5cb582 commit 0b61b88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions rd_ui/app/scripts/visualizations/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
if (type && oldType != type && scope.visualization && !scope.visForm.name.$dirty) {
scope.visualization.name = _.string.titleize(scope.visualization.type);
}

scope.visualization.options = Visualization.visualizations[scope.visualization.type].defaultOptions;
});

scope.submit = function () {
Expand Down
8 changes: 4 additions & 4 deletions rd_ui/app/scripts/visualizations/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
'</map-renderer>';

var editTemplate = '<map-editor></map-editor>';
var defaultOptions = { 'height': 500 };
var defaultOptions = {
'height': 500,
'draw': 'Marker'
};

VisualizationProvider.registerVisualization({
type: 'MAP',
Expand Down Expand Up @@ -227,9 +230,6 @@
link: function($scope, elm, attrs) {
$scope.visualization.options.draw_options = ['Marker','Color'];
$scope.visualization.options.classify_columns = $scope.queryResult.columnNames.concat('none');

//FIXME: The following line should be removed when defaultOptions work
$scope.visualization.options.height = $scope.visualization.options.height || 500;
}
}
});
Expand Down

0 comments on commit 0b61b88

Please sign in to comment.