From 5acabc6ccbfab78b7441e2894e0ba7513025ac29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 4 May 2017 19:56:20 +0200 Subject: [PATCH] heatmap: refactoring --- .../app/plugins/panel/heatmap/axes_editor.ts | 6 -- .../app/plugins/panel/heatmap/heatmap_ctrl.ts | 12 ++- .../panel/heatmap/partials/axes_editor.html | 84 +++++++++++-------- 3 files changed, 58 insertions(+), 44 deletions(-) diff --git a/public/app/plugins/panel/heatmap/axes_editor.ts b/public/app/plugins/panel/heatmap/axes_editor.ts index 32ea66cc4d9..46926697522 100644 --- a/public/app/plugins/panel/heatmap/axes_editor.ts +++ b/public/app/plugins/panel/heatmap/axes_editor.ts @@ -8,7 +8,6 @@ export class AxesEditorCtrl { unitFormats: any; logScales: any; dataFormats: any; - yBucketModes: any[]; /** @ngInject */ constructor($scope, uiSegmentSrv) { @@ -29,11 +28,6 @@ export class AxesEditorCtrl { 'Time series': 'timeseries', 'Time series Pre-bucketed': 'tsbuckets' }; - - this.yBucketModes = [ - {text: 'Count', value: 'count'}, - {text: 'Interval', value: 'interval'}, - ]; } setUnitFormat(subItem) { diff --git a/public/app/plugins/panel/heatmap/heatmap_ctrl.ts b/public/app/plugins/panel/heatmap/heatmap_ctrl.ts index 8a7672f7a23..5c5f8b33efb 100644 --- a/public/app/plugins/panel/heatmap/heatmap_ctrl.ts +++ b/public/app/plugins/panel/heatmap/heatmap_ctrl.ts @@ -30,7 +30,11 @@ let panelDefaults = { dataFormat: 'timeseries', xAxis: { show: true, - buckets: 'auto', + buckets: { + mode: 'count', + count: null, + size: null, + }, }, yAxis: { show: true, @@ -40,7 +44,11 @@ let panelDefaults = { splitFactor: null, min: null, max: null, - buckets: 'auto', + buckets: { + mode: 'count', + count: null, + size: null, + }, removeZeroValues: false }, tooltip: { diff --git a/public/app/plugins/panel/heatmap/partials/axes_editor.html b/public/app/plugins/panel/heatmap/partials/axes_editor.html index 933f3f08df1..5841470f69c 100644 --- a/public/app/plugins/panel/heatmap/partials/axes_editor.html +++ b/public/app/plugins/panel/heatmap/partials/axes_editor.html @@ -4,9 +4,9 @@
+ ng-model="ctrl.panel.yAxis.format" + dropdown-typeahead2="editor.unitFormats" + dropdown-typeahead-on-select="editor.setUnitFormat($subItem)">
@@ -26,54 +26,66 @@
+ bs-tooltip="'Override automatic decimal precision for axis.'" + ng-model="ctrl.panel.yAxis.decimals" ng-change="ctrl.render()" ng-model-onblur>
+
+ +
+
Buckets
- -
- -
- - - Number of buckets for Y axis + + + +
+
+ + +
+
+
+
+ + + +
+
+ +
- - + + +
-
X Axis
+
Data format
- - -
-
- -
-
Data format
-
- -
- + +
+ +
-