mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-22 15:53:09 +00:00
Merge pull request #79 from flant/update_ts_babel_fixes_for_6_3_0_plus
feat: migrate to typescript, support 6.3.0+
This commit is contained in:
+16
-7
@@ -1,7 +1,7 @@
|
|||||||
|
'use strict';
|
||||||
module.exports = (grunt) => {
|
module.exports = (grunt) => {
|
||||||
require('load-grunt-tasks')(grunt);
|
require('load-grunt-tasks')(grunt);
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-execute');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
grunt.loadNpmTasks('grunt-notify');
|
grunt.loadNpmTasks('grunt-notify');
|
||||||
|
|
||||||
@@ -22,10 +22,10 @@ module.exports = (grunt) => {
|
|||||||
src_to_dist: {
|
src_to_dist: {
|
||||||
cwd: 'src',
|
cwd: 'src',
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['**/*', '!**/*.js', '!**/*.scss'],
|
src: ['**/*', '!**/*.js', '!**/*.ts', '!**/*.scss'],
|
||||||
dest: 'dist'
|
dest: 'dist'
|
||||||
},
|
},
|
||||||
pluginDef: {
|
root_to_dist: {
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['plugin.json', 'README.md', 'CHANGELOG.md'],
|
src: ['plugin.json', 'README.md', 'CHANGELOG.md'],
|
||||||
dest: 'dist'
|
dest: 'dist'
|
||||||
@@ -46,14 +46,23 @@ module.exports = (grunt) => {
|
|||||||
babel: {
|
babel: {
|
||||||
options: {
|
options: {
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
presets: ['es2015'],
|
presets: ['@babel/preset-env', '@babel/typescript'],
|
||||||
plugins: ['transform-es2015-modules-systemjs', 'transform-es2015-for-of', 'transform-class-properties', 'transform-object-rest-spread'],
|
plugins: ['angularjs-annotate', '@babel/plugin-transform-modules-systemjs', '@babel/plugin-transform-for-of', '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-object-rest-spread'],
|
||||||
|
},
|
||||||
|
d3lib: {
|
||||||
|
files: [{
|
||||||
|
cwd: 'src',
|
||||||
|
expand: true,
|
||||||
|
src: ['libs/**/*.js'],
|
||||||
|
dest: 'dist',
|
||||||
|
ext: '.js'
|
||||||
|
}]
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
files: [{
|
files: [{
|
||||||
cwd: 'src',
|
cwd: 'src',
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['*.js', '**/*.js'],
|
src: ['*.ts', '**/*.ts'],
|
||||||
dest: 'dist',
|
dest: 'dist',
|
||||||
ext: '.js'
|
ext: '.js'
|
||||||
}]
|
}]
|
||||||
@@ -71,7 +80,7 @@ module.exports = (grunt) => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel', 'sass']);
|
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:root_to_dist', 'babel', 'sass']);
|
||||||
// grunt.registerTask('clean', ['clean']);
|
// grunt.registerTask('clean', ['clean']);
|
||||||
// grunt.registerTask('watch', ['watch']);
|
// grunt.registerTask('watch', ['watch']);
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
+48
-50
@@ -1,15 +1,17 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_export, _context) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var d3, $, _, kbn, _createClass, TOOLTIP_PADDING_X, TOOLTIP_PADDING_Y, AnnotationTooltip;
|
System.register(["d3", "jquery", "lodash"], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
var d3, $, _, TOOLTIP_PADDING_X, TOOLTIP_PADDING_Y, AnnotationTooltip;
|
||||||
if (!(instance instanceof Constructor)) {
|
|
||||||
throw new TypeError("Cannot call a class as a function");
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
}
|
|
||||||
}
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_d) {
|
setters: [function (_d) {
|
||||||
@@ -18,47 +20,42 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
$ = _jquery.default;
|
$ = _jquery.default;
|
||||||
}, function (_lodash) {
|
}, function (_lodash) {
|
||||||
_ = _lodash.default;
|
_ = _lodash.default;
|
||||||
}, function (_appCoreUtilsKbn) {
|
|
||||||
kbn = _appCoreUtilsKbn.default;
|
|
||||||
}],
|
}],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
_createClass = function () {
|
|
||||||
function defineProperties(target, props) {
|
|
||||||
for (var i = 0; i < props.length; i++) {
|
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (Constructor, protoProps, staticProps) {
|
|
||||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
TOOLTIP_PADDING_X = 30;
|
TOOLTIP_PADDING_X = 30;
|
||||||
TOOLTIP_PADDING_Y = 10;
|
TOOLTIP_PADDING_Y = 10;
|
||||||
|
|
||||||
_export('AnnotationTooltip', AnnotationTooltip = function () {
|
_export("AnnotationTooltip", AnnotationTooltip =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function () {
|
||||||
function AnnotationTooltip(elem, scope) {
|
function AnnotationTooltip(elem, scope) {
|
||||||
_classCallCheck(this, AnnotationTooltip);
|
_classCallCheck(this, AnnotationTooltip);
|
||||||
|
|
||||||
|
_defineProperty(this, "scope", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "dashboard", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panelCtrl", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panel", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "mouseOverAnnotationTick", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "tooltipBase", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "tooltip", void 0);
|
||||||
|
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.dashboard = scope.ctrl.dashboard;
|
this.dashboard = scope.ctrl.dashboard;
|
||||||
this.panelCtrl = scope.ctrl;
|
this.panelCtrl = scope.ctrl;
|
||||||
this.panel = scope.ctrl.panel;
|
this.panel = scope.ctrl.panel;
|
||||||
this.mouseOverAnnotationTick = false;
|
this.mouseOverAnnotationTick = false;
|
||||||
|
|
||||||
elem.on("mouseover", this.onMouseOver.bind(this));
|
elem.on("mouseover", this.onMouseOver.bind(this));
|
||||||
elem.on("mouseleave", this.onMouseLeave.bind(this));
|
elem.on("mouseleave", this.onMouseLeave.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(AnnotationTooltip, [{
|
_createClass(AnnotationTooltip, [{
|
||||||
key: 'onMouseOver',
|
key: "onMouseOver",
|
||||||
value: function onMouseOver(e) {
|
value: function onMouseOver(e) {
|
||||||
if (!this.panel.tooltip.show || !this.scope.ctrl.data || _.isEmpty(this.scope.ctrl.data)) {
|
if (!this.panel.tooltip.show || !this.scope.ctrl.data || _.isEmpty(this.scope.ctrl.data)) {
|
||||||
return;
|
return;
|
||||||
@@ -70,12 +67,12 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onMouseLeave',
|
key: "onMouseLeave",
|
||||||
value: function onMouseLeave() {
|
value: function onMouseLeave() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onMouseMove',
|
key: "onMouseMove",
|
||||||
value: function onMouseMove(e) {
|
value: function onMouseMove(e) {
|
||||||
if (!this.panel.tooltip.show) {
|
if (!this.panel.tooltip.show) {
|
||||||
return;
|
return;
|
||||||
@@ -84,13 +81,13 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
this.move(e);
|
this.move(e);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'add',
|
key: "add",
|
||||||
value: function add() {
|
value: function add() {
|
||||||
this.tooltipBase = d3.select("body").append("div").attr("class", "statusmap-annotation-tooltip drop drop-popover drop-popover--annotation drop-element drop-enabled drop-target-attached-center drop-open drop-open-transitionend drop-after-open").style("position", "absolute");
|
this.tooltipBase = d3.select("body").append("div").attr("class", "statusmap-annotation-tooltip drop drop-popover drop-popover--annotation drop-element drop-enabled drop-target-attached-center drop-open drop-open-transitionend drop-after-open").style("position", "absolute");
|
||||||
this.tooltip = this.tooltipBase.append("div").attr("class", "drop-content").append("div").append("annotation-tooltip").append("div").attr("class", "graph-annotation");
|
this.tooltip = this.tooltipBase.append("div").attr("class", "drop-content").append("div").append("annotation-tooltip").append("div").attr("class", "graph-annotation");
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'destroy',
|
key: "destroy",
|
||||||
value: function destroy() {
|
value: function destroy() {
|
||||||
if (this.tooltip) {
|
if (this.tooltip) {
|
||||||
this.tooltip.remove();
|
this.tooltip.remove();
|
||||||
@@ -105,50 +102,54 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
this.tooltipBase = null;
|
this.tooltipBase = null;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'show',
|
key: "show",
|
||||||
value: function show(pos) {
|
value: function show(pos) {
|
||||||
if (!this.panel.tooltip.show || !this.tooltip) {
|
if (!this.panel.tooltip.show || !this.tooltip) {
|
||||||
return;
|
return;
|
||||||
}
|
} // shared tooltip mode
|
||||||
// shared tooltip mode
|
|
||||||
//if (pos.panelRelY) {
|
//if (pos.panelRelY) {
|
||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
var annoId = d3.select(pos.target).attr('annoId');
|
var annoId = d3.select(pos.target).attr('annoId');
|
||||||
|
|
||||||
if (!annoId) {
|
if (!annoId) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var anno = this.panelCtrl.annotations[annoId];
|
var anno = this.panelCtrl.annotations[annoId];
|
||||||
|
|
||||||
if (!anno) {
|
if (!anno) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var annoTitle = "";
|
var annoTitle = "";
|
||||||
|
|
||||||
var tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
var tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
||||||
var annoTime = this.dashboard.formatDate(anno.time, tooltipTimeFormat);
|
var annoTime = this.dashboard.formatDate(anno.time, tooltipTimeFormat);
|
||||||
var annoText = anno.text;
|
var annoText = anno.text;
|
||||||
var annoTags = [];
|
var annoTags = [];
|
||||||
|
|
||||||
if (anno.tags) {
|
if (anno.tags) {
|
||||||
annoTags = _.map(anno.tags, function (t) {
|
annoTags = _.map(anno.tags, function (t) {
|
||||||
return { "text": t, "backColor": "rgb(63, 43, 91)", "borderColor": "rgb(101, 81, 129)" };
|
return {
|
||||||
|
"text": t,
|
||||||
|
"backColor": "rgb(63, 43, 91)",
|
||||||
|
"borderColor": "rgb(101, 81, 129)"
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var tooltipHtml = '<div class="graph-annotation__header">\n <span class="graph-annotation__title">' + annoTitle + '</span>\n <span class="graph-annotation__time">' + annoTime + '</span></div>\n <div class="graph-annotation__body">\n <div>' + annoText + '</div>\n ' + _.join(_.map(annoTags, function (t) {
|
var tooltipHtml = "<div class=\"graph-annotation__header\">\n <span class=\"graph-annotation__title\">".concat(annoTitle, "</span>\n <span class=\"graph-annotation__time\">").concat(annoTime, "</span></div>\n <div class=\"graph-annotation__body\">\n <div>").concat(annoText, "</div>\n ").concat(_.join(_.map(annoTags, function (t) {
|
||||||
return '<span class="label label-tag small" style="background-color: ' + t.backColor + '; border-color: ' + t.borderColor + '">' + t.text + '</span>';
|
return "<span class=\"label label-tag small\" style=\"background-color: ".concat(t.backColor, "; border-color: ").concat(t.borderColor, "\">").concat(t.text, "</span>");
|
||||||
}), "") + '\n </div>\n <div class="statusmap-histogram"></div>';
|
}), ""), "\n </div>\n <div class=\"statusmap-histogram\"></div>");
|
||||||
|
|
||||||
this.tooltip.html(tooltipHtml);
|
this.tooltip.html(tooltipHtml);
|
||||||
|
|
||||||
this.move(pos);
|
this.move(pos);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'move',
|
key: "move",
|
||||||
value: function move(pos) {
|
value: function move(pos) {
|
||||||
if (!this.tooltipBase) {
|
if (!this.tooltipBase) {
|
||||||
return;
|
return;
|
||||||
@@ -157,7 +158,6 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
var elem = $(this.tooltipBase.node())[0];
|
var elem = $(this.tooltipBase.node())[0];
|
||||||
var tooltipWidth = elem.clientWidth;
|
var tooltipWidth = elem.clientWidth;
|
||||||
var tooltipHeight = elem.clientHeight;
|
var tooltipHeight = elem.clientHeight;
|
||||||
|
|
||||||
var left = pos.pageX - tooltipWidth / 2;
|
var left = pos.pageX - tooltipWidth / 2;
|
||||||
var top = pos.pageY + TOOLTIP_PADDING_Y;
|
var top = pos.pageY + TOOLTIP_PADDING_Y;
|
||||||
|
|
||||||
@@ -175,8 +175,6 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
|
|
||||||
return AnnotationTooltip;
|
return AnnotationTooltip;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
_export('AnnotationTooltip', AnnotationTooltip);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+52
-68
@@ -1,36 +1,31 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic/index', 'app/core/core', 'app/core/utils/ticks'], function (_export, _context) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var angular, _, $, d3, d3ScaleChromatic, contextSrv, tickStep, mod, LEGEND_STEP_WIDTH;
|
System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "app/core/core", "app/core/utils/ticks", "app/core/core_module"], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var _, $, d3, d3ScaleChromatic, contextSrv, tickStep, coreModule, LEGEND_STEP_WIDTH;
|
||||||
|
|
||||||
function drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue) {
|
function drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue) {
|
||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
var legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values
|
var legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values
|
||||||
var legendHeight = legendElem.attr("height");
|
|
||||||
|
|
||||||
var rangeStep = (rangeTo - rangeFrom) / (legendWidth / LEGEND_STEP_WIDTH);
|
var legendHeight = legendElem.attr("height");
|
||||||
// width in pixels in legend space of unit segment in range space
|
var rangeStep = (rangeTo - rangeFrom) / (legendWidth / LEGEND_STEP_WIDTH); // width in pixels in legend space of unit segment in range space
|
||||||
// rangeStep * witdhFactor == width in pixels of one rangeStep
|
// rangeStep * witdhFactor == width in pixels of one rangeStep
|
||||||
|
|
||||||
var widthFactor = legendWidth / (rangeTo - rangeFrom);
|
var widthFactor = legendWidth / (rangeTo - rangeFrom);
|
||||||
var valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
|
var valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
|
||||||
|
|
||||||
var colorScale = getColorScale(colorScheme, maxValue, minValue);
|
var colorScale = getColorScale(colorScheme, maxValue, minValue);
|
||||||
legend.selectAll(".status-heatmap-color-legend-rect").data(valuesRange).enter().append("rect")
|
legend.selectAll(".status-heatmap-color-legend-rect").data(valuesRange).enter().append("rect") // translate from range space into pixels
|
||||||
// translate from range space into pixels
|
|
||||||
// and shift all rectangles to the right by 10
|
// and shift all rectangles to the right by 10
|
||||||
.attr("x", function (d) {
|
.attr("x", function (d) {
|
||||||
return d * widthFactor + 10;
|
return d * widthFactor + 10;
|
||||||
}).attr("y", 0)
|
}).attr("y", 0) // rectangles are slightly overlaped to prevent gaps
|
||||||
// rectangles are slightly overlaped to prevent gaps
|
|
||||||
.attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", function (d) {
|
.attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", function (d) {
|
||||||
return colorScale(d);
|
return colorScale(d);
|
||||||
});
|
});
|
||||||
|
|
||||||
drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);
|
drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,28 +33,23 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
var legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values
|
var legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values
|
||||||
var legendHeight = legendElem.attr("height");
|
|
||||||
|
|
||||||
var rangeStep = (rangeTo - rangeFrom) / (legendWidth / LEGEND_STEP_WIDTH);
|
var legendHeight = legendElem.attr("height");
|
||||||
// width in pixels in legend space of unit segment in range space
|
var rangeStep = (rangeTo - rangeFrom) / (legendWidth / LEGEND_STEP_WIDTH); // width in pixels in legend space of unit segment in range space
|
||||||
// rangeStep * witdhFactor == width in pixels of one rangeStep
|
// rangeStep * witdhFactor == width in pixels of one rangeStep
|
||||||
|
|
||||||
var widthFactor = legendWidth / (rangeTo - rangeFrom);
|
var widthFactor = legendWidth / (rangeTo - rangeFrom);
|
||||||
var valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
|
var valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
|
||||||
|
|
||||||
var opacityScale = getOpacityScale(options, maxValue, minValue);
|
var opacityScale = getOpacityScale(options, maxValue, minValue);
|
||||||
legend.selectAll(".status-heatmap-opacity-legend-rect").data(valuesRange).enter().append("rect")
|
legend.selectAll(".status-heatmap-opacity-legend-rect").data(valuesRange).enter().append("rect") // translate from range space into pixels
|
||||||
// translate from range space into pixels
|
|
||||||
// and shift all rectangles to the right by 10
|
// and shift all rectangles to the right by 10
|
||||||
.attr("x", function (d) {
|
.attr("x", function (d) {
|
||||||
return d * widthFactor + 10;
|
return d * widthFactor + 10;
|
||||||
}).attr("y", 0)
|
}).attr("y", 0) // rectangles are slightly overlaped to prevent gaps
|
||||||
// rectangles are slightly overlaped to prevent gaps
|
|
||||||
.attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", options.cardColor).style("opacity", function (d) {
|
.attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", options.cardColor).style("opacity", function (d) {
|
||||||
return opacityScale(d);
|
return opacityScale(d);
|
||||||
});
|
});
|
||||||
|
|
||||||
drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);
|
drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,18 +57,18 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
var thresholds = colorOptions.thresholds;
|
var thresholds = colorOptions.thresholds;
|
||||||
|
|
||||||
var tooltips = _.map(thresholds, function (tr) {
|
var tooltips = _.map(thresholds, function (tr) {
|
||||||
return tr.tooltip;
|
return tr.tooltip;
|
||||||
});
|
});
|
||||||
var valuesNumber = thresholds.length;
|
|
||||||
|
|
||||||
// graph width as a fallback
|
var valuesNumber = thresholds.length; // graph width as a fallback
|
||||||
|
|
||||||
var $heatmap = $(elem).parent().parent().parent().find('.status-heatmap-panel');
|
var $heatmap = $(elem).parent().parent().parent().find('.status-heatmap-panel');
|
||||||
var graphWidth = $heatmap.find('svg').attr("width");
|
var graphWidthAttr = $heatmap.find('svg').attr("width");
|
||||||
|
var graphWidth = parseInt(graphWidthAttr); // calculate max width of tooltip and use it as width for each item
|
||||||
|
|
||||||
// calculate max width of tooltip and use it as width for each item
|
|
||||||
var textWidth = [];
|
var textWidth = [];
|
||||||
legend.selectAll(".hidden-texts").data(tooltips).enter().append("text").attr("class", "axis tick hidden-texts").attr("font-family", "sans-serif").text(function (d) {
|
legend.selectAll(".hidden-texts").data(tooltips).enter().append("text").attr("class", "axis tick hidden-texts").attr("font-family", "sans-serif").text(function (d) {
|
||||||
return d;
|
return d;
|
||||||
@@ -87,12 +77,9 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
textWidth.push(thisWidth);
|
textWidth.push(thisWidth);
|
||||||
});
|
});
|
||||||
legend.selectAll(".hidden-texts").remove();
|
legend.selectAll(".hidden-texts").remove();
|
||||||
|
|
||||||
var legendWidth = Math.floor(_.min([graphWidth - 30, (_.max(textWidth) + 3) * valuesNumber]));
|
var legendWidth = Math.floor(_.min([graphWidth - 30, (_.max(textWidth) + 3) * valuesNumber]));
|
||||||
legendElem.attr("width", legendWidth);
|
legendElem.attr("width", legendWidth);
|
||||||
|
|
||||||
var legendHeight = legendElem.attr("height");
|
var legendHeight = legendElem.attr("height");
|
||||||
|
|
||||||
var itemWidth = Math.floor(legendWidth / valuesNumber);
|
var itemWidth = Math.floor(legendWidth / valuesNumber);
|
||||||
var valuesRange = d3.range(valuesNumber); // from 0 to valuesNumber-1
|
var valuesRange = d3.range(valuesNumber); // from 0 to valuesNumber-1
|
||||||
|
|
||||||
@@ -102,7 +89,6 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
.attr("height", legendHeight).attr("stroke-width", 0).attr("fill", function (d) {
|
.attr("height", legendHeight).attr("stroke-width", 0).attr("fill", function (d) {
|
||||||
return discreteHelper.getDiscreteColor(d);
|
return discreteHelper.getDiscreteColor(d);
|
||||||
});
|
});
|
||||||
|
|
||||||
drawDiscreteLegendValues(elem, colorOptions, legendWidth);
|
drawDiscreteLegendValues(elem, colorOptions, legendWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,22 +101,17 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var legendValueScale = d3.scaleLinear().domain([0, rangeTo]).range([0, legendWidth]);
|
var legendValueScale = d3.scaleLinear().domain([0, rangeTo]).range([0, legendWidth]);
|
||||||
|
|
||||||
var ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);
|
var ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);
|
||||||
var xAxis = d3.axisBottom(legendValueScale).tickValues(ticks).tickSize(2);
|
var xAxis = d3.axisBottom(legendValueScale).tickValues(ticks).tickSize(2);
|
||||||
|
|
||||||
var colorRect = legendElem.find(":first-child");
|
var colorRect = legendElem.find(":first-child");
|
||||||
var posY = getSvgElemHeight(legendElem) + 2;
|
var posY = getSvgElemHeight(legendElem) + 2;
|
||||||
var posX = getSvgElemX(colorRect);
|
var posX = getSvgElemX(colorRect);
|
||||||
|
|
||||||
d3.select(legendElem.get(0)).append("g").attr("class", "axis").attr("transform", "translate(" + posX + "," + posY + ")").call(xAxis);
|
d3.select(legendElem.get(0)).append("g").attr("class", "axis").attr("transform", "translate(" + posX + "," + posY + ")").call(xAxis);
|
||||||
|
|
||||||
legend.select(".axis").select(".domain").remove();
|
legend.select(".axis").select(".domain").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawDiscreteLegendValues(elem, colorOptions, legendWidth) {
|
function drawDiscreteLegendValues(elem, colorOptions, legendWidth) {
|
||||||
var thresholds = colorOptions.thresholds;
|
var thresholds = colorOptions.thresholds;
|
||||||
|
|
||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
|
|
||||||
@@ -141,11 +122,10 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var valuesNumber = thresholds.length;
|
var valuesNumber = thresholds.length;
|
||||||
var rangeStep = Math.floor(legendWidth / valuesNumber);
|
var rangeStep = Math.floor(legendWidth / valuesNumber);
|
||||||
var valuesRange = d3.range(0, legendWidth, rangeStep);
|
var valuesRange = d3.range(0, legendWidth, rangeStep);
|
||||||
|
|
||||||
var legendValueScale = d3.scaleLinear().domain([0, valuesNumber]).range([0, legendWidth]);
|
var legendValueScale = d3.scaleLinear().domain([0, valuesNumber]).range([0, legendWidth]);
|
||||||
|
|
||||||
var thresholdValues = [];
|
var thresholdValues = [];
|
||||||
var thresholdTooltips = [];
|
var thresholdTooltips = [];
|
||||||
|
|
||||||
for (var i = 0; i < thresholds.length; i++) {
|
for (var i = 0; i < thresholds.length; i++) {
|
||||||
thresholdValues.push(thresholds[i].value);
|
thresholdValues.push(thresholds[i].value);
|
||||||
thresholdTooltips.push(thresholds[i].tooltip);
|
thresholdTooltips.push(thresholds[i].tooltip);
|
||||||
@@ -155,10 +135,12 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
.tickSize(2).tickFormat(function (t) {
|
.tickSize(2).tickFormat(function (t) {
|
||||||
var i = Math.floor(t);
|
var i = Math.floor(t);
|
||||||
var v = thresholdTooltips[i];
|
var v = thresholdTooltips[i];
|
||||||
|
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
return "" + v;
|
return "" + v;
|
||||||
} else {
|
} else {
|
||||||
v = thresholdValues[i];
|
v = thresholdValues[i];
|
||||||
|
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
return "" + v;
|
return "" + v;
|
||||||
} else {
|
} else {
|
||||||
@@ -166,13 +148,10 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var colorRect = legendElem.find(":first-child");
|
var colorRect = legendElem.find(":first-child");
|
||||||
var posY = getSvgElemHeight(legendElem) + 2;
|
var posY = getSvgElemHeight(legendElem) + 2;
|
||||||
var posX = getSvgElemX(colorRect) + Math.floor(rangeStep / 2);
|
var posX = getSvgElemX(colorRect) + Math.floor(rangeStep / 2);
|
||||||
|
|
||||||
d3.select(legendElem.get(0)).append("g").attr("class", "axis").attr("transform", "translate(" + posX + "," + posY + ")").call(xAxis);
|
d3.select(legendElem.get(0)).append("g").attr("class", "axis").attr("transform", "translate(" + posX + "," + posY + ")").call(xAxis);
|
||||||
|
|
||||||
legend.select(".axis").select(".domain").remove();
|
legend.select(".axis").select(".domain").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,13 +159,11 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
var legendWidth = Math.floor(legendElem.outerWidth());
|
var legendWidth = Math.floor(legendElem.outerWidth());
|
||||||
var legendHeight = legendElem.attr("height");
|
var legendHeight = legendElem.attr("height");
|
||||||
|
|
||||||
if (legendWidth) {
|
if (legendWidth) {
|
||||||
var valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);
|
var valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);
|
||||||
|
|
||||||
legend.selectAll(".status-heatmap-color-legend-rect").data(valuesRange).enter().append("rect").attr("x", function (d) {
|
legend.selectAll(".status-heatmap-color-legend-rect").data(valuesRange).enter().append("rect").attr("x", function (d) {
|
||||||
return d;
|
return d;
|
||||||
}).attr("y", 0).attr("width", LEGEND_STEP_WIDTH + 1) // Overlap rectangles to prevent gaps
|
}).attr("y", 0).attr("width", LEGEND_STEP_WIDTH + 1) // Overlap rectangles to prevent gaps
|
||||||
@@ -200,12 +177,12 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var legendElem = $(elem).find('svg');
|
var legendElem = $(elem).find('svg');
|
||||||
var legend = d3.select(legendElem.get(0));
|
var legend = d3.select(legendElem.get(0));
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
var legendWidth = Math.floor(legendElem.outerWidth());
|
var legendWidth = Math.floor(legendElem.outerWidth());
|
||||||
var legendHeight = legendElem.attr("height");
|
var legendHeight = legendElem.attr("height");
|
||||||
|
|
||||||
if (legendWidth) {
|
if (legendWidth) {
|
||||||
var legendOpacityScale = void 0;
|
var legendOpacityScale;
|
||||||
|
|
||||||
if (options.colorScale === 'linear') {
|
if (options.colorScale === 'linear') {
|
||||||
legendOpacityScale = d3.scaleLinear().domain([0, legendWidth]).range([0, 1]);
|
legendOpacityScale = d3.scaleLinear().domain([0, legendWidth]).range([0, 1]);
|
||||||
} else if (options.colorScale === 'sqrt') {
|
} else if (options.colorScale === 'sqrt') {
|
||||||
@@ -213,7 +190,6 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
}
|
}
|
||||||
|
|
||||||
var valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);
|
var valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);
|
||||||
|
|
||||||
legend.selectAll(".status-heatmap-opacity-legend-rect").data(valuesRange).enter().append("rect").attr("x", function (d) {
|
legend.selectAll(".status-heatmap-opacity-legend-rect").data(valuesRange).enter().append("rect").attr("x", function (d) {
|
||||||
return d;
|
return d;
|
||||||
}).attr("y", 0).attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", options.cardColor).style("opacity", function (d) {
|
}).attr("y", 0).attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", options.cardColor).style("opacity", function (d) {
|
||||||
@@ -229,30 +205,29 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
|
|
||||||
function getColorScale(colorScheme, maxValue) {
|
function getColorScale(colorScheme, maxValue) {
|
||||||
var minValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
var minValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||||
|
|
||||||
var colorInterpolator = d3ScaleChromatic[colorScheme.value];
|
var colorInterpolator = d3ScaleChromatic[colorScheme.value];
|
||||||
var colorScaleInverted = colorScheme.invert === 'always' || colorScheme.invert === 'dark' && !contextSrv.user.lightTheme;
|
var colorScaleInverted = colorScheme.invert === 'always' || colorScheme.invert === 'dark' && !contextSrv.user.lightTheme;
|
||||||
|
|
||||||
var start = colorScaleInverted ? maxValue : minValue;
|
var start = colorScaleInverted ? maxValue : minValue;
|
||||||
var end = colorScaleInverted ? minValue : maxValue;
|
var end = colorScaleInverted ? minValue : maxValue;
|
||||||
|
|
||||||
return d3.scaleSequential(colorInterpolator).domain([start, end]);
|
return d3.scaleSequential(colorInterpolator).domain([start, end]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOpacityScale(options, maxValue) {
|
function getOpacityScale(options, maxValue) {
|
||||||
var minValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
var minValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||||
|
var legendOpacityScale;
|
||||||
|
|
||||||
var legendOpacityScale = void 0;
|
|
||||||
if (options.colorScale === 'linear') {
|
if (options.colorScale === 'linear') {
|
||||||
legendOpacityScale = d3.scaleLinear().domain([minValue, maxValue]).range([0, 1]);
|
legendOpacityScale = d3.scaleLinear().domain([minValue, maxValue]).range([0, 1]);
|
||||||
} else if (options.colorScale === 'sqrt') {
|
} else if (options.colorScale === 'sqrt') {
|
||||||
legendOpacityScale = d3.scalePow().exponent(options.exponent).domain([minValue, maxValue]).range([0, 1]);
|
legendOpacityScale = d3.scalePow().exponent(options.exponent).domain([minValue, maxValue]).range([0, 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return legendOpacityScale;
|
return legendOpacityScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSvgElemX(elem) {
|
function getSvgElemX(elem) {
|
||||||
var svgElem = elem.get(0);
|
var svgElem = elem.get(0);
|
||||||
|
|
||||||
if (svgElem && svgElem.x && svgElem.x.baseVal) {
|
if (svgElem && svgElem.x && svgElem.x.baseVal) {
|
||||||
return svgElem.x.baseVal.value;
|
return svgElem.x.baseVal.value;
|
||||||
} else {
|
} else {
|
||||||
@@ -262,6 +237,7 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
|
|
||||||
function getSvgElemHeight(elem) {
|
function getSvgElemHeight(elem) {
|
||||||
var svgElem = elem.get(0);
|
var svgElem = elem.get(0);
|
||||||
|
|
||||||
if (svgElem && svgElem.height && svgElem.height.baseVal) {
|
if (svgElem && svgElem.height && svgElem.height.baseVal) {
|
||||||
return svgElem.height.baseVal.value;
|
return svgElem.height.baseVal.value;
|
||||||
} else {
|
} else {
|
||||||
@@ -276,25 +252,29 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var ticks = [];
|
var ticks = [];
|
||||||
|
|
||||||
for (var i = 0; i < ticksNum; i++) {
|
for (var i = 0; i < ticksNum; i++) {
|
||||||
var current = tickStepSize * i;
|
var current = tickStepSize * i; // Add user-defined min and max if it had been set
|
||||||
// Add user-defined min and max if it had been set
|
|
||||||
if (isValueCloseTo(minValue, current, tickStepSize)) {
|
if (isValueCloseTo(minValue, current, tickStepSize)) {
|
||||||
ticks.push(minValue);
|
ticks.push(minValue);
|
||||||
continue;
|
continue;
|
||||||
} else if (minValue < current) {
|
} else if (minValue < current) {
|
||||||
ticks.push(minValue);
|
ticks.push(minValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValueCloseTo(maxValue, current, tickStepSize)) {
|
if (isValueCloseTo(maxValue, current, tickStepSize)) {
|
||||||
ticks.push(maxValue);
|
ticks.push(maxValue);
|
||||||
continue;
|
continue;
|
||||||
} else if (maxValue < current) {
|
} else if (maxValue < current) {
|
||||||
ticks.push(maxValue);
|
ticks.push(maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
ticks.push(tickStepSize * i);
|
ticks.push(tickStepSize * i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {
|
if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {
|
||||||
ticks.push(maxValue);
|
ticks.push(maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
ticks.push(rangeTo);
|
ticks.push(rangeTo);
|
||||||
ticks = _.sortBy(_.uniq(ticks));
|
ticks = _.sortBy(_.uniq(ticks));
|
||||||
return ticks;
|
return ticks;
|
||||||
@@ -304,10 +284,9 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var diff = Math.abs(val - valueTo);
|
var diff = Math.abs(val - valueTo);
|
||||||
return diff < step * 0.3;
|
return diff < step * 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_angular) {
|
setters: [function (_lodash) {
|
||||||
angular = _angular.default;
|
|
||||||
}, function (_lodash) {
|
|
||||||
_ = _lodash.default;
|
_ = _lodash.default;
|
||||||
}, function (_jquery) {
|
}, function (_jquery) {
|
||||||
$ = _jquery.default;
|
$ = _jquery.default;
|
||||||
@@ -319,25 +298,23 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
contextSrv = _appCoreCore.contextSrv;
|
contextSrv = _appCoreCore.contextSrv;
|
||||||
}, function (_appCoreUtilsTicks) {
|
}, function (_appCoreUtilsTicks) {
|
||||||
tickStep = _appCoreUtilsTicks.tickStep;
|
tickStep = _appCoreUtilsTicks.tickStep;
|
||||||
|
}, function (_appCoreCore_module) {
|
||||||
|
coreModule = _appCoreCore_module.default;
|
||||||
}],
|
}],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
mod = angular.module('grafana.directives');
|
|
||||||
LEGEND_STEP_WIDTH = 2;
|
LEGEND_STEP_WIDTH = 2;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bigger color legend for opacity and spectrum modes editor.
|
* Bigger color legend for opacity and spectrum modes editor.
|
||||||
*/
|
*/
|
||||||
mod.directive('optionsColorLegend', function () {
|
|
||||||
|
coreModule.directive('optionsColorLegend', function () {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
template: '<div class="status-heatmap-color-legend"><svg width="16.8rem" height="24px"></svg></div>',
|
template: '<div class="status-heatmap-color-legend"><svg width="16.8rem" height="24px"></svg></div>',
|
||||||
link: function link(scope, elem, attrs) {
|
link: function link(scope, elem, attrs) {
|
||||||
var ctrl = scope.ctrl;
|
var ctrl = scope.ctrl;
|
||||||
var panel = scope.ctrl.panel;
|
var panel = scope.ctrl.panel;
|
||||||
|
|
||||||
render();
|
render();
|
||||||
|
|
||||||
ctrl.events.on('render', function () {
|
ctrl.events.on('render', function () {
|
||||||
render();
|
render();
|
||||||
});
|
});
|
||||||
@@ -347,7 +324,10 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var legendWidth = Math.floor(legendElem.outerWidth());
|
var legendWidth = Math.floor(legendElem.outerWidth());
|
||||||
|
|
||||||
if (panel.color.mode === 'spectrum') {
|
if (panel.color.mode === 'spectrum') {
|
||||||
var colorScheme = _.find(ctrl.colorSchemes, { value: panel.color.colorScheme });
|
var colorScheme = _.find(ctrl.colorSchemes, {
|
||||||
|
value: panel.color.colorScheme
|
||||||
|
});
|
||||||
|
|
||||||
var colorScale = getColorScale(colorScheme, legendWidth);
|
var colorScale = getColorScale(colorScheme, legendWidth);
|
||||||
drawSimpleColorLegend(elem, colorScale);
|
drawSimpleColorLegend(elem, colorScale);
|
||||||
} else if (panel.color.mode === 'opacity') {
|
} else if (panel.color.mode === 'opacity') {
|
||||||
@@ -358,18 +338,17 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Graph legend with values.
|
* Graph legend with values.
|
||||||
*/
|
*/
|
||||||
mod.directive('statusHeatmapLegend', function () {
|
|
||||||
|
coreModule.directive('statusHeatmapLegend', function () {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
template: '<div class="status-heatmap-color-legend"><svg width="100px" height="6px"></svg></div>',
|
template: '<div class="status-heatmap-color-legend"><svg width="100px" height="6px"></svg></div>',
|
||||||
link: function link(scope, elem, attrs) {
|
link: function link(scope, elem, attrs) {
|
||||||
var ctrl = scope.ctrl;
|
var ctrl = scope.ctrl;
|
||||||
var panel = scope.ctrl.panel;
|
var panel = scope.ctrl.panel;
|
||||||
|
|
||||||
render();
|
render();
|
||||||
ctrl.events.on('render', function () {
|
ctrl.events.on('render', function () {
|
||||||
render();
|
render();
|
||||||
@@ -377,9 +356,11 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
|
|
||||||
if (!ctrl.panel.legend.show) {
|
if (!ctrl.panel.legend.show) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isEmpty(ctrl.cardsData) && !_.isEmpty(ctrl.cardsData.cards)) {
|
if (!_.isEmpty(ctrl.cardsData) && !_.isEmpty(ctrl.cardsData.cards)) {
|
||||||
var rangeFrom = ctrl.cardsData.minValue;
|
var rangeFrom = ctrl.cardsData.minValue;
|
||||||
var rangeTo = ctrl.cardsData.maxValue;
|
var rangeTo = ctrl.cardsData.maxValue;
|
||||||
@@ -387,7 +368,10 @@ System.register(['angular', 'lodash', 'jquery', 'd3', './libs/d3-scale-chromatic
|
|||||||
var minValue = panel.color.min || rangeFrom;
|
var minValue = panel.color.min || rangeFrom;
|
||||||
|
|
||||||
if (panel.color.mode === 'spectrum') {
|
if (panel.color.mode === 'spectrum') {
|
||||||
var colorScheme = _.find(ctrl.colorSchemes, { value: panel.color.colorScheme });
|
var colorScheme = _.find(ctrl.colorSchemes, {
|
||||||
|
value: panel.color.colorScheme
|
||||||
|
});
|
||||||
|
|
||||||
drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);
|
drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);
|
||||||
} else if (panel.color.mode === 'opacity') {
|
} else if (panel.color.mode === 'opacity') {
|
||||||
var colorOptions = panel.color;
|
var colorOptions = panel.color;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+129
-64
@@ -1,49 +1,38 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
System.register(["lodash"], function (_export, _context) {
|
System.register([], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var _, _createClass, ColorModeDiscrete;
|
var ColorModeDiscrete;
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
if (!(instance instanceof Constructor)) {
|
|
||||||
throw new TypeError("Cannot call a class as a function");
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
}
|
|
||||||
}
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_lodash) {
|
setters: [],
|
||||||
_ = _lodash.default;
|
|
||||||
}],
|
|
||||||
execute: function () {
|
execute: function () {
|
||||||
_createClass = function () {
|
// Helper methods to handle discrete color mode
|
||||||
function defineProperties(target, props) {
|
_export("ColorModeDiscrete", ColorModeDiscrete =
|
||||||
for (var i = 0; i < props.length; i++) {
|
/*#__PURE__*/
|
||||||
var descriptor = props[i];
|
function () {
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (Constructor, protoProps, staticProps) {
|
|
||||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
_export("ColorModeDiscrete", ColorModeDiscrete = function () {
|
|
||||||
function ColorModeDiscrete(scope) {
|
function ColorModeDiscrete(scope) {
|
||||||
_classCallCheck(this, ColorModeDiscrete);
|
_classCallCheck(this, ColorModeDiscrete);
|
||||||
|
|
||||||
|
_defineProperty(this, "scope", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panelCtrl", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panel", void 0);
|
||||||
|
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.panelCtrl = scope.ctrl;
|
this.panelCtrl = scope.ctrl;
|
||||||
this.panel = scope.ctrl.panel;
|
this.panel = scope.ctrl.panel;
|
||||||
}
|
} // get tooltip for each value ordered by thresholds priority
|
||||||
|
|
||||||
// get tooltip for each value ordered by thresholds priority
|
|
||||||
|
|
||||||
|
|
||||||
_createClass(ColorModeDiscrete, [{
|
_createClass(ColorModeDiscrete, [{
|
||||||
@@ -62,40 +51,49 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tooltips;
|
return tooltips;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getNotMatchedValues",
|
key: "getNotMatchedValues",
|
||||||
value: function getNotMatchedValues(values) {
|
value: function getNotMatchedValues(values) {
|
||||||
var notMatched = [];
|
var notMatched = [];
|
||||||
|
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var j = 0; j < values.length; j++) {
|
||||||
if (!this.getMatchedThreshold(values[j])) {
|
if (!this.getMatchedThreshold(values[j])) {
|
||||||
notMatched.push(values[j]);
|
notMatched.push(values[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return notMatched;
|
return notMatched;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getNotColoredValues",
|
key: "getNotColoredValues",
|
||||||
value: function getNotColoredValues(values) {
|
value: function getNotColoredValues(values) {
|
||||||
var notMatched = [];
|
var notMatched = [];
|
||||||
|
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var j = 0; j < values.length; j++) {
|
||||||
var threshold = this.getMatchedThreshold(values[j]);
|
var threshold = this.getMatchedThreshold(values[j]);
|
||||||
|
|
||||||
if (!threshold || !threshold.color || threshold.color == "") {
|
if (!threshold || !threshold.color || threshold.color == "") {
|
||||||
notMatched.push(values[j]);
|
notMatched.push(values[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return notMatched;
|
return notMatched;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getDiscreteColor",
|
key: "getDiscreteColor",
|
||||||
value: function getDiscreteColor(index) {
|
value: function getDiscreteColor(index) {
|
||||||
var color = this.getThreshold(index).color;
|
var color = this.getThreshold(index).color;
|
||||||
|
|
||||||
if (!color || color == "") {
|
if (!color || color == "") {
|
||||||
return 'rgba(0,0,0,1)';
|
return 'rgba(0,0,0,1)';
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
} // returns color from first matched thresold in order from 0 to thresholds.length
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
key: "getBucketColor",
|
key: "getBucketColor",
|
||||||
value: function getBucketColor(values) {
|
value: function getBucketColor(values) {
|
||||||
@@ -108,6 +106,7 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
|
|
||||||
if (values.length == 1) {
|
if (values.length == 1) {
|
||||||
var threshold = this.getMatchedThreshold(values[0]);
|
var threshold = this.getMatchedThreshold(values[0]);
|
||||||
|
|
||||||
if (!threshold || !threshold.color || threshold.color == "") {
|
if (!threshold || !threshold.color || threshold.color == "") {
|
||||||
return 'rgba(0,0,0,1)';
|
return 'rgba(0,0,0,1)';
|
||||||
} else {
|
} else {
|
||||||
@@ -116,11 +115,13 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var isAllValuesNulls = true;
|
var isAllValuesNulls = true;
|
||||||
|
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var j = 0; j < values.length; j++) {
|
||||||
if (values[j] != null) {
|
if (values[j] != null) {
|
||||||
isAllValuesNulls = false;
|
isAllValuesNulls = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAllValuesNulls) {
|
if (isAllValuesNulls) {
|
||||||
return this.getMatchedThreshold(null).color;
|
return this.getMatchedThreshold(null).color;
|
||||||
}
|
}
|
||||||
@@ -132,6 +133,7 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'rgba(0,0,0,1)';
|
return 'rgba(0,0,0,1)';
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -140,13 +142,17 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
if (!this.panelCtrl.cardsData) {
|
if (!this.panelCtrl.cardsData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.panelCtrl.cardsData.noColorDefined = false;
|
this.panelCtrl.cardsData.noColorDefined = false;
|
||||||
var cards = this.panelCtrl.cardsData.cards;
|
var cards = this.panelCtrl.cardsData.cards;
|
||||||
|
|
||||||
for (var i = 0; i < cards.length; i++) {
|
for (var i = 0; i < cards.length; i++) {
|
||||||
cards[i].noColorDefined = false;
|
cards[i].noColorDefined = false;
|
||||||
var values = cards[i].values;
|
var values = cards[i].values;
|
||||||
|
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var j = 0; j < values.length; j++) {
|
||||||
var threshold = this.getMatchedThreshold(values[j]);
|
var threshold = this.getMatchedThreshold(values[j]);
|
||||||
|
|
||||||
if (!threshold || !threshold.color || threshold.color == "") {
|
if (!threshold || !threshold.color || threshold.color == "") {
|
||||||
cards[i].noColorDefined = true;
|
cards[i].noColorDefined = true;
|
||||||
this.panelCtrl.cardsData.noColorDefined = true;
|
this.panelCtrl.cardsData.noColorDefined = true;
|
||||||
@@ -173,17 +179,20 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var thresholds = this.panel.color.thresholds;
|
var thresholds = this.panel.color.thresholds;
|
||||||
|
|
||||||
for (var k = 0; k < thresholds.length; k++) {
|
for (var k = 0; k < thresholds.length; k++) {
|
||||||
if (value == thresholds[k].value) {
|
if (value == thresholds[k].value) {
|
||||||
return thresholds[k];
|
return thresholds[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getThreshold",
|
key: "getThreshold",
|
||||||
value: function getThreshold(index) {
|
value: function getThreshold(index) {
|
||||||
var thresholds = this.panel.color.thresholds;
|
var thresholds = this.panel.color.thresholds;
|
||||||
|
|
||||||
if (index < 0 || index >= thresholds.length == null) {
|
if (index < 0 || index >= thresholds.length == null) {
|
||||||
return {
|
return {
|
||||||
"color": "rgba(0,0,0,0)",
|
"color": "rgba(0,0,0,0)",
|
||||||
@@ -191,6 +200,7 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
"tooltip": "null"
|
"tooltip": "null"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return thresholds[index];
|
return thresholds[index];
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -198,71 +208,126 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
value: function roundIntervalCeil(interval) {
|
value: function roundIntervalCeil(interval) {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case interval <= 10:
|
case interval <= 10:
|
||||||
return 10; // 0.01s
|
return 10;
|
||||||
|
// 0.01s
|
||||||
|
|
||||||
case interval <= 20:
|
case interval <= 20:
|
||||||
return 20; // 0.02s
|
return 20;
|
||||||
|
// 0.02s
|
||||||
|
|
||||||
case interval <= 50:
|
case interval <= 50:
|
||||||
return 50; // 0.05s
|
return 50;
|
||||||
|
// 0.05s
|
||||||
|
|
||||||
case interval <= 100:
|
case interval <= 100:
|
||||||
return 100; // 0.1s
|
return 100;
|
||||||
|
// 0.1s
|
||||||
|
|
||||||
case interval <= 200:
|
case interval <= 200:
|
||||||
return 200; // 0.2s
|
return 200;
|
||||||
|
// 0.2s
|
||||||
|
|
||||||
case interval <= 500:
|
case interval <= 500:
|
||||||
return 500; // 0.5s
|
return 500;
|
||||||
|
// 0.5s
|
||||||
|
|
||||||
case interval <= 1000:
|
case interval <= 1000:
|
||||||
return 1000; // 1s
|
return 1000;
|
||||||
|
// 1s
|
||||||
|
|
||||||
case interval <= 2000:
|
case interval <= 2000:
|
||||||
return 2000; // 2s
|
return 2000;
|
||||||
|
// 2s
|
||||||
|
|
||||||
case interval <= 5000:
|
case interval <= 5000:
|
||||||
return 5000; // 5s
|
return 5000;
|
||||||
|
// 5s
|
||||||
|
|
||||||
case interval <= 10000:
|
case interval <= 10000:
|
||||||
return 10000; // 10s
|
return 10000;
|
||||||
|
// 10s
|
||||||
|
|
||||||
case interval <= 15000:
|
case interval <= 15000:
|
||||||
return 15000; // 15s
|
return 15000;
|
||||||
|
// 15s
|
||||||
|
|
||||||
case interval <= 20000:
|
case interval <= 20000:
|
||||||
return 20000; // 20s
|
return 20000;
|
||||||
|
// 20s
|
||||||
|
|
||||||
case interval <= 30000:
|
case interval <= 30000:
|
||||||
return 30000; // 30s
|
return 30000;
|
||||||
|
// 30s
|
||||||
|
|
||||||
case interval <= 60000:
|
case interval <= 60000:
|
||||||
return 60000; // 1m
|
return 60000;
|
||||||
|
// 1m
|
||||||
|
|
||||||
case interval <= 120000:
|
case interval <= 120000:
|
||||||
return 120000; // 2m
|
return 120000;
|
||||||
|
// 2m
|
||||||
|
|
||||||
case interval <= 300000:
|
case interval <= 300000:
|
||||||
return 300000; // 5m
|
return 300000;
|
||||||
|
// 5m
|
||||||
|
|
||||||
case interval <= 600000:
|
case interval <= 600000:
|
||||||
return 600000; // 10m
|
return 600000;
|
||||||
|
// 10m
|
||||||
|
|
||||||
case interval <= 900000:
|
case interval <= 900000:
|
||||||
return 900000; // 15m
|
return 900000;
|
||||||
|
// 15m
|
||||||
|
|
||||||
case interval <= 1200000:
|
case interval <= 1200000:
|
||||||
return 1200000; // 20m
|
return 1200000;
|
||||||
|
// 20m
|
||||||
|
|
||||||
case interval <= 1800000:
|
case interval <= 1800000:
|
||||||
return 1800000; // 30m
|
return 1800000;
|
||||||
|
// 30m
|
||||||
|
|
||||||
case interval <= 3600000:
|
case interval <= 3600000:
|
||||||
return 3600000; // 1h
|
return 3600000;
|
||||||
|
// 1h
|
||||||
|
|
||||||
case interval <= 7200000:
|
case interval <= 7200000:
|
||||||
return 7200000; // 2h
|
return 7200000;
|
||||||
|
// 2h
|
||||||
|
|
||||||
case interval <= 10800000:
|
case interval <= 10800000:
|
||||||
return 10800000; // 3h
|
return 10800000;
|
||||||
|
// 3h
|
||||||
|
|
||||||
case interval <= 21600000:
|
case interval <= 21600000:
|
||||||
return 21600000; // 6h
|
return 21600000;
|
||||||
|
// 6h
|
||||||
|
|
||||||
case interval <= 43200000:
|
case interval <= 43200000:
|
||||||
return 43200000; // 12h
|
return 43200000;
|
||||||
|
// 12h
|
||||||
|
|
||||||
case interval <= 86400000:
|
case interval <= 86400000:
|
||||||
return 86400000; // 1d
|
return 86400000;
|
||||||
|
// 1d
|
||||||
|
|
||||||
case interval <= 604800000:
|
case interval <= 604800000:
|
||||||
return 604800000; // 1w
|
return 604800000;
|
||||||
|
// 1w
|
||||||
|
|
||||||
case interval <= 2592000000:
|
case interval <= 2592000000:
|
||||||
return 2592000000; // 30d
|
return 2592000000;
|
||||||
|
// 30d
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 31536000000; // 1y
|
return 31536000000;
|
||||||
|
// 1y
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return ColorModeDiscrete;
|
return ColorModeDiscrete;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
_export("ColorModeDiscrete", ColorModeDiscrete);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Accent.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,kDAAP,C","file":"Accent.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Accent.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,kDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666\");\n"],"file":"Accent.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Dark2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,kDAAP,C","file":"Dark2.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Dark2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,kDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666\");\n"],"file":"Dark2.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Paired.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,0EAAP,C","file":"Paired.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Paired.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,0EAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928\");\n"],"file":"Paired.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Pastel1.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,wDAAP,C","file":"Pastel1.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Pastel1.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,wDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2\");\n"],"file":"Pastel1.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Pastel2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,kDAAP,C","file":"Pastel2.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Pastel2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,kDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc\");\n"],"file":"Pastel2.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set1.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,wDAAP,C","file":"Set1.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set1.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,wDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999\");\n"],"file":"Set1.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,kDAAP,C","file":"Set2.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set2.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,kDAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3\");\n"],"file":"Set2.js"}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set3.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,Y;;;yBAEQA,OAAO,0EAAP,C","file":"Set3.js","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/categorical/Set3.js"],"names":["colors"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;;yBAEQA,MAAM,CAAC,0EAAD,C","sourcesContent":["import colors from \"../colors\";\n\nexport default colors(\"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f\");\n"],"file":"Set3.js"}
|
||||||
+4
-1
@@ -7,9 +7,12 @@ System.register([], function (_export, _context) {
|
|||||||
var n = specifier.length / 6 | 0,
|
var n = specifier.length / 6 | 0,
|
||||||
colors = new Array(n),
|
colors = new Array(n),
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
while (i < n) {
|
while (i < n) {
|
||||||
colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
|
colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
|
||||||
}return colors;
|
}
|
||||||
|
|
||||||
|
return colors;
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../src/libs/d3-scale-chromatic/colors.js"],"names":["specifier","n","length","colors","Array","i","slice"],"mappings":";;;;;qBAAe,UAASA,SAAT,EAAoB;AACjC,QAAIC,IAAID,UAAUE,MAAV,GAAmB,CAAnB,GAAuB,CAA/B;AAAA,QAAkCC,SAAS,IAAIC,KAAJ,CAAUH,CAAV,CAA3C;AAAA,QAAyDI,IAAI,CAA7D;AACA,WAAOA,IAAIJ,CAAX;AAAcE,aAAOE,CAAP,IAAY,MAAML,UAAUM,KAAV,CAAgBD,IAAI,CAApB,EAAuB,EAAEA,CAAF,GAAM,CAA7B,CAAlB;AAAd,KACA,OAAOF,MAAP;AACD,G","file":"colors.js","sourcesContent":["export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n"]}
|
{"version":3,"sources":["../../../src/libs/d3-scale-chromatic/colors.js"],"names":["specifier","n","length","colors","Array","i","slice"],"mappings":";;;;;qBAAe,UAASA,SAAT,EAAoB;AACjC,QAAIC,CAAC,GAAGD,SAAS,CAACE,MAAV,GAAmB,CAAnB,GAAuB,CAA/B;AAAA,QAAkCC,MAAM,GAAG,IAAIC,KAAJ,CAAUH,CAAV,CAA3C;AAAA,QAAyDI,CAAC,GAAG,CAA7D;;AACA,WAAOA,CAAC,GAAGJ,CAAX;AAAcE,MAAAA,MAAM,CAACE,CAAD,CAAN,GAAY,MAAML,SAAS,CAACM,KAAV,CAAgBD,CAAC,GAAG,CAApB,EAAuB,EAAEA,CAAF,GAAM,CAA7B,CAAlB;AAAd;;AACA,WAAOF,MAAP;AACD,G","sourcesContent":["export default function(specifier) {\n var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;\n while (i < n) colors[i] = \"#\" + specifier.slice(i * 6, ++i * 6);\n return colors;\n}\n"],"file":"colors.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("d8b365f5f5f55ab4ac", "a6611adfc27d80cdc1018571", "a6611adfc27df5f5f580cdc1018571", "8c510ad8b365f6e8c3c7eae55ab4ac01665e", "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e", "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e", "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e", "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30", "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(colors));
|
_export("scheme", scheme = new Array(3).concat("d8b365f5f5f55ab4ac", "a6611adfc27d80cdc1018571", "a6611adfc27df5f5f580cdc1018571", "8c510ad8b365f6e8c3c7eae55ab4ac01665e", "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e", "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e", "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e", "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30", "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/BrBG.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"BrBG.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/BrBG.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"d8b365f5f5f55ab4ac\",\n \"a6611adfc27d80cdc1018571\",\n \"a6611adfc27df5f5f580cdc1018571\",\n \"8c510ad8b365f6e8c3c7eae55ab4ac01665e\",\n \"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e\",\n \"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e\",\n \"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e\",\n \"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30\",\n \"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"BrBG.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("91cf60ffffbffc8d59", "1a9641a6d96afdae61d7191c", "1a9641a6d96affffbffdae61d7191c", "1a985091cf60d9ef8bfee08bfc8d59d73027", "1a985091cf60d9ef8bffffbffee08bfc8d59d73027", "1a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027", "1a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027", "0068371a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027a50026", "0068371a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027a50026").map(colors));
|
_export("scheme", scheme = new Array(3).concat("91cf60ffffbffc8d59", "1a9641a6d96afdae61d7191c", "1a9641a6d96affffbffdae61d7191c", "1a985091cf60d9ef8bfee08bfc8d59d73027", "1a985091cf60d9ef8bffffbffee08bfc8d59d73027", "1a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027", "1a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027", "0068371a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027a50026", "0068371a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027a50026").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/GnYlRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"GnYlRd.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"91cf60ffffbffc8d59\",\n \"1a9641a6d96afdae61d7191c\",\n \"1a9641a6d96affffbffdae61d7191c\",\n \"1a985091cf60d9ef8bfee08bfc8d59d73027\",\n \"1a985091cf60d9ef8bffffbffee08bfc8d59d73027\",\n \"1a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027\",\n \"1a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027\",\n \"0068371a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027a50026\",\n \"0068371a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027a50026\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/GnYlRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"91cf60ffffbffc8d59\",\n \"1a9641a6d96afdae61d7191c\",\n \"1a9641a6d96affffbffdae61d7191c\",\n \"1a985091cf60d9ef8bfee08bfc8d59d73027\",\n \"1a985091cf60d9ef8bffffbffee08bfc8d59d73027\",\n \"1a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027\",\n \"1a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027\",\n \"0068371a985066bd63a6d96ad9ef8bfee08bfdae61f46d43d73027a50026\",\n \"0068371a985066bd63a6d96ad9ef8bffffbffee08bfdae61f46d43d73027a50026\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"GnYlRd.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("af8dc3f7f7f77fbf7b", "7b3294c2a5cfa6dba0008837", "7b3294c2a5cff7f7f7a6dba0008837", "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837", "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837", "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837", "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837", "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b", "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(colors));
|
_export("scheme", scheme = new Array(3).concat("af8dc3f7f7f77fbf7b", "7b3294c2a5cfa6dba0008837", "7b3294c2a5cff7f7f7a6dba0008837", "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837", "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837", "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837", "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837", "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b", "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PRGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"PRGn.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PRGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"af8dc3f7f7f77fbf7b\",\n \"7b3294c2a5cfa6dba0008837\",\n \"7b3294c2a5cff7f7f7a6dba0008837\",\n \"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837\",\n \"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837\",\n \"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837\",\n \"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837\",\n \"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b\",\n \"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PRGn.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e9a3c9f7f7f7a1d76a", "d01c8bf1b6dab8e1864dac26", "d01c8bf1b6daf7f7f7b8e1864dac26", "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221", "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221", "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221", "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221", "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419", "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e9a3c9f7f7f7a1d76a", "d01c8bf1b6dab8e1864dac26", "d01c8bf1b6daf7f7f7b8e1864dac26", "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221", "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221", "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221", "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221", "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419", "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PiYG.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"PiYG.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PiYG.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e9a3c9f7f7f7a1d76a\",\n \"d01c8bf1b6dab8e1864dac26\",\n \"d01c8bf1b6daf7f7f7b8e1864dac26\",\n \"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221\",\n \"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221\",\n \"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221\",\n \"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221\",\n \"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419\",\n \"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PiYG.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("998ec3f7f7f7f1a340", "5e3c99b2abd2fdb863e66101", "5e3c99b2abd2f7f7f7fdb863e66101", "542788998ec3d8daebfee0b6f1a340b35806", "542788998ec3d8daebf7f7f7fee0b6f1a340b35806", "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806", "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806", "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08", "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(colors));
|
_export("scheme", scheme = new Array(3).concat("998ec3f7f7f7f1a340", "5e3c99b2abd2fdb863e66101", "5e3c99b2abd2f7f7f7fdb863e66101", "542788998ec3d8daebfee0b6f1a340b35806", "542788998ec3d8daebf7f7f7fee0b6f1a340b35806", "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806", "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806", "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08", "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PuOr.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"PuOr.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/PuOr.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"998ec3f7f7f7f1a340\",\n \"5e3c99b2abd2fdb863e66101\",\n \"5e3c99b2abd2f7f7f7fdb863e66101\",\n \"542788998ec3d8daebfee0b6f1a340b35806\",\n \"542788998ec3d8daebf7f7f7fee0b6f1a340b35806\",\n \"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806\",\n \"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806\",\n \"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08\",\n \"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PuOr.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("ef8a62f7f7f767a9cf", "ca0020f4a58292c5de0571b0", "ca0020f4a582f7f7f792c5de0571b0", "b2182bef8a62fddbc7d1e5f067a9cf2166ac", "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac", "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac", "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac", "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061", "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(colors));
|
_export("scheme", scheme = new Array(3).concat("ef8a62f7f7f767a9cf", "ca0020f4a58292c5de0571b0", "ca0020f4a582f7f7f792c5de0571b0", "b2182bef8a62fddbc7d1e5f067a9cf2166ac", "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac", "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac", "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac", "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061", "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"RdBu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62f7f7f767a9cf\",\n \"ca0020f4a58292c5de0571b0\",\n \"ca0020f4a582f7f7f792c5de0571b0\",\n \"b2182bef8a62fddbc7d1e5f067a9cf2166ac\",\n \"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac\",\n \"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac\",\n \"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac\",\n \"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061\",\n \"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"RdBu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("ef8a62ffffff999999", "ca0020f4a582bababa404040", "ca0020f4a582ffffffbababa404040", "b2182bef8a62fddbc7e0e0e09999994d4d4d", "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d", "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d", "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d", "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a", "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(colors));
|
_export("scheme", scheme = new Array(3).concat("ef8a62ffffff999999", "ca0020f4a582bababa404040", "ca0020f4a582ffffffbababa404040", "b2182bef8a62fddbc7e0e0e09999994d4d4d", "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d", "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d", "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d", "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a", "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdGy.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"RdGy.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdGy.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ef8a62ffffff999999\",\n \"ca0020f4a582bababa404040\",\n \"ca0020f4a582ffffffbababa404040\",\n \"b2182bef8a62fddbc7e0e0e09999994d4d4d\",\n \"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d\",\n \"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d\",\n \"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d\",\n \"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a\",\n \"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"RdGy.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf91bfdb", "d7191cfdae61abd9e92c7bb6", "d7191cfdae61ffffbfabd9e92c7bb6", "d73027fc8d59fee090e0f3f891bfdb4575b4", "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4", "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4", "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4", "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695", "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf91bfdb", "d7191cfdae61abd9e92c7bb6", "d7191cfdae61ffffbfabd9e92c7bb6", "d73027fc8d59fee090e0f3f891bfdb4575b4", "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4", "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4", "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4", "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695", "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdYlBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"RdYlBu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdYlBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91bfdb\",\n \"d7191cfdae61abd9e92c7bb6\",\n \"d7191cfdae61ffffbfabd9e92c7bb6\",\n \"d73027fc8d59fee090e0f3f891bfdb4575b4\",\n \"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4\",\n \"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4\",\n \"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4\",\n \"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695\",\n \"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"RdYlBu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf91cf60", "d7191cfdae61a6d96a1a9641", "d7191cfdae61ffffbfa6d96a1a9641", "d73027fc8d59fee08bd9ef8b91cf601a9850", "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850", "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850", "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850", "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837", "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf91cf60", "d7191cfdae61a6d96a1a9641", "d7191cfdae61ffffbfa6d96a1a9641", "d73027fc8d59fee08bd9ef8b91cf601a9850", "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850", "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850", "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850", "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837", "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdYlGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"RdYlGn.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/RdYlGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf91cf60\",\n \"d7191cfdae61a6d96a1a9641\",\n \"d7191cfdae61ffffbfa6d96a1a9641\",\n \"d73027fc8d59fee08bd9ef8b91cf601a9850\",\n \"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850\",\n \"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850\",\n \"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850\",\n \"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837\",\n \"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"RdYlGn.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf99d594", "d7191cfdae61abdda42b83ba", "d7191cfdae61ffffbfabdda42b83ba", "d53e4ffc8d59fee08be6f59899d5943288bd", "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd", "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd", "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd", "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2", "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fc8d59ffffbf99d594", "d7191cfdae61abdda42b83ba", "d7191cfdae61ffffbfabdda42b83ba", "d53e4ffc8d59fee08be6f59899d5943288bd", "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd", "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd", "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd", "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2", "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/Spectral.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;;;yBAYLC,KAAKC,MAAL,C","file":"Spectral.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/diverging/Spectral.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlB,8DARkB,EASlB,oEATkB,EAUlBC,GAVkB,CAUdL,MAVc,C;;yBAYLC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fc8d59ffffbf99d594\",\n \"d7191cfdae61abdda42b83ba\",\n \"d7191cfdae61ffffbfabdda42b83ba\",\n \"d53e4ffc8d59fee08be6f59899d5943288bd\",\n \"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd\",\n \"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd\",\n \"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd\",\n \"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2\",\n \"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Spectral.js"}
|
||||||
+120
-172
@@ -5,213 +5,161 @@ System.register(["./categorical/Accent", "./categorical/Dark2", "./categorical/P
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_categoricalAccent) {
|
setters: [function (_categoricalAccent) {
|
||||||
var _exportObj = {};
|
_export("schemeAccent", _categoricalAccent.default);
|
||||||
_exportObj.schemeAccent = _categoricalAccent.default;
|
|
||||||
|
|
||||||
_export(_exportObj);
|
|
||||||
}, function (_categoricalDark) {
|
}, function (_categoricalDark) {
|
||||||
var _exportObj2 = {};
|
_export("schemeDark2", _categoricalDark.default);
|
||||||
_exportObj2.schemeDark2 = _categoricalDark.default;
|
|
||||||
|
|
||||||
_export(_exportObj2);
|
|
||||||
}, function (_categoricalPaired) {
|
}, function (_categoricalPaired) {
|
||||||
var _exportObj3 = {};
|
_export("schemePaired", _categoricalPaired.default);
|
||||||
_exportObj3.schemePaired = _categoricalPaired.default;
|
|
||||||
|
|
||||||
_export(_exportObj3);
|
|
||||||
}, function (_categoricalPastel) {
|
}, function (_categoricalPastel) {
|
||||||
var _exportObj4 = {};
|
_export("schemePastel1", _categoricalPastel.default);
|
||||||
_exportObj4.schemePastel1 = _categoricalPastel.default;
|
|
||||||
|
|
||||||
_export(_exportObj4);
|
|
||||||
}, function (_categoricalPastel2) {
|
}, function (_categoricalPastel2) {
|
||||||
var _exportObj5 = {};
|
_export("schemePastel2", _categoricalPastel2.default);
|
||||||
_exportObj5.schemePastel2 = _categoricalPastel2.default;
|
|
||||||
|
|
||||||
_export(_exportObj5);
|
|
||||||
}, function (_categoricalSet) {
|
}, function (_categoricalSet) {
|
||||||
var _exportObj6 = {};
|
_export("schemeSet1", _categoricalSet.default);
|
||||||
_exportObj6.schemeSet1 = _categoricalSet.default;
|
|
||||||
|
|
||||||
_export(_exportObj6);
|
|
||||||
}, function (_categoricalSet2) {
|
}, function (_categoricalSet2) {
|
||||||
var _exportObj7 = {};
|
_export("schemeSet2", _categoricalSet2.default);
|
||||||
_exportObj7.schemeSet2 = _categoricalSet2.default;
|
|
||||||
|
|
||||||
_export(_exportObj7);
|
|
||||||
}, function (_categoricalSet3) {
|
}, function (_categoricalSet3) {
|
||||||
var _exportObj8 = {};
|
_export("schemeSet3", _categoricalSet3.default);
|
||||||
_exportObj8.schemeSet3 = _categoricalSet3.default;
|
|
||||||
|
|
||||||
_export(_exportObj8);
|
|
||||||
}, function (_divergingBrBG) {
|
}, function (_divergingBrBG) {
|
||||||
var _exportObj9 = {};
|
_export({
|
||||||
_exportObj9.interpolateBrBG = _divergingBrBG.default;
|
interpolateBrBG: _divergingBrBG.default,
|
||||||
_exportObj9.schemeBrBG = _divergingBrBG.scheme;
|
schemeBrBG: _divergingBrBG.scheme
|
||||||
|
});
|
||||||
_export(_exportObj9);
|
|
||||||
}, function (_divergingPRGn) {
|
}, function (_divergingPRGn) {
|
||||||
var _exportObj10 = {};
|
_export({
|
||||||
_exportObj10.interpolatePRGn = _divergingPRGn.default;
|
interpolatePRGn: _divergingPRGn.default,
|
||||||
_exportObj10.schemePRGn = _divergingPRGn.scheme;
|
schemePRGn: _divergingPRGn.scheme
|
||||||
|
});
|
||||||
_export(_exportObj10);
|
|
||||||
}, function (_divergingPiYG) {
|
}, function (_divergingPiYG) {
|
||||||
var _exportObj11 = {};
|
_export({
|
||||||
_exportObj11.interpolatePiYG = _divergingPiYG.default;
|
interpolatePiYG: _divergingPiYG.default,
|
||||||
_exportObj11.schemePiYG = _divergingPiYG.scheme;
|
schemePiYG: _divergingPiYG.scheme
|
||||||
|
});
|
||||||
_export(_exportObj11);
|
|
||||||
}, function (_divergingPuOr) {
|
}, function (_divergingPuOr) {
|
||||||
var _exportObj12 = {};
|
_export({
|
||||||
_exportObj12.interpolatePuOr = _divergingPuOr.default;
|
interpolatePuOr: _divergingPuOr.default,
|
||||||
_exportObj12.schemePuOr = _divergingPuOr.scheme;
|
schemePuOr: _divergingPuOr.scheme
|
||||||
|
});
|
||||||
_export(_exportObj12);
|
|
||||||
}, function (_divergingRdBu) {
|
}, function (_divergingRdBu) {
|
||||||
var _exportObj13 = {};
|
_export({
|
||||||
_exportObj13.interpolateRdBu = _divergingRdBu.default;
|
interpolateRdBu: _divergingRdBu.default,
|
||||||
_exportObj13.schemeRdBu = _divergingRdBu.scheme;
|
schemeRdBu: _divergingRdBu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj13);
|
|
||||||
}, function (_divergingRdGy) {
|
}, function (_divergingRdGy) {
|
||||||
var _exportObj14 = {};
|
_export({
|
||||||
_exportObj14.interpolateRdGy = _divergingRdGy.default;
|
interpolateRdGy: _divergingRdGy.default,
|
||||||
_exportObj14.schemeRdGy = _divergingRdGy.scheme;
|
schemeRdGy: _divergingRdGy.scheme
|
||||||
|
});
|
||||||
_export(_exportObj14);
|
|
||||||
}, function (_divergingRdYlBu) {
|
}, function (_divergingRdYlBu) {
|
||||||
var _exportObj15 = {};
|
_export({
|
||||||
_exportObj15.interpolateRdYlBu = _divergingRdYlBu.default;
|
interpolateRdYlBu: _divergingRdYlBu.default,
|
||||||
_exportObj15.schemeRdYlBu = _divergingRdYlBu.scheme;
|
schemeRdYlBu: _divergingRdYlBu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj15);
|
|
||||||
}, function (_divergingRdYlGn) {
|
}, function (_divergingRdYlGn) {
|
||||||
var _exportObj16 = {};
|
_export({
|
||||||
_exportObj16.interpolateRdYlGn = _divergingRdYlGn.default;
|
interpolateRdYlGn: _divergingRdYlGn.default,
|
||||||
_exportObj16.schemeRdYlGn = _divergingRdYlGn.scheme;
|
schemeRdYlGn: _divergingRdYlGn.scheme
|
||||||
|
});
|
||||||
_export(_exportObj16);
|
|
||||||
}, function (_divergingGnYlRd) {
|
}, function (_divergingGnYlRd) {
|
||||||
var _exportObj17 = {};
|
_export({
|
||||||
_exportObj17.interpolateGnYlRd = _divergingGnYlRd.default;
|
interpolateGnYlRd: _divergingGnYlRd.default,
|
||||||
_exportObj17.schemeGnYlRd = _divergingGnYlRd.scheme;
|
schemeGnYlRd: _divergingGnYlRd.scheme
|
||||||
|
});
|
||||||
_export(_exportObj17);
|
|
||||||
}, function (_divergingSpectral) {
|
}, function (_divergingSpectral) {
|
||||||
var _exportObj18 = {};
|
_export({
|
||||||
_exportObj18.interpolateSpectral = _divergingSpectral.default;
|
interpolateSpectral: _divergingSpectral.default,
|
||||||
_exportObj18.schemeSpectral = _divergingSpectral.scheme;
|
schemeSpectral: _divergingSpectral.scheme
|
||||||
|
});
|
||||||
_export(_exportObj18);
|
|
||||||
}, function (_sequentialMultiBuGn) {
|
}, function (_sequentialMultiBuGn) {
|
||||||
var _exportObj19 = {};
|
_export({
|
||||||
_exportObj19.interpolateBuGn = _sequentialMultiBuGn.default;
|
interpolateBuGn: _sequentialMultiBuGn.default,
|
||||||
_exportObj19.schemeBuGn = _sequentialMultiBuGn.scheme;
|
schemeBuGn: _sequentialMultiBuGn.scheme
|
||||||
|
});
|
||||||
_export(_exportObj19);
|
|
||||||
}, function (_sequentialMultiBuPu) {
|
}, function (_sequentialMultiBuPu) {
|
||||||
var _exportObj20 = {};
|
_export({
|
||||||
_exportObj20.interpolateBuPu = _sequentialMultiBuPu.default;
|
interpolateBuPu: _sequentialMultiBuPu.default,
|
||||||
_exportObj20.schemeBuPu = _sequentialMultiBuPu.scheme;
|
schemeBuPu: _sequentialMultiBuPu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj20);
|
|
||||||
}, function (_sequentialMultiGnBu) {
|
}, function (_sequentialMultiGnBu) {
|
||||||
var _exportObj21 = {};
|
_export({
|
||||||
_exportObj21.interpolateGnBu = _sequentialMultiGnBu.default;
|
interpolateGnBu: _sequentialMultiGnBu.default,
|
||||||
_exportObj21.schemeGnBu = _sequentialMultiGnBu.scheme;
|
schemeGnBu: _sequentialMultiGnBu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj21);
|
|
||||||
}, function (_sequentialMultiOrRd) {
|
}, function (_sequentialMultiOrRd) {
|
||||||
var _exportObj22 = {};
|
_export({
|
||||||
_exportObj22.interpolateOrRd = _sequentialMultiOrRd.default;
|
interpolateOrRd: _sequentialMultiOrRd.default,
|
||||||
_exportObj22.schemeOrRd = _sequentialMultiOrRd.scheme;
|
schemeOrRd: _sequentialMultiOrRd.scheme
|
||||||
|
});
|
||||||
_export(_exportObj22);
|
|
||||||
}, function (_sequentialMultiPuBuGn) {
|
}, function (_sequentialMultiPuBuGn) {
|
||||||
var _exportObj23 = {};
|
_export({
|
||||||
_exportObj23.interpolatePuBuGn = _sequentialMultiPuBuGn.default;
|
interpolatePuBuGn: _sequentialMultiPuBuGn.default,
|
||||||
_exportObj23.schemePuBuGn = _sequentialMultiPuBuGn.scheme;
|
schemePuBuGn: _sequentialMultiPuBuGn.scheme
|
||||||
|
});
|
||||||
_export(_exportObj23);
|
|
||||||
}, function (_sequentialMultiPuBu) {
|
}, function (_sequentialMultiPuBu) {
|
||||||
var _exportObj24 = {};
|
_export({
|
||||||
_exportObj24.interpolatePuBu = _sequentialMultiPuBu.default;
|
interpolatePuBu: _sequentialMultiPuBu.default,
|
||||||
_exportObj24.schemePuBu = _sequentialMultiPuBu.scheme;
|
schemePuBu: _sequentialMultiPuBu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj24);
|
|
||||||
}, function (_sequentialMultiPuRd) {
|
}, function (_sequentialMultiPuRd) {
|
||||||
var _exportObj25 = {};
|
_export({
|
||||||
_exportObj25.interpolatePuRd = _sequentialMultiPuRd.default;
|
interpolatePuRd: _sequentialMultiPuRd.default,
|
||||||
_exportObj25.schemePuRd = _sequentialMultiPuRd.scheme;
|
schemePuRd: _sequentialMultiPuRd.scheme
|
||||||
|
});
|
||||||
_export(_exportObj25);
|
|
||||||
}, function (_sequentialMultiRdPu) {
|
}, function (_sequentialMultiRdPu) {
|
||||||
var _exportObj26 = {};
|
_export({
|
||||||
_exportObj26.interpolateRdPu = _sequentialMultiRdPu.default;
|
interpolateRdPu: _sequentialMultiRdPu.default,
|
||||||
_exportObj26.schemeRdPu = _sequentialMultiRdPu.scheme;
|
schemeRdPu: _sequentialMultiRdPu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj26);
|
|
||||||
}, function (_sequentialMultiYlGnBu) {
|
}, function (_sequentialMultiYlGnBu) {
|
||||||
var _exportObj27 = {};
|
_export({
|
||||||
_exportObj27.interpolateYlGnBu = _sequentialMultiYlGnBu.default;
|
interpolateYlGnBu: _sequentialMultiYlGnBu.default,
|
||||||
_exportObj27.schemeYlGnBu = _sequentialMultiYlGnBu.scheme;
|
schemeYlGnBu: _sequentialMultiYlGnBu.scheme
|
||||||
|
});
|
||||||
_export(_exportObj27);
|
|
||||||
}, function (_sequentialMultiYlGn) {
|
}, function (_sequentialMultiYlGn) {
|
||||||
var _exportObj28 = {};
|
_export({
|
||||||
_exportObj28.interpolateYlGn = _sequentialMultiYlGn.default;
|
interpolateYlGn: _sequentialMultiYlGn.default,
|
||||||
_exportObj28.schemeYlGn = _sequentialMultiYlGn.scheme;
|
schemeYlGn: _sequentialMultiYlGn.scheme
|
||||||
|
});
|
||||||
_export(_exportObj28);
|
|
||||||
}, function (_sequentialMultiYlOrBr) {
|
}, function (_sequentialMultiYlOrBr) {
|
||||||
var _exportObj29 = {};
|
_export({
|
||||||
_exportObj29.interpolateYlOrBr = _sequentialMultiYlOrBr.default;
|
interpolateYlOrBr: _sequentialMultiYlOrBr.default,
|
||||||
_exportObj29.schemeYlOrBr = _sequentialMultiYlOrBr.scheme;
|
schemeYlOrBr: _sequentialMultiYlOrBr.scheme
|
||||||
|
});
|
||||||
_export(_exportObj29);
|
|
||||||
}, function (_sequentialMultiYlOrRd) {
|
}, function (_sequentialMultiYlOrRd) {
|
||||||
var _exportObj30 = {};
|
_export({
|
||||||
_exportObj30.interpolateYlOrRd = _sequentialMultiYlOrRd.default;
|
interpolateYlOrRd: _sequentialMultiYlOrRd.default,
|
||||||
_exportObj30.schemeYlOrRd = _sequentialMultiYlOrRd.scheme;
|
schemeYlOrRd: _sequentialMultiYlOrRd.scheme
|
||||||
|
});
|
||||||
_export(_exportObj30);
|
|
||||||
}, function (_sequentialSingleBlues) {
|
}, function (_sequentialSingleBlues) {
|
||||||
var _exportObj31 = {};
|
_export({
|
||||||
_exportObj31.interpolateBlues = _sequentialSingleBlues.default;
|
interpolateBlues: _sequentialSingleBlues.default,
|
||||||
_exportObj31.schemeBlues = _sequentialSingleBlues.scheme;
|
schemeBlues: _sequentialSingleBlues.scheme
|
||||||
|
});
|
||||||
_export(_exportObj31);
|
|
||||||
}, function (_sequentialSingleGreens) {
|
}, function (_sequentialSingleGreens) {
|
||||||
var _exportObj32 = {};
|
_export({
|
||||||
_exportObj32.interpolateGreens = _sequentialSingleGreens.default;
|
interpolateGreens: _sequentialSingleGreens.default,
|
||||||
_exportObj32.schemeGreens = _sequentialSingleGreens.scheme;
|
schemeGreens: _sequentialSingleGreens.scheme
|
||||||
|
});
|
||||||
_export(_exportObj32);
|
|
||||||
}, function (_sequentialSingleGreys) {
|
}, function (_sequentialSingleGreys) {
|
||||||
var _exportObj33 = {};
|
_export({
|
||||||
_exportObj33.interpolateGreys = _sequentialSingleGreys.default;
|
interpolateGreys: _sequentialSingleGreys.default,
|
||||||
_exportObj33.schemeGreys = _sequentialSingleGreys.scheme;
|
schemeGreys: _sequentialSingleGreys.scheme
|
||||||
|
});
|
||||||
_export(_exportObj33);
|
|
||||||
}, function (_sequentialSinglePurples) {
|
}, function (_sequentialSinglePurples) {
|
||||||
var _exportObj34 = {};
|
_export({
|
||||||
_exportObj34.interpolatePurples = _sequentialSinglePurples.default;
|
interpolatePurples: _sequentialSinglePurples.default,
|
||||||
_exportObj34.schemePurples = _sequentialSinglePurples.scheme;
|
schemePurples: _sequentialSinglePurples.scheme
|
||||||
|
});
|
||||||
_export(_exportObj34);
|
|
||||||
}, function (_sequentialSingleReds) {
|
}, function (_sequentialSingleReds) {
|
||||||
var _exportObj35 = {};
|
_export({
|
||||||
_exportObj35.interpolateReds = _sequentialSingleReds.default;
|
interpolateReds: _sequentialSingleReds.default,
|
||||||
_exportObj35.schemeReds = _sequentialSingleReds.scheme;
|
schemeReds: _sequentialSingleReds.scheme
|
||||||
|
});
|
||||||
_export(_exportObj35);
|
|
||||||
}, function (_sequentialSingleOranges) {
|
}, function (_sequentialSingleOranges) {
|
||||||
var _exportObj36 = {};
|
_export({
|
||||||
_exportObj36.interpolateOranges = _sequentialSingleOranges.default;
|
interpolateOranges: _sequentialSingleOranges.default,
|
||||||
_exportObj36.schemeOranges = _sequentialSingleOranges.scheme;
|
schemeOranges: _sequentialSingleOranges.scheme
|
||||||
|
});
|
||||||
_export(_exportObj36);
|
|
||||||
}],
|
}],
|
||||||
execute: function () {}
|
execute: function () {}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
"use strict";
|
||||||
|
|
||||||
System.register(['d3'], function (_export, _context) {
|
System.register(["d3"], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var d3;
|
var d3;
|
||||||
|
|
||||||
_export('default', function (scheme) {
|
_export("default", function (scheme) {
|
||||||
return d3.interpolateRgbBasis(scheme[scheme.length - 1]);
|
return d3.interpolateRgbBasis(scheme[scheme.length - 1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../src/libs/d3-scale-chromatic/ramp.js"],"names":["scheme","d3","interpolateRgbBasis","length"],"mappings":";;;;;;;qBAEe,UAASA,MAAT,EAAiB;AAC9B,WAAOC,GAAGC,mBAAH,CAAuBF,OAAOA,OAAOG,MAAP,GAAgB,CAAvB,CAAvB,CAAP;AACD,G;;;;AAJMF,Q","file":"ramp.js","sourcesContent":["import d3 from 'd3';\n\nexport default function(scheme) {\n return d3.interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n"]}
|
{"version":3,"sources":["../../../src/libs/d3-scale-chromatic/ramp.js"],"names":["scheme","d3","interpolateRgbBasis","length"],"mappings":";;;;;;;qBAEe,UAASA,MAAT,EAAiB;AAC9B,WAAOC,EAAE,CAACC,mBAAH,CAAuBF,MAAM,CAACA,MAAM,CAACG,MAAP,GAAgB,CAAjB,CAA7B,CAAP;AACD,G;;;;AAJMF,MAAAA,E","sourcesContent":["import d3 from 'd3';\n\nexport default function(scheme) {\n return d3.interpolateRgbBasis(scheme[scheme.length - 1]);\n}\n"],"file":"ramp.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e5f5f999d8c92ca25f", "edf8fbb2e2e266c2a4238b45", "edf8fbb2e2e266c2a42ca25f006d2c", "edf8fbccece699d8c966c2a42ca25f006d2c", "edf8fbccece699d8c966c2a441ae76238b45005824", "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824", "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e5f5f999d8c92ca25f", "edf8fbb2e2e266c2a4238b45", "edf8fbb2e2e266c2a42ca25f006d2c", "edf8fbccece699d8c966c2a42ca25f006d2c", "edf8fbccece699d8c966c2a441ae76238b45005824", "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824", "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/BuGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"BuGn.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/BuGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5f999d8c92ca25f\",\n \"edf8fbb2e2e266c2a4238b45\",\n \"edf8fbb2e2e266c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a42ca25f006d2c\",\n \"edf8fbccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824\",\n \"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"BuGn.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e0ecf49ebcda8856a7", "edf8fbb3cde38c96c688419d", "edf8fbb3cde38c96c68856a7810f7c", "edf8fbbfd3e69ebcda8c96c68856a7810f7c", "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b", "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b", "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e0ecf49ebcda8856a7", "edf8fbb3cde38c96c688419d", "edf8fbb3cde38c96c68856a7810f7c", "edf8fbbfd3e69ebcda8c96c68856a7810f7c", "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b", "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b", "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/BuPu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"BuPu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/BuPu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e0ecf49ebcda8856a7\",\n \"edf8fbb3cde38c96c688419d\",\n \"edf8fbb3cde38c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68856a7810f7c\",\n \"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b\",\n \"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"BuPu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e0f3dba8ddb543a2ca", "f0f9e8bae4bc7bccc42b8cbe", "f0f9e8bae4bc7bccc443a2ca0868ac", "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac", "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e", "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e", "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e0f3dba8ddb543a2ca", "f0f9e8bae4bc7bccc42b8cbe", "f0f9e8bae4bc7bccc443a2ca0868ac", "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac", "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e", "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e", "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/GnBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"GnBu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/GnBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e0f3dba8ddb543a2ca\",\n \"f0f9e8bae4bc7bccc42b8cbe\",\n \"f0f9e8bae4bc7bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac\",\n \"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e\",\n \"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"GnBu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fee8c8fdbb84e34a33", "fef0d9fdcc8afc8d59d7301f", "fef0d9fdcc8afc8d59e34a33b30000", "fef0d9fdd49efdbb84fc8d59e34a33b30000", "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000", "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000", "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fee8c8fdbb84e34a33", "fef0d9fdcc8afc8d59d7301f", "fef0d9fdcc8afc8d59e34a33b30000", "fef0d9fdd49efdbb84fc8d59e34a33b30000", "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000", "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000", "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/OrRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"OrRd.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/OrRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee8c8fdbb84e34a33\",\n \"fef0d9fdcc8afc8d59d7301f\",\n \"fef0d9fdcc8afc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59e34a33b30000\",\n \"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000\",\n \"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"OrRd.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("ece7f2a6bddb2b8cbe", "f1eef6bdc9e174a9cf0570b0", "f1eef6bdc9e174a9cf2b8cbe045a8d", "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d", "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b", "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b", "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(colors));
|
_export("scheme", scheme = new Array(3).concat("ece7f2a6bddb2b8cbe", "f1eef6bdc9e174a9cf0570b0", "f1eef6bdc9e174a9cf2b8cbe045a8d", "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d", "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b", "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b", "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"PuBu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ece7f2a6bddb2b8cbe\",\n \"f1eef6bdc9e174a9cf0570b0\",\n \"f1eef6bdc9e174a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d\",\n \"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b\",\n \"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PuBu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("ece2f0a6bddb1c9099", "f6eff7bdc9e167a9cf02818a", "f6eff7bdc9e167a9cf1c9099016c59", "f6eff7d0d1e6a6bddb67a9cf1c9099016c59", "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450", "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450", "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(colors));
|
_export("scheme", scheme = new Array(3).concat("ece2f0a6bddb1c9099", "f6eff7bdc9e167a9cf02818a", "f6eff7bdc9e167a9cf1c9099016c59", "f6eff7d0d1e6a6bddb67a9cf1c9099016c59", "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450", "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450", "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuBuGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"PuBuGn.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuBuGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ece2f0a6bddb1c9099\",\n \"f6eff7bdc9e167a9cf02818a\",\n \"f6eff7bdc9e167a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf1c9099016c59\",\n \"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450\",\n \"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PuBuGn.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e7e1efc994c7dd1c77", "f1eef6d7b5d8df65b0ce1256", "f1eef6d7b5d8df65b0dd1c77980043", "f1eef6d4b9dac994c7df65b0dd1c77980043", "f1eef6d4b9dac994c7df65b0e7298ace125691003f", "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f", "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e7e1efc994c7dd1c77", "f1eef6d7b5d8df65b0ce1256", "f1eef6d7b5d8df65b0dd1c77980043", "f1eef6d4b9dac994c7df65b0dd1c77980043", "f1eef6d4b9dac994c7df65b0e7298ace125691003f", "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f", "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"PuRd.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/PuRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e7e1efc994c7dd1c77\",\n \"f1eef6d7b5d8df65b0ce1256\",\n \"f1eef6d7b5d8df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0dd1c77980043\",\n \"f1eef6d4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f\",\n \"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"PuRd.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fde0ddfa9fb5c51b8a", "feebe2fbb4b9f768a1ae017e", "feebe2fbb4b9f768a1c51b8a7a0177", "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177", "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177", "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177", "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fde0ddfa9fb5c51b8a", "feebe2fbb4b9f768a1ae017e", "feebe2fbb4b9f768a1c51b8a7a0177", "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177", "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177", "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177", "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/RdPu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"RdPu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/RdPu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fde0ddfa9fb5c51b8a\",\n \"feebe2fbb4b9f768a1ae017e\",\n \"feebe2fbb4b9f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177\",\n \"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177\",\n \"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"RdPu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("f7fcb9addd8e31a354", "ffffccc2e69978c679238443", "ffffccc2e69978c67931a354006837", "ffffccd9f0a3addd8e78c67931a354006837", "ffffccd9f0a3addd8e78c67941ab5d238443005a32", "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32", "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(colors));
|
_export("scheme", scheme = new Array(3).concat("f7fcb9addd8e31a354", "ffffccc2e69978c679238443", "ffffccc2e69978c67931a354006837", "ffffccd9f0a3addd8e78c67931a354006837", "ffffccd9f0a3addd8e78c67941ab5d238443005a32", "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32", "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"YlGn.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlGn.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"f7fcb9addd8e31a354\",\n \"ffffccc2e69978c679238443\",\n \"ffffccc2e69978c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67931a354006837\",\n \"ffffccd9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32\",\n \"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"YlGn.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("edf8b17fcdbb2c7fb8", "ffffcca1dab441b6c4225ea8", "ffffcca1dab441b6c42c7fb8253494", "ffffccc7e9b47fcdbb41b6c42c7fb8253494", "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84", "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84", "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(colors));
|
_export("scheme", scheme = new Array(3).concat("edf8b17fcdbb2c7fb8", "ffffcca1dab441b6c4225ea8", "ffffcca1dab441b6c42c7fb8253494", "ffffccc7e9b47fcdbb41b6c42c7fb8253494", "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84", "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84", "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlGnBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"YlGnBu.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlGnBu.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"edf8b17fcdbb2c7fb8\",\n \"ffffcca1dab441b6c4225ea8\",\n \"ffffcca1dab441b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c42c7fb8253494\",\n \"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84\",\n \"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"YlGnBu.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fff7bcfec44fd95f0e", "ffffd4fed98efe9929cc4c02", "ffffd4fed98efe9929d95f0e993404", "ffffd4fee391fec44ffe9929d95f0e993404", "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04", "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04", "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fff7bcfec44fd95f0e", "ffffd4fed98efe9929cc4c02", "ffffd4fed98efe9929d95f0e993404", "ffffd4fee391fec44ffe9929d95f0e993404", "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04", "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04", "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlOrBr.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"YlOrBr.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlOrBr.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fff7bcfec44fd95f0e\",\n \"ffffd4fed98efe9929cc4c02\",\n \"ffffd4fed98efe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929d95f0e993404\",\n \"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04\",\n \"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"YlOrBr.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("ffeda0feb24cf03b20", "ffffb2fecc5cfd8d3ce31a1c", "ffffb2fecc5cfd8d3cf03b20bd0026", "ffffb2fed976feb24cfd8d3cf03b20bd0026", "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026", "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026", "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(colors));
|
_export("scheme", scheme = new Array(3).concat("ffeda0feb24cf03b20", "ffffb2fecc5cfd8d3ce31a1c", "ffffb2fecc5cfd8d3cf03b20bd0026", "ffffb2fed976feb24cfd8d3cf03b20bd0026", "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026", "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026", "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlOrRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"YlOrRd.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-multi/YlOrRd.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"ffeda0feb24cf03b20\",\n \"ffffb2fecc5cfd8d3ce31a1c\",\n \"ffffb2fecc5cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cf03b20bd0026\",\n \"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026\",\n \"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"YlOrRd.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("deebf79ecae13182bd", "eff3ffbdd7e76baed62171b5", "eff3ffbdd7e76baed63182bd08519c", "eff3ffc6dbef9ecae16baed63182bd08519c", "eff3ffc6dbef9ecae16baed64292c62171b5084594", "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594", "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(colors));
|
_export("scheme", scheme = new Array(3).concat("deebf79ecae13182bd", "eff3ffbdd7e76baed62171b5", "eff3ffbdd7e76baed63182bd08519c", "eff3ffc6dbef9ecae16baed63182bd08519c", "eff3ffc6dbef9ecae16baed64292c62171b5084594", "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594", "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Blues.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Blues.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Blues.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"deebf79ecae13182bd\",\n \"eff3ffbdd7e76baed62171b5\",\n \"eff3ffbdd7e76baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed63182bd08519c\",\n \"eff3ffc6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594\",\n \"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Blues.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("e5f5e0a1d99b31a354", "edf8e9bae4b374c476238b45", "edf8e9bae4b374c47631a354006d2c", "edf8e9c7e9c0a1d99b74c47631a354006d2c", "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32", "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32", "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(colors));
|
_export("scheme", scheme = new Array(3).concat("e5f5e0a1d99b31a354", "edf8e9bae4b374c476238b45", "edf8e9bae4b374c47631a354006d2c", "edf8e9c7e9c0a1d99b74c47631a354006d2c", "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32", "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32", "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Greens.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Greens.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Greens.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"e5f5e0a1d99b31a354\",\n \"edf8e9bae4b374c476238b45\",\n \"edf8e9bae4b374c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47631a354006d2c\",\n \"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32\",\n \"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Greens.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("f0f0f0bdbdbd636363", "f7f7f7cccccc969696525252", "f7f7f7cccccc969696636363252525", "f7f7f7d9d9d9bdbdbd969696636363252525", "f7f7f7d9d9d9bdbdbd969696737373525252252525", "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525", "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(colors));
|
_export("scheme", scheme = new Array(3).concat("f0f0f0bdbdbd636363", "f7f7f7cccccc969696525252", "f7f7f7cccccc969696636363252525", "f7f7f7d9d9d9bdbdbd969696636363252525", "f7f7f7d9d9d9bdbdbd969696737373525252252525", "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525", "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Greys.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Greys.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Greys.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"f0f0f0bdbdbd636363\",\n \"f7f7f7cccccc969696525252\",\n \"f7f7f7cccccc969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696636363252525\",\n \"f7f7f7d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525\",\n \"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Greys.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fee6cefdae6be6550d", "feeddefdbe85fd8d3cd94701", "feeddefdbe85fd8d3ce6550da63603", "feeddefdd0a2fdae6bfd8d3ce6550da63603", "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04", "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04", "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fee6cefdae6be6550d", "feeddefdbe85fd8d3cd94701", "feeddefdbe85fd8d3ce6550da63603", "feeddefdd0a2fdae6bfd8d3ce6550da63603", "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04", "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04", "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Oranges.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Oranges.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Oranges.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee6cefdae6be6550d\",\n \"feeddefdbe85fd8d3cd94701\",\n \"feeddefdbe85fd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3ce6550da63603\",\n \"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04\",\n \"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Oranges.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("efedf5bcbddc756bb1", "f2f0f7cbc9e29e9ac86a51a3", "f2f0f7cbc9e29e9ac8756bb154278f", "f2f0f7dadaebbcbddc9e9ac8756bb154278f", "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486", "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486", "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(colors));
|
_export("scheme", scheme = new Array(3).concat("efedf5bcbddc756bb1", "f2f0f7cbc9e29e9ac86a51a3", "f2f0f7cbc9e29e9ac8756bb154278f", "f2f0f7dadaebbcbddc9e9ac8756bb154278f", "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486", "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486", "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Purples.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Purples.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Purples.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"efedf5bcbddc756bb1\",\n \"f2f0f7cbc9e29e9ac86a51a3\",\n \"f2f0f7cbc9e29e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8756bb154278f\",\n \"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486\",\n \"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Purples.js"}
|
||||||
@@ -13,8 +13,6 @@ System.register(["../colors", "../ramp"], function (_export, _context) {
|
|||||||
execute: function () {
|
execute: function () {
|
||||||
_export("scheme", scheme = new Array(3).concat("fee0d2fc9272de2d26", "fee5d9fcae91fb6a4acb181d", "fee5d9fcae91fb6a4ade2d26a50f15", "fee5d9fcbba1fc9272fb6a4ade2d26a50f15", "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d", "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d", "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(colors));
|
_export("scheme", scheme = new Array(3).concat("fee0d2fc9272de2d26", "fee5d9fcae91fb6a4acb181d", "fee5d9fcae91fb6a4ade2d26a50f15", "fee5d9fcbba1fc9272fb6a4ade2d26a50f15", "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d", "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d", "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(colors));
|
||||||
|
|
||||||
_export("scheme", scheme);
|
|
||||||
|
|
||||||
_export("default", ramp(scheme));
|
_export("default", ramp(scheme));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Reds.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,Y;;AACAC,U;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;;;yBAULC,KAAKC,MAAL,C","file":"Reds.js","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n"]}
|
{"version":3,"sources":["../../../../src/libs/d3-scale-chromatic/sequential-single/Reds.js"],"names":["colors","ramp","scheme","Array","concat","map"],"mappings":";;;;;;;;AAAOA,MAAAA,M;;AACAC,MAAAA,I;;;wBAEIC,M,GAAS,IAAIC,KAAJ,CAAU,CAAV,EAAaC,MAAb,CAClB,oBADkB,EAElB,0BAFkB,EAGlB,gCAHkB,EAIlB,sCAJkB,EAKlB,4CALkB,EAMlB,kDANkB,EAOlB,wDAPkB,EAQlBC,GARkB,CAQdL,MARc,C;;yBAULC,IAAI,CAACC,MAAD,C","sourcesContent":["import colors from \"../colors\";\nimport ramp from \"../ramp\";\n\nexport var scheme = new Array(3).concat(\n \"fee0d2fc9272de2d26\",\n \"fee5d9fcae91fb6a4acb181d\",\n \"fee5d9fcae91fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4ade2d26a50f15\",\n \"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d\",\n \"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d\"\n).map(colors);\n\nexport default ramp(scheme);\n"],"file":"Reds.js"}
|
||||||
Vendored
+629
-9
@@ -1,23 +1,643 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['app/plugins/sdk', './status_heatmap_ctrl'], function (_export, _context) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var loadPluginCss, StatusHeatmapCtrl;
|
System.register(["lodash", "./color_legend", "app/core/utils/kbn", "app/plugins/sdk", "./graph", "./rendering", "./options_editor", "./color_mode_discrete"], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var _, kbn, loadPluginCss, MetricsPanelCtrl, Card, rendering, statusHeatmapOptionsEditor, ColorModeDiscrete, CANVAS, SVG, VALUE_INDEX, TIME_INDEX, renderer, colorSchemes, colorModes, opacityScales, StatusHeatmapCtrl;
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
||||||
|
|
||||||
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_appPluginsSdk) {
|
setters: [function (_lodash) {
|
||||||
|
_ = _lodash.default;
|
||||||
|
}, function (_color_legend) {}, function (_appCoreUtilsKbn) {
|
||||||
|
kbn = _appCoreUtilsKbn.default;
|
||||||
|
}, function (_appPluginsSdk) {
|
||||||
loadPluginCss = _appPluginsSdk.loadPluginCss;
|
loadPluginCss = _appPluginsSdk.loadPluginCss;
|
||||||
}, function (_status_heatmap_ctrl) {
|
MetricsPanelCtrl = _appPluginsSdk.MetricsPanelCtrl;
|
||||||
StatusHeatmapCtrl = _status_heatmap_ctrl.StatusHeatmapCtrl;
|
}, function (_graph) {
|
||||||
|
Card = _graph.Card;
|
||||||
|
}, function (_rendering) {
|
||||||
|
rendering = _rendering.default;
|
||||||
|
}, function (_options_editor) {
|
||||||
|
statusHeatmapOptionsEditor = _options_editor.statusHeatmapOptionsEditor;
|
||||||
|
}, function (_color_mode_discrete) {
|
||||||
|
ColorModeDiscrete = _color_mode_discrete.ColorModeDiscrete;
|
||||||
}],
|
}],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
|
CANVAS = 'CANVAS';
|
||||||
|
SVG = 'SVG';
|
||||||
|
VALUE_INDEX = 0;
|
||||||
|
TIME_INDEX = 1;
|
||||||
|
renderer = CANVAS;
|
||||||
|
colorSchemes = [// Diverging
|
||||||
|
{
|
||||||
|
name: 'Spectral',
|
||||||
|
value: 'interpolateSpectral',
|
||||||
|
invert: 'always'
|
||||||
|
}, {
|
||||||
|
name: 'RdYlGn',
|
||||||
|
value: 'interpolateRdYlGn',
|
||||||
|
invert: 'always'
|
||||||
|
}, {
|
||||||
|
name: 'GnYlRd',
|
||||||
|
value: 'interpolateGnYlRd',
|
||||||
|
invert: 'always'
|
||||||
|
}, // Sequential (Single Hue)
|
||||||
|
{
|
||||||
|
name: 'Blues',
|
||||||
|
value: 'interpolateBlues',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'Greens',
|
||||||
|
value: 'interpolateGreens',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'Greys',
|
||||||
|
value: 'interpolateGreys',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'Oranges',
|
||||||
|
value: 'interpolateOranges',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'Purples',
|
||||||
|
value: 'interpolatePurples',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'Reds',
|
||||||
|
value: 'interpolateReds',
|
||||||
|
invert: 'dark'
|
||||||
|
}, // Sequential (Multi-Hue)
|
||||||
|
{
|
||||||
|
name: 'BuGn',
|
||||||
|
value: 'interpolateBuGn',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'BuPu',
|
||||||
|
value: 'interpolateBuPu',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'GnBu',
|
||||||
|
value: 'interpolateGnBu',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'OrRd',
|
||||||
|
value: 'interpolateOrRd',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'PuBuGn',
|
||||||
|
value: 'interpolatePuBuGn',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'PuBu',
|
||||||
|
value: 'interpolatePuBu',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'PuRd',
|
||||||
|
value: 'interpolatePuRd',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'RdPu',
|
||||||
|
value: 'interpolateRdPu',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'YlGnBu',
|
||||||
|
value: 'interpolateYlGnBu',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'YlGn',
|
||||||
|
value: 'interpolateYlGn',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'YlOrBr',
|
||||||
|
value: 'interpolateYlOrBr',
|
||||||
|
invert: 'dark'
|
||||||
|
}, {
|
||||||
|
name: 'YlOrRd',
|
||||||
|
value: 'interpolateYlOrRd',
|
||||||
|
invert: 'dark'
|
||||||
|
}];
|
||||||
|
colorModes = ['opacity', 'spectrum', 'discrete'];
|
||||||
|
opacityScales = ['linear', 'sqrt'];
|
||||||
loadPluginCss({
|
loadPluginCss({
|
||||||
dark: 'plugins/flant-statusmap-panel/css/statusmap.dark.css',
|
dark: 'plugins/flant-statusmap-panel/css/statusmap.dark.css',
|
||||||
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
||||||
});
|
});
|
||||||
|
|
||||||
_export('PanelCtrl', StatusHeatmapCtrl);
|
_export("PanelCtrl", _export("StatusHeatmapCtrl", StatusHeatmapCtrl =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_MetricsPanelCtrl) {
|
||||||
|
StatusHeatmapCtrl.$inject = ["$scope", "$injector", "annotationsSrv"];
|
||||||
|
|
||||||
|
_inherits(StatusHeatmapCtrl, _MetricsPanelCtrl);
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
function StatusHeatmapCtrl($scope, $injector, annotationsSrv) {
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
_classCallCheck(this, StatusHeatmapCtrl);
|
||||||
|
|
||||||
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(StatusHeatmapCtrl).call(this, $scope, $injector));
|
||||||
|
_this.annotationsSrv = annotationsSrv;
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "opacityScales", []);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "colorModes", []);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "colorSchemes", []);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "unitFormats", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "cardsData", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "graph", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "multipleValues", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "noColorDefined", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "discreteHelper", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "dataWarnings", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "annotations", []);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "annotationsPromise", void 0);
|
||||||
|
|
||||||
|
_defineProperty(_assertThisInitialized(_this), "panelDefaults", {
|
||||||
|
// datasource name, null = default datasource
|
||||||
|
datasource: null,
|
||||||
|
// color mode
|
||||||
|
color: {
|
||||||
|
mode: 'spectrum',
|
||||||
|
cardColor: '#b4ff00',
|
||||||
|
colorScale: 'sqrt',
|
||||||
|
exponent: 0.5,
|
||||||
|
colorScheme: 'interpolateGnYlRd',
|
||||||
|
// discrete mode settings
|
||||||
|
defaultColor: '#757575',
|
||||||
|
thresholds: [] // manual colors
|
||||||
|
|
||||||
|
},
|
||||||
|
// buckets settings
|
||||||
|
cards: {
|
||||||
|
cardMinWidth: 5,
|
||||||
|
cardVSpacing: 2,
|
||||||
|
cardHSpacing: 2,
|
||||||
|
cardRound: null
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
show: true,
|
||||||
|
showWeekends: true,
|
||||||
|
minBucketWidthToShowWeekends: 4,
|
||||||
|
showCrosshair: true,
|
||||||
|
labelFormat: '%a %m/%d'
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: true,
|
||||||
|
showCrosshair: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
unitFormat: 'short',
|
||||||
|
decimals: null
|
||||||
|
},
|
||||||
|
// how null points should be handled
|
||||||
|
nullPointMode: 'as empty',
|
||||||
|
yAxisSort: 'metrics',
|
||||||
|
highlightCards: true,
|
||||||
|
useMax: true
|
||||||
|
});
|
||||||
|
|
||||||
|
_.defaultsDeep(_this.panel, _this.panelDefaults);
|
||||||
|
|
||||||
|
_this.opacityScales = opacityScales;
|
||||||
|
_this.colorModes = colorModes;
|
||||||
|
_this.colorSchemes = colorSchemes; // default graph width for discrete card width calculation
|
||||||
|
|
||||||
|
_this.graph = {
|
||||||
|
"chartWidth": -1
|
||||||
|
};
|
||||||
|
_this.multipleValues = false;
|
||||||
|
_this.noColorDefined = false;
|
||||||
|
_this.discreteHelper = new ColorModeDiscrete($scope);
|
||||||
|
_this.dataWarnings = {
|
||||||
|
"noColorDefined": {
|
||||||
|
title: 'Data has value with undefined color',
|
||||||
|
tip: 'Check metric values, color values or define a new color'
|
||||||
|
},
|
||||||
|
"multipleValues": {
|
||||||
|
title: 'Data has multiple values for one target',
|
||||||
|
tip: 'Change targets definitions or set "use max value"'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
_this.annotations = [];
|
||||||
|
|
||||||
|
_this.events.on('render', _this.onRender.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
_this.events.on('data-received', _this.onDataReceived.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
_this.events.on('data-error', _this.onDataError.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
_this.events.on('data-snapshot-load', _this.onDataReceived.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
_this.events.on('init-edit-mode', _this.onInitEditMode.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
_this.events.on('refresh', _this.postRefresh.bind(_assertThisInitialized(_this))); // custom event from rendering.js
|
||||||
|
|
||||||
|
|
||||||
|
_this.events.on('render-complete', _this.onRenderComplete.bind(_assertThisInitialized(_this)));
|
||||||
|
|
||||||
|
return _this;
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(StatusHeatmapCtrl, [{
|
||||||
|
key: "onRenderComplete",
|
||||||
|
value: function onRenderComplete(data) {
|
||||||
|
this.graph.chartWidth = data.chartWidth;
|
||||||
|
this.renderingCompleted();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "getChartWidth",
|
||||||
|
value: function getChartWidth() {
|
||||||
|
var wndWidth = $(window).width(); // gripPos.w is a width in grid's measurements. Grid size in Grafana is 24.
|
||||||
|
|
||||||
|
var panelWidthFactor = this.panel.gridPos.w / 24;
|
||||||
|
var panelWidth = Math.ceil(wndWidth * panelWidthFactor); // approximate chartWidth because y axis ticks not rendered yet on first data receive.
|
||||||
|
|
||||||
|
var chartWidth = _.max([panelWidth - 200, panelWidth / 2]);
|
||||||
|
|
||||||
|
return chartWidth;
|
||||||
|
} // override calculateInterval for discrete color mode
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "calculateInterval",
|
||||||
|
value: function calculateInterval() {
|
||||||
|
var chartWidth = this.getChartWidth();
|
||||||
|
var minCardWidth = this.panel.cards.cardMinWidth;
|
||||||
|
var minSpacing = this.panel.cards.cardHSpacing;
|
||||||
|
var maxCardsCount = Math.ceil((chartWidth - minCardWidth) / (minCardWidth + minSpacing));
|
||||||
|
var intervalMs;
|
||||||
|
var rangeMs = this.range.to.valueOf() - this.range.from.valueOf(); // this is minimal interval! kbn.round_interval will lower it.
|
||||||
|
|
||||||
|
intervalMs = this.discreteHelper.roundIntervalCeil(rangeMs / maxCardsCount); // Calculate low limit of interval
|
||||||
|
|
||||||
|
var lowLimitMs = 1; // 1 millisecond default low limit
|
||||||
|
|
||||||
|
var intervalOverride = this.panel.interval; // if no panel interval check datasource
|
||||||
|
|
||||||
|
if (intervalOverride) {
|
||||||
|
intervalOverride = this.templateSrv.replace(intervalOverride, this.panel.scopedVars);
|
||||||
|
} else if (this.datasource && this.datasource.interval) {
|
||||||
|
intervalOverride = this.datasource.interval;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (intervalOverride) {
|
||||||
|
if (intervalOverride[0] === '>') {
|
||||||
|
intervalOverride = intervalOverride.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
lowLimitMs = kbn.interval_to_ms(intervalOverride);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowLimitMs > intervalMs) {
|
||||||
|
intervalMs = lowLimitMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
var interval = kbn.secondsToHms(intervalMs / 1000);
|
||||||
|
this.intervalMs = intervalMs;
|
||||||
|
this.interval = interval;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "issueQueries",
|
||||||
|
value: function issueQueries(datasource) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
this.annotationsPromise = this.annotationsSrv.getAnnotations({
|
||||||
|
dashboard: this.dashboard,
|
||||||
|
panel: this.panel,
|
||||||
|
range: this.range
|
||||||
|
});
|
||||||
|
/* Wait for annotationSrv requests to get datasources to
|
||||||
|
* resolve before issuing queries. This allows the annotations
|
||||||
|
* service to fire annotations queries before graph queries
|
||||||
|
* (but not wait for completion). This resolves
|
||||||
|
* issue 11806.
|
||||||
|
*/
|
||||||
|
// 5.x before 5.4 doesn't have datasourcePromises.
|
||||||
|
|
||||||
|
if ("undefined" !== typeof this.annotationsSrv.datasourcePromises) {
|
||||||
|
return this.annotationsSrv.datasourcePromises.then(function (r) {
|
||||||
|
return _this2.issueQueriesWithInterval(datasource, _this2.interval);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return this.issueQueriesWithInterval(datasource, this.interval);
|
||||||
|
}
|
||||||
|
} // Grafana 6.2 (and older) is using this.interval for queries,
|
||||||
|
// but Grafana 6.3+ is calculating interval again in queryRunner,
|
||||||
|
// so we need to save-restore this.panel.interval.
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "issueQueriesWithInterval",
|
||||||
|
value: function issueQueriesWithInterval(datasource, interval) {
|
||||||
|
var origInterval = this.panel.interval;
|
||||||
|
this.panel.interval = this.interval;
|
||||||
|
|
||||||
|
var res = _get(_getPrototypeOf(StatusHeatmapCtrl.prototype), "issueQueries", this).call(this, datasource);
|
||||||
|
|
||||||
|
this.panel.interval = origInterval;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onDataReceived",
|
||||||
|
value: function onDataReceived(dataList) {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
this.data = dataList;
|
||||||
|
this.cardsData = this.convertToCards(this.data);
|
||||||
|
console.log("OnDataReceived");
|
||||||
|
this.annotationsPromise.then(function (result) {
|
||||||
|
_this3.loading = false; //this.alertState = result.alertState;
|
||||||
|
|
||||||
|
if (result.annotations && result.annotations.length > 0) {
|
||||||
|
_this3.annotations = result.annotations;
|
||||||
|
} else {
|
||||||
|
_this3.annotations = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("annotationsPromise result " + _this3.annotations.length + " annotations");
|
||||||
|
|
||||||
|
_this3.render();
|
||||||
|
}, function () {
|
||||||
|
_this3.loading = false;
|
||||||
|
_this3.annotations = [];
|
||||||
|
console.log("annotationsPromise onrejected");
|
||||||
|
|
||||||
|
_this3.render();
|
||||||
|
}); //this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onInitEditMode",
|
||||||
|
value: function onInitEditMode() {
|
||||||
|
this.addEditorTab('Options', statusHeatmapOptionsEditor, 2);
|
||||||
|
this.unitFormats = kbn.getUnitFormats();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onRender",
|
||||||
|
value: function onRender() {
|
||||||
|
if (!this.range || !this.data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.multipleValues = false;
|
||||||
|
|
||||||
|
if (!this.panel.useMax) {
|
||||||
|
if (this.cardsData) {
|
||||||
|
this.multipleValues = this.cardsData.multipleValues;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.noColorDefined = false;
|
||||||
|
|
||||||
|
if (this.panel.color.mode === 'discrete') {
|
||||||
|
this.discreteHelper.updateCardsValuesHasColorInfo();
|
||||||
|
|
||||||
|
if (this.cardsData) {
|
||||||
|
this.noColorDefined = this.cardsData.noColorDefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onCardColorChange",
|
||||||
|
value: function onCardColorChange(newColor) {
|
||||||
|
this.panel.color.cardColor = newColor;
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onDataError",
|
||||||
|
value: function onDataError() {
|
||||||
|
this.data = [];
|
||||||
|
this.annotations = [];
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "postRefresh",
|
||||||
|
value: function postRefresh() {
|
||||||
|
this.noColorDefined = false;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onEditorAddThreshold",
|
||||||
|
value: function onEditorAddThreshold() {
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: this.panel.defaultColor
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onEditorRemoveThreshold",
|
||||||
|
value: function onEditorRemoveThreshold(index) {
|
||||||
|
this.panel.color.thresholds.splice(index, 1);
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onEditorRemoveThresholds",
|
||||||
|
value: function onEditorRemoveThresholds() {
|
||||||
|
this.panel.color.thresholds = [];
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "onEditorAddThreeLights",
|
||||||
|
value: function onEditorAddThreeLights() {
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "red",
|
||||||
|
value: 2,
|
||||||
|
tooltip: "error"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "yellow",
|
||||||
|
value: 1,
|
||||||
|
tooltip: "warning"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "green",
|
||||||
|
value: 0,
|
||||||
|
tooltip: "ok"
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
/* https://ethanschoonover.com/solarized/ */
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "onEditorAddSolarized",
|
||||||
|
value: function onEditorAddSolarized() {
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#b58900",
|
||||||
|
value: 0,
|
||||||
|
tooltip: "yellow"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#cb4b16",
|
||||||
|
value: 1,
|
||||||
|
tooltip: "orange"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#dc322f",
|
||||||
|
value: 2,
|
||||||
|
tooltip: "red"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#d33682",
|
||||||
|
value: 3,
|
||||||
|
tooltip: "magenta"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#6c71c4",
|
||||||
|
value: 4,
|
||||||
|
tooltip: "violet"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#268bd2",
|
||||||
|
value: 5,
|
||||||
|
tooltip: "blue"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#2aa198",
|
||||||
|
value: 6,
|
||||||
|
tooltip: "cyan"
|
||||||
|
});
|
||||||
|
this.panel.color.thresholds.push({
|
||||||
|
color: "#859900",
|
||||||
|
value: 7,
|
||||||
|
tooltip: "green"
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
key: "link",
|
||||||
|
value: function link(scope, elem, attrs, ctrl) {
|
||||||
|
rendering(scope, elem, attrs, ctrl);
|
||||||
|
} // group values into buckets by target
|
||||||
|
|
||||||
|
}, {
|
||||||
|
key: "convertToCards",
|
||||||
|
value: function convertToCards(data) {
|
||||||
|
var cardsData = {
|
||||||
|
cards: [],
|
||||||
|
xBucketSize: 0,
|
||||||
|
yBucketSize: 0,
|
||||||
|
maxValue: 0,
|
||||||
|
minValue: 0,
|
||||||
|
multipleValues: false,
|
||||||
|
noColorDefined: false,
|
||||||
|
targets: [],
|
||||||
|
// array of available unique targets
|
||||||
|
targetIndex: {} // indices in data array for each of available unique targets
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!data || data.length == 0) {
|
||||||
|
return cardsData;
|
||||||
|
} // Collect uniq timestamps from data and spread over targets and timestamps
|
||||||
|
// collect uniq targets and their indices
|
||||||
|
|
||||||
|
|
||||||
|
_.map(data, function (d, i) {
|
||||||
|
cardsData.targetIndex[d.target] = _.concat(_.toArray(cardsData.targetIndex[d.target]), i);
|
||||||
|
}); // TODO add some logic for targets heirarchy
|
||||||
|
|
||||||
|
|
||||||
|
cardsData.targets = _.keys(cardsData.targetIndex);
|
||||||
|
cardsData.yBucketSize = cardsData.targets.length; // Maximum number of buckets over x axis
|
||||||
|
|
||||||
|
cardsData.xBucketSize = _.max(_.map(data, function (d) {
|
||||||
|
return d.datapoints.length;
|
||||||
|
})); // Collect all values for each bucket from datapoints with similar target.
|
||||||
|
// TODO aggregate values into buckets over datapoint[TIME_INDEX] not over datapoint index (j).
|
||||||
|
|
||||||
|
for (var i = 0; i < cardsData.targets.length; i++) {
|
||||||
|
var target = cardsData.targets[i];
|
||||||
|
|
||||||
|
for (var j = 0; j < cardsData.xBucketSize; j++) {
|
||||||
|
var card = new Card();
|
||||||
|
card.id = i * cardsData.xBucketSize + j;
|
||||||
|
card.values = [];
|
||||||
|
card.y = target;
|
||||||
|
card.x = -1; // collect values from all timeseries with target
|
||||||
|
|
||||||
|
for (var si = 0; si < cardsData.targetIndex[target].length; si++) {
|
||||||
|
var s = data[cardsData.targetIndex[target][si]];
|
||||||
|
|
||||||
|
if (s.datapoints.length <= j) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var datapoint = s.datapoints[j];
|
||||||
|
|
||||||
|
if (card.values.length === 0) {
|
||||||
|
card.x = datapoint[TIME_INDEX];
|
||||||
|
}
|
||||||
|
|
||||||
|
card.values.push(datapoint[VALUE_INDEX]);
|
||||||
|
}
|
||||||
|
|
||||||
|
card.minValue = _.min(card.values);
|
||||||
|
card.maxValue = _.max(card.values);
|
||||||
|
|
||||||
|
if (card.values.length > 1) {
|
||||||
|
cardsData.multipleValues = true;
|
||||||
|
card.multipleValues = true;
|
||||||
|
card.value = card.maxValue; // max value by default
|
||||||
|
} else {
|
||||||
|
card.value = card.maxValue; // max value by default
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cardsData.maxValue < card.maxValue) cardsData.maxValue = card.maxValue;
|
||||||
|
if (cardsData.minValue > card.minValue) cardsData.minValue = card.minValue;
|
||||||
|
|
||||||
|
if (card.x != -1) {
|
||||||
|
cardsData.cards.push(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cardsData;
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return StatusHeatmapCtrl;
|
||||||
|
}(MetricsPanelCtrl)));
|
||||||
|
|
||||||
|
_defineProperty(StatusHeatmapCtrl, "templateUrl", 'module.html');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+22
-33
@@ -1,15 +1,17 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['app/core/utils/kbn'], function (_export, _context) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var kbn, _createClass, StatusHeatmapOptionsEditorCtrl;
|
System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
var kbn, StatusHeatmapOptionsEditorCtrl;
|
||||||
if (!(instance instanceof Constructor)) {
|
|
||||||
throw new TypeError("Cannot call a class as a function");
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
}
|
|
||||||
}
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
function statusHeatmapOptionsEditor() {
|
function statusHeatmapOptionsEditor() {
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -22,45 +24,34 @@ System.register(['app/core/utils/kbn'], function (_export, _context) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_export('statusHeatmapOptionsEditor', statusHeatmapOptionsEditor);
|
_export("statusHeatmapOptionsEditor", statusHeatmapOptionsEditor);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_appCoreUtilsKbn) {
|
setters: [function (_appCoreUtilsKbn) {
|
||||||
kbn = _appCoreUtilsKbn.default;
|
kbn = _appCoreUtilsKbn.default;
|
||||||
}],
|
}],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
_createClass = function () {
|
_export("StatusHeatmapOptionsEditorCtrl", StatusHeatmapOptionsEditorCtrl =
|
||||||
function defineProperties(target, props) {
|
/*#__PURE__*/
|
||||||
for (var i = 0; i < props.length; i++) {
|
function () {
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (Constructor, protoProps, staticProps) {
|
|
||||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
_export('StatusHeatmapOptionsEditorCtrl', StatusHeatmapOptionsEditorCtrl = function () {
|
|
||||||
function StatusHeatmapOptionsEditorCtrl($scope) {
|
function StatusHeatmapOptionsEditorCtrl($scope) {
|
||||||
_classCallCheck(this, StatusHeatmapOptionsEditorCtrl);
|
_classCallCheck(this, StatusHeatmapOptionsEditorCtrl);
|
||||||
|
|
||||||
|
_defineProperty(this, "panel", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panelCtrl", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "unitFormats", void 0);
|
||||||
|
|
||||||
$scope.editor = this;
|
$scope.editor = this;
|
||||||
this.panelCtrl = $scope.ctrl;
|
this.panelCtrl = $scope.ctrl;
|
||||||
this.panel = this.panelCtrl.panel;
|
this.panel = this.panelCtrl.panel;
|
||||||
this.unitFormats = kbn.getUnitFormats();
|
this.unitFormats = kbn.getUnitFormats();
|
||||||
|
|
||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(StatusHeatmapOptionsEditorCtrl, [{
|
_createClass(StatusHeatmapOptionsEditorCtrl, [{
|
||||||
key: 'setUnitFormat',
|
key: "setUnitFormat",
|
||||||
value: function setUnitFormat(subItem) {
|
value: function setUnitFormat(subItem) {
|
||||||
this.panel.data.unitFormat = subItem.value;
|
this.panel.data.unitFormat = subItem.value;
|
||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
@@ -69,8 +60,6 @@ System.register(['app/core/utils/kbn'], function (_export, _context) {
|
|||||||
|
|
||||||
return StatusHeatmapOptionsEditorCtrl;
|
return StatusHeatmapOptionsEditorCtrl;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
_export('StatusHeatmapOptionsEditorCtrl', StatusHeatmapOptionsEditorCtrl);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../src/options_editor.js"],"names":["statusHeatmapOptionsEditor","restrict","scope","templateUrl","controller","StatusHeatmapOptionsEditorCtrl","kbn","$scope","editor","panelCtrl","ctrl","panel","unitFormats","getUnitFormats","render","subItem","data","unitFormat","value"],"mappings":";;;;;;;;;;;;;AAkBO,WAASA,0BAAT,GAAsC;AAC3C;;AACA,WAAO;AACLC,gBAAU,GADL;AAELC,aAAO,IAFF;AAGLC,mBAAa,mEAHR;AAILC,kBAAYC;AAJP,KAAP;AAMD;;wCAReL,0B;;;;AAlBTM,S;;;;;;;;;;;;;;;;;;;;;gDAEMD,8B;AACX,gDAAYE,MAAZ,EAAoB;AAAA;;AAClBA,iBAAOC,MAAP,GAAgB,IAAhB;AACA,eAAKC,SAAL,GAAiBF,OAAOG,IAAxB;AACA,eAAKC,KAAL,GAAa,KAAKF,SAAL,CAAeE,KAA5B;AACA,eAAKC,WAAL,GAAmBN,IAAIO,cAAJ,EAAnB;;AAEA,eAAKJ,SAAL,CAAeK,MAAf;AACD;;;;wCAEaC,O,EAAS;AACrB,iBAAKJ,KAAL,CAAWK,IAAX,CAAgBC,UAAhB,GAA6BF,QAAQG,KAArC;AACA,iBAAKT,SAAL,CAAeK,MAAf;AACD","file":"options_editor.js","sourcesContent":["import kbn from 'app/core/utils/kbn';\n\nexport class StatusHeatmapOptionsEditorCtrl {\n constructor($scope) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = kbn.getUnitFormats();\n\n this.panelCtrl.render();\n }\n\n setUnitFormat(subItem) {\n this.panel.data.unitFormat = subItem.value;\n this.panelCtrl.render();\n }\n}\n\nexport function statusHeatmapOptionsEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/plugins/flant-statusmap-panel/partials/options_editor.html',\n controller: StatusHeatmapOptionsEditorCtrl,\n };\n}\n"]}
|
{"version":3,"sources":["../src/options_editor.ts"],"names":["statusHeatmapOptionsEditor","restrict","scope","templateUrl","controller","StatusHeatmapOptionsEditorCtrl","kbn","$scope","editor","panelCtrl","ctrl","panel","unitFormats","getUnitFormats","render","subItem","data","unitFormat","value"],"mappings":";;;;;;;;;;;;;;;AAsBO,WAASA,0BAAT,GAAsC;AAC3C;;AACA,WAAO;AACLC,MAAAA,QAAQ,EAAE,GADL;AAELC,MAAAA,KAAK,EAAE,IAFF;AAGLC,MAAAA,WAAW,EAAE,mEAHR;AAILC,MAAAA,UAAU,EAAEC;AAJP,KAAP;AAMD;;wCAReL,0B;;;;AAtBTM,MAAAA,G;;;gDAEMD,8B;;;AAKX,gDAAYE,MAAZ,EAAoB;AAAA;;AAAA;;AAAA;;AAAA;;AAClBA,UAAAA,MAAM,CAACC,MAAP,GAAgB,IAAhB;AACA,eAAKC,SAAL,GAAiBF,MAAM,CAACG,IAAxB;AACA,eAAKC,KAAL,GAAa,KAAKF,SAAL,CAAeE,KAA5B;AACA,eAAKC,WAAL,GAAmBN,GAAG,CAACO,cAAJ,EAAnB;AAEA,eAAKJ,SAAL,CAAeK,MAAf;AACD;;;;wCAEaC,O,EAAS;AACrB,iBAAKJ,KAAL,CAAWK,IAAX,CAAgBC,UAAhB,GAA6BF,OAAO,CAACG,KAArC;AACA,iBAAKT,SAAL,CAAeK,MAAf;AACD","sourcesContent":["import kbn from 'app/core/utils/kbn';\n\nexport class StatusHeatmapOptionsEditorCtrl {\n panel: any;\n panelCtrl: any;\n unitFormats: any;\n\n constructor($scope) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = kbn.getUnitFormats();\n\n this.panelCtrl.render();\n }\n\n setUnitFormat(subItem) {\n this.panel.data.unitFormat = subItem.value;\n this.panelCtrl.render();\n }\n}\n\nexport function statusHeatmapOptionsEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/plugins/flant-statusmap-panel/partials/options_editor.html',\n controller: StatusHeatmapOptionsEditorCtrl,\n };\n}\n"],"file":"options_editor.js"}
|
||||||
Vendored
+804
-646
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
-463
@@ -1,463 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['app/plugins/sdk', 'lodash', 'app/core/core', 'app/core/utils/kbn', './color_legend', './rendering', './options_editor', './color_mode_discrete'], function (_export, _context) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var MetricsPanelCtrl, _, contextSrv, kbn, rendering, statusHeatmapOptionsEditor, ColorModeDiscrete, _get, CANVAS, SVG, VALUE_INDEX, TIME_INDEX, panelDefaults, renderer, colorSchemes, colorModes, opacityScales, StatusHeatmapCtrl;
|
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
|
||||||
if (!(instance instanceof Constructor)) {
|
|
||||||
throw new TypeError("Cannot call a class as a function");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _possibleConstructorReturn(self, call) {
|
|
||||||
if (!self) {
|
|
||||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
||||||
}
|
|
||||||
|
|
||||||
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _inherits(subClass, superClass) {
|
|
||||||
if (typeof superClass !== "function" && superClass !== null) {
|
|
||||||
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
||||||
constructor: {
|
|
||||||
value: subClass,
|
|
||||||
enumerable: false,
|
|
||||||
writable: true,
|
|
||||||
configurable: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
setters: [function (_appPluginsSdk) {
|
|
||||||
MetricsPanelCtrl = _appPluginsSdk.MetricsPanelCtrl;
|
|
||||||
}, function (_lodash) {
|
|
||||||
_ = _lodash.default;
|
|
||||||
}, function (_appCoreCore) {
|
|
||||||
contextSrv = _appCoreCore.contextSrv;
|
|
||||||
}, function (_appCoreUtilsKbn) {
|
|
||||||
kbn = _appCoreUtilsKbn.default;
|
|
||||||
}, function (_color_legend) {}, function (_rendering) {
|
|
||||||
rendering = _rendering.default;
|
|
||||||
}, function (_options_editor) {
|
|
||||||
statusHeatmapOptionsEditor = _options_editor.statusHeatmapOptionsEditor;
|
|
||||||
}, function (_color_mode_discrete) {
|
|
||||||
ColorModeDiscrete = _color_mode_discrete.ColorModeDiscrete;
|
|
||||||
}],
|
|
||||||
execute: function () {
|
|
||||||
_get = function get(object, property, receiver) {
|
|
||||||
if (object === null) object = Function.prototype;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(object, property);
|
|
||||||
|
|
||||||
if (desc === undefined) {
|
|
||||||
var parent = Object.getPrototypeOf(object);
|
|
||||||
|
|
||||||
if (parent === null) {
|
|
||||||
return undefined;
|
|
||||||
} else {
|
|
||||||
return get(parent, property, receiver);
|
|
||||||
}
|
|
||||||
} else if ("value" in desc) {
|
|
||||||
return desc.value;
|
|
||||||
} else {
|
|
||||||
var getter = desc.get;
|
|
||||||
|
|
||||||
if (getter === undefined) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getter.call(receiver);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CANVAS = 'CANVAS';
|
|
||||||
SVG = 'SVG';
|
|
||||||
VALUE_INDEX = 0;
|
|
||||||
TIME_INDEX = 1;
|
|
||||||
panelDefaults = {
|
|
||||||
// aggregate: aggregates.AVG,
|
|
||||||
// fragment: fragments.HOUR,
|
|
||||||
color: {
|
|
||||||
mode: 'spectrum',
|
|
||||||
cardColor: '#b4ff00',
|
|
||||||
colorScale: 'sqrt',
|
|
||||||
exponent: 0.5,
|
|
||||||
colorScheme: 'interpolateGnYlRd',
|
|
||||||
// discrete mode settings
|
|
||||||
defaultColor: '#757575',
|
|
||||||
thresholds: [] // manual colors
|
|
||||||
},
|
|
||||||
cards: {
|
|
||||||
cardMinWidth: 5,
|
|
||||||
cardVSpacing: 2,
|
|
||||||
cardHSpacing: 2,
|
|
||||||
cardRound: null
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
show: true,
|
|
||||||
showWeekends: true,
|
|
||||||
minBucketWidthToShowWeekends: 4,
|
|
||||||
showCrosshair: true,
|
|
||||||
labelFormat: '%a %m/%d'
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
show: true,
|
|
||||||
showCrosshair: false
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
unitFormat: 'short',
|
|
||||||
decimals: null
|
|
||||||
},
|
|
||||||
// how null points should be handled
|
|
||||||
nullPointMode: 'as empty',
|
|
||||||
yAxisSort: 'metrics',
|
|
||||||
highlightCards: true,
|
|
||||||
useMax: true
|
|
||||||
};
|
|
||||||
renderer = CANVAS;
|
|
||||||
colorSchemes = [
|
|
||||||
// Diverging
|
|
||||||
{ name: 'Spectral', value: 'interpolateSpectral', invert: 'always' }, { name: 'RdYlGn', value: 'interpolateRdYlGn', invert: 'always' }, { name: 'GnYlRd', value: 'interpolateGnYlRd', invert: 'always' },
|
|
||||||
|
|
||||||
// Sequential (Single Hue)
|
|
||||||
{ name: 'Blues', value: 'interpolateBlues', invert: 'dark' }, { name: 'Greens', value: 'interpolateGreens', invert: 'dark' }, { name: 'Greys', value: 'interpolateGreys', invert: 'dark' }, { name: 'Oranges', value: 'interpolateOranges', invert: 'dark' }, { name: 'Purples', value: 'interpolatePurples', invert: 'dark' }, { name: 'Reds', value: 'interpolateReds', invert: 'dark' },
|
|
||||||
|
|
||||||
// Sequential (Multi-Hue)
|
|
||||||
{ name: 'BuGn', value: 'interpolateBuGn', invert: 'dark' }, { name: 'BuPu', value: 'interpolateBuPu', invert: 'dark' }, { name: 'GnBu', value: 'interpolateGnBu', invert: 'dark' }, { name: 'OrRd', value: 'interpolateOrRd', invert: 'dark' }, { name: 'PuBuGn', value: 'interpolatePuBuGn', invert: 'dark' }, { name: 'PuBu', value: 'interpolatePuBu', invert: 'dark' }, { name: 'PuRd', value: 'interpolatePuRd', invert: 'dark' }, { name: 'RdPu', value: 'interpolateRdPu', invert: 'dark' }, { name: 'YlGnBu', value: 'interpolateYlGnBu', invert: 'dark' }, { name: 'YlGn', value: 'interpolateYlGn', invert: 'dark' }, { name: 'YlOrBr', value: 'interpolateYlOrBr', invert: 'dark' }, { name: 'YlOrRd', value: 'interpolateYlOrRd', invert: 'dark' }];
|
|
||||||
colorModes = ['opacity', 'spectrum', 'discrete'];
|
|
||||||
opacityScales = ['linear', 'sqrt'];
|
|
||||||
|
|
||||||
_export('StatusHeatmapCtrl', StatusHeatmapCtrl = function (_MetricsPanelCtrl) {
|
|
||||||
_inherits(StatusHeatmapCtrl, _MetricsPanelCtrl);
|
|
||||||
|
|
||||||
/** @ngInject */
|
|
||||||
function StatusHeatmapCtrl($scope, $injector, $rootScope, timeSrv, annotationsSrv) {
|
|
||||||
_classCallCheck(this, StatusHeatmapCtrl);
|
|
||||||
|
|
||||||
var _this = _possibleConstructorReturn(this, (StatusHeatmapCtrl.__proto__ || Object.getPrototypeOf(StatusHeatmapCtrl)).call(this, $scope, $injector));
|
|
||||||
|
|
||||||
_this.onRenderComplete = function (data) {
|
|
||||||
_this.graph.chartWidth = data.chartWidth;
|
|
||||||
_this.renderingCompleted();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.calculateInterval = function () {
|
|
||||||
var panelWidth = Math.ceil($(window).width() * (_this.panel.gridPos.w / 24));
|
|
||||||
// approximate chartWidth because y axis ticks not rendered yet on first data receive.
|
|
||||||
var chartWidth = _.max([panelWidth - 200, panelWidth / 2]);
|
|
||||||
|
|
||||||
var minCardWidth = _this.panel.cards.cardMinWidth;
|
|
||||||
var minSpacing = _this.panel.cards.cardHSpacing;
|
|
||||||
var maxCardsCount = Math.ceil((chartWidth - minCardWidth) / (minCardWidth + minSpacing));
|
|
||||||
|
|
||||||
var intervalMs = void 0;
|
|
||||||
var rangeMs = _this.range.to.valueOf() - _this.range.from.valueOf();
|
|
||||||
|
|
||||||
// this is minimal interval! kbn.round_interval will lower it.
|
|
||||||
intervalMs = _this.discreteHelper.roundIntervalCeil(rangeMs / maxCardsCount);
|
|
||||||
|
|
||||||
// Calculate low limit of interval
|
|
||||||
var lowLimitMs = 1; // 1 millisecond default low limit
|
|
||||||
var intervalOverride = _this.panel.interval;
|
|
||||||
|
|
||||||
// if no panel interval check datasource
|
|
||||||
if (intervalOverride) {
|
|
||||||
intervalOverride = _this.templateSrv.replace(intervalOverride, _this.panel.scopedVars);
|
|
||||||
} else if (_this.datasource && _this.datasource.interval) {
|
|
||||||
intervalOverride = _this.datasource.interval;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (intervalOverride) {
|
|
||||||
if (intervalOverride[0] === '>') {
|
|
||||||
intervalOverride = intervalOverride.slice(1);
|
|
||||||
}
|
|
||||||
lowLimitMs = kbn.interval_to_ms(intervalOverride);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lowLimitMs > intervalMs) {
|
|
||||||
intervalMs = lowLimitMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
_this.intervalMs = intervalMs;
|
|
||||||
_this.interval = kbn.secondsToHms(intervalMs / 1000);
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.issueQueries = function (datasource) {
|
|
||||||
_this.annotationsPromise = _this.annotationsSrv.getAnnotations({
|
|
||||||
dashboard: _this.dashboard,
|
|
||||||
panel: _this.panel,
|
|
||||||
range: _this.range
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Wait for annotationSrv requests to get datasources to
|
|
||||||
* resolve before issuing queries. This allows the annotations
|
|
||||||
* service to fire annotations queries before graph queries
|
|
||||||
* (but not wait for completion). This resolves
|
|
||||||
* issue 11806.
|
|
||||||
*/
|
|
||||||
// 5.x before 5.4 doesn't have dataPromises
|
|
||||||
if ("undefined" !== typeof _this.annotationsSrv.datasourcePromises) {
|
|
||||||
return _this.annotationsSrv.datasourcePromises.then(function (r) {
|
|
||||||
return _get(StatusHeatmapCtrl.prototype.__proto__ || Object.getPrototypeOf(StatusHeatmapCtrl.prototype), 'issueQueries', _this).call(_this, datasource);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return _get(StatusHeatmapCtrl.prototype.__proto__ || Object.getPrototypeOf(StatusHeatmapCtrl.prototype), 'issueQueries', _this).call(_this, datasource);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onDataReceived = function (dataList) {
|
|
||||||
_this.data = dataList;
|
|
||||||
_this.cardsData = _this.convertToCards(_this.data);
|
|
||||||
|
|
||||||
_this.annotationsPromise.then(function (result) {
|
|
||||||
_this.loading = false;
|
|
||||||
//this.alertState = result.alertState;
|
|
||||||
if (result.annotations && result.annotations.length > 0) {
|
|
||||||
_this.annotations = result.annotations;
|
|
||||||
} else {
|
|
||||||
_this.annotations = null;
|
|
||||||
}
|
|
||||||
_this.render();
|
|
||||||
}, function () {
|
|
||||||
_this.loading = false;
|
|
||||||
_this.annotations = null;
|
|
||||||
_this.render();
|
|
||||||
});
|
|
||||||
|
|
||||||
//this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onInitEditMode = function () {
|
|
||||||
_this.addEditorTab('Options', statusHeatmapOptionsEditor, 2);
|
|
||||||
_this.unitFormats = kbn.getUnitFormats();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onRender = function () {
|
|
||||||
if (!_this.data) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_this.multipleValues = false;
|
|
||||||
if (!_this.panel.useMax) {
|
|
||||||
if (_this.cardsData) {
|
|
||||||
_this.multipleValues = _this.cardsData.multipleValues;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_this.noColorDefined = false;
|
|
||||||
if (_this.panel.color.mode === 'discrete') {
|
|
||||||
_this.discreteHelper.updateCardsValuesHasColorInfo();
|
|
||||||
if (_this.cardsData) {
|
|
||||||
_this.noColorDefined = _this.cardsData.noColorDefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onCardColorChange = function (newColor) {
|
|
||||||
_this.panel.color.cardColor = newColor;
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onDataError = function () {
|
|
||||||
_this.data = [];
|
|
||||||
_this.annotations = [];
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.postRefresh = function () {
|
|
||||||
_this.noColorDefined = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onEditorAddThreshold = function () {
|
|
||||||
_this.panel.color.thresholds.push({ color: _this.panel.defaultColor });
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onEditorRemoveThreshold = function (index) {
|
|
||||||
_this.panel.color.thresholds.splice(index, 1);
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onEditorRemoveThresholds = function () {
|
|
||||||
_this.panel.color.thresholds = [];
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onEditorAddThreeLights = function () {
|
|
||||||
_this.panel.color.thresholds.push({ color: "red", value: 2, tooltip: "error" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "yellow", value: 1, tooltip: "warning" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "green", value: 0, tooltip: "ok" });
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.onEditorAddSolarized = function () {
|
|
||||||
_this.panel.color.thresholds.push({ color: "#b58900", value: 0, tooltip: "yellow" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#cb4b16", value: 1, tooltip: "orange" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#dc322f", value: 2, tooltip: "red" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#d33682", value: 3, tooltip: "magenta" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#6c71c4", value: 4, tooltip: "violet" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#268bd2", value: 5, tooltip: "blue" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#2aa198", value: 6, tooltip: "cyan" });
|
|
||||||
_this.panel.color.thresholds.push({ color: "#859900", value: 7, tooltip: "green" });
|
|
||||||
_this.render();
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.link = function (scope, elem, attrs, ctrl) {
|
|
||||||
rendering(scope, elem, attrs, ctrl);
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.convertToCards = function (data) {
|
|
||||||
var cardsData = {
|
|
||||||
cards: [],
|
|
||||||
xBucketSize: 0,
|
|
||||||
yBucketSize: 0,
|
|
||||||
maxValue: 0,
|
|
||||||
minValue: 0,
|
|
||||||
multipleValues: false,
|
|
||||||
noColorDefined: false,
|
|
||||||
targets: [], // array of available unique targets
|
|
||||||
targetIndex: {} // indices in data array for each of available unique targets
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!data || data.length == 0) {
|
|
||||||
return cardsData;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect uniq timestamps from data and spread over targets and timestamps
|
|
||||||
|
|
||||||
// collect uniq targets and their indices
|
|
||||||
_.map(data, function (d, i) {
|
|
||||||
cardsData.targetIndex[d.target] = _.concat(_.toArray(cardsData.targetIndex[d.target]), i);
|
|
||||||
});
|
|
||||||
|
|
||||||
// TODO add some logic for targets heirarchy
|
|
||||||
cardsData.targets = _.keys(cardsData.targetIndex);
|
|
||||||
cardsData.yBucketSize = cardsData.targets.length;
|
|
||||||
// Maximum number of buckets over x axis
|
|
||||||
cardsData.xBucketSize = _.max(_.map(data, function (d) {
|
|
||||||
return d.datapoints.length;
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Collect all values for each bucket from datapoints with similar target.
|
|
||||||
// TODO aggregate values into buckets over datapoint[TIME_INDEX] not over datapoint index (j).
|
|
||||||
for (var i = 0; i < cardsData.targets.length; i++) {
|
|
||||||
var target = cardsData.targets[i];
|
|
||||||
|
|
||||||
for (var j = 0; j < cardsData.xBucketSize; j++) {
|
|
||||||
var card = {
|
|
||||||
id: i * cardsData.xBucketSize + j,
|
|
||||||
values: [],
|
|
||||||
multipleValues: false,
|
|
||||||
noColorDefined: false,
|
|
||||||
y: target,
|
|
||||||
x: -1
|
|
||||||
};
|
|
||||||
|
|
||||||
// collect values from all timeseries with target
|
|
||||||
for (var si = 0; si < cardsData.targetIndex[target].length; si++) {
|
|
||||||
var s = data[cardsData.targetIndex[target][si]];
|
|
||||||
if (s.datapoints.length <= j) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var datapoint = s.datapoints[j];
|
|
||||||
if (card.values.length === 0) {
|
|
||||||
card.x = datapoint[TIME_INDEX];
|
|
||||||
}
|
|
||||||
card.values.push(datapoint[VALUE_INDEX]);
|
|
||||||
}
|
|
||||||
card.minValue = _.min(card.values);
|
|
||||||
card.maxValue = _.max(card.values);
|
|
||||||
if (card.values.length > 1) {
|
|
||||||
cardsData.multipleValues = true;
|
|
||||||
card.multipleValues = true;
|
|
||||||
card.value = card.maxValue; // max value by default
|
|
||||||
} else {
|
|
||||||
card.value = card.maxValue; // max value by default
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cardsData.maxValue < card.maxValue) cardsData.maxValue = card.maxValue;
|
|
||||||
|
|
||||||
if (cardsData.minValue > card.minValue) cardsData.minValue = card.minValue;
|
|
||||||
|
|
||||||
if (card.x != -1) {
|
|
||||||
cardsData.cards.push(card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return cardsData;
|
|
||||||
};
|
|
||||||
|
|
||||||
_.defaultsDeep(_this.panel, panelDefaults);
|
|
||||||
|
|
||||||
_this.opacityScales = opacityScales;
|
|
||||||
_this.colorModes = colorModes;
|
|
||||||
_this.colorSchemes = colorSchemes;
|
|
||||||
|
|
||||||
// default graph width for discrete card width calculation
|
|
||||||
_this.graph = {
|
|
||||||
"chartWidth": -1
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.multipleValues = false;
|
|
||||||
_this.noColorDefined = false;
|
|
||||||
|
|
||||||
_this.discreteHelper = new ColorModeDiscrete($scope);
|
|
||||||
|
|
||||||
_this.dataWarnings = {
|
|
||||||
"noColorDefined": {
|
|
||||||
title: 'Data has value with undefined color',
|
|
||||||
tip: 'Check metric values, color values or define a new color'
|
|
||||||
},
|
|
||||||
"multipleValues": {
|
|
||||||
title: 'Data has multiple values for one target',
|
|
||||||
tip: 'Change targets definitions or set "use max value"'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_this.annotations = [];
|
|
||||||
_this.annotationsSrv = annotationsSrv;
|
|
||||||
|
|
||||||
_this.events.on('data-received', _this.onDataReceived);
|
|
||||||
_this.events.on('data-snapshot-load', _this.onDataReceived);
|
|
||||||
_this.events.on('data-error', _this.onDataError);
|
|
||||||
_this.events.on('init-edit-mode', _this.onInitEditMode);
|
|
||||||
_this.events.on('render', _this.onRender);
|
|
||||||
_this.events.on('refresh', _this.postRefresh);
|
|
||||||
// custom event from rendering.js
|
|
||||||
_this.events.on('render-complete', _this.onRenderComplete);
|
|
||||||
return _this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// override calculateInterval for discrete color mode
|
|
||||||
|
|
||||||
|
|
||||||
/* https://ethanschoonover.com/solarized/ */
|
|
||||||
|
|
||||||
|
|
||||||
// group values into buckets by target
|
|
||||||
|
|
||||||
|
|
||||||
return StatusHeatmapCtrl;
|
|
||||||
}(MetricsPanelCtrl));
|
|
||||||
|
|
||||||
_export('StatusHeatmapCtrl', StatusHeatmapCtrl);
|
|
||||||
|
|
||||||
StatusHeatmapCtrl.templateUrl = 'module.html';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=status_heatmap_ctrl.js.map
|
|
||||||
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+72
@@ -0,0 +1,72 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
System.register([], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var Card, CardsStorage;
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
|
return {
|
||||||
|
setters: [],
|
||||||
|
execute: function () {
|
||||||
|
// A holder of values
|
||||||
|
_export("Card", Card = // uniq
|
||||||
|
// Array of values in this bucket
|
||||||
|
// card has multiple values
|
||||||
|
// card has values that has no color
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
function Card() {
|
||||||
|
_classCallCheck(this, Card);
|
||||||
|
|
||||||
|
_defineProperty(this, "id", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "values", []);
|
||||||
|
|
||||||
|
_defineProperty(this, "multipleValues", false);
|
||||||
|
|
||||||
|
_defineProperty(this, "noColorDefined", false);
|
||||||
|
|
||||||
|
_defineProperty(this, "y", "");
|
||||||
|
|
||||||
|
_defineProperty(this, "x", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "minValue", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "maxValue", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "value", 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
_export("CardsStorage", CardsStorage = function CardsStorage() {
|
||||||
|
_classCallCheck(this, CardsStorage);
|
||||||
|
|
||||||
|
_defineProperty(this, "cards", []);
|
||||||
|
|
||||||
|
_defineProperty(this, "xBucketSize", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "yBucketSize", 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "maxValue", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "minValue", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "multipleValues", false);
|
||||||
|
|
||||||
|
_defineProperty(this, "noColorDefined", false);
|
||||||
|
|
||||||
|
_defineProperty(this, "targets", []);
|
||||||
|
|
||||||
|
_defineProperty(this, "targetIndex", void 0);
|
||||||
|
|
||||||
|
this.maxValue = 0;
|
||||||
|
this.minValue = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
//# sourceMappingURL=statusmap_data.js.map
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["../src/statusmap_data.ts"],"names":["Card","CardsStorage","maxValue","minValue"],"mappings":";;;;;;;;;;;;;;AAEA;sBACMA,I,GACF;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAKA,sBAAc;AAAA;;AAAA,oCAhBD,CAgBC;;AAAA,wCAdE,EAcF;;AAAA,gDAZY,KAYZ;;AAAA,gDAVY,KAUZ;;AAAA,mCARF,EAQE;;AAAA,mCANF,CAME;;AAAA,0CAJK,CAIL;;AAAA,0CAHK,CAGL;;AAAA,uCAFE,CAEF;AAEb,O;;8BAGCC,Y,GAWF,wBAAc;AAAA;;AAAA,uCAVE,EAUF;;AAAA,6CATQ,CASR;;AAAA,6CARQ,CAQR;;AAAA;;AAAA;;AAAA,gDALY,KAKZ;;AAAA,gDAJY,KAIZ;;AAAA,yCAHM,EAGN;;AAAA;;AACV,aAAKC,QAAL,GAAgB,CAAhB;AACA,aAAKC,QAAL,GAAgB,CAAhB;AAEH,O","sourcesContent":["\n\n// A holder of values\nclass Card {\n // uniq\n id: number = 0;\n // Array of values in this bucket\n values: any[] = [];\n // card has multiple values\n multipleValues: boolean = false;\n // card has values that has no color\n noColorDefined: boolean = false;\n //\n y: string = \"\";\n //\n x: number = 0;\n //\n minValue: number = 0;\n maxValue: number = 0;\n value: number = 0;\n \n constructor() {\n\n }\n }\n \nclass CardsStorage {\n cards: Card[] = [];\n xBucketSize: number = 0;\n yBucketSize: number = 0;\n maxValue: number;\n minValue: number;\n multipleValues: boolean = false;\n noColorDefined: boolean = false;\n targets: string[] = [];\n targetIndex: any;\n\n constructor() {\n this.maxValue = 0;\n this.minValue = 0;\n\n }\n }\n\nexport {CardsStorage, Card};"],"file":"statusmap_data.js"}
|
||||||
Vendored
+65
-65
@@ -1,15 +1,17 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_export, _context) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var d3, $, _, kbn, _createClass, TOOLTIP_PADDING_X, TOOLTIP_PADDING_Y, StatusHeatmapTooltip;
|
System.register(["d3", "jquery", "lodash"], function (_export, _context) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
var d3, $, _, TOOLTIP_PADDING_X, TOOLTIP_PADDING_Y, StatusmapTooltip;
|
||||||
if (!(instance instanceof Constructor)) {
|
|
||||||
throw new TypeError("Cannot call a class as a function");
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
}
|
|
||||||
}
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setters: [function (_d) {
|
setters: [function (_d) {
|
||||||
@@ -18,34 +20,32 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
$ = _jquery.default;
|
$ = _jquery.default;
|
||||||
}, function (_lodash) {
|
}, function (_lodash) {
|
||||||
_ = _lodash.default;
|
_ = _lodash.default;
|
||||||
}, function (_appCoreUtilsKbn) {
|
|
||||||
kbn = _appCoreUtilsKbn.default;
|
|
||||||
}],
|
}],
|
||||||
execute: function () {
|
execute: function () {
|
||||||
_createClass = function () {
|
|
||||||
function defineProperties(target, props) {
|
|
||||||
for (var i = 0; i < props.length; i++) {
|
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (Constructor, protoProps, staticProps) {
|
|
||||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|
||||||
TOOLTIP_PADDING_X = 30;
|
TOOLTIP_PADDING_X = 30;
|
||||||
TOOLTIP_PADDING_Y = 5;
|
TOOLTIP_PADDING_Y = 5;
|
||||||
|
|
||||||
_export('StatusHeatmapTooltip', StatusHeatmapTooltip = function () {
|
_export("StatusmapTooltip", StatusmapTooltip =
|
||||||
function StatusHeatmapTooltip(elem, scope) {
|
/*#__PURE__*/
|
||||||
_classCallCheck(this, StatusHeatmapTooltip);
|
function () {
|
||||||
|
function StatusmapTooltip(elem, scope) {
|
||||||
|
_classCallCheck(this, StatusmapTooltip);
|
||||||
|
|
||||||
|
_defineProperty(this, "tooltip", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "scope", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "dashboard", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panelCtrl", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "panel", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "heatmapPanel", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "mouseOverBucket", void 0);
|
||||||
|
|
||||||
|
_defineProperty(this, "originalFillColor", void 0);
|
||||||
|
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.dashboard = scope.ctrl.dashboard;
|
this.dashboard = scope.ctrl.dashboard;
|
||||||
@@ -54,13 +54,12 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
this.heatmapPanel = elem;
|
this.heatmapPanel = elem;
|
||||||
this.mouseOverBucket = false;
|
this.mouseOverBucket = false;
|
||||||
this.originalFillColor = null;
|
this.originalFillColor = null;
|
||||||
|
|
||||||
elem.on("mouseover", this.onMouseOver.bind(this));
|
elem.on("mouseover", this.onMouseOver.bind(this));
|
||||||
elem.on("mouseleave", this.onMouseLeave.bind(this));
|
elem.on("mouseleave", this.onMouseLeave.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_createClass(StatusHeatmapTooltip, [{
|
_createClass(StatusmapTooltip, [{
|
||||||
key: 'onMouseOver',
|
key: "onMouseOver",
|
||||||
value: function onMouseOver(e) {
|
value: function onMouseOver(e) {
|
||||||
if (!this.panel.tooltip.show || !this.scope.ctrl.data || _.isEmpty(this.scope.ctrl.data)) {
|
if (!this.panel.tooltip.show || !this.scope.ctrl.data || _.isEmpty(this.scope.ctrl.data)) {
|
||||||
return;
|
return;
|
||||||
@@ -72,12 +71,12 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onMouseLeave',
|
key: "onMouseLeave",
|
||||||
value: function onMouseLeave() {
|
value: function onMouseLeave() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'onMouseMove',
|
key: "onMouseMove",
|
||||||
value: function onMouseMove(e) {
|
value: function onMouseMove(e) {
|
||||||
if (!this.panel.tooltip.show) {
|
if (!this.panel.tooltip.show) {
|
||||||
return;
|
return;
|
||||||
@@ -86,12 +85,12 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
this.move(e);
|
this.move(e);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'add',
|
key: "add",
|
||||||
value: function add() {
|
value: function add() {
|
||||||
this.tooltip = d3.select("body").append("div").attr("class", "statusmap-tooltip graph-tooltip grafana-tooltip");
|
this.tooltip = d3.select("body").append("div").attr("class", "statusmap-tooltip graph-tooltip grafana-tooltip");
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'destroy',
|
key: "destroy",
|
||||||
value: function destroy() {
|
value: function destroy() {
|
||||||
if (this.tooltip) {
|
if (this.tooltip) {
|
||||||
this.tooltip.remove();
|
this.tooltip.remove();
|
||||||
@@ -100,22 +99,26 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
this.tooltip = null;
|
this.tooltip = null;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'show',
|
key: "show",
|
||||||
value: function show(pos) {
|
value: function show(pos) {
|
||||||
if (!this.panel.tooltip.show || !this.tooltip) {
|
if (!this.panel.tooltip.show || !this.tooltip) {
|
||||||
return;
|
return;
|
||||||
}
|
} // shared tooltip mode
|
||||||
// shared tooltip mode
|
|
||||||
|
|
||||||
if (pos.panelRelY) {
|
if (pos.panelRelY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cardId = d3.select(pos.target).attr('cardId');
|
var cardId = d3.select(pos.target).attr('cardId');
|
||||||
|
|
||||||
if (!cardId) {
|
if (!cardId) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var card = this.panelCtrl.cardsData.cards[cardId];
|
var card = this.panelCtrl.cardsData.cards[cardId];
|
||||||
|
|
||||||
if (!card) {
|
if (!card) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
return;
|
return;
|
||||||
@@ -127,51 +130,51 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
var values = card.values;
|
var values = card.values;
|
||||||
var tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
var tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
||||||
var time = this.dashboard.formatDate(+x, tooltipTimeFormat);
|
var time = this.dashboard.formatDate(+x, tooltipTimeFormat);
|
||||||
|
var tooltipHtml = "<div class=\"graph-tooltip-time\">".concat(time, "</div>\n <div class=\"statusmap-histogram\"></div>");
|
||||||
var tooltipHtml = '<div class="graph-tooltip-time">' + time + '</div>\n <div class="statusmap-histogram"></div>';
|
|
||||||
|
|
||||||
if (this.panel.color.mode === 'discrete') {
|
if (this.panel.color.mode === 'discrete') {
|
||||||
var statuses = this.panelCtrl.discreteHelper.convertValuesToTooltips(values);
|
var statuses = this.panelCtrl.discreteHelper.convertValuesToTooltips(values);
|
||||||
var statusesHtml = '';
|
var statusesHtml = '';
|
||||||
|
|
||||||
if (statuses.length === 1) {
|
if (statuses.length === 1) {
|
||||||
statusesHtml = "status:";
|
statusesHtml = "status:";
|
||||||
} else if (statuses.length > 1) {
|
} else if (statuses.length > 1) {
|
||||||
statusesHtml = "statuses:";
|
statusesHtml = "statuses:";
|
||||||
}
|
}
|
||||||
tooltipHtml += '\n <div>\n name: <b>' + y + '</b> <br>\n ' + statusesHtml + '\n <ul>\n ' + _.join(_.map(statuses, function (v) {
|
|
||||||
return '<li style="background-color: ' + v.color + '" class="discrete-item">' + v.tooltip + '</li>';
|
tooltipHtml += "\n <div>\n name: <b>".concat(y, "</b> <br>\n ").concat(statusesHtml, "\n <ul>\n ").concat(_.join(_.map(statuses, function (v) {
|
||||||
}), "") + '\n </ul>\n </div>';
|
return "<li style=\"background-color: ".concat(v.color, "\" class=\"discrete-item\">").concat(v.tooltip, "</li>");
|
||||||
|
}), ""), "\n </ul>\n </div>");
|
||||||
} else {
|
} else {
|
||||||
if (values.length === 1) {
|
if (values.length === 1) {
|
||||||
tooltipHtml += '<div> \n name: <b>' + y + '</b> <br>\n value: <b>' + value + '</b> <br>\n </div>';
|
tooltipHtml += "<div> \n name: <b>".concat(y, "</b> <br>\n value: <b>").concat(value, "</b> <br>\n </div>");
|
||||||
} else {
|
} else {
|
||||||
tooltipHtml += '<div>\n name: <b>' + y + '</b> <br>\n values:\n <ul>\n ' + _.join(_.map(values, function (v) {
|
tooltipHtml += "<div>\n name: <b>".concat(y, "</b> <br>\n values:\n <ul>\n ").concat(_.join(_.map(values, function (v) {
|
||||||
return '<li>' + v + '</li>';
|
return "<li>".concat(v, "</li>");
|
||||||
}), "") + '\n </ul>\n </div>';
|
}), ""), "\n </ul>\n </div>");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} // "Ambiguous bucket state: Multiple values!";
|
||||||
|
|
||||||
|
|
||||||
// "Ambiguous bucket state: Multiple values!";
|
|
||||||
if (!this.panel.useMax && card.multipleValues) {
|
if (!this.panel.useMax && card.multipleValues) {
|
||||||
tooltipHtml += '<div><b>Error:</b> ' + this.panelCtrl.dataWarnings.multipleValues.title + '</div>';
|
tooltipHtml += "<div><b>Error:</b> ".concat(this.panelCtrl.dataWarnings.multipleValues.title, "</div>");
|
||||||
}
|
} // Discrete mode errors
|
||||||
|
|
||||||
|
|
||||||
// Discrete mode errors
|
|
||||||
if (this.panel.color.mode === 'discrete') {
|
if (this.panel.color.mode === 'discrete') {
|
||||||
if (card.noColorDefined) {
|
if (card.noColorDefined) {
|
||||||
var badValues = this.panelCtrl.discreteHelper.getNotColoredValues(values);
|
var badValues = this.panelCtrl.discreteHelper.getNotColoredValues(values);
|
||||||
tooltipHtml += '<div><b>Error:</b> ' + this.panelCtrl.dataWarnings.noColorDefined.title + '\n <br>not colored values:\n <ul>\n ' + _.join(_.map(badValues, function (v) {
|
tooltipHtml += "<div><b>Error:</b> ".concat(this.panelCtrl.dataWarnings.noColorDefined.title, "\n <br>not colored values:\n <ul>\n ").concat(_.join(_.map(badValues, function (v) {
|
||||||
return '<li>' + v + '</li>';
|
return "<li>".concat(v, "</li>");
|
||||||
}), "") + '\n </ul>\n </div>';
|
}), ""), "\n </ul>\n </div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tooltip.html(tooltipHtml);
|
this.tooltip.html(tooltipHtml);
|
||||||
|
|
||||||
this.move(pos);
|
this.move(pos);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'move',
|
key: "move",
|
||||||
value: function move(pos) {
|
value: function move(pos) {
|
||||||
if (!this.tooltip) {
|
if (!this.tooltip) {
|
||||||
return;
|
return;
|
||||||
@@ -180,7 +183,6 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
var elem = $(this.tooltip.node())[0];
|
var elem = $(this.tooltip.node())[0];
|
||||||
var tooltipWidth = elem.clientWidth;
|
var tooltipWidth = elem.clientWidth;
|
||||||
var tooltipHeight = elem.clientHeight;
|
var tooltipHeight = elem.clientHeight;
|
||||||
|
|
||||||
var left = pos.pageX + TOOLTIP_PADDING_X;
|
var left = pos.pageX + TOOLTIP_PADDING_X;
|
||||||
var top = pos.pageY + TOOLTIP_PADDING_Y;
|
var top = pos.pageY + TOOLTIP_PADDING_Y;
|
||||||
|
|
||||||
@@ -196,10 +198,8 @@ System.register(['d3', 'jquery', 'lodash', 'app/core/utils/kbn'], function (_exp
|
|||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return StatusHeatmapTooltip;
|
return StatusmapTooltip;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
_export('StatusHeatmapTooltip', StatusHeatmapTooltip);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+8479
File diff suppressed because it is too large
Load Diff
+31
-16
@@ -4,7 +4,8 @@
|
|||||||
"description": "Grafana panel plugin to visualize status of multiple objects over time",
|
"description": "Grafana panel plugin to visualize status of multiple objects over time",
|
||||||
"main": "README.md",
|
"main": "README.md",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "grunt"
|
"build": "grunt",
|
||||||
|
"check-types": "node_modules/typescript/bin/tsc"
|
||||||
},
|
},
|
||||||
"author": "Flant JSC",
|
"author": "Flant JSC",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -13,28 +14,42 @@
|
|||||||
"url": "https://github.com/flant/grafana-statusmap.git"
|
"url": "https://github.com/flant/grafana-statusmap.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "^6.23.0",
|
"@babel/core": "7.6.4",
|
||||||
"babel-eslint": "^7.2.3",
|
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
||||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
|
||||||
"babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
|
"@babel/plugin-transform-for-of": "^7.0.0",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.23.0",
|
"@babel/plugin-transform-modules-systemjs": "^7.0.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"@babel/plugin-syntax-dynamic-import": "7.2.0",
|
||||||
"grunt": "^1.0.1",
|
"@babel/preset-env": "7.6.3",
|
||||||
"grunt-babel": "^6.0.0",
|
"@babel/preset-typescript": "7.6.0",
|
||||||
|
"@types/d3": "4.13.1",
|
||||||
|
"@types/d3-scale-chromatic": "1.3.1",
|
||||||
|
"@types/angular": "1.6.56",
|
||||||
|
"@types/grafana": "github:flant/types-grafana",
|
||||||
|
"@types/jquery": "1.10.35",
|
||||||
|
"@types/lodash": "4.14.123",
|
||||||
|
"babel-core": "7.0.0-bridge.0",
|
||||||
|
"babel-jest": "24.8.0",
|
||||||
|
"babel-loader": "8.0.5",
|
||||||
|
"babel-plugin-angularjs-annotate": "0.10.0",
|
||||||
|
"babel-eslint": "^10.0.2",
|
||||||
|
"eslint": "^4.12.1",
|
||||||
|
"grunt": "^1.0.4",
|
||||||
|
"grunt-angular-templates": "1.1.0",
|
||||||
|
"grunt-babel": "^8.0.0",
|
||||||
"grunt-contrib-clean": "^1.1.0",
|
"grunt-contrib-clean": "^1.1.0",
|
||||||
"grunt-contrib-copy": "^1.0.0",
|
"grunt-contrib-copy": "^1.0.0",
|
||||||
"grunt-contrib-sass": "^1.0.0",
|
"grunt-contrib-sass": "^1.0.0",
|
||||||
"grunt-contrib-uglify": "^3.0.1",
|
"grunt-contrib-uglify": "^3.0.1",
|
||||||
"grunt-contrib-watch": "^1.0.0",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"grunt-execute": "^0.2.2",
|
|
||||||
"grunt-notify": "^0.4.5",
|
"grunt-notify": "^0.4.5",
|
||||||
"grunt-systemjs-builder": "^1.0.0",
|
"load-grunt-tasks": "^3.5.2",
|
||||||
"load-grunt-tasks": "^3.5.2"
|
"typescript": "3.7.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"d3": "^4.11.0",
|
"d3": "4.13.0",
|
||||||
"d3-scale-chromatic": "^1.1.1",
|
"d3-scale-chromatic": "1.5.0",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "4.17.15",
|
||||||
"moment": "^2.18.1"
|
"moment": "2.24.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
import d3 from 'd3';
|
import d3 from 'd3';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import kbn from 'app/core/utils/kbn';
|
|
||||||
|
|
||||||
let TOOLTIP_PADDING_X = 30;
|
let TOOLTIP_PADDING_X = 30;
|
||||||
let TOOLTIP_PADDING_Y = 10;
|
let TOOLTIP_PADDING_Y = 10;
|
||||||
|
|
||||||
export class AnnotationTooltip {
|
export class AnnotationTooltip {
|
||||||
|
scope: any;
|
||||||
|
dashboard: any;
|
||||||
|
panelCtrl: any;
|
||||||
|
panel: any;
|
||||||
|
mouseOverAnnotationTick: boolean;
|
||||||
|
|
||||||
|
tooltipBase: any;
|
||||||
|
tooltip: any;
|
||||||
|
|
||||||
constructor(elem, scope) {
|
constructor(elem, scope) {
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.dashboard = scope.ctrl.dashboard;
|
this.dashboard = scope.ctrl.dashboard;
|
||||||
@@ -90,7 +98,7 @@ export class AnnotationTooltip {
|
|||||||
let tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
let tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
||||||
let annoTime = this.dashboard.formatDate(anno.time, tooltipTimeFormat);
|
let annoTime = this.dashboard.formatDate(anno.time, tooltipTimeFormat);
|
||||||
let annoText = anno.text;
|
let annoText = anno.text;
|
||||||
let annoTags = [];
|
let annoTags:any = [];
|
||||||
if (anno.tags) {
|
if (anno.tags) {
|
||||||
annoTags = _.map(anno.tags, t => ({"text": t, "backColor": "rgb(63, 43, 91)", "borderColor":"rgb(101, 81, 129)"}))
|
annoTags = _.map(anno.tags, t => ({"text": t, "backColor": "rgb(63, 43, 91)", "borderColor":"rgb(101, 81, 129)"}))
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
import angular from 'angular';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import d3 from 'd3';
|
import d3 from 'd3';
|
||||||
import * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';
|
import * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';
|
||||||
import {contextSrv} from 'app/core/core';
|
import {contextSrv} from 'app/core/core';
|
||||||
import {tickStep} from 'app/core/utils/ticks';
|
import {tickStep} from 'app/core/utils/ticks';
|
||||||
|
import coreModule from 'app/core/core_module';
|
||||||
let mod = angular.module('grafana.directives');
|
|
||||||
|
|
||||||
const LEGEND_STEP_WIDTH = 2;
|
const LEGEND_STEP_WIDTH = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bigger color legend for opacity and spectrum modes editor.
|
* Bigger color legend for opacity and spectrum modes editor.
|
||||||
*/
|
*/
|
||||||
mod.directive('optionsColorLegend', function() {
|
coreModule.directive('optionsColorLegend', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
template: '<div class="status-heatmap-color-legend"><svg width="16.8rem" height="24px"></svg></div>',
|
template: '<div class="status-heatmap-color-legend"><svg width="16.8rem" height="24px"></svg></div>',
|
||||||
@@ -47,7 +45,7 @@ mod.directive('optionsColorLegend', function() {
|
|||||||
/**
|
/**
|
||||||
* Graph legend with values.
|
* Graph legend with values.
|
||||||
*/
|
*/
|
||||||
mod.directive('statusHeatmapLegend', function() {
|
coreModule.directive('statusHeatmapLegend', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
template: '<div class="status-heatmap-color-legend"><svg width="100px" height="6px"></svg></div>',
|
template: '<div class="status-heatmap-color-legend"><svg width="100px" height="6px"></svg></div>',
|
||||||
@@ -160,11 +158,13 @@ function drawDiscreteColorLegend(elem, colorOptions, discreteHelper) {
|
|||||||
let valuesNumber = thresholds.length;
|
let valuesNumber = thresholds.length;
|
||||||
|
|
||||||
// graph width as a fallback
|
// graph width as a fallback
|
||||||
let $heatmap = $(elem).parent().parent().parent().find('.status-heatmap-panel');
|
const $heatmap = $(elem).parent().parent().parent().find('.status-heatmap-panel');
|
||||||
let graphWidth = $heatmap.find('svg').attr("width");
|
const graphWidthAttr = $heatmap.find('svg').attr("width");
|
||||||
|
let graphWidth = parseInt(graphWidthAttr);
|
||||||
|
|
||||||
|
|
||||||
// calculate max width of tooltip and use it as width for each item
|
// calculate max width of tooltip and use it as width for each item
|
||||||
let textWidth = [];
|
let textWidth:number[] = [];
|
||||||
legend.selectAll(".hidden-texts")
|
legend.selectAll(".hidden-texts")
|
||||||
.data(tooltips)
|
.data(tooltips)
|
||||||
.enter().append("text")
|
.enter().append("text")
|
||||||
@@ -179,8 +179,8 @@ function drawDiscreteColorLegend(elem, colorOptions, discreteHelper) {
|
|||||||
|
|
||||||
let legendWidth = Math.floor(_.min([
|
let legendWidth = Math.floor(_.min([
|
||||||
graphWidth - 30,
|
graphWidth - 30,
|
||||||
(_.max(textWidth) + 3) * valuesNumber,
|
(_.max(textWidth)! + 3) * valuesNumber,
|
||||||
]));
|
])!);
|
||||||
legendElem.attr("width", legendWidth);
|
legendElem.attr("width", legendWidth);
|
||||||
|
|
||||||
let legendHeight = legendElem.attr("height");
|
let legendHeight = legendElem.attr("height");
|
||||||
@@ -398,7 +398,7 @@ function buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue) {
|
|||||||
let range = rangeTo - rangeFrom;
|
let range = rangeTo - rangeFrom;
|
||||||
let tickStepSize = tickStep(rangeFrom, rangeTo, 3);
|
let tickStepSize = tickStep(rangeFrom, rangeTo, 3);
|
||||||
let ticksNum = Math.round(range / tickStepSize);
|
let ticksNum = Math.round(range / tickStepSize);
|
||||||
let ticks = [];
|
let ticks:any = [];
|
||||||
|
|
||||||
for (let i = 0; i < ticksNum; i++) {
|
for (let i = 0; i < ticksNum; i++) {
|
||||||
let current = tickStepSize * i;
|
let current = tickStepSize * i;
|
||||||
@@ -1,7 +1,23 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import {StatusHeatmapCtrl} from "./status_heatmap_ctrl";
|
||||||
|
|
||||||
|
interface Tooltip {
|
||||||
|
tooltip: string;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class DiscreteColorThreshold {
|
||||||
|
color: string;
|
||||||
|
value: number;
|
||||||
|
tooltip: string;
|
||||||
|
}
|
||||||
|
|
||||||
// Helper methods to handle discrete color mode
|
// Helper methods to handle discrete color mode
|
||||||
export class ColorModeDiscrete {
|
export class ColorModeDiscrete {
|
||||||
|
scope: any;
|
||||||
|
panelCtrl: StatusHeatmapCtrl;
|
||||||
|
panel: any;
|
||||||
|
|
||||||
constructor(scope) {
|
constructor(scope) {
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.panelCtrl = scope.ctrl;
|
this.panelCtrl = scope.ctrl;
|
||||||
@@ -9,9 +25,9 @@ export class ColorModeDiscrete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get tooltip for each value ordered by thresholds priority
|
// get tooltip for each value ordered by thresholds priority
|
||||||
convertValuesToTooltips(values) {
|
convertValuesToTooltips(values:any[]) : Tooltip[] {
|
||||||
let thresholds = this.panel.color.thresholds;
|
let thresholds = this.panel.color.thresholds;
|
||||||
let tooltips = [];
|
let tooltips:Tooltip[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < thresholds.length; i++) {
|
for (let i = 0; i < thresholds.length; i++) {
|
||||||
for (let j = 0; j < values.length; j++) {
|
for (let j = 0; j < values.length; j++) {
|
||||||
@@ -26,9 +42,8 @@ export class ColorModeDiscrete {
|
|||||||
return tooltips;
|
return tooltips;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNotMatchedValues(values:any[]) {
|
||||||
getNotMatchedValues(values) {
|
let notMatched:any[] = [];
|
||||||
let notMatched = [];
|
|
||||||
for (let j = 0; j < values.length; j++) {
|
for (let j = 0; j < values.length; j++) {
|
||||||
if (!this.getMatchedThreshold(values[j])) {
|
if (!this.getMatchedThreshold(values[j])) {
|
||||||
notMatched.push(values[j]);
|
notMatched.push(values[j]);
|
||||||
@@ -37,8 +52,8 @@ export class ColorModeDiscrete {
|
|||||||
return notMatched;
|
return notMatched;
|
||||||
}
|
}
|
||||||
|
|
||||||
getNotColoredValues(values) {
|
getNotColoredValues(values:any[]) {
|
||||||
let notMatched = [];
|
let notMatched:any[] = [];
|
||||||
for (let j = 0; j < values.length; j++) {
|
for (let j = 0; j < values.length; j++) {
|
||||||
let threshold = this.getMatchedThreshold(values[j]);
|
let threshold = this.getMatchedThreshold(values[j]);
|
||||||
if (!threshold || !threshold.color || threshold.color == "") {
|
if (!threshold || !threshold.color || threshold.color == "") {
|
||||||
@@ -48,7 +63,6 @@ export class ColorModeDiscrete {
|
|||||||
return notMatched;
|
return notMatched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getDiscreteColor(index) {
|
getDiscreteColor(index) {
|
||||||
let color = this.getThreshold(index).color;
|
let color = this.getThreshold(index).color;
|
||||||
if (!color || color == "") {
|
if (!color || color == "") {
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import {loadPluginCss} from 'app/plugins/sdk';
|
|
||||||
import { StatusHeatmapCtrl } from './status_heatmap_ctrl';
|
|
||||||
|
|
||||||
loadPluginCss({
|
|
||||||
dark: 'plugins/flant-statusmap-panel/css/statusmap.dark.css',
|
|
||||||
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
|
||||||
});
|
|
||||||
|
|
||||||
export {
|
|
||||||
StatusHeatmapCtrl as PanelCtrl
|
|
||||||
};
|
|
||||||
@@ -1,9 +1,20 @@
|
|||||||
import { MetricsPanelCtrl } from 'app/plugins/sdk';
|
// Libraries
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { contextSrv } from 'app/core/core';
|
import { auto } from 'angular';
|
||||||
import kbn from 'app/core/utils/kbn';
|
|
||||||
|
|
||||||
|
// Components
|
||||||
import './color_legend';
|
import './color_legend';
|
||||||
|
|
||||||
|
// Utils
|
||||||
|
import kbn from 'app/core/utils/kbn';
|
||||||
|
import {loadPluginCss} from 'app/plugins/sdk';
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import { MetricsPanelCtrl } from 'app/plugins/sdk';
|
||||||
|
import { contextSrv } from 'app/core/core';
|
||||||
|
import { AnnotationsSrv } from 'app/features/annotations/annotations_srv';
|
||||||
|
|
||||||
|
import {CardsStorage, Card} from './graph';
|
||||||
import rendering from './rendering';
|
import rendering from './rendering';
|
||||||
// import aggregates, { aggregatesMap } from './aggregates';
|
// import aggregates, { aggregatesMap } from './aggregates';
|
||||||
// import fragments, { fragmentsMap } from './fragments';
|
// import fragments, { fragmentsMap } from './fragments';
|
||||||
@@ -11,58 +22,12 @@ import rendering from './rendering';
|
|||||||
import {statusHeatmapOptionsEditor} from './options_editor';
|
import {statusHeatmapOptionsEditor} from './options_editor';
|
||||||
import {ColorModeDiscrete} from "./color_mode_discrete";
|
import {ColorModeDiscrete} from "./color_mode_discrete";
|
||||||
|
|
||||||
|
|
||||||
const CANVAS = 'CANVAS';
|
const CANVAS = 'CANVAS';
|
||||||
const SVG = 'SVG';
|
const SVG = 'SVG';
|
||||||
const VALUE_INDEX = 0,
|
const VALUE_INDEX = 0,
|
||||||
TIME_INDEX = 1;
|
TIME_INDEX = 1;
|
||||||
|
|
||||||
const panelDefaults = {
|
|
||||||
// aggregate: aggregates.AVG,
|
|
||||||
// fragment: fragments.HOUR,
|
|
||||||
color: {
|
|
||||||
mode: 'spectrum',
|
|
||||||
cardColor: '#b4ff00',
|
|
||||||
colorScale: 'sqrt',
|
|
||||||
exponent: 0.5,
|
|
||||||
colorScheme: 'interpolateGnYlRd',
|
|
||||||
// discrete mode settings
|
|
||||||
defaultColor: '#757575',
|
|
||||||
thresholds: [] // manual colors
|
|
||||||
},
|
|
||||||
cards: {
|
|
||||||
cardMinWidth: 5,
|
|
||||||
cardVSpacing: 2,
|
|
||||||
cardHSpacing: 2,
|
|
||||||
cardRound: null
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
show: true,
|
|
||||||
showWeekends: true,
|
|
||||||
minBucketWidthToShowWeekends: 4,
|
|
||||||
showCrosshair: true,
|
|
||||||
labelFormat: '%a %m/%d'
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
show: true,
|
|
||||||
showCrosshair: false
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
data: {
|
|
||||||
unitFormat: 'short',
|
|
||||||
decimals: null
|
|
||||||
},
|
|
||||||
// how null points should be handled
|
|
||||||
nullPointMode: 'as empty',
|
|
||||||
yAxisSort: 'metrics',
|
|
||||||
highlightCards: true,
|
|
||||||
useMax: true
|
|
||||||
};
|
|
||||||
|
|
||||||
const renderer = CANVAS;
|
const renderer = CANVAS;
|
||||||
|
|
||||||
const colorSchemes = [
|
const colorSchemes = [
|
||||||
@@ -97,13 +62,100 @@ const colorSchemes = [
|
|||||||
let colorModes = ['opacity', 'spectrum', 'discrete'];
|
let colorModes = ['opacity', 'spectrum', 'discrete'];
|
||||||
let opacityScales = ['linear', 'sqrt'];
|
let opacityScales = ['linear', 'sqrt'];
|
||||||
|
|
||||||
export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
interface DataWarning {
|
||||||
|
title: string;
|
||||||
|
tip: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataWarnings {
|
||||||
|
noColorDefined: DataWarning;
|
||||||
|
multipleValues: DataWarning;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ColorThreshold {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
loadPluginCss({
|
||||||
|
dark: 'plugins/flant-statusmap-panel/css/statusmap.dark.css',
|
||||||
|
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
||||||
|
});
|
||||||
|
|
||||||
|
class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
||||||
static templateUrl = 'module.html';
|
static templateUrl = 'module.html';
|
||||||
|
|
||||||
|
opacityScales: any = [];
|
||||||
|
colorModes: any = [];
|
||||||
|
colorSchemes: any = [];
|
||||||
|
unitFormats: any;
|
||||||
|
data: any;
|
||||||
|
cardsData: any;
|
||||||
|
graph: any;
|
||||||
|
multipleValues: boolean;
|
||||||
|
noColorDefined: boolean;
|
||||||
|
discreteHelper: ColorModeDiscrete;
|
||||||
|
dataWarnings: DataWarnings;
|
||||||
|
|
||||||
|
annotations: object[] = [];
|
||||||
|
annotationsPromise: any;
|
||||||
|
|
||||||
|
panelDefaults: any = {
|
||||||
|
// datasource name, null = default datasource
|
||||||
|
datasource: null,
|
||||||
|
// color mode
|
||||||
|
color: {
|
||||||
|
mode: 'spectrum',
|
||||||
|
cardColor: '#b4ff00',
|
||||||
|
colorScale: 'sqrt',
|
||||||
|
exponent: 0.5,
|
||||||
|
colorScheme: 'interpolateGnYlRd',
|
||||||
|
// discrete mode settings
|
||||||
|
defaultColor: '#757575',
|
||||||
|
thresholds: [] // manual colors
|
||||||
|
},
|
||||||
|
// buckets settings
|
||||||
|
cards: {
|
||||||
|
cardMinWidth: 5,
|
||||||
|
cardVSpacing: 2,
|
||||||
|
cardHSpacing: 2,
|
||||||
|
cardRound: null
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
show: true,
|
||||||
|
showWeekends: true,
|
||||||
|
minBucketWidthToShowWeekends: 4,
|
||||||
|
showCrosshair: true,
|
||||||
|
labelFormat: '%a %m/%d'
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: true,
|
||||||
|
showCrosshair: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
unitFormat: 'short',
|
||||||
|
decimals: null
|
||||||
|
},
|
||||||
|
// how null points should be handled
|
||||||
|
nullPointMode: 'as empty',
|
||||||
|
yAxisSort: 'metrics',
|
||||||
|
highlightCards: true,
|
||||||
|
useMax: true
|
||||||
|
};
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope, $injector, $rootScope, timeSrv, annotationsSrv) {
|
constructor($scope: any, $injector: auto.IInjectorService, private annotationsSrv: AnnotationsSrv) {
|
||||||
super($scope, $injector);
|
super($scope, $injector);
|
||||||
_.defaultsDeep(this.panel, panelDefaults);
|
|
||||||
|
_.defaultsDeep(this.panel, this.panelDefaults);
|
||||||
|
|
||||||
this.opacityScales = opacityScales;
|
this.opacityScales = opacityScales;
|
||||||
this.colorModes = colorModes;
|
this.colorModes = colorModes;
|
||||||
@@ -131,32 +183,40 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.annotations = [];
|
this.annotations = [];
|
||||||
this.annotationsSrv = annotationsSrv;
|
|
||||||
|
|
||||||
this.events.on('data-received', this.onDataReceived);
|
this.events.on('render', this.onRender.bind(this));
|
||||||
this.events.on('data-snapshot-load', this.onDataReceived);
|
this.events.on('data-received', this.onDataReceived.bind(this));
|
||||||
this.events.on('data-error', this.onDataError);
|
this.events.on('data-error', this.onDataError.bind(this));
|
||||||
this.events.on('init-edit-mode', this.onInitEditMode);
|
this.events.on('data-snapshot-load', this.onDataReceived.bind(this));
|
||||||
this.events.on('render', this.onRender);
|
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
|
||||||
this.events.on('refresh', this.postRefresh);
|
this.events.on('refresh', this.postRefresh.bind(this));
|
||||||
// custom event from rendering.js
|
// custom event from rendering.js
|
||||||
this.events.on('render-complete', this.onRenderComplete);
|
this.events.on('render-complete', this.onRenderComplete.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
onRenderComplete = (data) => {
|
onRenderComplete(data):void {
|
||||||
this.graph.chartWidth = data.chartWidth;
|
this.graph.chartWidth = data.chartWidth;
|
||||||
this.renderingCompleted();
|
this.renderingCompleted();
|
||||||
};
|
}
|
||||||
|
|
||||||
// override calculateInterval for discrete color mode
|
getChartWidth():number {
|
||||||
calculateInterval = () => {
|
const wndWidth = $(window).width();
|
||||||
let panelWidth = Math.ceil($(window).width() * (this.panel.gridPos.w / 24));
|
// gripPos.w is a width in grid's measurements. Grid size in Grafana is 24.
|
||||||
|
const panelWidthFactor = this.panel.gridPos.w / 24;
|
||||||
|
const panelWidth = Math.ceil(wndWidth * panelWidthFactor);
|
||||||
// approximate chartWidth because y axis ticks not rendered yet on first data receive.
|
// approximate chartWidth because y axis ticks not rendered yet on first data receive.
|
||||||
let chartWidth = _.max([
|
const chartWidth = _.max([
|
||||||
panelWidth - 200,
|
panelWidth - 200,
|
||||||
panelWidth/2
|
panelWidth/2
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
return chartWidth!;
|
||||||
|
}
|
||||||
|
|
||||||
|
// override calculateInterval for discrete color mode
|
||||||
|
calculateInterval() {
|
||||||
|
let chartWidth = this.getChartWidth();
|
||||||
|
|
||||||
let minCardWidth = this.panel.cards.cardMinWidth;
|
let minCardWidth = this.panel.cards.cardMinWidth;
|
||||||
let minSpacing = this.panel.cards.cardHSpacing;
|
let minSpacing = this.panel.cards.cardHSpacing;
|
||||||
let maxCardsCount = Math.ceil((chartWidth-minCardWidth) / (minCardWidth + minSpacing));
|
let maxCardsCount = Math.ceil((chartWidth-minCardWidth) / (minCardWidth + minSpacing));
|
||||||
@@ -169,6 +229,7 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
|
|
||||||
// Calculate low limit of interval
|
// Calculate low limit of interval
|
||||||
let lowLimitMs = 1; // 1 millisecond default low limit
|
let lowLimitMs = 1; // 1 millisecond default low limit
|
||||||
|
|
||||||
let intervalOverride = this.panel.interval;
|
let intervalOverride = this.panel.interval;
|
||||||
|
|
||||||
// if no panel interval check datasource
|
// if no panel interval check datasource
|
||||||
@@ -188,12 +249,13 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
if (lowLimitMs > intervalMs) {
|
if (lowLimitMs > intervalMs) {
|
||||||
intervalMs = lowLimitMs;
|
intervalMs = lowLimitMs;
|
||||||
}
|
}
|
||||||
|
let interval = kbn.secondsToHms(intervalMs / 1000);
|
||||||
|
|
||||||
this.intervalMs = intervalMs;
|
this.intervalMs = intervalMs;
|
||||||
this.interval = kbn.secondsToHms(intervalMs / 1000);
|
this.interval = interval;
|
||||||
};
|
}
|
||||||
|
|
||||||
issueQueries = (datasource) => {
|
issueQueries(datasource: any) {
|
||||||
this.annotationsPromise = this.annotationsSrv.getAnnotations({
|
this.annotationsPromise = this.annotationsSrv.getAnnotations({
|
||||||
dashboard: this.dashboard,
|
dashboard: this.dashboard,
|
||||||
panel: this.panel,
|
panel: this.panel,
|
||||||
@@ -206,49 +268,65 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
* (but not wait for completion). This resolves
|
* (but not wait for completion). This resolves
|
||||||
* issue 11806.
|
* issue 11806.
|
||||||
*/
|
*/
|
||||||
// 5.x before 5.4 doesn't have dataPromises
|
// 5.x before 5.4 doesn't have datasourcePromises.
|
||||||
|
|
||||||
if ("undefined" !== typeof(this.annotationsSrv.datasourcePromises)) {
|
if ("undefined" !== typeof(this.annotationsSrv.datasourcePromises)) {
|
||||||
return this.annotationsSrv.datasourcePromises.then(r => {
|
return this.annotationsSrv.datasourcePromises.then(r => {
|
||||||
return super.issueQueries(datasource);
|
return this.issueQueriesWithInterval(datasource, this.interval);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return super.issueQueries(datasource);
|
return this.issueQueriesWithInterval(datasource, this.interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grafana 6.2 (and older) is using this.interval for queries,
|
||||||
|
// but Grafana 6.3+ is calculating interval again in queryRunner,
|
||||||
|
// so we need to save-restore this.panel.interval.
|
||||||
|
issueQueriesWithInterval(datasource: any, interval: any) {
|
||||||
|
var origInterval = this.panel.interval;
|
||||||
|
this.panel.interval = this.interval;
|
||||||
|
var res = super.issueQueries(datasource);
|
||||||
|
this.panel.interval = origInterval;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
onDataReceived = (dataList) => {
|
|
||||||
|
onDataReceived(dataList: any) {
|
||||||
this.data = dataList;
|
this.data = dataList;
|
||||||
this.cardsData = this.convertToCards(this.data);
|
this.cardsData = this.convertToCards(this.data);
|
||||||
|
|
||||||
|
console.log("OnDataReceived");
|
||||||
|
|
||||||
this.annotationsPromise.then(
|
this.annotationsPromise.then(
|
||||||
result => {
|
(result: { alertState: any; annotations: any }) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
//this.alertState = result.alertState;
|
//this.alertState = result.alertState;
|
||||||
if (result.annotations && result.annotations.length > 0) {
|
if (result.annotations && result.annotations.length > 0) {
|
||||||
this.annotations = result.annotations;
|
this.annotations = result.annotations;
|
||||||
} else {
|
} else {
|
||||||
this.annotations = null;
|
this.annotations = [];
|
||||||
}
|
}
|
||||||
|
console.log("annotationsPromise result " + this.annotations.length + " annotations");
|
||||||
this.render();
|
this.render();
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.annotations = null;
|
this.annotations = [];
|
||||||
|
console.log("annotationsPromise onrejected");
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
//this.render();
|
//this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
onInitEditMode = () => {
|
onInitEditMode() {
|
||||||
this.addEditorTab('Options', statusHeatmapOptionsEditor, 2);
|
this.addEditorTab('Options', statusHeatmapOptionsEditor, 2);
|
||||||
this.unitFormats = kbn.getUnitFormats();
|
this.unitFormats = kbn.getUnitFormats();
|
||||||
};
|
}
|
||||||
|
|
||||||
onRender = () => {
|
onRender() {
|
||||||
if (!this.data) { return; }
|
if (!this.range || !this.data) { return; }
|
||||||
|
|
||||||
this.multipleValues = false;
|
this.multipleValues = false;
|
||||||
if (!this.panel.useMax) {
|
if (!this.panel.useMax) {
|
||||||
@@ -264,47 +342,47 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
this.noColorDefined = this.cardsData.noColorDefined;
|
this.noColorDefined = this.cardsData.noColorDefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
onCardColorChange = (newColor) => {
|
onCardColorChange(newColor) {
|
||||||
this.panel.color.cardColor = newColor;
|
this.panel.color.cardColor = newColor;
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
onDataError = () => {
|
onDataError() {
|
||||||
this.data = [];
|
this.data = [];
|
||||||
this.annotations = [];
|
this.annotations = [];
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
postRefresh = () => {
|
postRefresh() {
|
||||||
this.noColorDefined = false;
|
this.noColorDefined = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
onEditorAddThreshold = () => {
|
onEditorAddThreshold() {
|
||||||
this.panel.color.thresholds.push({ color: this.panel.defaultColor });
|
this.panel.color.thresholds.push({ color: this.panel.defaultColor });
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
onEditorRemoveThreshold = (index) => {
|
onEditorRemoveThreshold(index:number) {
|
||||||
this.panel.color.thresholds.splice(index, 1);
|
this.panel.color.thresholds.splice(index, 1);
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
onEditorRemoveThresholds = () => {
|
onEditorRemoveThresholds() {
|
||||||
this.panel.color.thresholds = [];
|
this.panel.color.thresholds = [];
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
onEditorAddThreeLights = () => {
|
onEditorAddThreeLights() {
|
||||||
this.panel.color.thresholds.push({color: "red", value: 2, tooltip: "error" });
|
this.panel.color.thresholds.push({color: "red", value: 2, tooltip: "error" });
|
||||||
this.panel.color.thresholds.push({color: "yellow", value: 1, tooltip: "warning" });
|
this.panel.color.thresholds.push({color: "yellow", value: 1, tooltip: "warning" });
|
||||||
this.panel.color.thresholds.push({color: "green", value: 0, tooltip: "ok" });
|
this.panel.color.thresholds.push({color: "green", value: 0, tooltip: "ok" });
|
||||||
this.render();
|
this.render();
|
||||||
};
|
}
|
||||||
|
|
||||||
/* https://ethanschoonover.com/solarized/ */
|
/* https://ethanschoonover.com/solarized/ */
|
||||||
onEditorAddSolarized = () => {
|
onEditorAddSolarized() {
|
||||||
this.panel.color.thresholds.push({color: "#b58900", value: 0, tooltip: "yellow" });
|
this.panel.color.thresholds.push({color: "#b58900", value: 0, tooltip: "yellow" });
|
||||||
this.panel.color.thresholds.push({color: "#cb4b16", value: 1, tooltip: "orange" });
|
this.panel.color.thresholds.push({color: "#cb4b16", value: 1, tooltip: "orange" });
|
||||||
this.panel.color.thresholds.push({color: "#dc322f", value: 2, tooltip: "red" });
|
this.panel.color.thresholds.push({color: "#dc322f", value: 2, tooltip: "red" });
|
||||||
@@ -316,13 +394,13 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
link = (scope, elem, attrs, ctrl) => {
|
link(scope, elem, attrs, ctrl) {
|
||||||
rendering(scope, elem, attrs, ctrl);
|
rendering(scope, elem, attrs, ctrl);
|
||||||
};
|
}
|
||||||
|
|
||||||
// group values into buckets by target
|
// group values into buckets by target
|
||||||
convertToCards = (data) => {
|
convertToCards(data) {
|
||||||
let cardsData = {
|
let cardsData = <CardsStorage> {
|
||||||
cards: [],
|
cards: [],
|
||||||
xBucketSize: 0,
|
xBucketSize: 0,
|
||||||
yBucketSize: 0,
|
yBucketSize: 0,
|
||||||
@@ -355,14 +433,11 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
let target = cardsData.targets[i];
|
let target = cardsData.targets[i];
|
||||||
|
|
||||||
for (let j = 0; j < cardsData.xBucketSize; j++) {
|
for (let j = 0; j < cardsData.xBucketSize; j++) {
|
||||||
let card = {
|
let card = new Card();
|
||||||
id: i*cardsData.xBucketSize + j,
|
card.id = i*cardsData.xBucketSize + j;
|
||||||
values: [],
|
card.values = [];
|
||||||
multipleValues: false,
|
card.y = target;
|
||||||
noColorDefined: false,
|
card.x = -1;
|
||||||
y: target,
|
|
||||||
x: -1,
|
|
||||||
};
|
|
||||||
|
|
||||||
// collect values from all timeseries with target
|
// collect values from all timeseries with target
|
||||||
for (let si = 0; si < cardsData.targetIndex[target].length; si++) {
|
for (let si = 0; si < cardsData.targetIndex[target].length; si++) {
|
||||||
@@ -399,5 +474,9 @@ export class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return cardsData;
|
return cardsData;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
StatusHeatmapCtrl, StatusHeatmapCtrl as PanelCtrl
|
||||||
|
};
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
import kbn from 'app/core/utils/kbn';
|
import kbn from 'app/core/utils/kbn';
|
||||||
|
|
||||||
export class StatusHeatmapOptionsEditorCtrl {
|
export class StatusHeatmapOptionsEditorCtrl {
|
||||||
|
panel: any;
|
||||||
|
panelCtrl: any;
|
||||||
|
unitFormats: any;
|
||||||
|
|
||||||
constructor($scope) {
|
constructor($scope) {
|
||||||
$scope.editor = this;
|
$scope.editor = this;
|
||||||
this.panelCtrl = $scope.ctrl;
|
this.panelCtrl = $scope.ctrl;
|
||||||
@@ -1,728 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import $ from 'jquery';
|
|
||||||
import moment from 'moment';
|
|
||||||
import kbn from 'app/core/utils/kbn';
|
|
||||||
import {appEvents, contextSrv} from 'app/core/core';
|
|
||||||
import {tickStep, getScaledDecimals, getFlotTickSize} from 'app/core/utils/ticks';
|
|
||||||
import d3 from 'd3';
|
|
||||||
import * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';
|
|
||||||
import {StatusHeatmapTooltip} from './tooltip';
|
|
||||||
import {AnnotationTooltip} from './annotations';
|
|
||||||
|
|
||||||
let MIN_CARD_SIZE = 5,
|
|
||||||
CARD_H_SPACING = 2,
|
|
||||||
CARD_V_SPACING = 2,
|
|
||||||
CARD_ROUND = 0,
|
|
||||||
DATA_RANGE_WIDING_FACTOR = 1.2,
|
|
||||||
DEFAULT_X_TICK_SIZE_PX = 100,
|
|
||||||
DEFAULT_Y_TICK_SIZE_PX = 50,
|
|
||||||
X_AXIS_TICK_PADDING = 10,
|
|
||||||
Y_AXIS_TICK_PADDING = 5,
|
|
||||||
MIN_SELECTION_WIDTH = 2;
|
|
||||||
|
|
||||||
export default function link(scope, elem, attrs, ctrl) {
|
|
||||||
let data, cardsData, timeRange, panel, heatmap;
|
|
||||||
|
|
||||||
// $heatmap is JQuery object, but heatmap is D3
|
|
||||||
let $heatmap = elem.find('.status-heatmap-panel');
|
|
||||||
let tooltip = new StatusHeatmapTooltip($heatmap, scope);
|
|
||||||
let annotationTooltip = new AnnotationTooltip($heatmap, scope);
|
|
||||||
|
|
||||||
let width, height,
|
|
||||||
yScale, xScale,
|
|
||||||
chartWidth, chartHeight,
|
|
||||||
chartTop, chartBottom,
|
|
||||||
yAxisWidth, xAxisHeight,
|
|
||||||
cardVSpacing, cardHSpacing, cardRound,
|
|
||||||
cardWidth, cardHeight,
|
|
||||||
colorScale, opacityScale,
|
|
||||||
mouseUpHandler,
|
|
||||||
xGridSize, yGridSize;
|
|
||||||
|
|
||||||
let yOffset = 0;
|
|
||||||
|
|
||||||
let selection = {
|
|
||||||
active: false,
|
|
||||||
x1: -1,
|
|
||||||
x2: -1
|
|
||||||
};
|
|
||||||
|
|
||||||
let padding = {left: 0, right: 0, top: 0, bottom: 0},
|
|
||||||
margin = {left: 25, right: 15, top: 10, bottom: 20},
|
|
||||||
dataRangeWidingFactor = DATA_RANGE_WIDING_FACTOR;
|
|
||||||
|
|
||||||
ctrl.events.on('render', () => {
|
|
||||||
render();
|
|
||||||
});
|
|
||||||
|
|
||||||
function setElementHeight() {
|
|
||||||
try {
|
|
||||||
var height = ctrl.height || panel.height || ctrl.row.height;
|
|
||||||
if (_.isString(height)) {
|
|
||||||
height = parseInt(height.replace('px', ''), 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
height -= panel.legend.show ? 32 : 10; // bottom padding and space for legend. Change margin in .status-heatmap-color-legend !
|
|
||||||
|
|
||||||
$heatmap.css('height', height + 'px');
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (e) { // IE throws errors sometimes
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getYAxisWidth(elem) {
|
|
||||||
let axis_text = elem.selectAll(".axis-y text").nodes();
|
|
||||||
let max_text_width = _.max(_.map(axis_text, text => {
|
|
||||||
// Use SVG getBBox method
|
|
||||||
return text.getBBox().width;
|
|
||||||
}));
|
|
||||||
|
|
||||||
return Math.ceil(max_text_width);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getXAxisHeight(elem) {
|
|
||||||
let axis_line = elem.select(".axis-x line");
|
|
||||||
if (!axis_line.empty()) {
|
|
||||||
let axis_line_position = parseFloat(elem.select(".axis-x line").attr("y2"));
|
|
||||||
let canvas_width = parseFloat(elem.attr("height"));
|
|
||||||
return canvas_width - axis_line_position;
|
|
||||||
} else {
|
|
||||||
// Default height
|
|
||||||
return 30;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addXAxis() {
|
|
||||||
// Scale timestamps to cards centers
|
|
||||||
scope.xScale = xScale = d3.scaleTime()
|
|
||||||
.domain([timeRange.from, timeRange.to])
|
|
||||||
.range([xGridSize/2, chartWidth-xGridSize/2]);
|
|
||||||
|
|
||||||
let ticks = chartWidth / DEFAULT_X_TICK_SIZE_PX;
|
|
||||||
let grafanaTimeFormatter = grafanaTimeFormat(ticks, timeRange.from, timeRange.to);
|
|
||||||
let timeFormat;
|
|
||||||
let dashboardTimeZone = ctrl.dashboard.getTimezone();
|
|
||||||
if (dashboardTimeZone === 'utc') {
|
|
||||||
timeFormat = d3.utcFormat(grafanaTimeFormatter);
|
|
||||||
} else {
|
|
||||||
timeFormat = d3.timeFormat(grafanaTimeFormatter);
|
|
||||||
}
|
|
||||||
|
|
||||||
let xAxis = d3.axisBottom(xScale)
|
|
||||||
.ticks(ticks)
|
|
||||||
.tickFormat(timeFormat)
|
|
||||||
.tickPadding(X_AXIS_TICK_PADDING)
|
|
||||||
.tickSize(chartHeight);
|
|
||||||
|
|
||||||
let posY = chartTop;
|
|
||||||
let posX = yAxisWidth;
|
|
||||||
|
|
||||||
heatmap.append("g")
|
|
||||||
.attr("class", "axis axis-x")
|
|
||||||
.attr("transform", "translate(" + posX + "," + posY + ")")
|
|
||||||
.call(xAxis);
|
|
||||||
|
|
||||||
// Remove horizontal line in the top of axis labels (called domain in d3)
|
|
||||||
heatmap.select(".axis-x").select(".domain").remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// divide chart height by ticks for cards drawing
|
|
||||||
function getYScale(ticks) {
|
|
||||||
let range = [];
|
|
||||||
let step = chartHeight / ticks.length;
|
|
||||||
// svg has y=0 on the top, so top card should have a minimal value in range
|
|
||||||
range.push(step);
|
|
||||||
for (let i = 1; i < ticks.length; i++) {
|
|
||||||
range.push(step * (i+1));
|
|
||||||
}
|
|
||||||
return d3.scaleOrdinal()
|
|
||||||
.domain(ticks)
|
|
||||||
.range(range);
|
|
||||||
}
|
|
||||||
|
|
||||||
// divide chart height by ticks with offset for ticks drawing
|
|
||||||
function getYAxisScale(ticks) {
|
|
||||||
let range = [];
|
|
||||||
let step = chartHeight / ticks.length;
|
|
||||||
// svg has y=0 on the top, so top tick should have a minimal value in range
|
|
||||||
range.push(yOffset);
|
|
||||||
for (let i = 1; i < ticks.length; i++) {
|
|
||||||
range.push(step * i + yOffset);
|
|
||||||
}
|
|
||||||
return d3.scaleOrdinal()
|
|
||||||
.domain(ticks)
|
|
||||||
.range(range);
|
|
||||||
}
|
|
||||||
|
|
||||||
function addYAxis() {
|
|
||||||
let ticks = _.uniq(_.map(data, d => d.target));
|
|
||||||
|
|
||||||
// Set default Y min and max if no data
|
|
||||||
if (_.isEmpty(data)) {
|
|
||||||
ticks = [''];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel.yAxisSort == 'a → z') {
|
|
||||||
ticks.sort((a, b) => a.localeCompare(b, 'en', {ignorePunctuation: false, numeric: true}));
|
|
||||||
} else if (panel.yAxisSort == 'z → a') {
|
|
||||||
ticks.sort((b, a) => a.localeCompare(b, 'en', {ignorePunctuation: false, numeric: true}));
|
|
||||||
}
|
|
||||||
|
|
||||||
let yAxisScale = getYAxisScale(ticks);
|
|
||||||
scope.yScale = yScale = getYScale(ticks);
|
|
||||||
|
|
||||||
let yAxis = d3.axisLeft(yAxisScale)
|
|
||||||
.tickValues(ticks)
|
|
||||||
.tickSizeInner(0 - width)
|
|
||||||
.tickPadding(Y_AXIS_TICK_PADDING);
|
|
||||||
|
|
||||||
heatmap.append("g")
|
|
||||||
.attr("class", "axis axis-y")
|
|
||||||
.call(yAxis);
|
|
||||||
|
|
||||||
// Calculate Y axis width first, then move axis into visible area
|
|
||||||
let posY = margin.top;
|
|
||||||
let posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;
|
|
||||||
heatmap.select(".axis-y").attr("transform", "translate(" + posX + "," + posY + ")");
|
|
||||||
|
|
||||||
// Remove vertical line in the right of axis labels (called domain in d3)
|
|
||||||
heatmap.select(".axis-y").select(".domain").remove();
|
|
||||||
heatmap.select(".axis-y").selectAll(".tick line").remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wide Y values range and adjust to bucket size
|
|
||||||
function wideYAxisRange(min, max, tickInterval) {
|
|
||||||
let y_widing = (max * (dataRangeWidingFactor - 1) - min * (dataRangeWidingFactor - 1)) / 2;
|
|
||||||
let y_min, y_max;
|
|
||||||
|
|
||||||
if (tickInterval === 0) {
|
|
||||||
y_max = max * dataRangeWidingFactor;
|
|
||||||
y_min = min - min * (dataRangeWidingFactor - 1);
|
|
||||||
tickInterval = (y_max - y_min) / 2;
|
|
||||||
} else {
|
|
||||||
y_max = Math.ceil((max + y_widing) / tickInterval) * tickInterval;
|
|
||||||
y_min = Math.floor((min - y_widing) / tickInterval) * tickInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't wide axis below 0 if all values are positive
|
|
||||||
if (min >= 0 && y_min < 0) {
|
|
||||||
y_min = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {y_min, y_max};
|
|
||||||
}
|
|
||||||
|
|
||||||
function tickValueFormatter(decimals, scaledDecimals = null) {
|
|
||||||
let format = panel.yAxis.format;
|
|
||||||
return function(value) {
|
|
||||||
return kbn.valueFormats[format](value, decimals, scaledDecimals);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create svg element, add axes and
|
|
||||||
// calculate sizes for cards drawing
|
|
||||||
function addHeatmapCanvas() {
|
|
||||||
let heatmap_elem = $heatmap[0];
|
|
||||||
|
|
||||||
width = Math.floor($heatmap.width()) - padding.right;
|
|
||||||
height = Math.floor($heatmap.height()) - padding.bottom;
|
|
||||||
|
|
||||||
if (heatmap) {
|
|
||||||
heatmap.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
heatmap = d3.select(heatmap_elem)
|
|
||||||
.append("svg")
|
|
||||||
.attr("width", width)
|
|
||||||
.attr("height", height);
|
|
||||||
|
|
||||||
chartHeight = height - margin.top - margin.bottom;
|
|
||||||
chartTop = margin.top;
|
|
||||||
chartBottom = chartTop + chartHeight;
|
|
||||||
|
|
||||||
cardHSpacing = panel.cards.cardHSpacing !== null ? panel.cards.cardHSpacing : CARD_H_SPACING;
|
|
||||||
cardVSpacing = panel.cards.cardVSpacing !== null ? panel.cards.cardVSpacing : CARD_V_SPACING;
|
|
||||||
cardRound = panel.cards.cardRound !== null ? panel.cards.cardRound : CARD_ROUND;
|
|
||||||
|
|
||||||
// calculate yOffset for YAxis
|
|
||||||
yGridSize = Math.floor(chartHeight / cardsData.yBucketSize);
|
|
||||||
cardHeight = yGridSize ? yGridSize - cardVSpacing : 0;
|
|
||||||
yOffset = cardHeight / 2;
|
|
||||||
|
|
||||||
addYAxis();
|
|
||||||
|
|
||||||
yAxisWidth = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;
|
|
||||||
chartWidth = width - yAxisWidth - margin.right;
|
|
||||||
|
|
||||||
// TODO allow per-y cardWidth!
|
|
||||||
// we need to fill chartWidth with xBucketSize cards.
|
|
||||||
xGridSize = chartWidth / (cardsData.xBucketSize+1);
|
|
||||||
cardWidth = xGridSize - cardHSpacing;
|
|
||||||
|
|
||||||
addXAxis();
|
|
||||||
xAxisHeight = getXAxisHeight(heatmap);
|
|
||||||
|
|
||||||
if (!panel.yAxis.show) {
|
|
||||||
heatmap.select(".axis-y").selectAll("line").style("opacity", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!panel.xAxis.show) {
|
|
||||||
heatmap.select(".axis-x").selectAll("line").style("opacity", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addHeatmap() {
|
|
||||||
addHeatmapCanvas();
|
|
||||||
|
|
||||||
let maxValue = panel.color.max || cardsData.maxValue;
|
|
||||||
let minValue = panel.color.min || cardsData.minValue;
|
|
||||||
|
|
||||||
if (panel.color.mode !== 'discrete') {
|
|
||||||
colorScale = getColorScale(maxValue, minValue);
|
|
||||||
}
|
|
||||||
setOpacityScale(maxValue);
|
|
||||||
|
|
||||||
let cards = heatmap.selectAll(".status-heatmap-card").data(cardsData.cards);
|
|
||||||
cards.append("title");
|
|
||||||
cards = cards.enter().append("rect")
|
|
||||||
.attr("cardId", c => c.id)
|
|
||||||
.attr("x", getCardX)
|
|
||||||
.attr("width", getCardWidth)
|
|
||||||
.attr("y", getCardY)
|
|
||||||
.attr("height", getCardHeight)
|
|
||||||
.attr("rx", cardRound)
|
|
||||||
.attr("ry", cardRound)
|
|
||||||
.attr("class", "bordered status-heatmap-card")
|
|
||||||
.style("fill", getCardColor)
|
|
||||||
.style("stroke", getCardColor)
|
|
||||||
.style("stroke-width", 0)
|
|
||||||
//.style("stroke-width", getCardStrokeWidth)
|
|
||||||
//.style("stroke-dasharray", "3,3")
|
|
||||||
.style("opacity", getCardOpacity);
|
|
||||||
|
|
||||||
let $cards = $heatmap.find(".status-heatmap-card");
|
|
||||||
$cards.on("mouseenter", (event) => {
|
|
||||||
tooltip.mouseOverBucket = true;
|
|
||||||
highlightCard(event);
|
|
||||||
})
|
|
||||||
.on("mouseleave", (event) => {
|
|
||||||
tooltip.mouseOverBucket = false;
|
|
||||||
resetCardHighLight(event);
|
|
||||||
});
|
|
||||||
|
|
||||||
_renderAnnotations();
|
|
||||||
|
|
||||||
ctrl.events.emit('render-complete', {
|
|
||||||
"chartWidth": chartWidth
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function highlightCard(event) {
|
|
||||||
let color = d3.select(event.target).style("fill");
|
|
||||||
let highlightColor = d3.color(color).darker(2);
|
|
||||||
let strokeColor = d3.color(color).brighter(4);
|
|
||||||
let current_card = d3.select(event.target);
|
|
||||||
tooltip.originalFillColor = color;
|
|
||||||
current_card.style("fill", highlightColor)
|
|
||||||
.style("stroke", strokeColor)
|
|
||||||
.style("stroke-width", 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetCardHighLight(event) {
|
|
||||||
d3
|
|
||||||
.select(event.target)
|
|
||||||
.style("fill", tooltip.originalFillColor)
|
|
||||||
.style("stroke", tooltip.originalFillColor)
|
|
||||||
.style("stroke-width", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getColorScale(maxValue, minValue = 0) {
|
|
||||||
let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});
|
|
||||||
let colorInterpolator = d3ScaleChromatic[colorScheme.value];
|
|
||||||
let colorScaleInverted = colorScheme.invert === 'always' ||
|
|
||||||
(colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);
|
|
||||||
|
|
||||||
if (maxValue == minValue)
|
|
||||||
maxValue = minValue + 1;
|
|
||||||
|
|
||||||
let start = colorScaleInverted ? maxValue : minValue;
|
|
||||||
let end = colorScaleInverted ? minValue : maxValue;
|
|
||||||
|
|
||||||
return d3.scaleSequential(colorInterpolator).domain([start, end]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setOpacityScale(maxValue) {
|
|
||||||
if (panel.color.colorScale === 'linear') {
|
|
||||||
opacityScale = d3.scaleLinear()
|
|
||||||
.domain([0, maxValue])
|
|
||||||
.range([0, 1]);
|
|
||||||
} else if (panel.color.colorScale === 'sqrt') {
|
|
||||||
opacityScale = d3.scalePow().exponent(panel.color.exponent)
|
|
||||||
.domain([0, maxValue])
|
|
||||||
.range([0, 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardX(d) {
|
|
||||||
let x;
|
|
||||||
// cx is the center of the card. Card should be placed to the left.
|
|
||||||
let cx = xScale(d.x);
|
|
||||||
|
|
||||||
if (cx - cardWidth/2 < 0) {
|
|
||||||
x = yAxisWidth + cardHSpacing/2;
|
|
||||||
} else {
|
|
||||||
x = yAxisWidth + cx - cardWidth/2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
// xScale returns card center. Adjust cardWidth in case of overlaping.
|
|
||||||
function getCardWidth(d) {
|
|
||||||
let w;
|
|
||||||
let cx = xScale(d.x);
|
|
||||||
|
|
||||||
if (cx < cardWidth/2) {
|
|
||||||
// Center should not exceed half of card.
|
|
||||||
// Cut card to the left to prevent overlay of y axis.
|
|
||||||
let cutted_width = (cx - cardHSpacing/2) + cardWidth/2;
|
|
||||||
w = cutted_width > 0 ? cutted_width : 0;
|
|
||||||
} else if (chartWidth - cx < cardWidth/2) {
|
|
||||||
// Cut card to the right to prevent overlay of right graph edge.
|
|
||||||
w = cardWidth/2 + (chartWidth - cx - cardHSpacing/2);
|
|
||||||
} else {
|
|
||||||
w = cardWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Card width should be MIN_CARD_SIZE at least
|
|
||||||
w = Math.max(w, MIN_CARD_SIZE);
|
|
||||||
|
|
||||||
if (cardHSpacing == 0) {
|
|
||||||
w = w+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardY(d) {
|
|
||||||
return yScale(d.y) + chartTop - cardHeight - cardVSpacing/2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardHeight(d) {
|
|
||||||
let ys = yScale(d.y);
|
|
||||||
let y = ys + chartTop - cardHeight - cardVSpacing/2;
|
|
||||||
let h = cardHeight;
|
|
||||||
|
|
||||||
// Cut card height to prevent overlay
|
|
||||||
if (y < chartTop) {
|
|
||||||
h = ys - cardVSpacing/2;
|
|
||||||
} else if (ys > chartBottom) {
|
|
||||||
h = chartBottom - y;
|
|
||||||
} else if (y + cardHeight > chartBottom) {
|
|
||||||
h = chartBottom - y;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Height can't be more than chart height
|
|
||||||
h = Math.min(h, chartHeight);
|
|
||||||
// Card height should be MIN_CARD_SIZE at least
|
|
||||||
h = Math.max(h, MIN_CARD_SIZE);
|
|
||||||
|
|
||||||
if (cardVSpacing == 0) {
|
|
||||||
h = h+1
|
|
||||||
}
|
|
||||||
|
|
||||||
return h;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardColor(d) {
|
|
||||||
if (panel.color.mode === 'opacity') {
|
|
||||||
return panel.color.cardColor;
|
|
||||||
} else if (panel.color.mode === 'spectrum') {
|
|
||||||
return colorScale(d.value);
|
|
||||||
} else if (panel.color.mode === 'discrete') {
|
|
||||||
return ctrl.discreteHelper.getBucketColor(d.values);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardOpacity(d) {
|
|
||||||
if (panel.nullPointMode === 'as empty' && d.value == null ) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (panel.color.mode === 'opacity') {
|
|
||||||
return opacityScale(d.value);
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCardStrokeWidth(d) {
|
|
||||||
if (panel.color.mode === 'discrete') {
|
|
||||||
return '1';
|
|
||||||
}
|
|
||||||
return '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////
|
|
||||||
// Selection and crosshair //
|
|
||||||
/////////////////////////////
|
|
||||||
|
|
||||||
// Shared crosshair and tooltip
|
|
||||||
appEvents.on('graph-hover', event => {
|
|
||||||
drawSharedCrosshair(event.pos);
|
|
||||||
}, scope);
|
|
||||||
|
|
||||||
appEvents.on('graph-hover-clear', () => {
|
|
||||||
clearCrosshair();
|
|
||||||
}, scope);
|
|
||||||
|
|
||||||
function onMouseDown(event) {
|
|
||||||
selection.active = true;
|
|
||||||
selection.x1 = event.offsetX;
|
|
||||||
|
|
||||||
mouseUpHandler = function() {
|
|
||||||
onMouseUp();
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).one("mouseup", mouseUpHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMouseUp() {
|
|
||||||
$(document).unbind("mouseup", mouseUpHandler);
|
|
||||||
mouseUpHandler = null;
|
|
||||||
selection.active = false;
|
|
||||||
|
|
||||||
let selectionRange = Math.abs(selection.x2 - selection.x1);
|
|
||||||
if (selection.x2 >= 0 && selectionRange > MIN_SELECTION_WIDTH) {
|
|
||||||
let timeFrom = xScale.invert(Math.min(selection.x1, selection.x2) - yAxisWidth - xGridSize/2);
|
|
||||||
let timeTo = xScale.invert(Math.max(selection.x1, selection.x2) - yAxisWidth - xGridSize/2);
|
|
||||||
|
|
||||||
ctrl.timeSrv.setTime({
|
|
||||||
from: moment.utc(timeFrom),
|
|
||||||
to: moment.utc(timeTo)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
clearSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMouseLeave() {
|
|
||||||
appEvents.emit('graph-hover-clear');
|
|
||||||
clearCrosshair();
|
|
||||||
//annotationTooltip.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMouseMove(event) {
|
|
||||||
if (!heatmap) { return; }
|
|
||||||
|
|
||||||
if (selection.active) {
|
|
||||||
// Clear crosshair and tooltip
|
|
||||||
clearCrosshair();
|
|
||||||
tooltip.destroy();
|
|
||||||
annotationTooltip.destroy();
|
|
||||||
|
|
||||||
selection.x2 = limitSelection(event.offsetX);
|
|
||||||
drawSelection(selection.x1, selection.x2);
|
|
||||||
} else {
|
|
||||||
emitGraphHoverEvet(event);
|
|
||||||
drawCrosshair(event.offsetX);
|
|
||||||
tooltip.show(event); //, data);
|
|
||||||
annotationTooltip.show(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function emitGraphHoverEvet(event) {
|
|
||||||
let x = xScale.invert(event.offsetX - yAxisWidth - xGridSize/2).valueOf();
|
|
||||||
let y = yScale(event.offsetY);
|
|
||||||
let pos = {
|
|
||||||
pageX: event.pageX,
|
|
||||||
pageY: event.pageY,
|
|
||||||
x: x, x1: x,
|
|
||||||
y: y, y1: y,
|
|
||||||
panelRelY: null
|
|
||||||
};
|
|
||||||
|
|
||||||
// Set minimum offset to prevent showing legend from another panel
|
|
||||||
pos.panelRelY = Math.max(event.offsetY / height, 0.001);
|
|
||||||
|
|
||||||
// broadcast to other graph panels that we are hovering
|
|
||||||
appEvents.emit('graph-hover', {pos: pos, panel: panel});
|
|
||||||
}
|
|
||||||
|
|
||||||
function limitSelection(x2) {
|
|
||||||
x2 = Math.max(x2, yAxisWidth);
|
|
||||||
x2 = Math.min(x2, chartWidth + yAxisWidth);
|
|
||||||
return x2;
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawSelection(posX1, posX2) {
|
|
||||||
if (heatmap) {
|
|
||||||
heatmap.selectAll(".status-heatmap-selection").remove();
|
|
||||||
let selectionX = Math.min(posX1, posX2);
|
|
||||||
let selectionWidth = Math.abs(posX1 - posX2);
|
|
||||||
|
|
||||||
if (selectionWidth > MIN_SELECTION_WIDTH) {
|
|
||||||
heatmap.append("rect")
|
|
||||||
.attr("class", "status-heatmap-selection")
|
|
||||||
.attr("x", selectionX)
|
|
||||||
.attr("width", selectionWidth)
|
|
||||||
.attr("y", chartTop)
|
|
||||||
.attr("height", chartHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearSelection() {
|
|
||||||
selection.x1 = -1;
|
|
||||||
selection.x2 = -1;
|
|
||||||
|
|
||||||
if (heatmap) {
|
|
||||||
heatmap.selectAll(".status-heatmap-selection").remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawCrosshair(position) {
|
|
||||||
if (heatmap) {
|
|
||||||
heatmap.selectAll(".status-heatmap-crosshair").remove();
|
|
||||||
|
|
||||||
let posX = position;
|
|
||||||
posX = Math.max(posX, yAxisWidth);
|
|
||||||
posX = Math.min(posX, chartWidth + yAxisWidth);
|
|
||||||
|
|
||||||
heatmap.append("g")
|
|
||||||
.attr("class", "status-heatmap-crosshair")
|
|
||||||
.attr("transform", "translate(" + posX + ",0)")
|
|
||||||
.append("line")
|
|
||||||
.attr("x1", 1)
|
|
||||||
.attr("y1", chartTop)
|
|
||||||
.attr("x2", 1)
|
|
||||||
.attr("y2", chartBottom)
|
|
||||||
.attr("stroke-width", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// map time to X
|
|
||||||
function drawSharedCrosshair(pos) {
|
|
||||||
if (heatmap && ctrl.dashboard.graphTooltip !== 0) {
|
|
||||||
let posX = xScale(pos.x) + yAxisWidth;
|
|
||||||
drawCrosshair(posX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearCrosshair() {
|
|
||||||
if (heatmap) {
|
|
||||||
heatmap.selectAll(".status-heatmap-crosshair").remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function render() {
|
|
||||||
data = ctrl.data;
|
|
||||||
panel = ctrl.panel;
|
|
||||||
timeRange = ctrl.range;
|
|
||||||
cardsData = ctrl.cardsData;
|
|
||||||
|
|
||||||
if (!data || !cardsData || !setElementHeight()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw default axes and return if no data
|
|
||||||
if (_.isEmpty(cardsData.cards)) {
|
|
||||||
addHeatmapCanvas();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
addHeatmap();
|
|
||||||
scope.yAxisWidth = yAxisWidth;
|
|
||||||
scope.xAxisHeight = xAxisHeight;
|
|
||||||
scope.chartHeight = chartHeight;
|
|
||||||
scope.chartWidth = chartWidth;
|
|
||||||
scope.chartTop = chartTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register selection listeners
|
|
||||||
$heatmap.on("mousedown", onMouseDown);
|
|
||||||
$heatmap.on("mousemove", onMouseMove);
|
|
||||||
$heatmap.on("mouseleave", onMouseLeave);
|
|
||||||
|
|
||||||
function _renderAnnotations() {
|
|
||||||
if (!ctrl.annotations || ctrl.annotations.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!heatmap) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let annoData = _.map(ctrl.annotations, (d,i) => ({"x": Math.floor(yAxisWidth + xScale(d.time)), "id":i, "anno": d.source}));
|
|
||||||
|
|
||||||
|
|
||||||
let anno = heatmap
|
|
||||||
.append("g")
|
|
||||||
.attr("class", "statusmap-annotations")
|
|
||||||
.attr("transform", "translate(0.5,0)")
|
|
||||||
.selectAll(".statusmap-annotations")
|
|
||||||
.data(annoData)
|
|
||||||
.enter().append("g")
|
|
||||||
;
|
|
||||||
anno.append("line")
|
|
||||||
//.attr("class", "statusmap-annotation-tick")
|
|
||||||
.attr("x1", d => d.x)
|
|
||||||
.attr("y1", chartTop)
|
|
||||||
.attr("x2", d => d.x)
|
|
||||||
.attr("y2", chartBottom)
|
|
||||||
.style("stroke", d => d.anno.iconColor)
|
|
||||||
.style("stroke-width", 1)
|
|
||||||
.style("stroke-dasharray", "3,3")
|
|
||||||
;
|
|
||||||
anno.append("polygon")
|
|
||||||
.attr("points", d => [[d.x, chartBottom+1], [d.x-5, chartBottom+6], [d.x+5, chartBottom+6]].join(" "))
|
|
||||||
.style("stroke-width", 0)
|
|
||||||
.style("fill", d => d.anno.iconColor)
|
|
||||||
;
|
|
||||||
// Polygons didn't fire mouseevents
|
|
||||||
anno.append("rect")
|
|
||||||
.attr("x", d => d.x-5)
|
|
||||||
.attr("width", 10)
|
|
||||||
.attr("y", chartBottom+1)
|
|
||||||
.attr("height", 5)
|
|
||||||
.attr("class", "statusmap-annotation-tick")
|
|
||||||
.attr("annoId", d => d.id)
|
|
||||||
.style("opacity", 0)
|
|
||||||
;
|
|
||||||
|
|
||||||
let $ticks = $heatmap.find(".statusmap-annotation-tick");
|
|
||||||
$ticks.on("mouseenter", (event) => {
|
|
||||||
annotationTooltip.mouseOverAnnotationTick = true;
|
|
||||||
})
|
|
||||||
.on("mouseleave", (event) => {
|
|
||||||
annotationTooltip.mouseOverAnnotationTick = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function grafanaTimeFormat(ticks, min, max) {
|
|
||||||
if (min && max && ticks) {
|
|
||||||
let range = max - min;
|
|
||||||
let secPerTick = (range/ticks) / 1000;
|
|
||||||
let oneDay = 86400000;
|
|
||||||
let oneYear = 31536000000;
|
|
||||||
|
|
||||||
if (secPerTick <= 45) {
|
|
||||||
return "%H:%M:%S";
|
|
||||||
}
|
|
||||||
if (secPerTick <= 7200 || range <= oneDay) {
|
|
||||||
return "%H:%M";
|
|
||||||
}
|
|
||||||
if (secPerTick <= 80000) {
|
|
||||||
return "%m/%d %H:%M";
|
|
||||||
}
|
|
||||||
if (secPerTick <= 2419200 || range <= oneYear) {
|
|
||||||
return "%m/%d";
|
|
||||||
}
|
|
||||||
return "%Y-%m";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "%H:%M";
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,812 @@
|
|||||||
|
import _ from 'lodash';
|
||||||
|
import $ from 'jquery';
|
||||||
|
import moment from 'moment';
|
||||||
|
import kbn from 'app/core/utils/kbn';
|
||||||
|
import {appEvents, contextSrv} from 'app/core/core';
|
||||||
|
import {tickStep, getScaledDecimals, getFlotTickSize} from 'app/core/utils/ticks';
|
||||||
|
import * as d3 from 'd3';
|
||||||
|
import * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';
|
||||||
|
import {StatusmapTooltip} from './tooltip';
|
||||||
|
import {AnnotationTooltip} from './annotations';
|
||||||
|
|
||||||
|
let MIN_CARD_SIZE = 5,
|
||||||
|
CARD_H_SPACING = 2,
|
||||||
|
CARD_V_SPACING = 2,
|
||||||
|
CARD_ROUND = 0,
|
||||||
|
DATA_RANGE_WIDING_FACTOR = 1.2,
|
||||||
|
DEFAULT_X_TICK_SIZE_PX = 100,
|
||||||
|
DEFAULT_Y_TICK_SIZE_PX = 50,
|
||||||
|
X_AXIS_TICK_PADDING = 10,
|
||||||
|
Y_AXIS_TICK_PADDING = 5,
|
||||||
|
MIN_SELECTION_WIDTH = 2;
|
||||||
|
|
||||||
|
export default function rendering(scope: any, elem: any, attrs: any, ctrl: any) {
|
||||||
|
return new StatusmapRenderer(scope, elem, attrs, ctrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StatusmapRenderer {
|
||||||
|
width: number = 0;
|
||||||
|
height: number = 0;
|
||||||
|
yScale: any;
|
||||||
|
xScale: any;
|
||||||
|
chartWidth: number = 0;
|
||||||
|
chartHeight: number = 0;
|
||||||
|
chartTop: number = 0;
|
||||||
|
chartBottom: number = 0;
|
||||||
|
yAxisWidth: number = 0;
|
||||||
|
xAxisHeight: number = 0;
|
||||||
|
cardVSpacing: number = 0;
|
||||||
|
cardHSpacing: number = 0;
|
||||||
|
cardRound: number = 0;
|
||||||
|
cardWidth: number = 0;
|
||||||
|
cardHeight: number = 0;
|
||||||
|
colorScale: any;
|
||||||
|
opacityScale: any;
|
||||||
|
mouseUpHandler: any;
|
||||||
|
xGridSize: number = 0;
|
||||||
|
yGridSize: number = 0;
|
||||||
|
data: any;
|
||||||
|
cardsData: any;
|
||||||
|
panel: any;
|
||||||
|
$heatmap: any;
|
||||||
|
tooltip: StatusmapTooltip;
|
||||||
|
annotationTooltip: AnnotationTooltip;
|
||||||
|
heatmap: any;
|
||||||
|
timeRange: any;
|
||||||
|
|
||||||
|
yOffset: number;
|
||||||
|
selection: any;
|
||||||
|
padding: any;
|
||||||
|
margin: any;
|
||||||
|
dataRangeWidingFactor: number = DATA_RANGE_WIDING_FACTOR;
|
||||||
|
|
||||||
|
constructor(private scope: any, private elem: any, attrs: any, private ctrl: any) {
|
||||||
|
// $heatmap is JQuery object, but heatmap is D3
|
||||||
|
this.$heatmap = this.elem.find('.status-heatmap-panel');
|
||||||
|
this.tooltip = new StatusmapTooltip(this.$heatmap, this.scope);
|
||||||
|
this.annotationTooltip = new AnnotationTooltip(this.$heatmap, this.scope);
|
||||||
|
|
||||||
|
this.yOffset = 0;
|
||||||
|
|
||||||
|
this.selection = {
|
||||||
|
active: false,
|
||||||
|
x1: -1,
|
||||||
|
x2: -1,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.padding = { left: 0, right: 0, top: 0, bottom: 0 };
|
||||||
|
this.margin = { left: 25, right: 15, top: 10, bottom: 20 };
|
||||||
|
|
||||||
|
this.ctrl.events.on('render', this.onRender.bind(this));
|
||||||
|
|
||||||
|
this.ctrl.tickValueFormatter = this.tickValueFormatter.bind(this);
|
||||||
|
|
||||||
|
/////////////////////////////
|
||||||
|
// Selection and crosshair //
|
||||||
|
/////////////////////////////
|
||||||
|
|
||||||
|
// Shared crosshair and tooltip
|
||||||
|
appEvents.on('graph-hover', this.onGraphHover.bind(this), this.scope);
|
||||||
|
|
||||||
|
appEvents.on('graph-hover-clear', this.onGraphHoverClear.bind(this), this.scope);
|
||||||
|
|
||||||
|
// Register selection listeners
|
||||||
|
this.$heatmap.on('mousedown', this.onMouseDown.bind(this));
|
||||||
|
this.$heatmap.on('mousemove', this.onMouseMove.bind(this));
|
||||||
|
this.$heatmap.on('mouseleave', this.onMouseLeave.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
onGraphHoverClear() {
|
||||||
|
this.clearCrosshair();
|
||||||
|
}
|
||||||
|
|
||||||
|
onGraphHover(event: { pos: any }) {
|
||||||
|
this.drawSharedCrosshair(event.pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
onRender() {
|
||||||
|
this.render();
|
||||||
|
this.ctrl.renderingCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setElementHeight() {
|
||||||
|
try {
|
||||||
|
var height = this.ctrl.height || this.panel.height || this.ctrl.row.height;
|
||||||
|
if (_.isString(height)) {
|
||||||
|
height = parseInt(height.replace('px', ''), 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
height -= this.panel.legend.show ? 32 : 10; // bottom padding and space for legend. Change margin in .status-heatmap-color-legend !
|
||||||
|
|
||||||
|
this.$heatmap.css('height', height + 'px');
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (e) { // IE throws errors sometimes
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getYAxisWidth(elem: any) {
|
||||||
|
const axisText = elem.selectAll(".axis-y text").nodes();
|
||||||
|
const maxTextWidth = _.max(_.map(axisText, text => {
|
||||||
|
// Use SVG getBBox method
|
||||||
|
return text.getBBox().width;
|
||||||
|
}));
|
||||||
|
|
||||||
|
return Math.ceil(maxTextWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
getXAxisHeight(elem: any) {
|
||||||
|
let axisLine = elem.select(".axis-x line");
|
||||||
|
if (!axisLine.empty()) {
|
||||||
|
let axisLinePosition = parseFloat(elem.select(".axis-x line").attr("y2"));
|
||||||
|
let canvasWidth = parseFloat(elem.attr("height"));
|
||||||
|
return canvasWidth - axisLinePosition;
|
||||||
|
} else {
|
||||||
|
// Default height
|
||||||
|
return 30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addXAxis() {
|
||||||
|
// Scale timestamps to cards centers
|
||||||
|
this.scope.xScale = this.xScale = d3.scaleTime()
|
||||||
|
.domain([this.timeRange.from, this.timeRange.to])
|
||||||
|
.range([this.xGridSize/2, this.chartWidth-this.xGridSize/2]);
|
||||||
|
|
||||||
|
let ticks = this.chartWidth / DEFAULT_X_TICK_SIZE_PX;
|
||||||
|
let grafanaTimeFormatter = grafanaTimeFormat(ticks, this.timeRange.from, this.timeRange.to);
|
||||||
|
let timeFormat;
|
||||||
|
let dashboardTimeZone = this.ctrl.dashboard.getTimezone();
|
||||||
|
if (dashboardTimeZone === 'utc') {
|
||||||
|
timeFormat = d3.utcFormat(grafanaTimeFormatter);
|
||||||
|
} else {
|
||||||
|
timeFormat = d3.timeFormat(grafanaTimeFormatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
let xAxis = d3
|
||||||
|
.axisBottom(this.xScale)
|
||||||
|
.ticks(ticks)
|
||||||
|
.tickFormat(timeFormat)
|
||||||
|
.tickPadding(X_AXIS_TICK_PADDING)
|
||||||
|
.tickSize(this.chartHeight);
|
||||||
|
|
||||||
|
let posY = this.chartTop; // this.margin.top !
|
||||||
|
let posX = this.yAxisWidth;
|
||||||
|
|
||||||
|
this.heatmap.append("g")
|
||||||
|
.attr("class", "axis axis-x")
|
||||||
|
.attr("transform", "translate(" + posX + "," + posY + ")")
|
||||||
|
.call(xAxis);
|
||||||
|
|
||||||
|
// Remove horizontal line in the top of axis labels (called domain in d3)
|
||||||
|
this.heatmap
|
||||||
|
.select(".axis-x")
|
||||||
|
.select(".domain")
|
||||||
|
.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// divide chart height by ticks for cards drawing
|
||||||
|
getYScale(ticks) {
|
||||||
|
let range:any[] = [];
|
||||||
|
let step = this.chartHeight / ticks.length;
|
||||||
|
// svg has y=0 on the top, so top card should have a minimal value in range
|
||||||
|
range.push(step);
|
||||||
|
for (let i = 1; i < ticks.length; i++) {
|
||||||
|
range.push(step * (i+1));
|
||||||
|
}
|
||||||
|
return d3.scaleOrdinal()
|
||||||
|
.domain(ticks)
|
||||||
|
.range(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
// divide chart height by ticks with offset for ticks drawing
|
||||||
|
getYAxisScale(ticks) {
|
||||||
|
let range:any[] = [];
|
||||||
|
let step = this.chartHeight / ticks.length;
|
||||||
|
// svg has y=0 on the top, so top tick should have a minimal value in range
|
||||||
|
range.push(this.yOffset);
|
||||||
|
for (let i = 1; i < ticks.length; i++) {
|
||||||
|
range.push(step * i + this.yOffset);
|
||||||
|
}
|
||||||
|
return d3.scaleOrdinal()
|
||||||
|
.domain(ticks)
|
||||||
|
.range(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
addYAxis() {
|
||||||
|
let ticks = _.uniq(_.map(this.data, d => d.target));
|
||||||
|
|
||||||
|
// Set default Y min and max if no data
|
||||||
|
if (_.isEmpty(this.data)) {
|
||||||
|
ticks = [''];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.panel.yAxisSort == 'a → z') {
|
||||||
|
ticks.sort((a, b) => a.localeCompare(b, 'en', {ignorePunctuation: false, numeric: true}));
|
||||||
|
} else if (this.panel.yAxisSort == 'z → a') {
|
||||||
|
ticks.sort((b, a) => a.localeCompare(b, 'en', {ignorePunctuation: false, numeric: true}));
|
||||||
|
}
|
||||||
|
|
||||||
|
let yAxisScale = this.getYAxisScale(ticks);
|
||||||
|
this.scope.yScale = this.yScale = this.getYScale(ticks);
|
||||||
|
|
||||||
|
let yAxis = d3
|
||||||
|
.axisLeft(yAxisScale)
|
||||||
|
.tickValues(ticks)
|
||||||
|
.tickSizeInner(0 - this.width)
|
||||||
|
.tickPadding(Y_AXIS_TICK_PADDING);
|
||||||
|
|
||||||
|
this.heatmap
|
||||||
|
.append("g")
|
||||||
|
.attr("class", "axis axis-y")
|
||||||
|
.call(yAxis);
|
||||||
|
|
||||||
|
// Calculate Y axis width first, then move axis into visible area
|
||||||
|
let posY = this.margin.top;
|
||||||
|
let posX = this.getYAxisWidth(this.heatmap) + Y_AXIS_TICK_PADDING;
|
||||||
|
this.heatmap.select(".axis-y").attr("transform", "translate(" + posX + "," + posY + ")");
|
||||||
|
|
||||||
|
// Remove vertical line in the right of axis labels (called domain in d3)
|
||||||
|
this.heatmap.select(".axis-y").select(".domain").remove();
|
||||||
|
this.heatmap.select(".axis-y").selectAll(".tick line").remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wide Y values range and adjust to bucket size
|
||||||
|
wideYAxisRange(min, max, tickInterval) {
|
||||||
|
let y_widing = (max * (this.dataRangeWidingFactor - 1) - min * (this.dataRangeWidingFactor - 1)) / 2;
|
||||||
|
let y_min, y_max;
|
||||||
|
|
||||||
|
if (tickInterval === 0) {
|
||||||
|
y_max = max * this.dataRangeWidingFactor;
|
||||||
|
y_min = min - min * (this.dataRangeWidingFactor - 1);
|
||||||
|
tickInterval = (y_max - y_min) / 2;
|
||||||
|
} else {
|
||||||
|
y_max = Math.ceil((max + y_widing) / tickInterval) * tickInterval;
|
||||||
|
y_min = Math.floor((min - y_widing) / tickInterval) * tickInterval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't wide axis below 0 if all values are positive
|
||||||
|
if (min >= 0 && y_min < 0) {
|
||||||
|
y_min = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {y_min, y_max};
|
||||||
|
}
|
||||||
|
|
||||||
|
tickValueFormatter(decimals, scaledDecimals = null) {
|
||||||
|
let format = this.panel.yAxis.format;
|
||||||
|
return function(value) {
|
||||||
|
return kbn.valueFormats[format](value, decimals, scaledDecimals);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create svg element, add axes and
|
||||||
|
// calculate sizes for cards drawing
|
||||||
|
addHeatmapCanvas() {
|
||||||
|
let heatmap_elem = this.$heatmap[0];
|
||||||
|
|
||||||
|
this.width = Math.floor(this.$heatmap.width()) - this.padding.right;
|
||||||
|
this.height = Math.floor(this.$heatmap.height()) - this.padding.bottom;
|
||||||
|
|
||||||
|
if (this.heatmap) {
|
||||||
|
this.heatmap.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.heatmap = d3.select(heatmap_elem)
|
||||||
|
.append("svg")
|
||||||
|
.attr("width", this.width)
|
||||||
|
.attr("height", this.height);
|
||||||
|
|
||||||
|
this.chartHeight = this.height - this.margin.top - this.margin.bottom;
|
||||||
|
this.chartTop = this.margin.top;
|
||||||
|
this.chartBottom = this.chartTop + this.chartHeight;
|
||||||
|
|
||||||
|
this.cardHSpacing = this.panel.cards.cardHSpacing !== null ? this.panel.cards.cardHSpacing : CARD_H_SPACING;
|
||||||
|
this.cardVSpacing = this.panel.cards.cardVSpacing !== null ? this.panel.cards.cardVSpacing : CARD_V_SPACING;
|
||||||
|
this.cardRound = this.panel.cards.cardRound !== null ? this.panel.cards.cardRound : CARD_ROUND;
|
||||||
|
|
||||||
|
// calculate yOffset for YAxis
|
||||||
|
this.yGridSize = Math.floor(this.chartHeight / this.cardsData.yBucketSize);
|
||||||
|
this.cardHeight = this.yGridSize ? this.yGridSize - this.cardVSpacing : 0;
|
||||||
|
this.yOffset = this.cardHeight / 2;
|
||||||
|
|
||||||
|
this.addYAxis();
|
||||||
|
|
||||||
|
this.yAxisWidth = this.getYAxisWidth(this.heatmap) + Y_AXIS_TICK_PADDING;
|
||||||
|
this.chartWidth = this.width - this.yAxisWidth - this.margin.right;
|
||||||
|
|
||||||
|
// TODO allow per-y cardWidth!
|
||||||
|
// we need to fill chartWidth with xBucketSize cards.
|
||||||
|
this.xGridSize = this.chartWidth / (this.cardsData.xBucketSize+1);
|
||||||
|
this.cardWidth = this.xGridSize - this.cardHSpacing;
|
||||||
|
|
||||||
|
this.addXAxis();
|
||||||
|
this.xAxisHeight = this.getXAxisHeight(this.heatmap);
|
||||||
|
|
||||||
|
if (!this.panel.yAxis.show) {
|
||||||
|
this.heatmap.select(".axis-y").selectAll("line").style("opacity", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.panel.xAxis.show) {
|
||||||
|
this.heatmap.select(".axis-x").selectAll("line").style("opacity", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addHeatmap() {
|
||||||
|
this.addHeatmapCanvas();
|
||||||
|
|
||||||
|
let maxValue = this.panel.color.max || this.cardsData.maxValue;
|
||||||
|
let minValue = this.panel.color.min || this.cardsData.minValue;
|
||||||
|
|
||||||
|
if (this.panel.color.mode !== 'discrete') {
|
||||||
|
this.colorScale = this.getColorScale(maxValue, minValue);
|
||||||
|
}
|
||||||
|
this.setOpacityScale(maxValue);
|
||||||
|
|
||||||
|
let cards = this.heatmap.selectAll(".status-heatmap-card").data(this.cardsData.cards);
|
||||||
|
cards.append("title");
|
||||||
|
cards = cards.enter().append("rect")
|
||||||
|
.attr("cardId", c => c.id)
|
||||||
|
.attr("x", this.getCardX.bind(this))
|
||||||
|
.attr("width", this.getCardWidth.bind(this))
|
||||||
|
.attr("y", this.getCardY.bind(this))
|
||||||
|
.attr("height", this.getCardHeight.bind(this))
|
||||||
|
.attr("rx", this.cardRound)
|
||||||
|
.attr("ry", this.cardRound)
|
||||||
|
.attr("class", "bordered status-heatmap-card")
|
||||||
|
.style("fill", this.getCardColor.bind(this))
|
||||||
|
.style("stroke", this.getCardColor.bind(this))
|
||||||
|
.style("stroke-width", 0)
|
||||||
|
//.style("stroke-width", getCardStrokeWidth)
|
||||||
|
//.style("stroke-dasharray", "3,3")
|
||||||
|
.style("opacity", this.getCardOpacity.bind(this));
|
||||||
|
|
||||||
|
let $cards = this.$heatmap.find(".status-heatmap-card");
|
||||||
|
$cards
|
||||||
|
.on("mouseenter", (event) => {
|
||||||
|
this.tooltip.mouseOverBucket = true;
|
||||||
|
this.highlightCard(event);
|
||||||
|
})
|
||||||
|
.on("mouseleave", (event) => {
|
||||||
|
this.tooltip.mouseOverBucket = false;
|
||||||
|
this.resetCardHighLight(event);
|
||||||
|
});
|
||||||
|
|
||||||
|
this._renderAnnotations();
|
||||||
|
|
||||||
|
this.ctrl.events.emit('render-complete', {
|
||||||
|
"chartWidth": this.chartWidth
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
highlightCard(event) {
|
||||||
|
const color = d3.select(event.target).style("fill");
|
||||||
|
const highlightColor = d3.color(color).darker(2);
|
||||||
|
const strokeColor = d3.color(color).brighter(4);
|
||||||
|
const current_card = d3.select(event.target);
|
||||||
|
this.tooltip.originalFillColor = color;
|
||||||
|
current_card
|
||||||
|
.style("fill", highlightColor.toString())
|
||||||
|
.style("stroke", strokeColor.toString())
|
||||||
|
.style("stroke-width", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
resetCardHighLight(event) {
|
||||||
|
d3.select(event.target)
|
||||||
|
.style("fill", this.tooltip.originalFillColor)
|
||||||
|
.style("stroke", this.tooltip.originalFillColor)
|
||||||
|
.style("stroke-width", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
getColorScale(maxValue, minValue = 0) {
|
||||||
|
let colorScheme = _.find(this.ctrl.colorSchemes, {value: this.panel.color.colorScheme});
|
||||||
|
// if (!colorScheme) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
let colorInterpolator = d3ScaleChromatic[colorScheme.value];
|
||||||
|
let colorScaleInverted = colorScheme.invert === 'always' ||
|
||||||
|
(colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);
|
||||||
|
|
||||||
|
if (maxValue == minValue)
|
||||||
|
maxValue = minValue + 1;
|
||||||
|
|
||||||
|
let start = colorScaleInverted ? maxValue : minValue;
|
||||||
|
let end = colorScaleInverted ? minValue : maxValue;
|
||||||
|
|
||||||
|
return d3.scaleSequential(colorInterpolator).domain([start, end]);
|
||||||
|
}
|
||||||
|
|
||||||
|
setOpacityScale(maxValue) {
|
||||||
|
if (this.panel.color.colorScale === 'linear') {
|
||||||
|
this.opacityScale = d3.scaleLinear()
|
||||||
|
.domain([0, maxValue])
|
||||||
|
.range([0, 1]);
|
||||||
|
} else if (this.panel.color.colorScale === 'sqrt') {
|
||||||
|
this.opacityScale = d3.scalePow().exponent(this.panel.color.exponent)
|
||||||
|
.domain([0, maxValue])
|
||||||
|
.range([0, 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardX(d) {
|
||||||
|
let x;
|
||||||
|
// cx is the center of the card. Card should be placed to the left.
|
||||||
|
let cx = this.xScale(d.x);
|
||||||
|
|
||||||
|
if (cx - this.cardWidth/2 < 0) {
|
||||||
|
x = this.yAxisWidth + this.cardHSpacing/2;
|
||||||
|
} else {
|
||||||
|
x = this.yAxisWidth + cx - this.cardWidth/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
// xScale returns card center. Adjust cardWidth in case of overlaping.
|
||||||
|
getCardWidth(d) {
|
||||||
|
let w;
|
||||||
|
let cx = this.xScale(d.x);
|
||||||
|
|
||||||
|
if (cx < this.cardWidth/2) {
|
||||||
|
// Center should not exceed half of card.
|
||||||
|
// Cut card to the left to prevent overlay of y axis.
|
||||||
|
let cutted_width = (cx - this.cardHSpacing/2) + this.cardWidth/2;
|
||||||
|
w = cutted_width > 0 ? cutted_width : 0;
|
||||||
|
} else if (this.chartWidth - cx < this.cardWidth/2) {
|
||||||
|
// Cut card to the right to prevent overlay of right graph edge.
|
||||||
|
w = this.cardWidth/2 + (this.chartWidth - cx - this.cardHSpacing/2);
|
||||||
|
} else {
|
||||||
|
w = this.cardWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Card width should be MIN_CARD_SIZE at least
|
||||||
|
w = Math.max(w, MIN_CARD_SIZE);
|
||||||
|
|
||||||
|
if (this.cardHSpacing == 0) {
|
||||||
|
w = w+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardY(d) {
|
||||||
|
return this.yScale(d.y) + this.chartTop - this.cardHeight - this.cardVSpacing/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardHeight(d) {
|
||||||
|
let ys = this.yScale(d.y);
|
||||||
|
let y = ys + this.chartTop - this.cardHeight - this.cardVSpacing/2;
|
||||||
|
let h = this.cardHeight;
|
||||||
|
|
||||||
|
// Cut card height to prevent overlay
|
||||||
|
if (y < this.chartTop) {
|
||||||
|
h = ys - this.cardVSpacing/2;
|
||||||
|
} else if (ys > this.chartBottom) {
|
||||||
|
h = this.chartBottom - y;
|
||||||
|
} else if (y + this.cardHeight > this.chartBottom) {
|
||||||
|
h = this.chartBottom - y;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Height can't be more than chart height
|
||||||
|
h = Math.min(h, this.chartHeight);
|
||||||
|
// Card height should be MIN_CARD_SIZE at least
|
||||||
|
h = Math.max(h, MIN_CARD_SIZE);
|
||||||
|
|
||||||
|
if (this.cardVSpacing == 0) {
|
||||||
|
h = h+1
|
||||||
|
}
|
||||||
|
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardColor(d) {
|
||||||
|
if (this.panel.color.mode === 'opacity') {
|
||||||
|
return this.panel.color.cardColor;
|
||||||
|
} else if (this.panel.color.mode === 'spectrum') {
|
||||||
|
return this.colorScale(d.value);
|
||||||
|
} else if (this.panel.color.mode === 'discrete') {
|
||||||
|
return this.ctrl.discreteHelper.getBucketColor(d.values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardOpacity(d) {
|
||||||
|
if (this.panel.nullPointMode === 'as empty' && d.value == null ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (this.panel.color.mode === 'opacity') {
|
||||||
|
return this.opacityScale(d.value);
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getCardStrokeWidth(d) {
|
||||||
|
if (this.panel.color.mode === 'discrete') {
|
||||||
|
return '1';
|
||||||
|
}
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////
|
||||||
|
// Selection and crosshair //
|
||||||
|
/////////////////////////////
|
||||||
|
|
||||||
|
getEventOffset(event) {
|
||||||
|
const elemOffset = this.$heatmap.offset();
|
||||||
|
const x = Math.floor(event.clientX - elemOffset.left);
|
||||||
|
const y = Math.floor(event.clientY - elemOffset.top);
|
||||||
|
return { x, y };
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseDown(event) {
|
||||||
|
const offset = this.getEventOffset(event);
|
||||||
|
this.selection.active = true;
|
||||||
|
this.selection.x1 = offset.x;
|
||||||
|
|
||||||
|
this.mouseUpHandler = () => {
|
||||||
|
this.onMouseUp();
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).one("mouseup", this.mouseUpHandler.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseUp() {
|
||||||
|
$(document).unbind("mouseup", this.mouseUpHandler.bind(this));
|
||||||
|
this.mouseUpHandler = null;
|
||||||
|
this.selection.active = false;
|
||||||
|
|
||||||
|
let selectionRange = Math.abs(this.selection.x2 - this.selection.x1);
|
||||||
|
if (this.selection.x2 >= 0 && selectionRange > MIN_SELECTION_WIDTH) {
|
||||||
|
let timeFrom = this.xScale.invert(Math.min(this.selection.x1, this.selection.x2) - this.yAxisWidth - this.xGridSize/2);
|
||||||
|
let timeTo = this.xScale.invert(Math.max(this.selection.x1, this.selection.x2) - this.yAxisWidth - this.xGridSize/2);
|
||||||
|
|
||||||
|
this.ctrl.timeSrv.setTime({
|
||||||
|
from: moment.utc(timeFrom),
|
||||||
|
to: moment.utc(timeTo)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseLeave() {
|
||||||
|
appEvents.emit('graph-hover-clear');
|
||||||
|
this.clearCrosshair();
|
||||||
|
//annotationTooltip.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseMove(event) {
|
||||||
|
if (!this.heatmap) { return; }
|
||||||
|
|
||||||
|
const offset = this.getEventOffset(event);
|
||||||
|
if (this.selection.active) {
|
||||||
|
// Clear crosshair and tooltip
|
||||||
|
this.clearCrosshair();
|
||||||
|
this.tooltip.destroy();
|
||||||
|
this.annotationTooltip.destroy();
|
||||||
|
|
||||||
|
this.selection.x2 = this.limitSelection(event.offsetX);
|
||||||
|
this.drawSelection(this.selection.x1, this.selection.x2);
|
||||||
|
} else {
|
||||||
|
//const pos = this.getEventPos(event, offset);
|
||||||
|
this.emitGraphHoverEvent(event);
|
||||||
|
this.drawCrosshair(offset.x);
|
||||||
|
this.tooltip.show(event); //, data); // pos, this.data
|
||||||
|
this.annotationTooltip.show(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getEventPos(event, offset) {
|
||||||
|
const x = this.xScale.invert(offset.x - this.yAxisWidth).valueOf();
|
||||||
|
const y = this.yScale.invert(offset.y - this.chartTop);
|
||||||
|
const pos = {
|
||||||
|
pageX: event.pageX,
|
||||||
|
pageY: event.pageY,
|
||||||
|
x: x,
|
||||||
|
x1: x,
|
||||||
|
y: y,
|
||||||
|
y1: y,
|
||||||
|
panelRelY: null,
|
||||||
|
offset,
|
||||||
|
};
|
||||||
|
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
emitGraphHoverEvent(event) {
|
||||||
|
let x = this.xScale.invert(event.offsetX - this.yAxisWidth - this.xGridSize/2).valueOf();
|
||||||
|
let y = this.yScale(event.offsetY);
|
||||||
|
let pos = {
|
||||||
|
pageX: event.pageX,
|
||||||
|
pageY: event.pageY,
|
||||||
|
x: x, x1: x,
|
||||||
|
y: y, y1: y,
|
||||||
|
panelRelY: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set minimum offset to prevent showing legend from another panel
|
||||||
|
pos.panelRelY = Math.max(event.offsetY / this.height, 0.001);
|
||||||
|
|
||||||
|
// broadcast to other graph panels that we are hovering
|
||||||
|
appEvents.emit('graph-hover', {pos: pos, panel: this.panel});
|
||||||
|
}
|
||||||
|
|
||||||
|
limitSelection(x2) {
|
||||||
|
x2 = Math.max(x2, this.yAxisWidth);
|
||||||
|
x2 = Math.min(x2, this.chartWidth + this.yAxisWidth);
|
||||||
|
return x2;
|
||||||
|
}
|
||||||
|
|
||||||
|
drawSelection(posX1, posX2) {
|
||||||
|
if (this.heatmap) {
|
||||||
|
this.heatmap.selectAll(".status-heatmap-selection").remove();
|
||||||
|
let selectionX = Math.min(posX1, posX2);
|
||||||
|
let selectionWidth = Math.abs(posX1 - posX2);
|
||||||
|
|
||||||
|
if (selectionWidth > MIN_SELECTION_WIDTH) {
|
||||||
|
this.heatmap.append("rect")
|
||||||
|
.attr("class", "status-heatmap-selection")
|
||||||
|
.attr("x", selectionX)
|
||||||
|
.attr("width", selectionWidth)
|
||||||
|
.attr("y", this.chartTop)
|
||||||
|
.attr("height", this.chartHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clearSelection() {
|
||||||
|
this.selection.x1 = -1;
|
||||||
|
this.selection.x2 = -1;
|
||||||
|
|
||||||
|
if (this.heatmap) {
|
||||||
|
this.heatmap.selectAll(".status-heatmap-selection").remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
drawCrosshair(position) {
|
||||||
|
if (this.heatmap) {
|
||||||
|
this.heatmap.selectAll(".status-heatmap-crosshair").remove();
|
||||||
|
|
||||||
|
let posX = position;
|
||||||
|
posX = Math.max(posX, this.yAxisWidth);
|
||||||
|
posX = Math.min(posX, this.chartWidth + this.yAxisWidth);
|
||||||
|
|
||||||
|
this.heatmap.append("g")
|
||||||
|
.attr("class", "status-heatmap-crosshair")
|
||||||
|
.attr("transform", "translate(" + posX + ",0)")
|
||||||
|
.append("line")
|
||||||
|
.attr("x1", 1)
|
||||||
|
.attr("y1", this.chartTop)
|
||||||
|
.attr("x2", 1)
|
||||||
|
.attr("y2", this.chartBottom)
|
||||||
|
.attr("stroke-width", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// map time to X
|
||||||
|
drawSharedCrosshair(pos) {
|
||||||
|
if (this.heatmap && this.ctrl.dashboard.graphTooltip !== 0) {
|
||||||
|
const posX = this.xScale(pos.x) + this.yAxisWidth;
|
||||||
|
this.drawCrosshair(posX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clearCrosshair() {
|
||||||
|
if (this.heatmap) {
|
||||||
|
this.heatmap.selectAll(".status-heatmap-crosshair").remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
render() {
|
||||||
|
this.data = this.ctrl.data;
|
||||||
|
this.panel = this.ctrl.panel;
|
||||||
|
this.timeRange = this.ctrl.range;
|
||||||
|
this.cardsData = this.ctrl.cardsData;
|
||||||
|
|
||||||
|
if (!this.data || !this.cardsData || !this.setElementHeight()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw default axes and return if no data
|
||||||
|
if (_.isEmpty(this.cardsData.cards)) {
|
||||||
|
this.addHeatmapCanvas();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addHeatmap();
|
||||||
|
this.scope.yAxisWidth = this.yAxisWidth;
|
||||||
|
this.scope.xAxisHeight = this.xAxisHeight;
|
||||||
|
this.scope.chartHeight = this.chartHeight;
|
||||||
|
this.scope.chartWidth = this.chartWidth;
|
||||||
|
this.scope.chartTop = this.chartTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
_renderAnnotations() {
|
||||||
|
if (!this.ctrl.annotations || this.ctrl.annotations.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.heatmap) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let annoData = _.map(this.ctrl.annotations, (d,i) => ({"x": Math.floor(this.yAxisWidth + this.xScale(d.time)), "id":i, "anno": d.source}));
|
||||||
|
|
||||||
|
//console.log({"ctrl_annotations": this.ctrl.annotations, "annoData": annoData});
|
||||||
|
|
||||||
|
let anno = this.heatmap
|
||||||
|
.append("g")
|
||||||
|
.attr("class", "statusmap-annotations")
|
||||||
|
.attr("transform", "translate(0.5,0)")
|
||||||
|
.selectAll(".statusmap-annotations")
|
||||||
|
.data(annoData)
|
||||||
|
.enter().append("g")
|
||||||
|
;
|
||||||
|
anno.append("line")
|
||||||
|
//.attr("class", "statusmap-annotation-tick")
|
||||||
|
.attr("x1", d => d.x)
|
||||||
|
.attr("y1", this.chartTop)
|
||||||
|
.attr("x2", d => d.x)
|
||||||
|
.attr("y2", this.chartBottom)
|
||||||
|
.style("stroke", d => d.anno.iconColor)
|
||||||
|
.style("stroke-width", 1)
|
||||||
|
.style("stroke-dasharray", "3,3")
|
||||||
|
;
|
||||||
|
anno.append("polygon")
|
||||||
|
.attr("points", d => [[d.x, this.chartBottom+1], [d.x-5, this.chartBottom+6], [d.x+5, this.chartBottom+6]].join(" "))
|
||||||
|
.style("stroke-width", 0)
|
||||||
|
.style("fill", d => d.anno.iconColor)
|
||||||
|
;
|
||||||
|
// Polygons didn't fire mouseevents
|
||||||
|
anno.append("rect")
|
||||||
|
.attr("x", d => d.x-5)
|
||||||
|
.attr("width", 10)
|
||||||
|
.attr("y", this.chartBottom+1)
|
||||||
|
.attr("height", 5)
|
||||||
|
.attr("class", "statusmap-annotation-tick")
|
||||||
|
.attr("annoId", d => d.id)
|
||||||
|
.style("opacity", 0)
|
||||||
|
;
|
||||||
|
|
||||||
|
let $ticks = this.$heatmap.find(".statusmap-annotation-tick");
|
||||||
|
$ticks
|
||||||
|
.on("mouseenter", (event) => {
|
||||||
|
this.annotationTooltip.mouseOverAnnotationTick = true;
|
||||||
|
})
|
||||||
|
.on("mouseleave", (event) => {
|
||||||
|
this.annotationTooltip.mouseOverAnnotationTick = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function grafanaTimeFormat(ticks, min, max) {
|
||||||
|
if (min && max && ticks) {
|
||||||
|
let range = max - min;
|
||||||
|
let secPerTick = (range/ticks) / 1000;
|
||||||
|
let oneDay = 86400000;
|
||||||
|
let oneYear = 31536000000;
|
||||||
|
|
||||||
|
if (secPerTick <= 45) {
|
||||||
|
return "%H:%M:%S";
|
||||||
|
}
|
||||||
|
if (secPerTick <= 7200 || range <= oneDay) {
|
||||||
|
return "%H:%M";
|
||||||
|
}
|
||||||
|
if (secPerTick <= 80000) {
|
||||||
|
return "%m/%d %H:%M";
|
||||||
|
}
|
||||||
|
if (secPerTick <= 2419200 || range <= oneYear) {
|
||||||
|
return "%m/%d";
|
||||||
|
}
|
||||||
|
return "%Y-%m";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "%H:%M";
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// A holder of values
|
||||||
|
class Card {
|
||||||
|
// uniq
|
||||||
|
id: number = 0;
|
||||||
|
// Array of values in this bucket
|
||||||
|
values: any[] = [];
|
||||||
|
// card has multiple values
|
||||||
|
multipleValues: boolean = false;
|
||||||
|
// card has values that has no color
|
||||||
|
noColorDefined: boolean = false;
|
||||||
|
//
|
||||||
|
y: string = "";
|
||||||
|
//
|
||||||
|
x: number = 0;
|
||||||
|
//
|
||||||
|
minValue: number = 0;
|
||||||
|
maxValue: number = 0;
|
||||||
|
value: number = 0;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CardsStorage {
|
||||||
|
cards: Card[] = [];
|
||||||
|
xBucketSize: number = 0;
|
||||||
|
yBucketSize: number = 0;
|
||||||
|
maxValue: number;
|
||||||
|
minValue: number;
|
||||||
|
multipleValues: boolean = false;
|
||||||
|
noColorDefined: boolean = false;
|
||||||
|
targets: string[] = [];
|
||||||
|
targetIndex: any;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.maxValue = 0;
|
||||||
|
this.minValue = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {CardsStorage, Card};
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user