Merge pull request #1564 from janusd/viz-map-column-fix

Fix: options selection in the map visualization editor (lat, long, groupBy)
This commit is contained in:
Arik Fraimovich 2017-02-10 20:10:00 +02:00 committed by GitHub
commit db9c925cbb
2 changed files with 24 additions and 7 deletions

View File

@ -218,7 +218,9 @@ function mapEditor() {
template: editorTemplate,
link($scope) {
$scope.currentTab = 'general';
$scope.classify_columns = $scope.queryResult.columnNames.concat('none');
$scope.columns = $scope.queryResult.getColumns();
$scope.columnNames = _.pluck($scope.columns, 'name');
$scope.classify_columns = $scope.columnNames.concat('none');
$scope.mapTiles = [
{
name: 'OpenStreetMap',

View File

@ -8,20 +8,35 @@
<div ng-show="currentTab == 'general'">
<div class="form-group">
<label class="control-label">Latitude Column Name</label>
<select ng-options="name for name in queryResult.columnNames" ng-model="visualization.options.latColName"
class="form-control"></select>
<ui-select name="form-control" required ng-model="visualization.options.latColName">
<ui-select-match placeholder="Choose column...">{{$select.selected}}</ui-select-match>
<ui-select-choices repeat="column in columnNames | remove:visualization.options.classify | remove:visualization.options.lonColName">
<span ng-bind-html="column | highlight: $select.search"></span><span> </span>
<small class="text-muted" ng-bind="columns[column].type"></small>
</ui-select-choices>
</ui-select>
</div>
<div class="form-group">
<label class="control-label">Longitude Column Name</label>
<select ng-options="name for name in queryResult.columnNames" ng-model="visualization.options.lonColName"
class="form-control"></select>
<ui-select name="form-control" required ng-model="visualization.options.lonColName">
<ui-select-match placeholder="Choose column...">{{$select.selected}}</ui-select-match>
<ui-select-choices repeat="column in columnNames | remove:visualization.options.classify | remove:visualization.options.latColName">
<span ng-bind-html="column | highlight: $select.search"></span><span> </span>
<small class="text-muted" ng-bind="columns[column].type"></small>
</ui-select-choices>
</ui-select>
</div>
<div class="form-group">
<label class="control-label">Group By</label>
<select ng-options="name for name in classify_columns" ng-model="visualization.options.classify"
class="form-control"></select>
<ui-select name="form-control" required ng-model="visualization.options.classify">
<ui-select-match placeholder="Choose column...">{{$select.selected}}</ui-select-match>
<ui-select-choices repeat="column in classify_columns | remove:visualization.options.lonColName | remove:visualization.options.latColName">
<span ng-bind-html="column | highlight: $select.search"></span><span> </span>
<small class="text-muted" ng-bind="columns[column].type"></small>
</ui-select-choices>
</ui-select>
</div>
</div>