@carbon/charts 1.5.2 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/build/src/interfaces/axis-scales.d.ts +11 -0
- package/build/src/interfaces/charts.d.ts +2 -1
- package/bundle.js +1 -1
- package/components/graphs/heatmap.js +33 -14
- package/components/graphs/heatmap.js.map +1 -1
- package/interfaces/axis-scales.d.ts +11 -0
- package/interfaces/axis-scales.js.map +1 -1
- package/interfaces/charts.d.ts +2 -1
- package/interfaces/charts.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +5 -5
|
@@ -47,25 +47,41 @@ var Heatmap = /** @class */ (function (_super) {
|
|
|
47
47
|
// Scales
|
|
48
48
|
var mainXScale = _this.services.cartesianScales.getMainXScale();
|
|
49
49
|
var mainYScale = _this.services.cartesianScales.getMainYScale();
|
|
50
|
-
var label = '', sum =
|
|
50
|
+
var label = '', sum = null, minimum = null, maximum = null;
|
|
51
51
|
// Check to see where datum belongs
|
|
52
52
|
if (_this.matrix[datum] !== undefined) {
|
|
53
53
|
label = domainLabel;
|
|
54
54
|
// Iterate through Object and get sum, min, and max
|
|
55
55
|
ranges.forEach(function (element) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
if (typeof _this.matrix[datum][element].value === 'number') {
|
|
57
|
+
var value = _this.matrix[datum][element].value;
|
|
58
|
+
if (sum === null) {
|
|
59
|
+
sum = value;
|
|
60
|
+
minimum = value;
|
|
61
|
+
maximum = value;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
sum += value;
|
|
65
|
+
minimum = value < minimum ? value : minimum;
|
|
66
|
+
maximum = value > maximum ? value : maximum;
|
|
67
|
+
}
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
70
|
else {
|
|
63
71
|
label = rangeLabel;
|
|
64
72
|
domains.forEach(function (element) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
if (typeof _this.matrix[element][datum].value === 'number') {
|
|
74
|
+
var value = _this.matrix[element][datum].value;
|
|
75
|
+
if (sum === null) {
|
|
76
|
+
sum = value;
|
|
77
|
+
minimum = value;
|
|
78
|
+
maximum = value;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
sum += value;
|
|
82
|
+
minimum = value < minimum ? value : minimum;
|
|
83
|
+
maximum = value > maximum ? value : maximum;
|
|
84
|
+
}
|
|
69
85
|
});
|
|
70
86
|
}
|
|
71
87
|
if (mainXScale(datum) !== undefined) {
|
|
@@ -92,15 +108,15 @@ var Heatmap = /** @class */ (function (_super) {
|
|
|
92
108
|
},
|
|
93
109
|
{
|
|
94
110
|
label: 'Min',
|
|
95
|
-
value: minimum,
|
|
111
|
+
value: minimum !== null ? minimum : '-',
|
|
96
112
|
},
|
|
97
113
|
{
|
|
98
114
|
label: 'Max',
|
|
99
|
-
value: maximum,
|
|
115
|
+
value: maximum !== null ? maximum : '-',
|
|
100
116
|
},
|
|
101
117
|
{
|
|
102
118
|
label: 'Average',
|
|
103
|
-
value: sum / domains.length,
|
|
119
|
+
value: sum !== null ? sum / domains.length : '-',
|
|
104
120
|
},
|
|
105
121
|
],
|
|
106
122
|
});
|
|
@@ -279,7 +295,8 @@ var Heatmap = /** @class */ (function (_super) {
|
|
|
279
295
|
if (!nullState) {
|
|
280
296
|
// Get transformation value of node
|
|
281
297
|
var transform = Tools.getTranformOffsets(cell.attr('transform'));
|
|
282
|
-
|
|
298
|
+
self.parent
|
|
299
|
+
.select('g.cell-highlight')
|
|
283
300
|
.attr('transform', "translate(" + (transform.x + self.translationUnits.x) + ", " + (transform.y + self.translationUnits.y) + ")")
|
|
284
301
|
.classed('highlighter-hidden', false);
|
|
285
302
|
// Dispatch mouse over event
|
|
@@ -333,7 +350,9 @@ var Heatmap = /** @class */ (function (_super) {
|
|
|
333
350
|
var cell = select(this);
|
|
334
351
|
var hoveredElement = cell.select('rect.heat');
|
|
335
352
|
var nullState = hoveredElement.classed('null-state');
|
|
336
|
-
|
|
353
|
+
self.parent
|
|
354
|
+
.select('g.cell-highlight')
|
|
355
|
+
.classed('highlighter-hidden', true);
|
|
337
356
|
// Dispatch event and tooltip only if value exists
|
|
338
357
|
if (!nullState) {
|
|
339
358
|
// Dispatch mouse out event
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.js","sourceRoot":"","sources":["heatmap.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;QAAA,qEA2cC;QA1cA,UAAI,GAAG,SAAS,CAAC;QACjB,gBAAU,GAAG,WAAW,CAAC,GAAG,CAAC;QAErB,YAAM,GAAG,EAAE,CAAC;QACZ,gBAAU,GAAG,CAAC,CAAC;QACf,gBAAU,GAAG,CAAC,CAAC;QACf,sBAAgB,GAAG;YAC1B,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;SACJ,CAAC;QA2UF,sDAAsD;QACtD,uBAAiB,GAAG,UAAC,KAAkB;YAC9B,IAAA,qBAAM,CAAW;YACjB,IAAA,oBAAK,CAAY;YACzB,4BAA4B;YAC5B,IAAM,MAAM,GAAG,KAAI,CAAC,KAAK,CAAC,eA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BAA2B;gBAC3B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CACjC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAC/B;oBACC,KAAK,OAAA;oBACL,OAAO,EAAE,cAAc;oBACvB,KAAK,EAAE,KAAK;iBACZ,CACD,CAAC;gBAEF,8BAA8B;gBAC9B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;oBACvD,KAAK,OAAA;oBACL,cAAc,gBAAA;iBACd,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;IACL,CAAC;IAoGD,yBAAyB;IACzB,yBAAO,GAAP;QACC,IAAI,CAAC,MAAM;aACT,SAAS,CAAC,WAAW,CAAC;aACtB,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;aACrB,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;aACrB,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;aACjB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAEvB,0BAA0B;QAC1B,IAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,cAAc,CAAC,mBAAmB,CACjC,MAAM,CAAC,MAAM,CAAC,UAAU,EACxB,IAAI,CAAC,iBAAiB,CACtB,CAAC;QACF,cAAc,CAAC,mBAAmB,CACjC,MAAM,CAAC,MAAM,CAAC,aAAa,EAC3B,IAAI,CAAC,kBAAkB,CACvB,CAAC;IACH,CAAC;IACF,cAAC;AAAD,CAAC,AA3cD,CAA6B,SAAS,GA2crC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport * as Configuration from '../../configuration';\nimport { Events, RenderTypes, DividerStatus } from '../../interfaces';\nimport { Tools } from '../../tools';\nimport { DOMUtils } from '../../services';\n\nimport { get } from 'lodash-es';\n\n// D3 Imports\nimport { min } from 'd3-array';\nimport { select } from 'd3-selection';\n\nexport class Heatmap extends Component {\n\ttype = 'heatmap';\n\trenderType = RenderTypes.SVG;\n\n\tprivate matrix = {};\n\tprivate xBandwidth = 0;\n\tprivate yBandwidth = 0;\n\tprivate translationUnits = {\n\t\tx: 0,\n\t\ty: 0,\n\t};\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events;\n\n\t\t// Highlight correct cells on Axis item hovers\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_MOUSEOVER,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\n\t\t// Highlight correct cells on Axis item mouseouts\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_MOUSEOUT,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\n\t\t// Highlight correct cells on Axis item focus\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_FOCUS,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\n\t\t// Highlight correct cells on Axis item blur\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_BLUR,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true });\n\t\t// Lower the chart so the axes are always visible\n\t\tsvg.lower();\n\n\t\tconst { cartesianScales } = this.services;\n\t\tthis.matrix = this.model.getMatrix();\n\n\t\tsvg.html('');\n\n\t\tif (Tools.getProperty(this.getOptions(), 'data', 'loading')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// determine x and y axis scale\n\t\tconst mainXScale = cartesianScales.getMainXScale();\n\t\tconst mainYScale = cartesianScales.getMainYScale();\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier();\n\n\t\t// Get unique axis values & create a matrix\n\t\tconst uniqueDomain = this.model.getUniqueDomain();\n\t\tconst uniqueRange = this.model.getUniqueRanges();\n\n\t\t// Get matrix in the form of an array to create a single heatmap group\n\t\tconst matrixArray = this.model.getMatrixAsArray();\n\n\t\t// Get available chart area\n\t\tconst xRange = mainXScale.range();\n\t\tconst yRange = mainYScale.range();\n\n\t\t// Determine rectangle dimensions based on the number of unique domain and range\n\t\tthis.xBandwidth = Math.abs(\n\t\t\t(xRange[1] - xRange[0]) / uniqueDomain.length\n\t\t);\n\t\tthis.yBandwidth = Math.abs(\n\t\t\t(yRange[1] - yRange[0]) / uniqueRange.length\n\t\t);\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(\n\t\t\t`heatmap-pattern-stripes`\n\t\t);\n\n\t\t// Create a striped pattern for missing data\n\t\tsvg.append('defs')\n\t\t\t.append('pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 3)\n\t\t\t.attr('height', 3)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('rect')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr('width', 0.5)\n\t\t\t.attr('height', 8);\n\n\t\tconst rectangles = svg\n\t\t\t.selectAll()\n\t\t\t.data(matrixArray)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('class', (d) => `heat-${d.index}`)\n\t\t\t.classed('cell', true)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t(d) =>\n\t\t\t\t\t`translate(${mainXScale(d[domainIdentifier])}, ${mainYScale(\n\t\t\t\t\t\td[rangeIdentifier]\n\t\t\t\t\t)})`\n\t\t\t)\n\t\t\t.append('rect')\n\t\t\t.attr('class', (d) => {\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tvalue: d.value,\n\t\t\t\t\toriginalClassName: `heat-${d.index}`,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.classed('heat', true)\n\t\t\t.classed('null-state', (d) =>\n\t\t\t\td.index === -1 || d.value === null ? true : false\n\t\t\t)\n\t\t\t.attr('width', this.xBandwidth)\n\t\t\t.attr('height', this.yBandwidth)\n\t\t\t.style('fill', (d) => {\n\t\t\t\t// Check if a valid value exists\n\t\t\t\tif (d.index === -1 || d.value === null) {\n\t\t\t\t\treturn `url(#${patternID})`;\n\t\t\t\t}\n\t\t\t\treturn this.model.getFillColor(Number(d.value));\n\t\t\t})\n\t\t\t.attr('aria-label', (d) => d.value);\n\n\t\t// Cell highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.cell-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tthis.yBandwidth\n\t\t);\n\t\t// Column highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.column-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tMath.abs(yRange[1] - yRange[0])\n\t\t);\n\t\t// Row highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.row-highlight',\n\t\t\tMath.abs(xRange[1] - xRange[0]),\n\t\t\tthis.yBandwidth\n\t\t);\n\n\t\tif (this.determineDividerStatus()) {\n\t\t\trectangles.style('stroke-width', '1px');\n\t\t\tthis.parent.select('g.cell-highlight').classed('cell-2', true);\n\t\t}\n\n\t\tthis.addEventListener();\n\t}\n\n\t/**\n\t * Generates a box using lines to create a hover effect\n\t * The lines have drop shadow in their respective direction\n\t * @param parentTag - tag name\n\t * @param xBandwidth - X length\n\t * @param yBandwidth - y length\n\t */\n\tprivate createOuterBox(parentTag, xBandwidth, yBandwidth) {\n\t\t// Create a highlighter in the parent component so the shadow and the lines do not get clipped\n\t\tconst highlight = DOMUtils.appendOrSelect(this.parent, parentTag)\n\t\t\t.classed('shadows', true)\n\t\t\t.classed('highlighter-hidden', true);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.top')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.left')\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('x2', 0)\n\t\t\t.attr('y2', yBandwidth + 1);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.down')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\t\t\t.attr('y1', yBandwidth)\n\t\t\t.attr('y2', yBandwidth);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.right')\n\t\t\t.attr('x1', xBandwidth)\n\t\t\t.attr('x2', xBandwidth)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('y2', yBandwidth + 1);\n\t}\n\n\tprivate determineDividerStatus(): boolean {\n\t\t// Add dividers if status is not off, will assume auto or on by default.\n\t\tconst dividerStatus = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'heatmap',\n\t\t\t'divider',\n\t\t\t'state'\n\t\t);\n\n\t\t// Determine if cell divider should be displayed\n\t\tif (dividerStatus !== DividerStatus.OFF) {\n\t\t\tif (\n\t\t\t\t(dividerStatus === DividerStatus.AUTO &&\n\t\t\t\t\tConfiguration.heatmap.minCellDividerDimension <=\n\t\t\t\t\t\tthis.xBandwidth &&\n\t\t\t\t\tConfiguration.heatmap.minCellDividerDimension <=\n\t\t\t\t\t\tthis.yBandwidth) ||\n\t\t\t\tdividerStatus === DividerStatus.ON\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\taddEventListener() {\n\t\tconst self = this;\n\t\tconst { cartesianScales } = this.services;\n\t\tconst options = this.getOptions();\n\t\tconst totalLabel = get(options, 'tooltip.totalLabel');\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier();\n\n\t\tconst domainLabel = cartesianScales.getDomainLabel();\n\t\tconst rangeLabel = cartesianScales.getRangeLabel();\n\n\t\tthis.parent\n\t\t\t.selectAll('g.cell')\n\t\t\t.on('mouseover', function (event, datum) {\n\t\t\t\tconst cell = select(this);\n\t\t\t\tconst hoveredElement = cell.select('rect.heat');\n\t\t\t\tconst nullState = hoveredElement.classed('null-state');\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst transform = Tools.getTranformOffsets(\n\t\t\t\t\t\tcell.attr('transform')\n\t\t\t\t\t);\n\n\t\t\t\t\tselect('g.cell-highlight')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${\n\t\t\t\t\t\t\t\ttransform.x + self.translationUnits.x\n\t\t\t\t\t\t\t}, ${transform.y + self.translationUnits.y})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.classed('highlighter-hidden', false);\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEOVER,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Dispatch tooltip show event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\t\t\t\tvalue: datum[domainIdentifier],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: totalLabel || 'Total',\n\t\t\t\t\t\t\t\tvalue: datum['value'],\n\t\t\t\t\t\t\t\tcolor: hoveredElement.style('fill'),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event, datum) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEMOVE,\n\t\t\t\t\t{\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on('click', function (event, datum) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Heatmap.HEATMAP_CLICK,\n\t\t\t\t\t{\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})\n\t\t\t.on('mouseout', function (event, datum) {\n\t\t\t\tconst cell = select(this);\n\t\t\t\tconst hoveredElement = cell.select('rect.heat');\n\t\t\t\tconst nullState = hoveredElement.classed('null-state');\n\n\t\t\t\tselect('g.cell-highlight').classed('highlighter-hidden', true);\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Dispatch mouse out event\n\t\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEOUT,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t// Highlight elements that match the hovered axis item\n\thandleAxisOnHover = (event: CustomEvent) => {\n\t\tconst { detail } = event;\n\t\tconst { datum } = detail;\n\t\t// Unique ranges and domains\n\t\tconst ranges = this.model.getUniqueRanges();\n\t\tconst domains = this.model.getUniqueDomain();\n\t\t// Labels\n\t\tconst domainLabel = this.services.cartesianScales.getDomainLabel();\n\t\tconst rangeLabel = this.services.cartesianScales.getRangeLabel();\n\t\t// Scales\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale();\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale();\n\n\t\tlet label = '',\n\t\t\tsum = 0,\n\t\t\tminimum = 0,\n\t\t\tmaximum = 0;\n\n\t\t// Check to see where datum belongs\n\t\tif (this.matrix[datum] !== undefined) {\n\t\t\tlabel = domainLabel;\n\t\t\t// Iterate through Object and get sum, min, and max\n\t\t\tranges.forEach((element) => {\n\t\t\t\tlet value = this.matrix[datum][element].value || 0;\n\t\t\t\tsum += value;\n\t\t\t\tminimum = value < minimum ? value : minimum;\n\t\t\t\tmaximum = value > maximum ? value : maximum;\n\t\t\t});\n\t\t} else {\n\t\t\tlabel = rangeLabel;\n\t\t\tdomains.forEach((element) => {\n\t\t\t\tlet value = this.matrix[element][datum].value || 0;\n\t\t\t\tsum += value;\n\t\t\t\tminimum = value < minimum ? value : minimum;\n\t\t\t\tmaximum = value > maximum ? value : maximum;\n\t\t\t});\n\t\t}\n\n\t\tif (mainXScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.column-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${mainXScale(datum)}, ${min(\n\t\t\t\t\t\tmainYScale.range()\n\t\t\t\t\t)})`\n\t\t\t\t);\n\t\t} else if (mainYScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.row-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${min(mainXScale.range())},${mainYScale(datum)})`\n\t\t\t\t);\n\t\t}\n\n\t\t// Dispatch tooltip show event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\tevent: detail.event,\n\t\t\thoveredElement: select(event.detail.element),\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: datum,\n\t\t\t\t\tbold: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Min',\n\t\t\t\t\tvalue: minimum,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Max',\n\t\t\t\t\tvalue: maximum,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Average',\n\t\t\t\t\tvalue: sum / domains.length,\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t};\n\n\t// Un-highlight all elements\n\thandleAxisMouseOut = (event: CustomEvent) => {\n\t\t// Hide column/row\n\t\tthis.parent\n\t\t\t.selectAll('g.multi-cell')\n\t\t\t.classed('highlighter-hidden', true);\n\n\t\t// Dispatch hide tooltip event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\tevent,\n\t\t});\n\t};\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('rect.heat')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null);\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events;\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Legend.ITEM_MOUSEOUT,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"heatmap.js","sourceRoot":"","sources":["heatmap.ts"],"names":[],"mappings":";;;;;;;;;;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,CAAC;QACF,cAAc,CAAC,mBAAmB,CACjC,MAAM,CAAC,MAAM,CAAC,aAAa,EAC3B,IAAI,CAAC,kBAAkB,CACvB,CAAC;IACH,CAAC;IACF,cAAC;AAAD,CAAC,AA9dD,CAA6B,SAAS,GA8drC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport * as Configuration from '../../configuration';\nimport { Events, RenderTypes, DividerStatus } from '../../interfaces';\nimport { Tools } from '../../tools';\nimport { DOMUtils } from '../../services';\n\nimport { get } from 'lodash-es';\n\n// D3 Imports\nimport { min } from 'd3-array';\nimport { select } from 'd3-selection';\n\nexport class Heatmap extends Component {\n\ttype = 'heatmap';\n\trenderType = RenderTypes.SVG;\n\n\tprivate matrix = {};\n\tprivate xBandwidth = 0;\n\tprivate yBandwidth = 0;\n\tprivate translationUnits = {\n\t\tx: 0,\n\t\ty: 0,\n\t};\n\n\tinit() {\n\t\tconst eventsFragment = this.services.events;\n\n\t\t// Highlight correct cells on Axis item hovers\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_MOUSEOVER,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\n\t\t// Highlight correct cells on Axis item mouseouts\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_MOUSEOUT,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\n\t\t// Highlight correct cells on Axis item focus\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_FOCUS,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\n\t\t// Highlight correct cells on Axis item blur\n\t\teventsFragment.addEventListener(\n\t\t\tEvents.Axis.LABEL_BLUR,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true });\n\t\t// Lower the chart so the axes are always visible\n\t\tsvg.lower();\n\n\t\tconst { cartesianScales } = this.services;\n\t\tthis.matrix = this.model.getMatrix();\n\n\t\tsvg.html('');\n\n\t\tif (Tools.getProperty(this.getOptions(), 'data', 'loading')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// determine x and y axis scale\n\t\tconst mainXScale = cartesianScales.getMainXScale();\n\t\tconst mainYScale = cartesianScales.getMainYScale();\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier();\n\n\t\t// Get unique axis values & create a matrix\n\t\tconst uniqueDomain = this.model.getUniqueDomain();\n\t\tconst uniqueRange = this.model.getUniqueRanges();\n\n\t\t// Get matrix in the form of an array to create a single heatmap group\n\t\tconst matrixArray = this.model.getMatrixAsArray();\n\n\t\t// Get available chart area\n\t\tconst xRange = mainXScale.range();\n\t\tconst yRange = mainYScale.range();\n\n\t\t// Determine rectangle dimensions based on the number of unique domain and range\n\t\tthis.xBandwidth = Math.abs(\n\t\t\t(xRange[1] - xRange[0]) / uniqueDomain.length\n\t\t);\n\t\tthis.yBandwidth = Math.abs(\n\t\t\t(yRange[1] - yRange[0]) / uniqueRange.length\n\t\t);\n\n\t\tconst patternID = this.services.domUtils.generateElementIDString(\n\t\t\t`heatmap-pattern-stripes`\n\t\t);\n\n\t\t// Create a striped pattern for missing data\n\t\tsvg.append('defs')\n\t\t\t.append('pattern')\n\t\t\t.attr('id', patternID)\n\t\t\t.attr('width', 3)\n\t\t\t.attr('height', 3)\n\t\t\t.attr('patternUnits', 'userSpaceOnUse')\n\t\t\t.attr('patternTransform', 'rotate(45)')\n\t\t\t.append('rect')\n\t\t\t.classed('pattern-fill', true)\n\t\t\t.attr('width', 0.5)\n\t\t\t.attr('height', 8);\n\n\t\tconst rectangles = svg\n\t\t\t.selectAll()\n\t\t\t.data(matrixArray)\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('class', (d) => `heat-${d.index}`)\n\t\t\t.classed('cell', true)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t(d) =>\n\t\t\t\t\t`translate(${mainXScale(d[domainIdentifier])}, ${mainYScale(\n\t\t\t\t\t\td[rangeIdentifier]\n\t\t\t\t\t)})`\n\t\t\t)\n\t\t\t.append('rect')\n\t\t\t.attr('class', (d) => {\n\t\t\t\treturn this.model.getColorClassName({\n\t\t\t\t\tvalue: d.value,\n\t\t\t\t\toriginalClassName: `heat-${d.index}`,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.classed('heat', true)\n\t\t\t.classed('null-state', (d) =>\n\t\t\t\td.index === -1 || d.value === null ? true : false\n\t\t\t)\n\t\t\t.attr('width', this.xBandwidth)\n\t\t\t.attr('height', this.yBandwidth)\n\t\t\t.style('fill', (d) => {\n\t\t\t\t// Check if a valid value exists\n\t\t\t\tif (d.index === -1 || d.value === null) {\n\t\t\t\t\treturn `url(#${patternID})`;\n\t\t\t\t}\n\t\t\t\treturn this.model.getFillColor(Number(d.value));\n\t\t\t})\n\t\t\t.attr('aria-label', (d) => d.value);\n\n\t\t// Cell highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.cell-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tthis.yBandwidth\n\t\t);\n\t\t// Column highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.column-highlight',\n\t\t\tthis.xBandwidth,\n\t\t\tMath.abs(yRange[1] - yRange[0])\n\t\t);\n\t\t// Row highlight box\n\t\tthis.createOuterBox(\n\t\t\t'g.multi-cell.row-highlight',\n\t\t\tMath.abs(xRange[1] - xRange[0]),\n\t\t\tthis.yBandwidth\n\t\t);\n\n\t\tif (this.determineDividerStatus()) {\n\t\t\trectangles.style('stroke-width', '1px');\n\t\t\tthis.parent.select('g.cell-highlight').classed('cell-2', true);\n\t\t}\n\n\t\tthis.addEventListener();\n\t}\n\n\t/**\n\t * Generates a box using lines to create a hover effect\n\t * The lines have drop shadow in their respective direction\n\t * @param parentTag - tag name\n\t * @param xBandwidth - X length\n\t * @param yBandwidth - y length\n\t */\n\tprivate createOuterBox(parentTag, xBandwidth, yBandwidth) {\n\t\t// Create a highlighter in the parent component so the shadow and the lines do not get clipped\n\t\tconst highlight = DOMUtils.appendOrSelect(this.parent, parentTag)\n\t\t\t.classed('shadows', true)\n\t\t\t.classed('highlighter-hidden', true);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.top')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.left')\n\t\t\t.attr('x1', 0)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('x2', 0)\n\t\t\t.attr('y2', yBandwidth + 1);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.down')\n\t\t\t.attr('x1', -1)\n\t\t\t.attr('x2', xBandwidth + 1)\n\t\t\t.attr('y1', yBandwidth)\n\t\t\t.attr('y2', yBandwidth);\n\n\t\tDOMUtils.appendOrSelect(highlight, 'line.right')\n\t\t\t.attr('x1', xBandwidth)\n\t\t\t.attr('x2', xBandwidth)\n\t\t\t.attr('y1', -1)\n\t\t\t.attr('y2', yBandwidth + 1);\n\t}\n\n\tprivate determineDividerStatus(): boolean {\n\t\t// Add dividers if status is not off, will assume auto or on by default.\n\t\tconst dividerStatus = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'heatmap',\n\t\t\t'divider',\n\t\t\t'state'\n\t\t);\n\n\t\t// Determine if cell divider should be displayed\n\t\tif (dividerStatus !== DividerStatus.OFF) {\n\t\t\tif (\n\t\t\t\t(dividerStatus === DividerStatus.AUTO &&\n\t\t\t\t\tConfiguration.heatmap.minCellDividerDimension <=\n\t\t\t\t\t\tthis.xBandwidth &&\n\t\t\t\t\tConfiguration.heatmap.minCellDividerDimension <=\n\t\t\t\t\t\tthis.yBandwidth) ||\n\t\t\t\tdividerStatus === DividerStatus.ON\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\taddEventListener() {\n\t\tconst self = this;\n\t\tconst { cartesianScales } = this.services;\n\t\tconst options = this.getOptions();\n\t\tconst totalLabel = get(options, 'tooltip.totalLabel');\n\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = cartesianScales.getRangeIdentifier();\n\n\t\tconst domainLabel = cartesianScales.getDomainLabel();\n\t\tconst rangeLabel = cartesianScales.getRangeLabel();\n\n\t\tthis.parent\n\t\t\t.selectAll('g.cell')\n\t\t\t.on('mouseover', function (event, datum) {\n\t\t\t\tconst cell = select(this);\n\t\t\t\tconst hoveredElement = cell.select('rect.heat');\n\t\t\t\tconst nullState = hoveredElement.classed('null-state');\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Get transformation value of node\n\t\t\t\t\tconst transform = Tools.getTranformOffsets(\n\t\t\t\t\t\tcell.attr('transform')\n\t\t\t\t\t);\n\n\t\t\t\t\tself.parent\n\t\t\t\t\t\t.select('g.cell-highlight')\n\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t'transform',\n\t\t\t\t\t\t\t`translate(${\n\t\t\t\t\t\t\t\ttransform.x + self.translationUnits.x\n\t\t\t\t\t\t\t}, ${transform.y + self.translationUnits.y})`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.classed('highlighter-hidden', false);\n\n\t\t\t\t\t// Dispatch mouse over event\n\t\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEOVER,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Dispatch tooltip show event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: domainLabel,\n\t\t\t\t\t\t\t\tvalue: datum[domainIdentifier],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: rangeLabel,\n\t\t\t\t\t\t\t\tvalue: datum[rangeIdentifier],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: totalLabel || 'Total',\n\t\t\t\t\t\t\t\tvalue: datum['value'],\n\t\t\t\t\t\t\t\tcolor: hoveredElement.style('fill'),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('mousemove', function (event, datum) {\n\t\t\t\t// Dispatch mouse move event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEMOVE,\n\t\t\t\t\t{\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Dispatch tooltip move event\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\tevent,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on('click', function (event, datum) {\n\t\t\t\t// Dispatch mouse click event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Heatmap.HEATMAP_CLICK,\n\t\t\t\t\t{\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})\n\t\t\t.on('mouseout', function (event, datum) {\n\t\t\t\tconst cell = select(this);\n\t\t\t\tconst hoveredElement = cell.select('rect.heat');\n\t\t\t\tconst nullState = hoveredElement.classed('null-state');\n\n\t\t\t\tself.parent\n\t\t\t\t\t.select('g.cell-highlight')\n\t\t\t\t\t.classed('highlighter-hidden', true);\n\n\t\t\t\t// Dispatch event and tooltip only if value exists\n\t\t\t\tif (!nullState) {\n\t\t\t\t\t// Dispatch mouse out event\n\t\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\t\tEvents.Heatmap.HEATMAP_MOUSEOUT,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\t\tdatum: datum,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\t// Dispatch hide tooltip event\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t// Highlight elements that match the hovered axis item\n\thandleAxisOnHover = (event: CustomEvent) => {\n\t\tconst { detail } = event;\n\t\tconst { datum } = detail;\n\t\t// Unique ranges and domains\n\t\tconst ranges = this.model.getUniqueRanges();\n\t\tconst domains = this.model.getUniqueDomain();\n\t\t// Labels\n\t\tconst domainLabel = this.services.cartesianScales.getDomainLabel();\n\t\tconst rangeLabel = this.services.cartesianScales.getRangeLabel();\n\t\t// Scales\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale();\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale();\n\n\t\tlet label = '',\n\t\t\tsum = null,\n\t\t\tminimum = null,\n\t\t\tmaximum = null;\n\n\t\t// Check to see where datum belongs\n\t\tif (this.matrix[datum] !== undefined) {\n\t\t\tlabel = domainLabel;\n\t\t\t// Iterate through Object and get sum, min, and max\n\t\t\tranges.forEach((element) => {\n\t\t\t\tif (typeof this.matrix[datum][element].value === 'number') {\n\t\t\t\t\tlet value = this.matrix[datum][element].value;\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value;\n\t\t\t\t\t\tminimum = value;\n\t\t\t\t\t\tmaximum = value;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsum += value;\n\t\t\t\t\tminimum = value < minimum ? value : minimum;\n\t\t\t\t\tmaximum = value > maximum ? value : maximum;\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tlabel = rangeLabel;\n\t\t\tdomains.forEach((element) => {\n\t\t\t\tif (typeof this.matrix[element][datum].value === 'number') {\n\t\t\t\t\tlet value = this.matrix[element][datum].value;\n\t\t\t\t\tif (sum === null) {\n\t\t\t\t\t\tsum = value;\n\t\t\t\t\t\tminimum = value;\n\t\t\t\t\t\tmaximum = value;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsum += value;\n\t\t\t\t\tminimum = value < minimum ? value : minimum;\n\t\t\t\t\tmaximum = value > maximum ? value : maximum;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (mainXScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.column-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${mainXScale(datum)}, ${min(\n\t\t\t\t\t\tmainYScale.range()\n\t\t\t\t\t)})`\n\t\t\t\t);\n\t\t} else if (mainYScale(datum) !== undefined) {\n\t\t\tthis.parent\n\t\t\t\t.select('g.multi-cell.row-highlight')\n\t\t\t\t.classed('highlighter-hidden', false)\n\t\t\t\t.attr(\n\t\t\t\t\t'transform',\n\t\t\t\t\t`translate(${min(mainXScale.range())},${mainYScale(datum)})`\n\t\t\t\t);\n\t\t}\n\n\t\t// Dispatch tooltip show event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\tevent: detail.event,\n\t\t\thoveredElement: select(event.detail.element),\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: datum,\n\t\t\t\t\tbold: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Min',\n\t\t\t\t\tvalue: minimum !== null ? minimum : '-',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Max',\n\t\t\t\t\tvalue: maximum !== null ? maximum : '-',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Average',\n\t\t\t\t\tvalue: sum !== null ? sum / domains.length : '-',\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t};\n\n\t// Un-highlight all elements\n\thandleAxisMouseOut = (event: CustomEvent) => {\n\t\t// Hide column/row\n\t\tthis.parent\n\t\t\t.selectAll('g.multi-cell')\n\t\t\t.classed('highlighter-hidden', true);\n\n\t\t// Dispatch hide tooltip event\n\t\tthis.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\tevent,\n\t\t});\n\t};\n\n\t// Remove event listeners\n\tdestroy() {\n\t\tthis.parent\n\t\t\t.selectAll('rect.heat')\n\t\t\t.on('mouseover', null)\n\t\t\t.on('mousemove', null)\n\t\t\t.on('click', null)\n\t\t\t.on('mouseout', null);\n\n\t\t// Remove legend listeners\n\t\tconst eventsFragment = this.services.events;\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Legend.ITEM_HOVER,\n\t\t\tthis.handleAxisOnHover\n\t\t);\n\t\teventsFragment.removeEventListener(\n\t\t\tEvents.Legend.ITEM_MOUSEOUT,\n\t\t\tthis.handleAxisMouseOut\n\t\t);\n\t}\n}\n"]}
|
|
@@ -122,6 +122,17 @@ export interface AxisOptions extends BasedAxisOptions {
|
|
|
122
122
|
*/
|
|
123
123
|
percentage?: boolean;
|
|
124
124
|
}
|
|
125
|
+
export interface ComboChartAxisOptions extends AxisOptions {
|
|
126
|
+
/**
|
|
127
|
+
* should be set to `true` for the
|
|
128
|
+
* left axis to be the primary axis
|
|
129
|
+
*/
|
|
130
|
+
main?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* used to map data on the secondary axis
|
|
133
|
+
*/
|
|
134
|
+
correspondingDatasets?: Array<string>;
|
|
135
|
+
}
|
|
125
136
|
export interface BinnedAxisOptions {
|
|
126
137
|
/**
|
|
127
138
|
* should be set to `true` on the domain
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis-scales.js","sourceRoot":"","sources":["axis-scales.ts"],"names":[],"mappings":"","sourcesContent":["import { ScaleTypes, TickRotations, AxisTitleOrientations } from './enums';\nimport { ThresholdOptions } from './components';\nimport { TruncationOptions } from './truncation';\n\nimport { AxisDomain } from 'd3-axis';\nimport { Locale } from 'date-fns';\n\nexport interface BasedAxisOptions {\n\t/**\n\t * type of the scale used on axis\n\t */\n\tscaleType?: ScaleTypes;\n\t/**\n\t * Whether the Axis should use the specified domain\n\t * instead of it being dynamically generated based on data extents.\n\t * The type of values should depend on the scale type.\n\t * Example for continuous axis scale: [-100, 100]\n\t * Example for discrete axis scale: ['Qty', 'More', 'Sold']\n\t * No need to define domain for percentage axis scale\n\t */\n\tdomain?: AxisDomain[];\n\t/**\n\t * an additional key from the charting data that is used to\n\t * extend the domain of an axis by\n\t * (e.g. in the bullet graph we need both the marker &\n\t * the data values to define the domain of the linear scale)\n\t */\n\textendLinearDomainBy?: string;\n\t/**\n\t * Whether the Axis should be forced to include 0 as a starting point\n\t * (or ending point, in case of all negative axis).\n\t * Default: true\n\t */\n\tincludeZero?: boolean;\n\t/**\n\t * identifies what key within the data the axis values would map to\n\t */\n\tmapsTo?: string;\n\t/**\n\t * optional title for the scales\n\t */\n\ttitle?: string;\n\t/**\n\t * Override for the orientation of the title (for vertical axes).\n\t * The title string can be overrided to be rotated left or right.\n\t */\n\ttitleOrientation?: AxisTitleOrientations;\n\t/**\n\t * thresholds\n\t * Example:\n\t * [\n\t *\t\t{value: 10000},\n\t *\t\t{value: 40020, valueFormatter: (x) => x},\n\t *\t\t{value: 55000, label: \"Custom label\", fillColor: \"#03a9f4\"},\n\t * ]\n\t */\n\tthresholds?: ThresholdOptions[];\n\t/**\n\t * tick configuration\n\t */\n\tticks?: {\n\t\t/**\n\t\t * number of ticks to show\n\t\t */\n\t\tnumber?: number;\n\t\t/**\n\t\t * minimum tick value\n\t\t */\n\t\tmin?: number;\n\t\t/**\n\t\t * maximum tick value\n\t\t */\n\t\tmax?: number;\n\t\t/**\n\t\t * minimum width of a tick\n\t\t * before getting rotated (in pixels)\n\t\t */\n\t\trotateIfSmallerThan?: number;\n\t\t/**\n\t\t * when to rotate ticks\n\t\t */\n\t\trotation?: TickRotations;\n\t\t/**\n\t\t * function to format the ticks\n\t\t */\n\t\tformatter?: Function;\n\t\t/**\n\t\t * optional custom array of tick values that is within the domain of data\n\t\t */\n\t\tvalues?: any[];\n\t};\n\ttruncation?: TruncationOptions;\n\t/**\n\t * is axis visible or not\n\t */\n\tvisible?: boolean;\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[];\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean;\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean;\n}\n\n/**\n * options to configure a scale. not all options are used by all scales\n */\nexport interface AxisOptions extends BasedAxisOptions {\n\t/**\n\t * option for stacked axis\n\t */\n\tstacked?: boolean;\n\t/**\n\t * option for percentage axis scale\n\t */\n\tpercentage?: boolean;\n}\n\nexport interface BinnedAxisOptions {\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean;\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[];\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean;\n}\n\n/**\n * customize time series scales\n */\nexport interface TimeScaleOptions {\n\taddSpaceOnEdges?: number;\n\t/**\n\t * if it's true, days are shown as mon-sun,\n\t * otherwise days are shown as number 1-31\n\t */\n\tshowDayName?: boolean;\n\t/**\n\t * formats for each time interval\n\t */\n\ttimeIntervalFormats?: TimeIntervalFormats;\n\t/**\n\t * locale object, for more information see https://date-fns.org/v2.11.0/docs/Locale.\n\t * example: `import enUSLocaleObject from \"date-fns/locale/en-US/index\"`.\n\t * available locale objects are: https://github.com/date-fns/date-fns/tree/master/src/locale\n\t */\n\tlocaleObject?: Locale;\n}\n\n/**\n * time scales: customize ticks format for different time intervals\n */\nexport interface TickFormats {\n\tprimary?: string;\n\tsecondary?: string;\n}\n\nexport interface TimeIntervalFormats {\n\t'15seconds'?: TickFormats;\n\tminute?: TickFormats;\n\t'30minutes'?: TickFormats;\n\thourly?: TickFormats;\n\tdaily?: TickFormats;\n\tweekly?: TickFormats;\n\tmonthly?: TickFormats;\n\tquarterly?: TickFormats;\n\tyearly?: TickFormats;\n}\n\n/**\n * customize the axes components\n */\nexport interface AxesOptions<AxesOptionType> {\n\tleft?: AxesOptionType;\n\tbottom?: AxesOptionType;\n\tright?: AxesOptionType;\n\ttop?: AxesOptionType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"axis-scales.js","sourceRoot":"","sources":["axis-scales.ts"],"names":[],"mappings":"","sourcesContent":["import { ScaleTypes, TickRotations, AxisTitleOrientations } from './enums';\nimport { ThresholdOptions } from './components';\nimport { TruncationOptions } from './truncation';\n\nimport { AxisDomain } from 'd3-axis';\nimport { Locale } from 'date-fns';\n\nexport interface BasedAxisOptions {\n\t/**\n\t * type of the scale used on axis\n\t */\n\tscaleType?: ScaleTypes;\n\t/**\n\t * Whether the Axis should use the specified domain\n\t * instead of it being dynamically generated based on data extents.\n\t * The type of values should depend on the scale type.\n\t * Example for continuous axis scale: [-100, 100]\n\t * Example for discrete axis scale: ['Qty', 'More', 'Sold']\n\t * No need to define domain for percentage axis scale\n\t */\n\tdomain?: AxisDomain[];\n\t/**\n\t * an additional key from the charting data that is used to\n\t * extend the domain of an axis by\n\t * (e.g. in the bullet graph we need both the marker &\n\t * the data values to define the domain of the linear scale)\n\t */\n\textendLinearDomainBy?: string;\n\t/**\n\t * Whether the Axis should be forced to include 0 as a starting point\n\t * (or ending point, in case of all negative axis).\n\t * Default: true\n\t */\n\tincludeZero?: boolean;\n\t/**\n\t * identifies what key within the data the axis values would map to\n\t */\n\tmapsTo?: string;\n\t/**\n\t * optional title for the scales\n\t */\n\ttitle?: string;\n\t/**\n\t * Override for the orientation of the title (for vertical axes).\n\t * The title string can be overrided to be rotated left or right.\n\t */\n\ttitleOrientation?: AxisTitleOrientations;\n\t/**\n\t * thresholds\n\t * Example:\n\t * [\n\t *\t\t{value: 10000},\n\t *\t\t{value: 40020, valueFormatter: (x) => x},\n\t *\t\t{value: 55000, label: \"Custom label\", fillColor: \"#03a9f4\"},\n\t * ]\n\t */\n\tthresholds?: ThresholdOptions[];\n\t/**\n\t * tick configuration\n\t */\n\tticks?: {\n\t\t/**\n\t\t * number of ticks to show\n\t\t */\n\t\tnumber?: number;\n\t\t/**\n\t\t * minimum tick value\n\t\t */\n\t\tmin?: number;\n\t\t/**\n\t\t * maximum tick value\n\t\t */\n\t\tmax?: number;\n\t\t/**\n\t\t * minimum width of a tick\n\t\t * before getting rotated (in pixels)\n\t\t */\n\t\trotateIfSmallerThan?: number;\n\t\t/**\n\t\t * when to rotate ticks\n\t\t */\n\t\trotation?: TickRotations;\n\t\t/**\n\t\t * function to format the ticks\n\t\t */\n\t\tformatter?: Function;\n\t\t/**\n\t\t * optional custom array of tick values that is within the domain of data\n\t\t */\n\t\tvalues?: any[];\n\t};\n\ttruncation?: TruncationOptions;\n\t/**\n\t * is axis visible or not\n\t */\n\tvisible?: boolean;\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[];\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean;\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean;\n}\n\n/**\n * options to configure a scale. not all options are used by all scales\n */\nexport interface AxisOptions extends BasedAxisOptions {\n\t/**\n\t * option for stacked axis\n\t */\n\tstacked?: boolean;\n\t/**\n\t * option for percentage axis scale\n\t */\n\tpercentage?: boolean;\n}\n\nexport interface ComboChartAxisOptions extends AxisOptions {\n\t/**\n\t * should be set to `true` for the\n\t * left axis to be the primary axis\n\t */\n\tmain?: boolean;\n\t/**\n\t * used to map data on the secondary axis\n\t */\n\tcorrespondingDatasets?: Array<string>;\n}\n\nexport interface BinnedAxisOptions {\n\t/**\n\t * should be set to `true` on the domain\n\t * axis that's being broken into bins\n\t */\n\tbinned?: boolean;\n\t/**\n\t * Bins to display (Histogram)\n\t * bins: 20\n\t * bins: [0, 20, 40, 60]\n\t * bins: [new Date(...), new Date(...), ...]\n\t */\n\tbins?: number | any[];\n\t/**\n\t * limit the visible axis domain to only the binned area\n\t */\n\tlimitDomainToBins?: boolean;\n}\n\n/**\n * customize time series scales\n */\nexport interface TimeScaleOptions {\n\taddSpaceOnEdges?: number;\n\t/**\n\t * if it's true, days are shown as mon-sun,\n\t * otherwise days are shown as number 1-31\n\t */\n\tshowDayName?: boolean;\n\t/**\n\t * formats for each time interval\n\t */\n\ttimeIntervalFormats?: TimeIntervalFormats;\n\t/**\n\t * locale object, for more information see https://date-fns.org/v2.11.0/docs/Locale.\n\t * example: `import enUSLocaleObject from \"date-fns/locale/en-US/index\"`.\n\t * available locale objects are: https://github.com/date-fns/date-fns/tree/master/src/locale\n\t */\n\tlocaleObject?: Locale;\n}\n\n/**\n * time scales: customize ticks format for different time intervals\n */\nexport interface TickFormats {\n\tprimary?: string;\n\tsecondary?: string;\n}\n\nexport interface TimeIntervalFormats {\n\t'15seconds'?: TickFormats;\n\tminute?: TickFormats;\n\t'30minutes'?: TickFormats;\n\thourly?: TickFormats;\n\tdaily?: TickFormats;\n\tweekly?: TickFormats;\n\tmonthly?: TickFormats;\n\tquarterly?: TickFormats;\n\tyearly?: TickFormats;\n}\n\n/**\n * customize the axes components\n */\nexport interface AxesOptions<AxesOptionType> {\n\tleft?: AxesOptionType;\n\tbottom?: AxesOptionType;\n\tright?: AxesOptionType;\n\ttop?: AxesOptionType;\n}\n"]}
|
package/interfaces/charts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GaugeTypes, Statuses, ArrowDirections, Alignments, ChartTypes, TreeTypes, DividerStatus, ColorLegendType, ChartTheme } from './enums';
|
|
2
2
|
import { LegendOptions, TooltipOptions, GridOptions, AxesOptions, ZoomBarsOptions } from './index';
|
|
3
3
|
import { BarOptions, StackedBarOptions, ToolbarOptions } from './components';
|
|
4
|
-
import { AxisOptions, BinnedAxisOptions, TimeScaleOptions } from './axis-scales';
|
|
4
|
+
import { AxisOptions, BinnedAxisOptions, ComboChartAxisOptions, TimeScaleOptions } from './axis-scales';
|
|
5
5
|
/**
|
|
6
6
|
* Base chart options common to any chart
|
|
7
7
|
*/
|
|
@@ -397,6 +397,7 @@ export interface RadarChartOptions extends BaseChartOptions {
|
|
|
397
397
|
* options specific to combo charts
|
|
398
398
|
*/
|
|
399
399
|
export interface ComboChartOptions extends AxisChartOptions {
|
|
400
|
+
axes?: AxesOptions<ComboChartAxisOptions>;
|
|
400
401
|
comboChartTypes: Array<{
|
|
401
402
|
type: ChartTypes | any;
|
|
402
403
|
options?: object;
|
package/interfaces/charts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.js","sourceRoot":"","sources":["charts.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tGaugeTypes,\n\tStatuses,\n\tArrowDirections,\n\tAlignments,\n\tChartTypes,\n\tTreeTypes,\n\tDividerStatus,\n\tColorLegendType,\n\tChartTheme,\n} from './enums';\nimport {\n\tLegendOptions,\n\tTooltipOptions,\n\tGridOptions,\n\tAxesOptions,\n\tZoomBarsOptions,\n} from './index';\nimport { BarOptions, StackedBarOptions, ToolbarOptions } from './components';\nimport {\n\tAxisOptions,\n\tBinnedAxisOptions,\n\tTimeScaleOptions,\n} from './axis-scales';\n\n/**\n * Base chart options common to any chart\n */\nexport interface BaseChartOptions {\n\t/**\n\t * Optionally specify a title for the chart\n\t */\n\ttitle?: string;\n\t/**\n\t * boolean to disable animations (enabled by default)\n\t */\n\tanimations?: boolean;\n\t/**\n\t * boolean to prevent the container from resizing\n\t */\n\tresizable?: boolean;\n\t/**\n\t * Optionally specify a width for the chart\n\t */\n\twidth?: string;\n\t/**\n\t * Optionally specify a height for the chart\n\t */\n\theight?: string;\n\t/**\n\t * Optionally specify a theme for the chart\n\t */\n\ttheme?: ChartTheme;\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: TooltipOptions;\n\t/**\n\t * legend configuration\n\t */\n\tlegend?: LegendOptions;\n\t/**\n\t * toolbar configurations\n\t */\n\ttoolbar?: ToolbarOptions;\n\t/**\n\t * Optional function to determine whether is filled based on datasetLabel, label, and/or data\n\t */\n\tgetIsFilled?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFilled?: boolean\n\t) => boolean;\n\t/**\n\t * Optional function to generate the fill color based on datasetLabel, label, and/or data\n\t */\n\tgetFillColor?: (\n\t\tgroup: string,\n\t\tlabel?: string,\n\t\tdata?: any,\n\t\tdefaultFillColor?: string\n\t) => string;\n\t/**\n\t * Optional function to generate the stroke color based on datasetLabel, label, and/or data\n\t * (note) - not all chart types support the stroke color (e.g. wordcloud)\n\t */\n\tgetStrokeColor?: (\n\t\tgroup: string,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultStrokeColor?: string\n\t) => string;\n\t/**\n\t * stylesheet options\n\t */\n\tstyle?: {\n\t\t/**\n\t\t * optional prefixing string for css classes (defaults to 'cc')\n\t\t */\n\t\tprefix?: string;\n\t};\n\t/**\n\t * options related to charting data\n\t */\n\tdata?: {\n\t\t/**\n\t\t * identifier for data groups\n\t\t */\n\t\tgroupMapsTo?: string;\n\t\t/**\n\t\t * used to simulate data loading in skeleton way\n\t\t */\n\t\tloading?: boolean;\n\t\t/**\n\t\t * options related to pre-selected data groups\n\t\t * Remains empty if every legend item is active or dataset doesn't have the data groups.\n\t\t */\n\t\tselectedGroups?: string[];\n\t};\n\t/**\n\t * options related to color scales\n\t */\n\tcolor?: {\n\t\t/**\n\t\t * e.g. { 'Dataset 1': 'blue' }\n\t\t */\n\t\tscale?: object;\n\t\t/**\n\t\t * use a carbon dataviz preset color palette\n\t\t * put the index (selection of which variant)\n\t\t */\n\t\tpairing?: {\n\t\t\t/**\n\t\t\t * the number of color variants in the palette (defaults to using the number of data groups in the given data)\n\t\t\t */\n\t\t\tnumberOfVariants?: number;\n\t\t\t/**\n\t\t\t * the option number of the color paring\n\t\t\t */\n\t\t\toption?: number;\n\t\t};\n\t\t/*\n\t\t * options related to gradient\n\t\t * e.g. { enabled: true }\n\t\t */\n\t\tgradient?: {\n\t\t\tenabled?: boolean;\n\t\t\t/**\n\t\t\t * hex color array\n\t\t\t * e.g. ['#fff', '#000', ...]\n\t\t\t */\n\t\t\tcolors?: Array<String>;\n\t\t};\n\t};\n}\n\n/**\n * Options common to any chart with an axis\n */\nexport interface AxisChartOptions extends BaseChartOptions {\n\taxes?: AxesOptions<AxisOptions>;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\t/**\n\t * zoombar configuration\n\t */\n\tzoomBar?: ZoomBarsOptions;\n}\n\n/**\n * Options common to binned charts with an axis\n */\nexport interface BinnedAxisChartOptions extends AxisChartOptions {\n\taxes?: AxesOptions<BinnedAxisOptions>;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\t/**\n\t * zoombar configuration\n\t */\n\tzoomBar?: ZoomBarsOptions;\n}\n\n/**\n * options specific to boxplot charts\n */\nexport interface BoxplotChartOptions extends AxisChartOptions {}\n\n/**\n * options specific to bar charts\n */\nexport interface BarChartOptions extends AxisChartOptions {\n\tbars?: BarOptions;\n}\n\n/**\n * options specific to stacked bar charts\n */\nexport interface StackedBarChartOptions extends BarChartOptions {\n\tbars?: StackedBarOptions;\n}\n\n/**\n * options specific to scatter charts\n */\nexport interface ScatterChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the points\n\t */\n\tpoints?: {\n\t\t/**\n\t\t * sets the radius of the point\n\t\t */\n\t\tradius: number;\n\t\tfillOpacity?: number;\n\t\tfilled?: boolean;\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * options specific to lollipop charts\n */\nexport interface LollipopChartOptions extends ScatterChartOptions {}\n\n/**\n * options specific to bubble charts\n */\nexport interface BubbleChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bubbles\n\t */\n\tbubble?: {\n\t\t/**\n\t\t * the key to lookup in charting data for the bubble radius value\n\t\t */\n\t\tradiusMapsTo?: string;\n\t\t/**\n\t\t * options for what the bubble radius value maps to\n\t\t */\n\t\tradiusLabel?: string;\n\t\t/**\n\t\t * A function that would determine the range of the bubble radius to use\n\t\t * Returns an array with the 1st value being the min and the 2nd value being the max radius\n\t\t */\n\t\tradiusRange?: Function;\n\t\t/**\n\t\t * Opacity of the fills used within each circle\n\t\t */\n\t\tfillOpacity?: number;\n\t\t/**\n\t\t * enabled scatter dot or not\n\t\t */\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * options specific to bullet charts\n */\nexport interface BulletChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bullets\n\t */\n\tbullet?: {\n\t\tperformanceAreaTitles?: string[];\n\t};\n}\n\n/**\n * options specific to histogram charts\n */\nexport interface HistogramChartOptions extends AxisChartOptions {\n\t/**\n\t * options related to bins\n\t */\n\tbins?: {\n\t\trangeLabel?: string;\n\t};\n}\n\n/**\n * options specific to line charts\n */\nexport interface LineChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n}\n\n/**\n * options specific to area charts\n */\nexport interface AreaChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n\t/**\n\t * options to bound the area of the chart\n\t */\n\tbounds?: {\n\t\tupperBoundMapsTo?: string;\n\t\tlowerBoundMapsTo?: string;\n\t};\n}\n\n/**\n * options specific to area charts\n */\nexport interface StackedAreaChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n}\n\n/**\n * options specific to world cloud charts\n */\nexport interface WordCloudChartTooltipOptions extends TooltipOptions {\n\t/** the label that shows up by the highlighted word in the tooltip */\n\twordLabel?: string;\n\t/** the label that shows up by the value of the highlighted word in the tooltip */\n\tvalueLabel?: string;\n}\n\nexport interface WorldCloudChartOptions extends BaseChartOptions {\n\twordCloud?: {\n\t\t/** what key in your charting data will the font sizes map to? */\n\t\tfontSizeMapsTo?: string;\n\t\t/** a function (chartSize, data) => {} that'll decide the range of font sizes, e.g. [10, 80] */\n\t\tfontSizeRange?: Function;\n\t\t/** what key in your charting data will the words map to? */\n\t\twordMapsTo?: string;\n\t};\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: WordCloudChartTooltipOptions;\n}\n\n/**\n * options specific to pie charts\n */\nexport interface PieChartOptions extends BaseChartOptions {\n\tpie?: {\n\t\tlabels?: {\n\t\t\tformatter?: Function;\n\t\t\tenabled?: Boolean;\n\t\t};\n\t\talignment?: Alignments;\n\t\t/**\n\t\t * identifier for value key in your charting data\n\t\t * defaults to value\n\t\t */\n\t\tvalueMapsTo?: string;\n\t\tsortFunction?: (a: any, b: any) => number;\n\t};\n}\n\n/**\n * options specific to gauge charts\n */\nexport interface GaugeChartOptions extends BaseChartOptions {\n\tgauge?: {\n\t\tarcWidth?: number;\n\t\tdeltaArrow?: {\n\t\t\tdirection?: ArrowDirections;\n\t\t\tsize?: Function;\n\t\t\tenabled: Boolean;\n\t\t};\n\t\tshowPercentageSymbol?: Boolean;\n\t\tstatus?: Statuses;\n\t\tdeltaFontSize?: Function;\n\t\tnumberSpacing?: number;\n\t\tnumberFormatter?: Function;\n\t\tvalueFontSize?: Function;\n\t\ttype?: GaugeTypes;\n\t\talignment?: Alignments;\n\t};\n}\n\n/**\n * options specific to donut charts\n */\nexport interface DonutChartOptions extends PieChartOptions {\n\tdonut?: {\n\t\tcenter?: {\n\t\t\tlabel?: string;\n\t\t\tnumber?: number;\n\t\t\tnumberFontSize?: Function;\n\t\t\ttitleFontSize?: Function;\n\t\t\ttitleYPosition?: Function;\n\t\t\tnumberFormatter?: Function;\n\t\t};\n\t\talignment?: Alignments;\n\t};\n}\n\nexport interface MeterChartOptions extends BaseChartOptions {\n\tmeter?: {\n\t\tshowLabels?: boolean;\n\t\tproportional?: {\n\t\t\ttotal?: number;\n\t\t\tunit?: string;\n\t\t};\n\t\tpeak?: number;\n\t\tstatus?: {\n\t\t\tranges: Array<{\n\t\t\t\trange: [number, number];\n\t\t\t\tstatus: Statuses;\n\t\t\t}>;\n\t\t};\n\t\theight?: number;\n\t\ttitle?: {\n\t\t\tpercentageIndicator?: {\n\t\t\t\t/**\n\t\t\t\t * rendering of the percentage value relative to the dataset within title\n\t\t\t\t */\n\t\t\t\tenabled?: boolean;\n\t\t\t};\n\t\t};\n\t};\n}\n\nexport interface ProportionalMeterChartOptions extends BaseChartOptions {\n\tmeter?: {\n\t\tproportional?: {\n\t\t\ttotal?: number;\n\t\t\tunit?: string;\n\t\t};\n\t};\n}\n\n/**\n * options specific to radar charts\n */\nexport interface RadarChartOptions extends BaseChartOptions {\n\tradar?: {\n\t\taxes: {\n\t\t\tangle: string;\n\t\t\tvalue: string;\n\t\t};\n\t\talignment?: Alignments;\n\t};\n}\n\n/**\n * options specific to combo charts\n */\nexport interface ComboChartOptions extends AxisChartOptions {\n\tcomboChartTypes: Array<{\n\t\ttype: ChartTypes | any;\n\t\toptions?: object;\n\t\tcorrespondingDatasets: Array<string>;\n\t}>;\n}\n\n/*\n * options specific to treemap charts\n */\nexport interface TreemapChartOptions extends BaseChartOptions {}\n\n/*\n * options specific to tree charts\n */\nexport interface TreeChartOptions extends BaseChartOptions {\n\ttree?: {\n\t\ttype?: TreeTypes;\n\t\trootTitle?: string;\n\t};\n}\n\n/*\n * options specific to circle pack charts\n */\nexport interface CirclePackChartOptions extends BaseChartOptions {\n\tcirclePack?: {\n\t\tcircles: {\n\t\t\tfillOpacity: number;\n\t\t};\n\t\t// depth of nodes to display\n\t\thierachyLevel: number;\n\t\tpadding?: {\n\t\t\touter?: number;\n\t\t\tinner?: number;\n\t\t};\n\t};\n}\n\n/**\n * options specific to Alluvial charts\n */\nexport interface AlluvialChartOptions extends BaseChartOptions {\n\talluvial: {\n\t\tunits?: string;\n\t\t/**\n\t\t * List of nodes to draw\n\t\t */\n\t\tnodes: Array<{\n\t\t\tname: string;\n\t\t\tcategory?: string;\n\t\t}>;\n\t\t/**\n\t\t * Node alignment (Default is center)\n\t\t */\n\t\tnodeAlignment?: Alignments;\n\t\t/**\n\t\t * Set the node padding\n\t\t */\n\t\tnodePadding?: number;\n\t\t/**\n\t\t * Enable single color usage for lines\n\t\t */\n\t\tmonochrome?: boolean;\n\t};\n}\n\n/**\n * options specific to Heatmap charts\n */\nexport interface HeatmapChartOptions extends BaseChartOptions {\n\theatmap: {\n\t\t/**\n\t\t * Divider width state - will default to auto\n\t\t * No cell divider for cell dimensions less than 16\n\t\t */\n\t\tdivider?: {\n\t\t\tstate?: DividerStatus;\n\t\t};\n\t\t/**\n\t\t * customize color legend\n\t\t * enabled by default on select charts\n\t\t */\n\t\tcolorLegend?: {\n\t\t\t/**\n\t\t\t * Text to display beside or on top of the legend\n\t\t\t * Position is determined by text length\n\t\t\t */\n\t\t\ttitle?: string;\n\t\t\ttype: ColorLegendType;\n\t\t};\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"charts.js","sourceRoot":"","sources":["charts.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tGaugeTypes,\n\tStatuses,\n\tArrowDirections,\n\tAlignments,\n\tChartTypes,\n\tTreeTypes,\n\tDividerStatus,\n\tColorLegendType,\n\tChartTheme,\n} from './enums';\nimport {\n\tLegendOptions,\n\tTooltipOptions,\n\tGridOptions,\n\tAxesOptions,\n\tZoomBarsOptions,\n} from './index';\nimport { BarOptions, StackedBarOptions, ToolbarOptions } from './components';\nimport {\n\tAxisOptions,\n\tBinnedAxisOptions,\n\tComboChartAxisOptions,\n\tTimeScaleOptions,\n} from './axis-scales';\n\n/**\n * Base chart options common to any chart\n */\nexport interface BaseChartOptions {\n\t/**\n\t * Optionally specify a title for the chart\n\t */\n\ttitle?: string;\n\t/**\n\t * boolean to disable animations (enabled by default)\n\t */\n\tanimations?: boolean;\n\t/**\n\t * boolean to prevent the container from resizing\n\t */\n\tresizable?: boolean;\n\t/**\n\t * Optionally specify a width for the chart\n\t */\n\twidth?: string;\n\t/**\n\t * Optionally specify a height for the chart\n\t */\n\theight?: string;\n\t/**\n\t * Optionally specify a theme for the chart\n\t */\n\ttheme?: ChartTheme;\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: TooltipOptions;\n\t/**\n\t * legend configuration\n\t */\n\tlegend?: LegendOptions;\n\t/**\n\t * toolbar configurations\n\t */\n\ttoolbar?: ToolbarOptions;\n\t/**\n\t * Optional function to determine whether is filled based on datasetLabel, label, and/or data\n\t */\n\tgetIsFilled?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFilled?: boolean\n\t) => boolean;\n\t/**\n\t * Optional function to generate the fill color based on datasetLabel, label, and/or data\n\t */\n\tgetFillColor?: (\n\t\tgroup: string,\n\t\tlabel?: string,\n\t\tdata?: any,\n\t\tdefaultFillColor?: string\n\t) => string;\n\t/**\n\t * Optional function to generate the stroke color based on datasetLabel, label, and/or data\n\t * (note) - not all chart types support the stroke color (e.g. wordcloud)\n\t */\n\tgetStrokeColor?: (\n\t\tgroup: string,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultStrokeColor?: string\n\t) => string;\n\t/**\n\t * stylesheet options\n\t */\n\tstyle?: {\n\t\t/**\n\t\t * optional prefixing string for css classes (defaults to 'cc')\n\t\t */\n\t\tprefix?: string;\n\t};\n\t/**\n\t * options related to charting data\n\t */\n\tdata?: {\n\t\t/**\n\t\t * identifier for data groups\n\t\t */\n\t\tgroupMapsTo?: string;\n\t\t/**\n\t\t * used to simulate data loading in skeleton way\n\t\t */\n\t\tloading?: boolean;\n\t\t/**\n\t\t * options related to pre-selected data groups\n\t\t * Remains empty if every legend item is active or dataset doesn't have the data groups.\n\t\t */\n\t\tselectedGroups?: string[];\n\t};\n\t/**\n\t * options related to color scales\n\t */\n\tcolor?: {\n\t\t/**\n\t\t * e.g. { 'Dataset 1': 'blue' }\n\t\t */\n\t\tscale?: object;\n\t\t/**\n\t\t * use a carbon dataviz preset color palette\n\t\t * put the index (selection of which variant)\n\t\t */\n\t\tpairing?: {\n\t\t\t/**\n\t\t\t * the number of color variants in the palette (defaults to using the number of data groups in the given data)\n\t\t\t */\n\t\t\tnumberOfVariants?: number;\n\t\t\t/**\n\t\t\t * the option number of the color paring\n\t\t\t */\n\t\t\toption?: number;\n\t\t};\n\t\t/*\n\t\t * options related to gradient\n\t\t * e.g. { enabled: true }\n\t\t */\n\t\tgradient?: {\n\t\t\tenabled?: boolean;\n\t\t\t/**\n\t\t\t * hex color array\n\t\t\t * e.g. ['#fff', '#000', ...]\n\t\t\t */\n\t\t\tcolors?: Array<String>;\n\t\t};\n\t};\n}\n\n/**\n * Options common to any chart with an axis\n */\nexport interface AxisChartOptions extends BaseChartOptions {\n\taxes?: AxesOptions<AxisOptions>;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\t/**\n\t * zoombar configuration\n\t */\n\tzoomBar?: ZoomBarsOptions;\n}\n\n/**\n * Options common to binned charts with an axis\n */\nexport interface BinnedAxisChartOptions extends AxisChartOptions {\n\taxes?: AxesOptions<BinnedAxisOptions>;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\t/**\n\t * zoombar configuration\n\t */\n\tzoomBar?: ZoomBarsOptions;\n}\n\n/**\n * options specific to boxplot charts\n */\nexport interface BoxplotChartOptions extends AxisChartOptions {}\n\n/**\n * options specific to bar charts\n */\nexport interface BarChartOptions extends AxisChartOptions {\n\tbars?: BarOptions;\n}\n\n/**\n * options specific to stacked bar charts\n */\nexport interface StackedBarChartOptions extends BarChartOptions {\n\tbars?: StackedBarOptions;\n}\n\n/**\n * options specific to scatter charts\n */\nexport interface ScatterChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the points\n\t */\n\tpoints?: {\n\t\t/**\n\t\t * sets the radius of the point\n\t\t */\n\t\tradius: number;\n\t\tfillOpacity?: number;\n\t\tfilled?: boolean;\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * options specific to lollipop charts\n */\nexport interface LollipopChartOptions extends ScatterChartOptions {}\n\n/**\n * options specific to bubble charts\n */\nexport interface BubbleChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bubbles\n\t */\n\tbubble?: {\n\t\t/**\n\t\t * the key to lookup in charting data for the bubble radius value\n\t\t */\n\t\tradiusMapsTo?: string;\n\t\t/**\n\t\t * options for what the bubble radius value maps to\n\t\t */\n\t\tradiusLabel?: string;\n\t\t/**\n\t\t * A function that would determine the range of the bubble radius to use\n\t\t * Returns an array with the 1st value being the min and the 2nd value being the max radius\n\t\t */\n\t\tradiusRange?: Function;\n\t\t/**\n\t\t * Opacity of the fills used within each circle\n\t\t */\n\t\tfillOpacity?: number;\n\t\t/**\n\t\t * enabled scatter dot or not\n\t\t */\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * options specific to bullet charts\n */\nexport interface BulletChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bullets\n\t */\n\tbullet?: {\n\t\tperformanceAreaTitles?: string[];\n\t};\n}\n\n/**\n * options specific to histogram charts\n */\nexport interface HistogramChartOptions extends AxisChartOptions {\n\t/**\n\t * options related to bins\n\t */\n\tbins?: {\n\t\trangeLabel?: string;\n\t};\n}\n\n/**\n * options specific to line charts\n */\nexport interface LineChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n}\n\n/**\n * options specific to area charts\n */\nexport interface AreaChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n\t/**\n\t * options to bound the area of the chart\n\t */\n\tbounds?: {\n\t\tupperBoundMapsTo?: string;\n\t\tlowerBoundMapsTo?: string;\n\t};\n}\n\n/**\n * options specific to area charts\n */\nexport interface StackedAreaChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?: string | { name: string };\n}\n\n/**\n * options specific to world cloud charts\n */\nexport interface WordCloudChartTooltipOptions extends TooltipOptions {\n\t/** the label that shows up by the highlighted word in the tooltip */\n\twordLabel?: string;\n\t/** the label that shows up by the value of the highlighted word in the tooltip */\n\tvalueLabel?: string;\n}\n\nexport interface WorldCloudChartOptions extends BaseChartOptions {\n\twordCloud?: {\n\t\t/** what key in your charting data will the font sizes map to? */\n\t\tfontSizeMapsTo?: string;\n\t\t/** a function (chartSize, data) => {} that'll decide the range of font sizes, e.g. [10, 80] */\n\t\tfontSizeRange?: Function;\n\t\t/** what key in your charting data will the words map to? */\n\t\twordMapsTo?: string;\n\t};\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: WordCloudChartTooltipOptions;\n}\n\n/**\n * options specific to pie charts\n */\nexport interface PieChartOptions extends BaseChartOptions {\n\tpie?: {\n\t\tlabels?: {\n\t\t\tformatter?: Function;\n\t\t\tenabled?: Boolean;\n\t\t};\n\t\talignment?: Alignments;\n\t\t/**\n\t\t * identifier for value key in your charting data\n\t\t * defaults to value\n\t\t */\n\t\tvalueMapsTo?: string;\n\t\tsortFunction?: (a: any, b: any) => number;\n\t};\n}\n\n/**\n * options specific to gauge charts\n */\nexport interface GaugeChartOptions extends BaseChartOptions {\n\tgauge?: {\n\t\tarcWidth?: number;\n\t\tdeltaArrow?: {\n\t\t\tdirection?: ArrowDirections;\n\t\t\tsize?: Function;\n\t\t\tenabled: Boolean;\n\t\t};\n\t\tshowPercentageSymbol?: Boolean;\n\t\tstatus?: Statuses;\n\t\tdeltaFontSize?: Function;\n\t\tnumberSpacing?: number;\n\t\tnumberFormatter?: Function;\n\t\tvalueFontSize?: Function;\n\t\ttype?: GaugeTypes;\n\t\talignment?: Alignments;\n\t};\n}\n\n/**\n * options specific to donut charts\n */\nexport interface DonutChartOptions extends PieChartOptions {\n\tdonut?: {\n\t\tcenter?: {\n\t\t\tlabel?: string;\n\t\t\tnumber?: number;\n\t\t\tnumberFontSize?: Function;\n\t\t\ttitleFontSize?: Function;\n\t\t\ttitleYPosition?: Function;\n\t\t\tnumberFormatter?: Function;\n\t\t};\n\t\talignment?: Alignments;\n\t};\n}\n\nexport interface MeterChartOptions extends BaseChartOptions {\n\tmeter?: {\n\t\tshowLabels?: boolean;\n\t\tproportional?: {\n\t\t\ttotal?: number;\n\t\t\tunit?: string;\n\t\t};\n\t\tpeak?: number;\n\t\tstatus?: {\n\t\t\tranges: Array<{\n\t\t\t\trange: [number, number];\n\t\t\t\tstatus: Statuses;\n\t\t\t}>;\n\t\t};\n\t\theight?: number;\n\t\ttitle?: {\n\t\t\tpercentageIndicator?: {\n\t\t\t\t/**\n\t\t\t\t * rendering of the percentage value relative to the dataset within title\n\t\t\t\t */\n\t\t\t\tenabled?: boolean;\n\t\t\t};\n\t\t};\n\t};\n}\n\nexport interface ProportionalMeterChartOptions extends BaseChartOptions {\n\tmeter?: {\n\t\tproportional?: {\n\t\t\ttotal?: number;\n\t\t\tunit?: string;\n\t\t};\n\t};\n}\n\n/**\n * options specific to radar charts\n */\nexport interface RadarChartOptions extends BaseChartOptions {\n\tradar?: {\n\t\taxes: {\n\t\t\tangle: string;\n\t\t\tvalue: string;\n\t\t};\n\t\talignment?: Alignments;\n\t};\n}\n\n/**\n * options specific to combo charts\n */\nexport interface ComboChartOptions extends AxisChartOptions {\n\taxes?: AxesOptions<ComboChartAxisOptions>;\n\tcomboChartTypes: Array<{\n\t\ttype: ChartTypes | any;\n\t\toptions?: object;\n\t\tcorrespondingDatasets: Array<string>;\n\t}>;\n}\n\n/*\n * options specific to treemap charts\n */\nexport interface TreemapChartOptions extends BaseChartOptions {}\n\n/*\n * options specific to tree charts\n */\nexport interface TreeChartOptions extends BaseChartOptions {\n\ttree?: {\n\t\ttype?: TreeTypes;\n\t\trootTitle?: string;\n\t};\n}\n\n/*\n * options specific to circle pack charts\n */\nexport interface CirclePackChartOptions extends BaseChartOptions {\n\tcirclePack?: {\n\t\tcircles: {\n\t\t\tfillOpacity: number;\n\t\t};\n\t\t// depth of nodes to display\n\t\thierachyLevel: number;\n\t\tpadding?: {\n\t\t\touter?: number;\n\t\t\tinner?: number;\n\t\t};\n\t};\n}\n\n/**\n * options specific to Alluvial charts\n */\nexport interface AlluvialChartOptions extends BaseChartOptions {\n\talluvial: {\n\t\tunits?: string;\n\t\t/**\n\t\t * List of nodes to draw\n\t\t */\n\t\tnodes: Array<{\n\t\t\tname: string;\n\t\t\tcategory?: string;\n\t\t}>;\n\t\t/**\n\t\t * Node alignment (Default is center)\n\t\t */\n\t\tnodeAlignment?: Alignments;\n\t\t/**\n\t\t * Set the node padding\n\t\t */\n\t\tnodePadding?: number;\n\t\t/**\n\t\t * Enable single color usage for lines\n\t\t */\n\t\tmonochrome?: boolean;\n\t};\n}\n\n/**\n * options specific to Heatmap charts\n */\nexport interface HeatmapChartOptions extends BaseChartOptions {\n\theatmap: {\n\t\t/**\n\t\t * Divider width state - will default to auto\n\t\t * No cell divider for cell dimensions less than 16\n\t\t */\n\t\tdivider?: {\n\t\t\tstate?: DividerStatus;\n\t\t};\n\t\t/**\n\t\t * customize color legend\n\t\t * enabled by default on select charts\n\t\t */\n\t\tcolorLegend?: {\n\t\t\t/**\n\t\t\t * Text to display beside or on top of the legend\n\t\t\t * Position is determined by text length\n\t\t\t */\n\t\t\ttitle?: string;\n\t\t\ttype: ColorLegendType;\n\t\t};\n\t};\n}\n"]}
|
package/package.json
CHANGED
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -258,12 +258,12 @@
|
|
|
258
258
|
"signature": "b3393902df89f63a8da74a8003ee951164b2556608d256c248d6d79510becbb2"
|
|
259
259
|
},
|
|
260
260
|
"../src/interfaces/axis-scales.ts": {
|
|
261
|
-
"version": "
|
|
262
|
-
"signature": "
|
|
261
|
+
"version": "974a79238c33161b6b3353101bcc832c518598aa9a1a52bc0d32edb3451379cf",
|
|
262
|
+
"signature": "eb74e0c21a374f1ed0ee6a35a1bbc27b14f89990755ddef7037e4fade072882d"
|
|
263
263
|
},
|
|
264
264
|
"../src/interfaces/charts.ts": {
|
|
265
|
-
"version": "
|
|
266
|
-
"signature": "
|
|
265
|
+
"version": "d17c6531b21db51a05c2118ddaf7882a785bcc4f9ccaf5610e85431afebb2ceb",
|
|
266
|
+
"signature": "a031e04af6d0ce1e3011f40bee58873ad959c5ceda42d3efa3d2530681bde342"
|
|
267
267
|
},
|
|
268
268
|
"../src/interfaces/layout.ts": {
|
|
269
269
|
"version": "684de2d7c612bd74a9d8e866b0b94cc53bd824422be4b3d216dc6682614e5fe8",
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
"signature": "6f3713e818b533c35baf17cc31cf6606d42bb3fc62e0f488c81d8f5c5e84b655"
|
|
443
443
|
},
|
|
444
444
|
"../src/components/graphs/heatmap.ts": {
|
|
445
|
-
"version": "
|
|
445
|
+
"version": "e5345e75a39ca123358333047ad00d3b545f806c9724887ab0950e691eb0a243",
|
|
446
446
|
"signature": "d53ef21c5edafc7c01599e31bee92cbcdcb948e93ed129eaec19467bcc2f998e"
|
|
447
447
|
},
|
|
448
448
|
"../src/components/layout/spacer.ts": {
|