diff --git a/.gitignore b/.gitignore
index af23741..9f06557 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ node_modules
.jshintrc
.idea
.sass-cache
+.tscache
\ No newline at end of file
diff --git a/dist/color_legend.js b/dist/color_legend.js
index 35a4072..a15f3e5 100644
--- a/dist/color_legend.js
+++ b/dist/color_legend.js
@@ -21,7 +21,7 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
legend.selectAll(".status-heatmap-color-legend-rect").data(valuesRange).enter().append("rect") // translate from range space into pixels
// and shift all rectangles to the right by 10
.attr("x", function (d) {
- return d * widthFactor + 10;
+ return (d - rangeFrom) * widthFactor + 10;
}).attr("y", 0) // rectangles are slightly overlaped to prevent gaps
.attr("width", LEGEND_STEP_WIDTH + 1).attr("height", legendHeight).attr("stroke-width", 0).attr("fill", function (d) {
return colorScale(d);
@@ -65,7 +65,7 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
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('.statusmap-panel');
var graphWidthAttr = $heatmap.find('svg').attr("width");
var graphWidth = parseInt(graphWidthAttr); // calculate max width of tooltip and use it as width for each item
@@ -100,8 +100,8 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
return;
}
- var legendValueScale = d3.scaleLinear().domain([0, rangeTo]).range([0, legendWidth]);
- var ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);
+ var legendValueScale = d3.scaleLinear().domain([rangeFrom, rangeTo]).range([0, legendWidth]);
+ var ticks = buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue);
var xAxis = d3.axisBottom(legendValueScale).tickValues(ticks).tickSize(2);
var colorRect = legendElem.find(":first-child");
var posY = getSvgElemHeight(legendElem) + 2;
@@ -252,7 +252,7 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
var ticks = [];
for (var i = 0; i < ticksNum; i++) {
- var current = tickStepSize * i; // Add user-defined min and max if it had been set
+ var current = tickStepSize * i + rangeFrom; // Add user-defined min and max if it had been set
if (isValueCloseTo(minValue, current, tickStepSize)) {
ticks.push(minValue);
@@ -268,7 +268,7 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
ticks.push(maxValue);
}
- ticks.push(tickStepSize * i);
+ ticks.push(current);
}
if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {
@@ -361,12 +361,34 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
return;
}
- if (!_.isEmpty(ctrl.cardsData) && !_.isEmpty(ctrl.cardsData.cards)) {
- var rangeFrom = ctrl.cardsData.minValue;
- var rangeTo = ctrl.cardsData.maxValue;
+ if (ctrl.bucketMatrix) {
+ var rangeFrom = ctrl.bucketMatrix.minValue;
+ var rangeTo = ctrl.bucketMatrix.maxValue;
var maxValue = panel.color.max || rangeTo;
var minValue = panel.color.min || rangeFrom;
+ if (ctrl.bucketMatrix.noDatapoints) {
+ if (!panel.color.max) {
+ rangeTo = maxValue = 100;
+ } else {
+ rangeTo = 100;
+ }
+
+ if (!panel.color.min) {
+ rangeFrom = minValue = 0;
+ } else {
+ rangeFrom = 0;
+ }
+ }
+
+ console.log("legent state:", {
+ rangeFrom: rangeFrom,
+ rangeTo: rangeTo,
+ maxValue: maxValue,
+ minValue: minValue,
+ colorMode: panel.color.mode
+ });
+
if (panel.color.mode === 'spectrum') {
var colorScheme = _.find(ctrl.colorSchemes, {
value: panel.color.colorScheme
diff --git a/dist/color_legend.js.map b/dist/color_legend.js.map
index 1eade9b..6c23cbb 100644
--- a/dist/color_legend.js.map
+++ b/dist/color_legend.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/color_legend.ts"],"names":["drawColorLegend","elem","colorScheme","rangeFrom","rangeTo","maxValue","minValue","legendElem","$","find","legend","d3","select","get","clearLegend","legendWidth","Math","floor","outerWidth","legendHeight","attr","rangeStep","LEGEND_STEP_WIDTH","widthFactor","valuesRange","range","colorScale","getColorScale","selectAll","data","enter","append","d","drawLegendValues","drawOpacityLegend","options","opacityScale","getOpacityScale","cardColor","style","drawDiscreteColorLegend","colorOptions","discreteExtraSeries","thresholds","tooltips","_","map","tr","tooltip","valuesNumber","length","$heatmap","parent","graphWidthAttr","graphWidth","parseInt","textWidth","text","each","i","thisWidth","getBBox","width","push","remove","min","max","itemWidth","getDiscreteColor","drawDiscreteLegendValues","childNodes","legendValueScale","scaleLinear","domain","ticks","buildLegendTicks","xAxis","axisBottom","tickValues","tickSize","colorRect","posY","getSvgElemHeight","posX","getSvgElemX","call","thresholdValues","thresholdTooltips","value","tickFormat","t","v","undefined","drawSimpleColorLegend","drawSimpleOpacityLegend","legendOpacityScale","scalePow","exponent","empty","colorInterpolator","d3ScaleChromatic","colorScaleInverted","invert","contextSrv","user","lightTheme","start","end","scaleSequential","svgElem","x","baseVal","height","tickStepSize","tickStep","ticksNum","round","current","isValueCloseTo","sortBy","uniq","val","valueTo","step","diff","abs","coreModule","directive","restrict","template","link","scope","attrs","ctrl","panel","render","events","on","color","mode","colorSchemes","show","isEmpty","cardsData","cards"],"mappings":";;;;;;;AAuFA,WAASA,eAAT,CAAyBC,IAAzB,EAA+BC,WAA/B,EAA4CC,SAA5C,EAAuDC,OAAvD,EAAgEC,QAAhE,EAA0EC,QAA1E,EAAoF;AAClF,QAAIC,UAAU,GAAGC,CAAC,CAACP,IAAD,CAAD,CAAQQ,IAAR,CAAa,KAAb,CAAjB;AACA,QAAIC,MAAM,GAAGC,EAAE,CAACC,MAAH,CAAUL,UAAU,CAACM,GAAX,CAAe,CAAf,CAAV,CAAb;AACAC,IAAAA,WAAW,CAACb,IAAD,CAAX;AAEA,QAAIc,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWV,UAAU,CAACW,UAAX,EAAX,IAAsC,EAAxD,CALkF,CAKrB;;AAC7D,QAAIC,YAAY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,CAACU,SAAL,CAAe1I,QAA7B;AACA,oBAAIA,QAAQ,GAAGiI,KAAK,CAACI,KAAN,CAAYxE,GAAZ,IAAmB9D,OAAlC;AACA,oBAAIE,QAAQ,GAAGgI,KAAK,CAACI,KAAN,CAAYzE,GAAZ,IAAmB9D,SAAlC;;AAEA,oBAAImI,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,UAAzB,EAAqC;AACnC,sBAAIzI,WAAW,GAAG2C,CAAC,CAACpC,IAAF,CAAO4H,IAAI,CAACO,YAAZ,EAA0B;AAACpD,oBAAAA,KAAK,EAAE8C,KAAK,CAACI,KAAN,CAAYxI;AAApB,mBAA1B,CAAlB;;AACAF,kBAAAA,eAAe,CAACC,IAAD,EAAOC,WAAP,EAAoBC,SAApB,EAA+BC,OAA/B,EAAwCC,QAAxC,EAAkDC,QAAlD,CAAf;AACD,iBAHD,MAGO,IAAIgI,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,SAAzB,EAAoC;AACzC,sBAAIlG,YAAY,GAAG6F,KAAK,CAACI,KAAzB;AACAxG,kBAAAA,iBAAiB,CAACjC,IAAD,EAAOwC,YAAP,EAAqBtC,SAArB,EAAgCC,OAAhC,EAAyCC,QAAzC,EAAmDC,QAAnD,CAAjB;AACD,iBAHM,MAGA,IAAIgI,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,UAAzB,EAAqC;AAC1C,sBAAIlG,aAAY,GAAG6F,KAAK,CAACI,KAAzB;AACAlG,kBAAAA,uBAAuB,CAACvC,IAAD,EAAOwC,aAAP,EAAqB4F,IAAI,CAAC3F,mBAA1B,CAAvB;AACD;AACF;AACF;AACF;AAnCI,SAAP;AAqCD,OAtCD","sourcesContent":["import _ from 'lodash';\nimport $ from 'jquery';\nimport d3 from 'd3';\nimport * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';\nimport {contextSrv} from 'app/core/core';\nimport {tickStep} from 'app/core/utils/ticks';\nimport coreModule from 'app/core/core_module';\n\nconst LEGEND_STEP_WIDTH = 2;\n\n/**\n * Bigger color legend for opacity and spectrum modes editor.\n */\ncoreModule.directive('optionsColorLegend', function() {\n return {\n restrict: 'E',\n template: '
',\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n let legendElem = $(elem).find('svg');\n let legendWidth = Math.floor(legendElem.outerWidth());\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});\n let colorScale = getColorScale(colorScheme, legendWidth);\n drawSimpleColorLegend(elem, colorScale);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawSimpleOpacityLegend(elem, colorOptions);\n }\n }\n }\n };\n});\n\n/**\n * Graph legend with values.\n */\ncoreModule.directive('statusHeatmapLegend', function() {\n return {\n restrict: 'E',\n template: '',\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n clearLegend(elem);\n if (!ctrl.panel.legend.show) {\n return \n }\n if (!_.isEmpty(ctrl.cardsData) && !_.isEmpty(ctrl.cardsData.cards)) {\n let rangeFrom = ctrl.cardsData.minValue;\n let rangeTo = ctrl.cardsData.maxValue;\n let maxValue = panel.color.max || rangeTo;\n let minValue = panel.color.min || rangeFrom;\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});\n drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawOpacityLegend(elem, colorOptions, rangeFrom, rangeTo, maxValue, minValue);\n } else if (panel.color.mode === 'discrete') {\n let colorOptions = panel.color;\n drawDiscreteColorLegend(elem, colorOptions, ctrl.discreteExtraSeries);\n }\n }\n }\n }\n };\n});\n\nfunction drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values\n let legendHeight = legendElem.attr(\"height\");\n\n let rangeStep = (rangeTo - rangeFrom) / (legendWidth/LEGEND_STEP_WIDTH);\n // width in pixels in legend space of unit segment in range space\n // rangeStep * witdhFactor == width in pixels of one rangeStep\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let colorScale = getColorScale(colorScheme, maxValue, minValue);\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n // translate from range space into pixels\n // and shift all rectangles to the right by 10\n .attr(\"x\", d => d * widthFactor+10)\n .attr(\"y\", 0)\n // rectangles are slightly overlaped to prevent gaps\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => colorScale(d));\n\n drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawOpacityLegend(elem, options, rangeFrom, rangeTo, maxValue, minValue) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values\n let legendHeight = legendElem.attr(\"height\");\n\n let rangeStep = (rangeTo - rangeFrom) / (legendWidth/LEGEND_STEP_WIDTH);\n // width in pixels in legend space of unit segment in range space\n // rangeStep * witdhFactor == width in pixels of one rangeStep\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let opacityScale = getOpacityScale(options, maxValue, minValue);\n legend.selectAll(\".status-heatmap-opacity-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n // translate from range space into pixels\n // and shift all rectangles to the right by 10\n .attr(\"x\", d => d * widthFactor+10)\n .attr(\"y\", 0)\n // rectangles are slightly overlaped to prevent gaps\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", options.cardColor)\n .style(\"opacity\", d => opacityScale(d));\n\n drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawDiscreteColorLegend(elem, colorOptions, discreteExtraSeries) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let thresholds = colorOptions.thresholds;\n let tooltips = _.map(thresholds, tr => tr.tooltip);\n let valuesNumber = thresholds.length;\n\n // graph width as a fallback\n const $heatmap = $(elem).parent().parent().parent().find('.status-heatmap-panel');\n const graphWidthAttr = $heatmap.find('svg').attr(\"width\");\n let graphWidth = parseInt(graphWidthAttr);\n\n\n // calculate max width of tooltip and use it as width for each item\n let textWidth:number[] = [];\n legend.selectAll(\".hidden-texts\")\n .data(tooltips)\n .enter().append(\"text\")\n .attr(\"class\", \"axis tick hidden-texts\")\n .attr(\"font-family\", \"sans-serif\")\n .text(d => d)\n .each(function(d,i) {\n let thisWidth = this.getBBox().width;\n textWidth.push(thisWidth);\n });\n legend.selectAll(\".hidden-texts\").remove();\n\n let legendWidth = Math.floor(_.min([\n graphWidth - 30,\n (_.max(textWidth)! + 3) * valuesNumber,\n ])!);\n legendElem.attr(\"width\", legendWidth);\n\n let legendHeight = legendElem.attr(\"height\");\n\n let itemWidth = Math.floor(legendWidth / valuesNumber);\n let valuesRange = d3.range(valuesNumber); // from 0 to valuesNumber-1\n\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d*itemWidth)\n .attr(\"y\", 0)\n .attr(\"width\", itemWidth + 1) // Overlap rectangles to prevent gaps\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => discreteExtraSeries.getDiscreteColor(d));\n\n drawDiscreteLegendValues(elem, colorOptions, legendWidth);\n}\n\n\nfunction drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n\n let legendValueScale = d3.scaleLinear()\n .domain([0, rangeTo])\n .range([0, legendWidth]);\n\n let ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);\n let xAxis = d3.axisBottom(legendValueScale)\n .tickValues(ticks)\n .tickSize(2);\n\n let colorRect = legendElem.find(\":first-child\");\n let posY = getSvgElemHeight(legendElem) + 2;\n let posX = getSvgElemX(colorRect);\n\n d3.select(legendElem.get(0)).append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + posX + \",\" + posY + \")\")\n .call(xAxis);\n\n legend.select(\".axis\").select(\".domain\").remove();\n}\n\nfunction drawDiscreteLegendValues(elem, colorOptions, legendWidth) {\n let thresholds = colorOptions.thresholds;\n\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n\n let valuesNumber = thresholds.length;\n let rangeStep = Math.floor(legendWidth / valuesNumber);\n let valuesRange = d3.range(0, legendWidth, rangeStep);\n\n\n let legendValueScale = d3.scaleLinear()\n .domain([0, valuesNumber])\n .range([0, legendWidth]);\n\n let thresholdValues = [];\n let thresholdTooltips = [];\n for (let i = 0; i < thresholds.length; i++) {\n thresholdValues.push(thresholds[i].value);\n thresholdTooltips.push(thresholds[i].tooltip);\n }\n\n let xAxis = d3.axisBottom(legendValueScale)\n .tickValues(d3.range(0, valuesNumber, 1)) //thresholdValues)\n .tickSize(2)\n .tickFormat((t) => {\n let i = Math.floor(t);\n let v = thresholdTooltips[i];\n if (v != undefined) {\n return \"\"+v;\n } else {\n v = thresholdValues[i];\n if (v != undefined) {\n return \"\"+v;\n } else {\n return \"n/a\";\n }\n }\n });\n\n let colorRect = legendElem.find(\":first-child\");\n let posY = getSvgElemHeight(legendElem) + 2;\n let posX = getSvgElemX(colorRect) + Math.floor(rangeStep/2);\n\n d3.select(legendElem.get(0)).append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + posX + \",\" + posY + \")\")\n .call(xAxis);\n\n legend.select(\".axis\").select(\".domain\").remove();\n}\n\nfunction drawSimpleColorLegend(elem, colorScale) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr(\"height\");\n\n if (legendWidth) {\n let valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);\n\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d)\n .attr(\"y\", 0)\n .attr(\"width\", LEGEND_STEP_WIDTH + 1) // Overlap rectangles to prevent gaps\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => colorScale(d));\n }\n}\n\nfunction drawSimpleOpacityLegend(elem, options) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr(\"height\");\n\n if (legendWidth) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3.scaleLinear()\n .domain([0, legendWidth])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3.scalePow().exponent(options.exponent)\n .domain([0, legendWidth])\n .range([0, 1]);\n }\n\n let valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);\n\n legend.selectAll(\".status-heatmap-opacity-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d)\n .attr(\"y\", 0)\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", options.cardColor)\n .style(\"opacity\", d => legendOpacityScale(d));\n }\n}\n\n\nfunction clearLegend(elem) {\n let legendElem = $(elem).find('svg');\n legendElem.empty();\n}\n\nfunction getColorScale(colorScheme, maxValue, minValue = 0) {\n let colorInterpolator = d3ScaleChromatic[colorScheme.value];\n let colorScaleInverted = colorScheme.invert === 'always' ||\n (colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);\n\n let start = colorScaleInverted ? maxValue : minValue;\n let end = colorScaleInverted ? minValue : maxValue;\n\n return d3.scaleSequential(colorInterpolator).domain([start, end]);\n}\n\nfunction getOpacityScale(options, maxValue, minValue = 0) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3.scaleLinear()\n .domain([minValue, maxValue])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3.scalePow().exponent(options.exponent)\n .domain([minValue, maxValue])\n .range([0, 1]);\n }\n return legendOpacityScale;\n}\n\nfunction getSvgElemX(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.x && svgElem.x.baseVal) {\n return svgElem.x.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction getSvgElemHeight(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.height && svgElem.height.baseVal) {\n return svgElem.height.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue) {\n let range = rangeTo - rangeFrom;\n let tickStepSize = tickStep(rangeFrom, rangeTo, 3);\n let ticksNum = Math.round(range / tickStepSize);\n let ticks:any = [];\n\n for (let i = 0; i < ticksNum; i++) {\n let current = tickStepSize * i;\n // Add user-defined min and max if it had been set\n if (isValueCloseTo(minValue, current, tickStepSize)) {\n ticks.push(minValue);\n continue;\n } else if (minValue < current) {\n ticks.push(minValue);\n }\n if (isValueCloseTo(maxValue, current, tickStepSize)) {\n ticks.push(maxValue);\n continue;\n } else if (maxValue < current) {\n ticks.push(maxValue);\n }\n ticks.push(tickStepSize * i);\n }\n if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {\n ticks.push(maxValue);\n }\n ticks.push(rangeTo);\n ticks = _.sortBy(_.uniq(ticks));\n return ticks;\n}\n\nfunction isValueCloseTo(val, valueTo, step) {\n let diff = Math.abs(val - valueTo);\n return diff < step * 0.3;\n}\n"],"file":"color_legend.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/color_legend.ts"],"names":["drawColorLegend","elem","colorScheme","rangeFrom","rangeTo","maxValue","minValue","legendElem","$","find","legend","d3","select","get","clearLegend","legendWidth","Math","floor","outerWidth","legendHeight","attr","rangeStep","LEGEND_STEP_WIDTH","widthFactor","valuesRange","range","colorScale","getColorScale","selectAll","data","enter","append","d","drawLegendValues","drawOpacityLegend","options","opacityScale","getOpacityScale","cardColor","style","drawDiscreteColorLegend","colorOptions","discreteExtraSeries","thresholds","tooltips","_","map","tr","tooltip","valuesNumber","length","$heatmap","parent","graphWidthAttr","graphWidth","parseInt","textWidth","text","each","i","thisWidth","getBBox","width","push","remove","min","max","itemWidth","getDiscreteColor","drawDiscreteLegendValues","childNodes","legendValueScale","scaleLinear","domain","ticks","buildLegendTicks","xAxis","axisBottom","tickValues","tickSize","colorRect","posY","getSvgElemHeight","posX","getSvgElemX","call","thresholdValues","thresholdTooltips","value","tickFormat","t","v","undefined","drawSimpleColorLegend","drawSimpleOpacityLegend","legendOpacityScale","scalePow","exponent","empty","colorInterpolator","d3ScaleChromatic","colorScaleInverted","invert","contextSrv","user","lightTheme","start","end","scaleSequential","svgElem","x","baseVal","height","tickStepSize","tickStep","ticksNum","round","current","isValueCloseTo","sortBy","uniq","val","valueTo","step","diff","abs","coreModule","directive","restrict","template","link","scope","attrs","ctrl","panel","render","events","on","color","mode","colorSchemes","show","bucketMatrix","noDatapoints","console","log","colorMode"],"mappings":";;;;;;;AA6GA,WAASA,eAAT,CAAyBC,IAAzB,EAA+BC,WAA/B,EAA4CC,SAA5C,EAA+DC,OAA/D,EAA+EC,QAA/E,EAAiGC,QAAjG,EAAkH;AAChH,QAAIC,UAAU,GAAGC,CAAC,CAACP,IAAD,CAAD,CAAQQ,IAAR,CAAa,KAAb,CAAjB;AACA,QAAIC,MAAM,GAAGC,EAAE,CAACC,MAAH,CAAUL,UAAU,CAACM,GAAX,CAAe,CAAf,CAAV,CAAb;AACAC,IAAAA,WAAW,CAACb,IAAD,CAAX;AAEA,QAAIc,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWV,UAAU,CAACW,UAAX,EAAX,IAAsC,EAAxD,CALgH,CAKnD;;AAC7D,QAAIC,YAAY,GAAGZ,UAAU,CAACa,IAAX,CAAgB,QAAhB,CAAnB;AAEA,QAAIC,SAAS,GAAG,CAACjB,OAAO,GAAGD,SAAX,KAAyBY,WAAW,GAACO,iBAArC,CAAhB,CARgH,CAShH;AACA;;AACA,QAAIC,WAAW,GAAGR,WAAW,IAAIX,OAAO,GAAGD,SAAd,CAA7B;AACA,QAAIqB,WAAW,GAAGb,EAAE,CAACc,KAAH,CAAStB,SAAT,EAAoBC,OAApB,EAA6BiB,SAA7B,CAAlB;AAEA,QAAIK,UAAU,GAAGC,aAAa,CAACzB,WAAD,EAAcG,QAAd,EAAwBC,QAAxB,CAA9B;AACAI,IAAAA,MAAM,CAACkB,SAAP,CAAiB,mCAAjB,EACGC,IADH,CACQL,WADR,EAEGM,KAFH,GAEWC,MAFX,CAEkB,MAFlB,EAGE;AACA;AAJF,KAKGX,IALH,CAKQ,GALR,EAKa,UAAAY,CAAC;AAAA,aAAK,CAACA,CAAC,GAAG7B,SAAL,IAAkBoB,WAAnB,GAAgC,EAApC;AAAA,KALd,EAMGH,IANH,CAMQ,GANR,EAMa,CANb,EAOE;AAPF,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K3B4I,kBAAAA,SAAS,EAAEZ,KAAK,CAACI,KAAN,CAAYC;AALI,iBAA7B;;AAQA,oBAAIL,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,UAAzB,EAAqC;AACnC,sBAAIzI,WAAW,GAAG2C,CAAC,CAACpC,IAAF,CAAO4H,IAAI,CAACO,YAAZ,EAA0B;AAACpD,oBAAAA,KAAK,EAAE8C,KAAK,CAACI,KAAN,CAAYxI;AAApB,mBAA1B,CAAlB;;AACAF,kBAAAA,eAAe,CAACC,IAAD,EAAOC,WAAP,EAAoBC,SAApB,EAA+BC,OAA/B,EAAwCC,QAAxC,EAAkDC,QAAlD,CAAf;AACD,iBAHD,MAGO,IAAIgI,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,SAAzB,EAAoC;AACzC,sBAAIlG,YAAY,GAAG6F,KAAK,CAACI,KAAzB;AACAxG,kBAAAA,iBAAiB,CAACjC,IAAD,EAAOwC,YAAP,EAAqBtC,SAArB,EAAgCC,OAAhC,EAAyCC,QAAzC,EAAmDC,QAAnD,CAAjB;AACD,iBAHM,MAGA,IAAIgI,KAAK,CAACI,KAAN,CAAYC,IAAZ,KAAqB,UAAzB,EAAqC;AAC1C,sBAAIlG,aAAY,GAAG6F,KAAK,CAACI,KAAzB;AACAlG,kBAAAA,uBAAuB,CAACvC,IAAD,EAAOwC,aAAP,EAAqB4F,IAAI,CAAC3F,mBAA1B,CAAvB;AACD;AACF;AACF;AACF;AAxDI,SAAP;AA0DD,OA3DD","sourcesContent":["import _ from 'lodash';\nimport $ from 'jquery';\nimport d3 from 'd3';\nimport * as d3ScaleChromatic from './libs/d3-scale-chromatic/index';\nimport {contextSrv} from 'app/core/core';\nimport {tickStep} from 'app/core/utils/ticks';\nimport coreModule from 'app/core/core_module';\nimport { BucketMatrix } from './statusmap_data';\n\nconst LEGEND_STEP_WIDTH = 2;\n\n/**\n * Bigger color legend for opacity and spectrum modes editor.\n */\ncoreModule.directive('optionsColorLegend', function() {\n return {\n restrict: 'E',\n template: '',\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n let legendElem = $(elem).find('svg');\n let legendWidth = Math.floor(legendElem.outerWidth());\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});\n let colorScale = getColorScale(colorScheme, legendWidth);\n drawSimpleColorLegend(elem, colorScale);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawSimpleOpacityLegend(elem, colorOptions);\n }\n }\n }\n };\n});\n\n/**\n * Graph legend with values.\n */\ncoreModule.directive('statusHeatmapLegend', function() {\n return {\n restrict: 'E',\n template: '',\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n clearLegend(elem);\n if (!ctrl.panel.legend.show) {\n return;\n }\n if (ctrl.bucketMatrix) {\n let rangeFrom = ctrl.bucketMatrix.minValue;\n let rangeTo = ctrl.bucketMatrix.maxValue;\n let maxValue = panel.color.max || rangeTo;\n let minValue = panel.color.min || rangeFrom;\n\n if (ctrl.bucketMatrix.noDatapoints) {\n if (!panel.color.max) {\n rangeTo = maxValue = 100;\n } else {\n rangeTo = 100;\n }\n if (!panel.color.min) {\n rangeFrom = minValue = 0;\n } else {\n rangeFrom = 0;\n }\n }\n\n console.log(\"legent state:\", {\n rangeFrom: rangeFrom,\n rangeTo: rangeTo,\n maxValue: maxValue,\n minValue: minValue,\n colorMode: panel.color.mode\n });\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});\n drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawOpacityLegend(elem, colorOptions, rangeFrom, rangeTo, maxValue, minValue);\n } else if (panel.color.mode === 'discrete') {\n let colorOptions = panel.color;\n drawDiscreteColorLegend(elem, colorOptions, ctrl.discreteExtraSeries);\n }\n }\n }\n }\n };\n});\n\nfunction drawColorLegend(elem, colorScheme, rangeFrom: number, rangeTo:number, maxValue: number, minValue:number) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values\n let legendHeight = legendElem.attr(\"height\");\n\n let rangeStep = (rangeTo - rangeFrom) / (legendWidth/LEGEND_STEP_WIDTH);\n // width in pixels in legend space of unit segment in range space\n // rangeStep * witdhFactor == width in pixels of one rangeStep\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let colorScale = getColorScale(colorScheme, maxValue, minValue);\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n // translate from range space into pixels\n // and shift all rectangles to the right by 10\n .attr(\"x\", d => ((d - rangeFrom) * widthFactor)+10)\n .attr(\"y\", 0)\n // rectangles are slightly overlaped to prevent gaps\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => colorScale(d));\n\n drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawOpacityLegend(elem, options, rangeFrom, rangeTo, maxValue, minValue) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30; // narrow legendWidth by 30px to get space for first and last tick values\n let legendHeight = legendElem.attr(\"height\");\n\n let rangeStep = (rangeTo - rangeFrom) / (legendWidth/LEGEND_STEP_WIDTH);\n // width in pixels in legend space of unit segment in range space\n // rangeStep * witdhFactor == width in pixels of one rangeStep\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let opacityScale = getOpacityScale(options, maxValue, minValue);\n legend.selectAll(\".status-heatmap-opacity-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n // translate from range space into pixels\n // and shift all rectangles to the right by 10\n .attr(\"x\", d => d * widthFactor+10)\n .attr(\"y\", 0)\n // rectangles are slightly overlaped to prevent gaps\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", options.cardColor)\n .style(\"opacity\", d => opacityScale(d));\n\n drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawDiscreteColorLegend(elem, colorOptions, discreteExtraSeries) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let thresholds = colorOptions.thresholds;\n let tooltips = _.map(thresholds, tr => tr.tooltip);\n let valuesNumber = thresholds.length;\n\n // graph width as a fallback\n const $heatmap = $(elem).parent().parent().parent().find('.statusmap-panel');\n const graphWidthAttr = $heatmap.find('svg').attr(\"width\");\n let graphWidth = parseInt(graphWidthAttr);\n\n\n // calculate max width of tooltip and use it as width for each item\n let textWidth:number[] = [];\n legend.selectAll(\".hidden-texts\")\n .data(tooltips)\n .enter().append(\"text\")\n .attr(\"class\", \"axis tick hidden-texts\")\n .attr(\"font-family\", \"sans-serif\")\n .text(d => d)\n .each(function(d,i) {\n let thisWidth = this.getBBox().width;\n textWidth.push(thisWidth);\n });\n legend.selectAll(\".hidden-texts\").remove();\n\n let legendWidth = Math.floor(_.min([\n graphWidth - 30,\n (_.max(textWidth)! + 3) * valuesNumber,\n ])!);\n legendElem.attr(\"width\", legendWidth);\n\n let legendHeight = legendElem.attr(\"height\");\n\n let itemWidth = Math.floor(legendWidth / valuesNumber);\n let valuesRange = d3.range(valuesNumber); // from 0 to valuesNumber-1\n\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d*itemWidth)\n .attr(\"y\", 0)\n .attr(\"width\", itemWidth + 1) // Overlap rectangles to prevent gaps\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => discreteExtraSeries.getDiscreteColor(d));\n\n drawDiscreteLegendValues(elem, colorOptions, legendWidth);\n}\n\n\nfunction drawLegendValues(elem, colorScale, rangeFrom: number, rangeTo: number, maxValue: number, minValue: number, legendWidth: number) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n\n let legendValueScale = d3.scaleLinear()\n .domain([rangeFrom, rangeTo])\n .range([0, legendWidth]);\n\n let ticks = buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue);\n let xAxis = d3.axisBottom(legendValueScale)\n .tickValues(ticks)\n .tickSize(2);\n\n let colorRect = legendElem.find(\":first-child\");\n let posY = getSvgElemHeight(legendElem) + 2;\n let posX = getSvgElemX(colorRect);\n\n d3.select(legendElem.get(0)).append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + posX + \",\" + posY + \")\")\n .call(xAxis);\n\n legend.select(\".axis\").select(\".domain\").remove();\n}\n\nfunction drawDiscreteLegendValues(elem, colorOptions, legendWidth) {\n let thresholds = colorOptions.thresholds;\n\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n\n let valuesNumber = thresholds.length;\n let rangeStep = Math.floor(legendWidth / valuesNumber);\n let valuesRange = d3.range(0, legendWidth, rangeStep);\n\n\n let legendValueScale = d3.scaleLinear()\n .domain([0, valuesNumber])\n .range([0, legendWidth]);\n\n let thresholdValues = [];\n let thresholdTooltips = [];\n for (let i = 0; i < thresholds.length; i++) {\n thresholdValues.push(thresholds[i].value);\n thresholdTooltips.push(thresholds[i].tooltip);\n }\n\n let xAxis = d3.axisBottom(legendValueScale)\n .tickValues(d3.range(0, valuesNumber, 1)) //thresholdValues)\n .tickSize(2)\n .tickFormat((t) => {\n let i = Math.floor(t);\n let v = thresholdTooltips[i];\n if (v != undefined) {\n return \"\"+v;\n } else {\n v = thresholdValues[i];\n if (v != undefined) {\n return \"\"+v;\n } else {\n return \"n/a\";\n }\n }\n });\n\n let colorRect = legendElem.find(\":first-child\");\n let posY = getSvgElemHeight(legendElem) + 2;\n let posX = getSvgElemX(colorRect) + Math.floor(rangeStep/2);\n\n d3.select(legendElem.get(0)).append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + posX + \",\" + posY + \")\")\n .call(xAxis);\n\n legend.select(\".axis\").select(\".domain\").remove();\n}\n\nfunction drawSimpleColorLegend(elem, colorScale) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr(\"height\");\n\n if (legendWidth) {\n let valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);\n\n legend.selectAll(\".status-heatmap-color-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d)\n .attr(\"y\", 0)\n .attr(\"width\", LEGEND_STEP_WIDTH + 1) // Overlap rectangles to prevent gaps\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", d => colorScale(d));\n }\n}\n\nfunction drawSimpleOpacityLegend(elem, options) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr(\"height\");\n\n if (legendWidth) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3.scaleLinear()\n .domain([0, legendWidth])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3.scalePow().exponent(options.exponent)\n .domain([0, legendWidth])\n .range([0, 1]);\n }\n\n let valuesRange = d3.range(0, legendWidth, LEGEND_STEP_WIDTH);\n\n legend.selectAll(\".status-heatmap-opacity-legend-rect\")\n .data(valuesRange)\n .enter().append(\"rect\")\n .attr(\"x\", d => d)\n .attr(\"y\", 0)\n .attr(\"width\", LEGEND_STEP_WIDTH+1)\n .attr(\"height\", legendHeight)\n .attr(\"stroke-width\", 0)\n .attr(\"fill\", options.cardColor)\n .style(\"opacity\", d => legendOpacityScale(d));\n }\n}\n\n\nfunction clearLegend(elem) {\n let legendElem = $(elem).find('svg');\n legendElem.empty();\n}\n\nfunction getColorScale(colorScheme, maxValue, minValue = 0) {\n let colorInterpolator = d3ScaleChromatic[colorScheme.value];\n let colorScaleInverted = colorScheme.invert === 'always' ||\n (colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);\n\n let start = colorScaleInverted ? maxValue : minValue;\n let end = colorScaleInverted ? minValue : maxValue;\n\n return d3.scaleSequential(colorInterpolator).domain([start, end]);\n}\n\nfunction getOpacityScale(options, maxValue, minValue = 0) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3.scaleLinear()\n .domain([minValue, maxValue])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3.scalePow().exponent(options.exponent)\n .domain([minValue, maxValue])\n .range([0, 1]);\n }\n return legendOpacityScale;\n}\n\nfunction getSvgElemX(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.x && svgElem.x.baseVal) {\n return svgElem.x.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction getSvgElemHeight(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.height && svgElem.height.baseVal) {\n return svgElem.height.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue) {\n let range = rangeTo - rangeFrom;\n let tickStepSize = tickStep(rangeFrom, rangeTo, 3);\n let ticksNum = Math.round(range / tickStepSize);\n let ticks:any = [];\n\n for (let i = 0; i < ticksNum; i++) {\n let current = tickStepSize * i + rangeFrom;\n // Add user-defined min and max if it had been set\n if (isValueCloseTo(minValue, current, tickStepSize)) {\n ticks.push(minValue);\n continue;\n } else if (minValue < current) {\n ticks.push(minValue);\n }\n if (isValueCloseTo(maxValue, current, tickStepSize)) {\n ticks.push(maxValue);\n continue;\n } else if (maxValue < current) {\n ticks.push(maxValue);\n }\n ticks.push(current);\n }\n if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {\n ticks.push(maxValue);\n }\n ticks.push(rangeTo);\n ticks = _.sortBy(_.uniq(ticks));\n return ticks;\n}\n\nfunction isValueCloseTo(val, valueTo, step) {\n let diff = Math.abs(val - valueTo);\n return diff < step * 0.3;\n}\n"],"file":"color_legend.js"}
\ No newline at end of file
diff --git a/dist/color_mode_discrete.js b/dist/color_mode_discrete.js
index 58d1dde..2a2815a 100644
--- a/dist/color_mode_discrete.js
+++ b/dist/color_mode_discrete.js
@@ -174,48 +174,51 @@ System.register([], function (_export, _context) {
}, {
key: "updateCardsValuesHasColorInfoSingle",
value: function updateCardsValuesHasColorInfoSingle() {
- if (!this.panelCtrl.cardsData) {
+ var _this = this;
+
+ if (!this.panelCtrl.bucketMatrix) {
return;
}
- this.panelCtrl.cardsData.noColorDefined = false;
- var cards = this.panelCtrl.cardsData.cards;
+ this.panelCtrl.bucketMatrix.noColorDefined = false;
+ this.panelCtrl.bucketMatrix.targets.map(function (target) {
+ _this.panelCtrl.bucketMatrix.buckets[target].map(function (bucket) {
+ bucket.noColorDefined = false;
- for (var i = 0; i < cards.length; i++) {
- cards[i].noColorDefined = false;
- var values = cards[i].value;
- var threshold = this.getMatchedThreshold(values);
+ var threshold = _this.getMatchedThreshold(bucket.value);
- if (!threshold || !threshold.color || threshold.color == "") {
- cards[i].noColorDefined = true;
- this.panelCtrl.cardsData.noColorDefined = true;
- }
- }
+ if (!threshold || !threshold.color || threshold.color == "") {
+ bucket.noColorDefined = true;
+ _this.panelCtrl.bucketMatrix.noColorDefined = true;
+ }
+ });
+ });
}
}, {
key: "updateCardsValuesHasColorInfo",
value: function updateCardsValuesHasColorInfo() {
- if (!this.panelCtrl.cardsData) {
+ var _this2 = this;
+
+ if (!this.panelCtrl.bucketMatrix) {
return;
}
- this.panelCtrl.cardsData.noColorDefined = false;
- var cards = this.panelCtrl.cardsData.cards;
-
- for (var i = 0; i < cards.length; i++) {
- cards[i].noColorDefined = false;
- var values = cards[i].values;
+ this.panelCtrl.bucketMatrix.noColorDefined = false;
+ this.panelCtrl.bucketMatrix.targets.map(function (target) {
+ _this2.panelCtrl.bucketMatrix.buckets[target].map(function (bucket) {
+ bucket.noColorDefined = false;
- for (var j = 0; j < values.length; j++) {
- var threshold = this.getMatchedThreshold(values[j]);
+ for (var j = 0; j < bucket.values.length; j++) {
+ var threshold = _this2.getMatchedThreshold(bucket.values[j]);
- if (!threshold || !threshold.color || threshold.color == "") {
- cards[i].noColorDefined = true;
- this.panelCtrl.cardsData.noColorDefined = true;
- break;
+ if (!threshold || !threshold.color || threshold.color == "") {
+ bucket.noColorDefined = true;
+ _this2.panelCtrl.bucketMatrix.noColorDefined = true;
+ break;
+ }
}
- }
- }
+ });
+ });
}
}, {
key: "getMatchedThreshold",
diff --git a/dist/color_mode_discrete.js.map b/dist/color_mode_discrete.js.map
index 30a558d..70c61ec 100644
--- a/dist/color_mode_discrete.js.map
+++ b/dist/color_mode_discrete.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/color_mode_discrete.ts"],"names":["ColorModeDiscrete","scope","panelCtrl","ctrl","panel","values","thresholds","color","tooltips","i","length","j","value","push","tooltip","notMatched","getMatchedThreshold","threshold","index","getThreshold","isAllValuesNulls","getDiscreteColor","cardsData","noColorDefined","cards","nullPointMode","k","interval"],"mappings":";;;;;;;;;;;;;;;;;;AAcA;mCACaA,iB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B;AACE,uBAAO,KAAP;AAAc;;AAChB,mBAAKA,QAAQ,IAAI,KAAjB;AACE,uBAAO,KAAP;AAAc;;AAChB,mBAAKA,QAAQ,IAAI,KAAjB;AACE,uBAAO,KAAP;AAAc;;AAChB,mBAAKA,QAAQ,IAAI,KAAjB;AACE,uBAAO,KAAP;AAAc;;AAChB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,SAAjB;AACE,uBAAO,SAAP;AAAkB;;AACpB,mBAAKA,QAAQ,IAAI,UAAjB;AACE,uBAAO,UAAP;AAAmB;;AACrB;AACE,uBAAO,WAAP;AAAoB;AA1DxB;AA4DD","sourcesContent":["import _ from 'lodash';\nimport {StatusHeatmapCtrl} from \"./status_heatmap_ctrl\";\n\ninterface Tooltip {\n tooltip: string;\n color: string;\n}\n\ndeclare class DiscreteColorThreshold {\n color: string;\n value: number;\n tooltip: string;\n}\n\n// Extra Series methods to handle discrete color mode\nexport class ColorModeDiscrete {\n scope: any;\n panelCtrl: StatusHeatmapCtrl;\n panel: any;\n\n constructor(scope) {\n this.scope = scope;\n this.panelCtrl = scope.ctrl;\n this.panel = scope.ctrl.panel;\n }\n\n // get tooltip for each value ordered by thresholds priority\n convertValuesToTooltips(values:any[]) : Tooltip[] {\n let thresholds = this.panel.color.thresholds;\n let tooltips:Tooltip[] = [];\n\n for (let i = 0; i < thresholds.length; i++) {\n for (let j = 0; j < values.length; j++) {\n if (values[j] == thresholds[i].value) {\n tooltips.push({\n \"tooltip\": thresholds[i].tooltip?thresholds[i].tooltip:values[j],\n \"color\": thresholds[i].color\n });\n }\n }\n }\n return tooltips;\n }\n\n convertValueToTooltips(values) {\n let thresholds = this.panel.color.thresholds;\n let tooltips = [];\n\n for (let i = 0; i < thresholds.length; i++) {\n //for (let j = 0; j < values.length; j++) {\n if (values == thresholds[i].value) {\n tooltips.push({\n \"tooltip\": thresholds[i].tooltip?thresholds[i].tooltip:values,\n \"color\": thresholds[i].color\n });\n //}\n }\n }\n return tooltips;\n }\n\n getNotMatchedValues(values:any[]) {\n let notMatched:any[] = [];\n for (let j = 0; j < values.length; j++) {\n if (!this.getMatchedThreshold(values[j])) {\n notMatched.push(values[j]);\n }\n }\n return notMatched;\n }\n\n getNotColoredValues(values:any[]) {\n let notMatched:any[] = [];\n for (let j = 0; j < values.length; j++) {\n let threshold = this.getMatchedThreshold(values[j]);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n notMatched.push(values[j]);\n }\n }\n return notMatched;\n }\n\n getDiscreteColor(index) {\n let color = this.getThreshold(index).color;\n if (!color || color == \"\") {\n return 'rgba(0,0,0,1)';\n }\n return color;\n }\n\n getBucketColorSingle(value) {\n //let thresholds = this.panel.color.thresholds;\n if (value == null) {\n // treat as null value\n return 'rgba(0,0,0,1)';\n //return this.getMatchedThreshold(null).color;\n }\n let threshold = this.getMatchedThreshold(value);\n\n if (!threshold || !threshold.color || threshold.color == \"\") {\n return 'rgba(0,0,0,1)';\n } else {\n return threshold.color;\n }\n }\n\n // returns color from first matched thresold in order from 0 to thresholds.length\n getBucketColor(values) {\n let thresholds = this.panel.color.thresholds;\n\n if (!values || values.length == 0) {\n // treat as null value\n return this.getMatchedThreshold(null).color;\n }\n\n if (values.length == 1) {\n let threshold = this.getMatchedThreshold(values[0]);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n return 'rgba(0,0,0,1)';\n } else {\n return threshold.color;\n }\n }\n\n let isAllValuesNulls = true;\n for (let j = 0; j < values.length; j++) {\n if (values[j] != null) {\n isAllValuesNulls = false;\n }\n }\n if (isAllValuesNulls) {\n return this.getMatchedThreshold(null).color;\n }\n\n for (let i = 0; i < thresholds.length; i++) {\n for (let j = 0; j < values.length; j++) {\n if (values[j] == thresholds[i].value) {\n return this.getDiscreteColor(i);\n }\n }\n }\n return 'rgba(0,0,0,1)';\n }\n\n\n updateCardsValuesHasColorInfoSingle() {\n if (!this.panelCtrl.cardsData) {\n return;\n }\n this.panelCtrl.cardsData.noColorDefined = false;\n var cards = this.panelCtrl.cardsData.cards;\n for (var i = 0; i < cards.length; i++) {\n cards[i].noColorDefined = false;\n var values = cards[i].value;\n var threshold = this.getMatchedThreshold(values);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n cards[i].noColorDefined = true;\n this.panelCtrl.cardsData.noColorDefined = true;\n }\n }\n }\n\n updateCardsValuesHasColorInfo() {\n if (!this.panelCtrl.cardsData) {\n return\n }\n this.panelCtrl.cardsData.noColorDefined = false;\n let cards = this.panelCtrl.cardsData.cards;\n for (let i=0; i= thresholds.length == null) {\n return {\n \"color\": \"rgba(0,0,0,0)\",\n \"value\": \"null\",\n \"tooltip\": \"null\",\n }\n }\n return thresholds[index];\n }\n\n roundIntervalCeil(interval) {\n switch (true) {\n case interval <= 10:\n return 10; // 0.01s\n case interval <= 20:\n return 20; // 0.02s\n case interval <= 50:\n return 50; // 0.05s\n case interval <= 100:\n return 100; // 0.1s\n case interval <= 200:\n return 200; // 0.2s\n case interval <= 500:\n return 500; // 0.5s\n case interval <= 1000:\n return 1000; // 1s\n case interval <= 2000:\n return 2000; // 2s\n case interval <= 5000:\n return 5000; // 5s\n case interval <= 10000:\n return 10000; // 10s\n case interval <= 15000:\n return 15000; // 15s\n case interval <= 20000:\n return 20000; // 20s\n case interval <= 30000:\n return 30000; // 30s\n case interval <= 60000:\n return 60000; // 1m\n case interval <= 120000:\n return 120000; // 2m\n case interval <= 300000:\n return 300000; // 5m\n case interval <= 600000:\n return 600000; // 10m\n case interval <= 900000:\n return 900000; // 15m\n case interval <= 1200000:\n return 1200000; // 20m\n case interval <= 1800000:\n return 1800000; // 30m\n case interval <= 3600000:\n return 3600000; // 1h\n case interval <= 7200000:\n return 7200000; // 2h\n case interval <= 10800000:\n return 10800000; // 3h\n case interval <= 21600000:\n return 21600000; // 6h\n case interval <= 43200000:\n return 43200000; // 12h\n case interval <= 86400000:\n return 86400000; // 1d\n case interval <= 604800000:\n return 604800000; // 1w\n case interval <= 2592000000:\n return 2592000000; // 30d\n default:\n return 31536000000; // 1y\n }\n }\n}\n"],"file":"color_mode_discrete.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/color_mode_discrete.ts"],"names":["ColorModeDiscrete","scope","panelCtrl","ctrl","panel","values","thresholds","color","tooltips","i","length","j","value","push","tooltip","notMatched","getMatchedThreshold","threshold","index","getThreshold","isAllValuesNulls","getDiscreteColor","bucketMatrix","noColorDefined","targets","map","target","buckets","bucket","nullPointMode","k","interval"],"mappings":";;;;;;;;;;;;;;;;;;AAeA;mCACaA,iB;;;AAKX,mCAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAAA;;AAAA;;AACjB,eAAKA,KAAL,GAAaA,KAAb;AACA,eAAKC,SAAL,GAAiBD,KAAK,CAACE,IAAvB;AACA,eAAKC,KAAL,GAAaH,KAAK,CAACE,IAAN,CAAWC,KAAxB;AACD,S,CAED;;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,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,MAAjB;AACE,uBAAO,MAAP;AAAe;;AACjB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,OAAjB;AACE,uBAAO,OAAP;AAAgB;;AAClB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,QAAjB;AACE,uBAAO,QAAP;AAAiB;;AACnB,mBAAKA,QAAQ,IAAI,SAAjB;AACE,uBAAO,SAAP;AAAkB;;AACpB,mBAAKA,QAAQ,IAAI,UAAjB;AACE,uBAAO,UAAP;AAAmB;;AACrB;AACE,uBAAO,WAAP;AAAoB;AA1DxB;AA4DD","sourcesContent":["import _ from 'lodash';\nimport { Bucket } from \"./statusmap_data\";\nimport { StatusHeatmapCtrl } from \"./module\";\n\ninterface Tooltip {\n tooltip: string;\n color: string;\n}\n\ndeclare class DiscreteColorThreshold {\n color: string;\n value: number;\n tooltip: string;\n}\n\n// Extra Series methods to handle discrete color mode\nexport class ColorModeDiscrete {\n scope: any;\n panelCtrl: StatusHeatmapCtrl;\n panel: any;\n\n constructor(scope) {\n this.scope = scope;\n this.panelCtrl = scope.ctrl;\n this.panel = scope.ctrl.panel;\n }\n\n // get tooltip for each value ordered by thresholds priority\n convertValuesToTooltips(values:any[]) : Tooltip[] {\n let thresholds = this.panel.color.thresholds;\n let tooltips:Tooltip[] = [];\n\n for (let i = 0; i < thresholds.length; i++) {\n for (let j = 0; j < values.length; j++) {\n if (values[j] == thresholds[i].value) {\n tooltips.push({\n \"tooltip\": thresholds[i].tooltip?thresholds[i].tooltip:values[j],\n \"color\": thresholds[i].color\n });\n }\n }\n }\n return tooltips;\n }\n\n convertValueToTooltips(values) {\n let thresholds = this.panel.color.thresholds;\n let tooltips = [];\n\n for (let i = 0; i < thresholds.length; i++) {\n //for (let j = 0; j < values.length; j++) {\n if (values == thresholds[i].value) {\n tooltips.push({\n \"tooltip\": thresholds[i].tooltip?thresholds[i].tooltip:values,\n \"color\": thresholds[i].color\n });\n //}\n }\n }\n return tooltips;\n }\n\n getNotMatchedValues(values:any[]) {\n let notMatched:any[] = [];\n for (let j = 0; j < values.length; j++) {\n if (!this.getMatchedThreshold(values[j])) {\n notMatched.push(values[j]);\n }\n }\n return notMatched;\n }\n\n getNotColoredValues(values:any[]) {\n let notMatched:any[] = [];\n for (let j = 0; j < values.length; j++) {\n let threshold = this.getMatchedThreshold(values[j]);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n notMatched.push(values[j]);\n }\n }\n return notMatched;\n }\n\n getDiscreteColor(index) {\n let color = this.getThreshold(index).color;\n if (!color || color == \"\") {\n return 'rgba(0,0,0,1)';\n }\n return color;\n }\n\n getBucketColorSingle(value) {\n //let thresholds = this.panel.color.thresholds;\n if (value == null) {\n // treat as null value\n return 'rgba(0,0,0,1)';\n //return this.getMatchedThreshold(null).color;\n }\n let threshold = this.getMatchedThreshold(value);\n\n if (!threshold || !threshold.color || threshold.color == \"\") {\n return 'rgba(0,0,0,1)';\n } else {\n return threshold.color;\n }\n }\n\n // returns color from first matched thresold in order from 0 to thresholds.length\n getBucketColor(values) {\n let thresholds = this.panel.color.thresholds;\n\n if (!values || values.length == 0) {\n // treat as null value\n return this.getMatchedThreshold(null).color;\n }\n\n if (values.length == 1) {\n let threshold = this.getMatchedThreshold(values[0]);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n return 'rgba(0,0,0,1)';\n } else {\n return threshold.color;\n }\n }\n\n let isAllValuesNulls = true;\n for (let j = 0; j < values.length; j++) {\n if (values[j] != null) {\n isAllValuesNulls = false;\n }\n }\n if (isAllValuesNulls) {\n return this.getMatchedThreshold(null).color;\n }\n\n for (let i = 0; i < thresholds.length; i++) {\n for (let j = 0; j < values.length; j++) {\n if (values[j] == thresholds[i].value) {\n return this.getDiscreteColor(i);\n }\n }\n }\n return 'rgba(0,0,0,1)';\n }\n\n\n updateCardsValuesHasColorInfoSingle() {\n if (!this.panelCtrl.bucketMatrix) {\n return;\n }\n this.panelCtrl.bucketMatrix.noColorDefined = false;\n\n this.panelCtrl.bucketMatrix.targets.map((target:string) => {\n this.panelCtrl.bucketMatrix.buckets[target].map((bucket:Bucket) => {\n bucket.noColorDefined = false;\n let threshold = this.getMatchedThreshold(bucket.value);\n if (!threshold || !threshold.color || threshold.color == \"\") {\n bucket.noColorDefined = true;\n this.panelCtrl.bucketMatrix.noColorDefined = true;\n }\n });\n });\n }\n\n updateCardsValuesHasColorInfo() {\n if (!this.panelCtrl.bucketMatrix) {\n return\n }\n this.panelCtrl.bucketMatrix.noColorDefined = false;\n\n this.panelCtrl.bucketMatrix.targets.map((target:string) => {\n this.panelCtrl.bucketMatrix.buckets[target].map((bucket:Bucket) => {\n bucket.noColorDefined = false;\n for (let j=0; j= thresholds.length == null) {\n return {\n \"color\": \"rgba(0,0,0,0)\",\n \"value\": \"null\",\n \"tooltip\": \"null\",\n }\n }\n return thresholds[index];\n }\n\n roundIntervalCeil(interval) {\n switch (true) {\n case interval <= 10:\n return 10; // 0.01s\n case interval <= 20:\n return 20; // 0.02s\n case interval <= 50:\n return 50; // 0.05s\n case interval <= 100:\n return 100; // 0.1s\n case interval <= 200:\n return 200; // 0.2s\n case interval <= 500:\n return 500; // 0.5s\n case interval <= 1000:\n return 1000; // 1s\n case interval <= 2000:\n return 2000; // 2s\n case interval <= 5000:\n return 5000; // 5s\n case interval <= 10000:\n return 10000; // 10s\n case interval <= 15000:\n return 15000; // 15s\n case interval <= 20000:\n return 20000; // 20s\n case interval <= 30000:\n return 30000; // 30s\n case interval <= 60000:\n return 60000; // 1m\n case interval <= 120000:\n return 120000; // 2m\n case interval <= 300000:\n return 300000; // 5m\n case interval <= 600000:\n return 600000; // 10m\n case interval <= 900000:\n return 900000; // 15m\n case interval <= 1200000:\n return 1200000; // 20m\n case interval <= 1800000:\n return 1800000; // 30m\n case interval <= 3600000:\n return 3600000; // 1h\n case interval <= 7200000:\n return 7200000; // 2h\n case interval <= 10800000:\n return 10800000; // 3h\n case interval <= 21600000:\n return 21600000; // 6h\n case interval <= 43200000:\n return 43200000; // 12h\n case interval <= 86400000:\n return 86400000; // 1d\n case interval <= 604800000:\n return 604800000; // 1w\n case interval <= 2592000000:\n return 2592000000; // 30d\n default:\n return 31536000000; // 1y\n }\n }\n}\n"],"file":"color_mode_discrete.js"}
\ No newline at end of file
diff --git a/dist/css/statusmap.dark.css b/dist/css/statusmap.dark.css
index 81f1068..cad3000 100644
--- a/dist/css/statusmap.dark.css
+++ b/dist/css/statusmap.dark.css
@@ -7,18 +7,18 @@
color: #d8d9da;
padding: 1px; }
-.status-heatmap-panel {
+.statusmap-panel {
position: relative; }
- .status-heatmap-panel .axis .tick text {
+ .statusmap-panel .axis .tick text {
fill: #d8d9da;
color: #d8d9da;
font-size: 11px; }
- .status-heatmap-panel .axis .tick line {
+ .statusmap-panel .axis .tick line {
opacity: 0.4;
stroke: #8e8e8e; }
- .status-heatmap-panel svg {
+ .statusmap-panel svg {
pointer-events: none; }
- .status-heatmap-panel svg rect {
+ .statusmap-panel svg rect {
pointer-events: visiblePainted; }
.statusmap-tooltip {
diff --git a/dist/css/statusmap.dark.css.map b/dist/css/statusmap.dark.css.map
index 0091a78..5954487 100644
--- a/dist/css/statusmap.d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AAuD;;AAIxE,8BAA+B;EAC7B,WAAW,EAAE,MAAM;EACnB,SAAS,EE1DI,IAAI;EF2DjB,gBAAgB,ECxDC,OAAO;EDyDxB,KAAK,EC3DM,OAAO;ED6DlB,6CAAe;IACb,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,uDAAuD;;AAIxE,yBAA0B;EACxB,IAAI,ECtEY,OAAO;;AD0EvB,8BAAK;EACH,MAAM,EAAE,OAAgB;EACxB,YAAY,EAAE,CAAC;;AAInB,yBAA0B;EACxB,YAAY,EAAE,CAAC;EACf,IAAI,EAAE,wBAAwB;EAC9B,MAAM,EAAE,wBAAwB;;AAGlC,WAAY;EACV,KAAK,EAAE,gBACT;;AACA,WAAY;EACV,KAAK,EAAE,gBACT;;AACA,WAAY;EACV,KAAK,EAAE,gBACT;;AACA,WAAY;EACV,KAAK,EAAE,gBACT;;AAEA,8BAA+B;EAC7B,MAAM,EAAE,MAAM;EAEd,kCAAI;IACF,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,MAAM;EAIrB,2DAA6B;IAC3B,UAAU,EAAE,GAAG;EAGjB,4DAA8B;IAC5B,OAAO,EAAE,YAAY;EAIrB,+CAAK;IACH,IAAI,ECxHG,OAAO;IDyHd,KAAK,ECzHE,OAAO;ID0Hd,SAAS,EE1HE,IAAI;EF6HjB,+CAAK;IACH,OAAO,EAAE,GAAG;IACZ,MAAM,EC9HM,OAAO;EDiIrB,kDAAQ;IACN,OAAO,EAAE,GAAG;IACZ,MAAM,ECnIM,OAAO",
"sources": ["../../src/css/_statusmap.scss","../../src/css/_variables.dark.scss","../../src/css/_variables.scss"],
"names": [],
"file": "statusmap.dark.css"
diff --git a/dist/css/statusmap.light.css b/dist/css/statusmap.light.css
index 085ec7a..d9e7b83 100644
--- a/dist/css/statusmap.light.css
+++ b/dist/css/statusmap.light.css
@@ -7,18 +7,18 @@
color: #52545c;
padding: 1px; }
-.status-heatmap-panel {
+.statusmap-panel {
position: relative; }
- .status-heatmap-panel .axis .tick text {
+ .statusmap-panel .axis .tick text {
fill: #52545c;
color: #52545c;
font-size: 11px; }
- .status-heatmap-panel .axis .tick line {
+ .statusmap-panel .axis .tick line {
opacity: 0.4;
stroke: #767980; }
- .status-heatmap-panel svg {
+ .statusmap-panel svg {
pointer-events: none; }
- .status-heatmap-panel svg rect {
+ .statusmap-panel svg rect {
pointer-events: visiblePainted; }
.statusmap-tooltip {
diff --git a/dist/css/statusmap.light.css.map b/dist/css/statusmap.light.css.map
index c322387..0c039bc 100644
--- a/dist/css/statusmap.light.css.map
+++ b/dist/css/statusmap.light.css.map
@@ -1,6 +1,6 @@
{
"version": 3,
-"mappings": "AAAA,8BAA+B;EAE7B,MAAM,EAAE,SAAS;EAGjB,kDAAoB;IAClB,cAAc,EAAE,IAAI;EAGtB,uDAAyB;IACzB,gBAAgB,ECNL,OAAO;IDOlB,KAAK,ECVM,OAAO;IDWlB,OAAO,EAAE,GAAG;;AAId,qBAAsB;EACpB,QAAQ,EAAE,QAAQ;EAGhB,sCAAK;IACH,IAAI,ECpBG,OAAO;IDqBd,KAAK,ECrBE,OAAO;IDsBd,SAAS,EEtBE,IAAI;EFyBjB,sCAAK;IACH,OAAO,EAAE,GAAG;IACZ,MAAM,EC1BM,OAAO;ED+BvB,yBAAI;IACF,cAAc,EAAE,IAAI;IAEpB,8BAAK;MACH,cAAc,EAAE,cAAc;;AAKpC,kBAAmB;EACjB,WAAW,EAAE,MAAM;EACnB,SAAS,EE5CI,IAAI;EF6CjB,gBAAgB,EC1CC,OAAO;ED2CxB,KAAK,EC7CM,OAAO;ED+ClB,iCAAe;IACb,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,GAAG;IACZ,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,uDAAuD;;AAIxE,8BAA+B;EAC7B,WAAW,EAAE,MAAM;EACnB,SAAS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AE,YAAY;EAIrB,+CAAK;IACH,IAAI,ECxHG,OAAO;IDyHd,KAAK,ECzHE,OAAO;ID0Hd,SAAS,EE1HE,IAAI;EF6HjB,+CAAK;IACH,OAAO,EAAE,GAAG;IACZ,MAAM,EC9HM,OAAO;EDiIrB,kDAAQ;IACN,OAAO,EAAE,GAAG;IACZ,MAAM,ECnIM,OAAO",
"sources": ["../../src/css/_statusmap.scss","../../src/css/_variables.light.scss","../../src/css/_variables.scss"],
"names": [],
"file": "statusmap.light.css"
diff --git a/dist/module.html b/dist/module.html
index a649b27..4e82e1a 100644
--- a/dist/module.html
+++ b/dist/module.html
@@ -1,12 +1,14 @@