@carbon/charts 0.47.0 → 0.48.0

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/axis-chart.js +2 -1
  3. package/axis-chart.js.map +1 -1
  4. package/build/demo/data/area.d.ts +33 -0
  5. package/build/src/components/axes/zoom-bar.d.ts +1 -0
  6. package/build/src/components/essentials/highlights.d.ts +13 -0
  7. package/build/src/components/index.d.ts +1 -0
  8. package/bundle.js +1 -1
  9. package/components/axes/zoom-bar.d.ts +1 -0
  10. package/components/axes/zoom-bar.js +26 -0
  11. package/components/axes/zoom-bar.js.map +1 -1
  12. package/components/essentials/highlights.d.ts +13 -0
  13. package/components/essentials/highlights.js +196 -0
  14. package/components/essentials/highlights.js.map +1 -0
  15. package/components/index.d.ts +1 -0
  16. package/components/index.js +1 -0
  17. package/components/index.js.map +1 -1
  18. package/demo/data/area.d.ts +33 -0
  19. package/demo/data/area.js +41 -0
  20. package/demo/data/area.js.map +1 -1
  21. package/demo/data/bundle.js +1 -1
  22. package/demo/data/index.js +15 -0
  23. package/demo/data/index.js.map +1 -1
  24. package/demo/styles.css +32 -0
  25. package/demo/styles.css.map +1 -1
  26. package/demo/styles.min.css +1 -1
  27. package/demo/styles.min.css.map +1 -1
  28. package/demo/tsconfig.tsbuildinfo +67 -66
  29. package/package.json +1 -1
  30. package/styles/components/_highlights.scss +6 -0
  31. package/styles/components/_zoom-bar.scss +5 -0
  32. package/styles/components/index.scss +1 -0
  33. package/styles-g10.css +9 -0
  34. package/styles-g10.css.map +1 -1
  35. package/styles-g10.min.css +1 -1
  36. package/styles-g10.min.css.map +1 -1
  37. package/styles-g100.css +9 -0
  38. package/styles-g100.css.map +1 -1
  39. package/styles-g100.min.css +1 -1
  40. package/styles-g100.min.css.map +1 -1
  41. package/styles-g90.css +9 -0
  42. package/styles-g90.css.map +1 -1
  43. package/styles-g90.min.css +1 -1
  44. package/styles-g90.min.css.map +1 -1
  45. package/styles.css +9 -0
  46. package/styles.css.map +1 -1
  47. package/styles.min.css +1 -1
  48. package/styles.min.css.map +1 -1
  49. package/tsconfig.tsbuildinfo +31 -5
@@ -11,6 +11,7 @@ export declare class ZoomBar extends Component {
11
11
  brush: import("d3-brush").BrushBehavior<unknown>;
12
12
  xScale: any;
13
13
  yScale: any;
14
+ highlightStrokeWidth: number;
14
15
  protected model: ChartModelCartesian;
15
16
  init(): void;
16
17
  render(animate?: boolean): void;
@@ -37,6 +37,7 @@ var ZoomBar = /** @class */ (function (_super) {
37
37
  // so they don't interfere the other zoom bars in a page
38
38
  _this.clipId = 'zoomBarClip-' + Math.floor(Math.random() * 99999999999);
39
39
  _this.brush = brushX();
40
+ _this.highlightStrokeWidth = 1;
40
41
  return _this;
41
42
  }
42
43
  ZoomBar.prototype.init = function () {
@@ -53,6 +54,8 @@ var ZoomBar = /** @class */ (function (_super) {
53
54
  var isTopZoomBarLoading = this.services.zoom.isZoomBarLoading(AxisPositions.TOP);
54
55
  var isTopZoomBarLocked = this.services.zoom.isZoomBarLocked(AxisPositions.TOP);
55
56
  var zoombarType = Tools.getProperty(this.getOptions(), 'zoomBar', AxisPositions.TOP, 'type');
57
+ // As zoom current only available on top only highlights corresponding to bottom axis will be shown
58
+ var highlight = Tools.getProperty(this.getOptions(), 'axes', AxisPositions.BOTTOM, 'highlights');
56
59
  var zoombarHeight = Configuration.zoomBar.height[zoombarType];
57
60
  var width = DOMUtils.getSVGElementSize(this.parent, {
58
61
  useAttrs: true,
@@ -164,6 +167,29 @@ var ZoomBar = /** @class */ (function (_super) {
164
167
  this.renderZoomBarArea(container, 'path.zoom-graph-area', zoomBarData, this.clipId);
165
168
  // Draw the zoom bar base line
166
169
  this.renderZoomBarBaseline(container, axesLeftMargin, width);
170
+ if (highlight) {
171
+ var startHighlight_1 = highlight.highlightStartMapsTo;
172
+ var endHighlight_1 = highlight.highlightEndMapsTo;
173
+ var color_1 = highlight.color;
174
+ var labelMapTo_1 = highlight.labelMapsTo;
175
+ highlight.data.forEach(function (element, index) {
176
+ DOMUtils.appendOrSelect(container, "rect.highlight-" + index)
177
+ .attr('height', zoombarHeight - 2 * _this.highlightStrokeWidth)
178
+ .attr('y', _this.highlightStrokeWidth)
179
+ .attr('x', _this.xScale(element[startHighlight_1]))
180
+ .attr('width', _this.xScale(element[endHighlight_1]) -
181
+ _this.xScale(element[startHighlight_1]))
182
+ .style('fill', color_1 && color_1.scale[element[labelMapTo_1]]
183
+ ? color_1.scale[element[labelMapTo_1]]
184
+ : null)
185
+ .style('fill-opacity', 0.1)
186
+ .style('stroke', color_1 && color_1.scale[element[labelMapTo_1]]
187
+ ? color_1.scale[element[labelMapTo_1]]
188
+ : null)
189
+ .style('stroke-dasharray', '2, 2')
190
+ .attr('stroke-width', 1 + 'px');
191
+ });
192
+ }
167
193
  }
168
194
  // Attach brushing event listeners
169
195
  this.addBrushEventListener(zoomDomain, axesLeftMargin, width);
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-bar.js","sourceRoot":"","sources":["zoom-bar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACN,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;QAAA,qEAooBC;QAnoBA,UAAI,GAAG,UA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,MAAM,CACX,CAAC;QACF,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QACvC,iBAAiB;QACjB,QAAQ,CAAC,cAAc,CACtB,IAAI,CAAC,qBAAqB,EAAE,EAC5B,IAAI,CAAC,aAAa,CAClB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,+FAA+F;QAC/F,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACpC,IAAI,CAAC,UAAU,EAAE,EACjB,SAAS,EACT,aAAa,CAAC,GAAG,EACjB,MAAM,CACN,CAAC;QACF,IAAI,WAAW,KAAK,YAAY,CAAC,UAAU,EAAE;YAC5C,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SAC1D;IACF,CAAC;IAED,yBAAO,GAAP;QACC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,wBAAwB;QAChE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CACvC,MAAM,CAAC,OAAO,CAAC,MAAM,EACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CACtB,CAAC;IACH,CAAC;IACF,cAAC;AAAD,CAAC,AApoBD,CAA6B,SAAS,GAooBrC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { ChartModelCartesian } from '../../model/cartesian-charts';\nimport { Tools } from '../../tools';\nimport {\n\tAxisPositions,\n\tEvents,\n\tRenderTypes,\n\tScaleTypes,\n\tZoomBarTypes,\n} from '../../interfaces';\nimport { DOMUtils } from '../../services';\nimport * as Configuration from '../../configuration';\n\n// D3 Imports\nimport { extent } from 'd3-array';\nimport { brushX } from 'd3-brush';\nimport { area, line } from 'd3-shape';\n\nexport class ZoomBar extends Component {\n\ttype = 'zoom-bar';\n\trenderType = RenderTypes.SVG;\n\n\t// The minimum selection x range to trigger handler update\n\t// Smaller number may introduce a handler flash during initialization\n\t// Bigger number may not trigger handler update while selection area on chart is very small\n\tMIN_SELECTION_DIFF = 9e-10;\n\n\t// needs to match the style in _zoom-bar.scss\n\tbrushSelector = 'g.zoom-bar-brush';\n\n\t// The max allowed selection range, will be updated soon in render()\n\tmaxSelectionRange: [0, 0];\n\n\t// Give every zoomBarClip a distinct ID\n\t// so they don't interfere the other zoom bars in a page\n\tclipId = 'zoomBarClip-' + Math.floor(Math.random() * 99999999999);\n\n\tbrush = brushX();\n\txScale: any;\n\tyScale: any;\n\n\tprotected model: ChartModelCartesian;\n\n\tinit() {\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.ZoomBar.UPDATE,\n\t\t\tthis.render.bind(this)\n\t\t);\n\t\t// check if pre-defined zoom bar data exists\n\t\tconst definedZoomBarData = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'data'\n\t\t);\n\n\t\t// load up the zoomBarData into this model\n\t\tthis.model.setZoomBarData(definedZoomBarData);\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer();\n\n\t\tconst isTopZoomBarLoading = this.services.zoom.isZoomBarLoading(\n\t\t\tAxisPositions.TOP\n\t\t);\n\t\tconst isTopZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\t\t// initialization is not completed yet\n\t\tif (width === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0;\n\t\tconst axesMargins = this.model.get('axesMargins');\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left;\n\t\t}\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.zoom-container')\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoombarHeight)\n\t\t\t.attr('opacity', 1);\n\n\t\tconst spacer = DOMUtils.appendOrSelect(svg, 'rect.zoom-spacer')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', zoombarHeight)\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', Configuration.zoomBar.spacerHeight)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill', 'none');\n\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t// Draw zoombar background rectangle\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', 0)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', '100%')\n\t\t\t\t.classed('zoom-bg-skeleton', isTopZoomBarLoading);\n\t\t} else if (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\t// Draw zoombar background line\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', 2)\n\t\t\t\t.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading);\n\t\t}\n\n\t\tif (isTopZoomBarLoading) {\n\t\t\tthis.renderSkeleton(container, axesLeftMargin, width);\n\t\t\treturn;\n\t\t}\n\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXScale = cartesianScales.getMainXScale();\n\t\tconst mainYScale = cartesianScales.getMainYScale();\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType();\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\tlet zoomBarData = this.services.zoom.getZoomBarData();\n\t\t\tif (Tools.isEmpty(zoomBarData)) {\n\t\t\t\t// if there's no zoom bar data we can't do anything\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.xScale = mainXScale.copy();\n\t\t\tthis.yScale = mainYScale.copy();\n\n\t\t\tconst defaultDomain = this.services.zoom.getDefaultZoomBarDomain(\n\t\t\t\tzoomBarData\n\t\t\t);\n\n\t\t\t// add value 0 to the extended domain for zoom bar area graph\n\t\t\tzoomBarData = this.compensateDataForDefaultDomain(\n\t\t\t\tzoomBarData,\n\t\t\t\tdefaultDomain\n\t\t\t);\n\n\t\t\t// get old initialZoomDomain from model\n\t\t\tconst oldInitialZoomDomain = this.model.get('initialZoomDomain');\n\t\t\t// get new initialZoomDomain from option\n\t\t\tconst newInitialZoomDomain = Tools.getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\tAxisPositions.TOP,\n\t\t\t\t'initialZoomDomain'\n\t\t\t);\n\t\t\t// change string date to Date object if necessary\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\tnewInitialZoomDomain[0] &&\n\t\t\t\tnewInitialZoomDomain[1]\n\t\t\t) {\n\t\t\t\tnewInitialZoomDomain[0] = new Date(newInitialZoomDomain[0]);\n\t\t\t\tnewInitialZoomDomain[1] = new Date(newInitialZoomDomain[1]);\n\t\t\t}\n\t\t\t// update initialZoomDomain and set zoomDomain in model only if the option is changed\n\t\t\t// not the same object, and both start date and end date are not equal\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\t!(\n\t\t\t\t\toldInitialZoomDomain &&\n\t\t\t\t\toldInitialZoomDomain[0].valueOf() ===\n\t\t\t\t\t\tnewInitialZoomDomain[0].valueOf() &&\n\t\t\t\t\toldInitialZoomDomain[1].valueOf() ===\n\t\t\t\t\t\tnewInitialZoomDomain[1].valueOf()\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\t// use a new object instead of newInitialZoomDomain\n\t\t\t\t\t\tinitialZoomDomain: Tools.merge(\n\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\tnewInitialZoomDomain\n\t\t\t\t\t\t),\n\t\t\t\t\t\tzoomDomain: newInitialZoomDomain\n\t\t\t\t\t\t\t? Tools.merge([], newInitialZoomDomain)\n\t\t\t\t\t\t\t: defaultDomain,\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tnewInitialZoomDomain === null &&\n\t\t\t\toldInitialZoomDomain != null\n\t\t\t) {\n\t\t\t\t// if newInitialZoomDomain is set to null (when oldInitialZoomDomain is not null)\n\t\t\t\t// save initialZoomDomain and reset zoom domain to default domain\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\tinitialZoomDomain: null,\n\t\t\t\t\t\tzoomDomain: Tools.merge([], defaultDomain),\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.xScale.range([axesLeftMargin, width]).domain(defaultDomain);\n\n\t\t\t// keep max selection range\n\t\t\tthis.maxSelectionRange = this.xScale.range();\n\n\t\t\tthis.yScale\n\t\t\t\t.range([0, zoombarHeight - 6])\n\t\t\t\t.domain(extent(zoomBarData, (d: any) => d.value));\n\n\t\t\tconst zoomDomain = this.model.get('zoomDomain');\n\n\t\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t\tthis.renderZoomBarArea(\n\t\t\t\t\tcontainer,\n\t\t\t\t\t'path.zoom-graph-area-unselected',\n\t\t\t\t\tzoomBarData,\n\t\t\t\t\tnull\n\t\t\t\t);\n\t\t\t\tthis.updateClipPath(svg, this.clipId, 0, 0, 0, 0);\n\t\t\t\tthis.renderZoomBarArea(\n\t\t\t\t\tcontainer,\n\t\t\t\t\t'path.zoom-graph-area',\n\t\t\t\t\tzoomBarData,\n\t\t\t\t\tthis.clipId\n\t\t\t\t);\n\t\t\t\t// Draw the zoom bar base line\n\t\t\t\tthis.renderZoomBarBaseline(container, axesLeftMargin, width);\n\t\t\t}\n\n\t\t\t// Attach brushing event listeners\n\t\t\tthis.addBrushEventListener(zoomDomain, axesLeftMargin, width);\n\n\t\t\t// Draw the brushing area\n\t\t\tconst brushArea = DOMUtils.appendOrSelect(\n\t\t\t\tsvg,\n\t\t\t\tthis.brushSelector\n\t\t\t).call(this.brush);\n\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// do nothing, initialization not completed yet\n\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t} else if (zoomDomain[0].valueOf() === zoomDomain[1].valueOf()) {\n\t\t\t\tbrushArea.call(this.brush.move, this.xScale.range()); // default to full range\n\t\t\t\tthis.updateBrushHandle(\n\t\t\t\t\tthis.getComponentContainer(),\n\t\t\t\t\tthis.xScale.range(),\n\t\t\t\t\tthis.xScale.domain()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst selected = zoomDomain.map((domain) =>\n\t\t\t\t\tthis.xScale(domain)\n\t\t\t\t);\n\t\t\t\tif (selected[1] - selected[0] < this.MIN_SELECTION_DIFF) {\n\t\t\t\t\t// initialization not completed yet\n\t\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t\t} else {\n\t\t\t\t\tbrushArea.call(this.brush.move, selected); // set brush to correct position\n\t\t\t\t\tthis.updateBrushHandle(\n\t\t\t\t\t\tthis.getComponentContainer(),\n\t\t\t\t\t\tselected,\n\t\t\t\t\t\tzoomDomain\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isTopZoomBarLocked) {\n\t\t\t\tthis.brush.filter(() => {\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\t// reset all cursor to auto\n\t\t\t\tbrushArea.selectAll('rect').attr('cursor', 'auto');\n\t\t\t}\n\t\t}\n\t}\n\n\taddBrushEventListener(zoomDomain, axesLeftMargin, width) {\n\t\tconst brushEventListener = (event) => {\n\t\t\tconst selection = event.selection;\n\t\t\t// follow d3 behavior: when selection is null, reset default full range\n\t\t\t// select behavior is completed, but nothing selected\n\t\t\tif (selection === null) {\n\t\t\t\tthis.handleBrushedEvent(\n\t\t\t\t\tevent,\n\t\t\t\t\tzoomDomain,\n\t\t\t\t\tthis.xScale,\n\t\t\t\t\tthis.xScale.range()\n\t\t\t\t);\n\t\t\t} else if (selection[0] === selection[1]) {\n\t\t\t\t// select behavior is not completed yet, do nothing\n\t\t\t} else {\n\t\t\t\tthis.handleBrushedEvent(\n\t\t\t\t\tevent,\n\t\t\t\t\tzoomDomain,\n\t\t\t\t\tthis.xScale,\n\t\t\t\t\tselection\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\t// Initialize the d3 brush\n\t\tthis.brush\n\t\t\t.extent([\n\t\t\t\t[axesLeftMargin, 0],\n\t\t\t\t[width, zoombarHeight],\n\t\t\t])\n\t\t\t.on('start brush end', null) // remove old listener first\n\t\t\t.on('start brush end', brushEventListener);\n\t}\n\n\t// brush event listener\n\thandleBrushedEvent(event, zoomDomain, scale, selection) {\n\t\tconst newDomain = [\n\t\t\tscale.invert(selection[0]),\n\t\t\tscale.invert(selection[1]),\n\t\t];\n\n\t\t// update brush handle position\n\t\tthis.updateBrushHandle(\n\t\t\tthis.getComponentContainer(),\n\t\t\tselection,\n\t\t\tnewDomain\n\t\t);\n\n\t\t// be aware that the value of d3.event changes during an event!\n\t\t// update zoomDomain only if the event comes from mouse/touch event\n\t\tif (\n\t\t\tevent.sourceEvent != null &&\n\t\t\t(event.sourceEvent.type === 'mousemove' ||\n\t\t\t\tevent.sourceEvent.type === 'mouseup' ||\n\t\t\t\tevent.sourceEvent.type === 'mousedown' ||\n\t\t\t\tevent.sourceEvent.type === 'touchstart' ||\n\t\t\t\tevent.sourceEvent.type === 'touchmove' ||\n\t\t\t\tevent.sourceEvent.type === 'touchend')\n\t\t) {\n\t\t\t// only if zoomDomain is never set or needs update\n\t\t\tif (\n\t\t\t\tzoomDomain === undefined ||\n\t\t\t\tzoomDomain[0] !== newDomain[0] ||\n\t\t\t\tzoomDomain[1] !== newDomain[1]\n\t\t\t) {\n\t\t\t\t// don't dispatch event for all event types\n\t\t\t\t// let the following code to dispatch necessary events\n\t\t\t\tthis.services.zoom.handleDomainChange(newDomain, {\n\t\t\t\t\tdispatchEvent: false,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// dispatch selection events\n\t\t\tlet zoomBarEventType;\n\t\t\tif (event.type === 'start') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_START;\n\t\t\t} else if (event.type === 'brush') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_IN_PROGRESS;\n\t\t\t} else if (event.type === 'end') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_END;\n\t\t\t\t// only dispatch zoom domain change event for triggering api call when event type equals to end\n\t\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\t\tnewDomain,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.services.events.dispatchEvent(zoomBarEventType, {\n\t\t\t\tselection,\n\t\t\t\tnewDomain,\n\t\t\t});\n\t\t}\n\t}\n\n\tupdateBrushHandle(svg, selection, domain) {\n\t\tconst self = this;\n\t\tconst handleWidth = Configuration.zoomBar.handleWidth;\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst handleHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst handleXDiff = -handleWidth / 2;\n\n\t\tconst handleBarWidth = Configuration.zoomBar.handleBarWidth;\n\t\tconst handleBarHeight =\n\t\t\tzoombarType === ZoomBarTypes.GRAPH_VIEW\n\t\t\t\t? Configuration.zoomBar.handleBarHeight\n\t\t\t\t: 6;\n\t\tconst handleBarXDiff = -handleBarWidth / 2;\n\t\tconst handleYBarDiff = (handleHeight - handleBarHeight) / 2;\n\n\t\t// handle\n\t\tsvg.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t\t.attr('x', function (d) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0]\n\t\t\t\t\t);\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] - handleWidth\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', handleWidth)\n\t\t\t.attr('height', handleHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\t\t\t.style('display', null); // always display\n\n\t\t// handle-bar\n\t\tconst handleBars = svg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle-bar')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }]);\n\t\t// create rect if not exists\n\t\thandleBars\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.attr('class', function (d) {\n\t\t\t\treturn 'handle-bar handle-bar--' + d.type;\n\t\t\t});\n\t\t// update positions\n\t\thandleBars\n\t\t\t.attr('x', function (d) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0] - handleXDiff + handleBarXDiff\n\t\t\t\t\t);\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] + handleXDiff + handleBarXDiff\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', handleYBarDiff)\n\t\t\t.attr('width', handleBarWidth)\n\t\t\t.attr('height', handleBarHeight)\n\t\t\t.attr('cursor', 'ew-resize');\n\n\t\t// Update slider selected area\n\t\tif (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\tthis.updateSliderSelectedArea(selection);\n\t\t}\n\n\t\tthis.updateClipPath(\n\t\t\tsvg,\n\t\t\tthis.clipId,\n\t\t\tselection[0],\n\t\t\t0,\n\t\t\tselection[1] - selection[0],\n\t\t\thandleHeight\n\t\t);\n\t}\n\n\tupdateSliderSelectedArea(selection) {\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0;\n\t\tconst axesMargins = this.model.get('axesMargins');\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left;\n\t\t}\n\n\t\tconst svg = this.getComponentContainer();\n\t\tconst container = svg.select('svg.zoom-container');\n\n\t\t// Draw zoombar background line\n\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-selected-area')\n\t\t\t.attr('x', selection[0])\n\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t.attr('width', selection[1] - selection[0])\n\t\t\t.attr('height', 2);\n\t}\n\n\trenderZoomBarArea(container, querySelector, data, clipId) {\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition();\n\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition();\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType();\n\t\tconst mainYScaleType = cartesianScales.getMainYScaleType();\n\n\t\tconst accessorFunction = (scale, scaleType, axisPosition) => {\n\t\t\treturn (d, i) => {\n\t\t\t\treturn cartesianScales.getValueFromScale(\n\t\t\t\t\tscale,\n\t\t\t\t\tscaleType,\n\t\t\t\t\taxisPosition,\n\t\t\t\t\td,\n\t\t\t\t\ti\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\n\t\tconst xAccessor = accessorFunction(\n\t\t\tthis.xScale,\n\t\t\tmainXScaleType,\n\t\t\tmainXAxisPosition\n\t\t);\n\t\tconst yAccessor = accessorFunction(\n\t\t\tthis.yScale,\n\t\t\tmainYScaleType,\n\t\t\tmainYAxisPosition\n\t\t);\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst areaGenerator = area()\n\t\t\t.x((d, i) => xAccessor(d, i))\n\t\t\t.y0(zoombarHeight)\n\t\t\t.y1((d, i) => zoombarHeight - yAccessor(d, i));\n\n\t\tconst areaGraph = DOMUtils.appendOrSelect(container, querySelector)\n\t\t\t.datum(data)\n\t\t\t.attr('d', areaGenerator);\n\n\t\tif (clipId) {\n\t\t\tareaGraph.attr('clip-path', `url(#${clipId})`);\n\t\t}\n\t}\n\n\tupdateClipPath(svg, clipId, x, y, width, height) {\n\t\tconst zoomBarClipPath = DOMUtils.appendOrSelect(svg, `clipPath`).attr(\n\t\t\t'id',\n\t\t\tclipId\n\t\t);\n\t\tDOMUtils.appendOrSelect(zoomBarClipPath, 'rect')\n\t\t\t.attr('x', x)\n\t\t\t.attr('y', y)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height);\n\t}\n\n\t// assume the domains in data are already sorted\n\tcompensateDataForDefaultDomain(data, defaultDomain) {\n\t\tif (!data || data.length < 2) {\n\t\t\treturn;\n\t\t}\n\t\tconst zoomBarData = Tools.clone(data);\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\t// if min domain is extended\n\t\tif (\n\t\t\tNumber(defaultDomain[0]) < Number(zoomBarData[0][domainIdentifier])\n\t\t) {\n\t\t\tconst newDatum = {};\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[0];\n\t\t\tnewDatum[rangeIdentifier] = 0;\n\t\t\tzoomBarData.unshift(newDatum);\n\t\t}\n\t\t// if max domain is extended\n\t\tif (\n\t\t\tNumber(defaultDomain[1]) >\n\t\t\tNumber(zoomBarData[zoomBarData.length - 1][domainIdentifier])\n\t\t) {\n\t\t\tconst newDatum = {};\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[1];\n\t\t\tnewDatum[rangeIdentifier] = 0;\n\t\t\tzoomBarData.push(newDatum);\n\t\t}\n\t\treturn zoomBarData;\n\t}\n\n\trenderZoomBarBaseline(container, startX, endX, skeletonClass = false) {\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst baselineGenerator = line()([\n\t\t\t[startX, zoombarHeight],\n\t\t\t[endX, zoombarHeight],\n\t\t]);\n\t\tDOMUtils.appendOrSelect(container, 'path.zoom-bg-baseline')\n\t\t\t.attr('d', baselineGenerator)\n\t\t\t.classed('zoom-bg-baseline-skeleton', skeletonClass);\n\t}\n\n\trenderSkeleton(container, startX, endX) {\n\t\t// need to clear current zoom bar area\n\t\tthis.renderZoomBarArea(\n\t\t\tcontainer,\n\t\t\t'path.zoom-graph-area-unselected',\n\t\t\t[],\n\t\t\tnull\n\t\t);\n\t\tthis.renderZoomBarArea(\n\t\t\tcontainer,\n\t\t\t'path.zoom-graph-area',\n\t\t\t[],\n\t\t\tthis.clipId\n\t\t);\n\t\t// remove brush listener\n\t\tthis.brush.on('start brush end', null);\n\t\t// clear d3 brush\n\t\tDOMUtils.appendOrSelect(\n\t\t\tthis.getComponentContainer(),\n\t\t\tthis.brushSelector\n\t\t).html(null);\n\n\t\t// re-render baseline because no axis labels in skeleton so the baseline length needs to change\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\tthis.renderZoomBarBaseline(container, startX, endX, true);\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tthis.brush.on('start brush end', null); // remove event listener\n\t\tthis.services.events.removeEventListener(\n\t\t\tEvents.ZoomBar.UPDATE,\n\t\t\tthis.render.bind(this)\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"zoom-bar.js","sourceRoot":"","sources":["zoom-bar.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACN,aAAa,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,IAAI,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cesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { ChartModelCartesian } from '../../model/cartesian-charts';\nimport { Tools } from '../../tools';\nimport {\n\tAxisPositions,\n\tEvents,\n\tRenderTypes,\n\tScaleTypes,\n\tZoomBarTypes,\n} from '../../interfaces';\nimport { DOMUtils } from '../../services';\nimport * as Configuration from '../../configuration';\n\n// D3 Imports\nimport { extent } from 'd3-array';\nimport { brushX } from 'd3-brush';\nimport { area, line } from 'd3-shape';\n\nexport class ZoomBar extends Component {\n\ttype = 'zoom-bar';\n\trenderType = RenderTypes.SVG;\n\n\t// The minimum selection x range to trigger handler update\n\t// Smaller number may introduce a handler flash during initialization\n\t// Bigger number may not trigger handler update while selection area on chart is very small\n\tMIN_SELECTION_DIFF = 9e-10;\n\n\t// needs to match the style in _zoom-bar.scss\n\tbrushSelector = 'g.zoom-bar-brush';\n\n\t// The max allowed selection range, will be updated soon in render()\n\tmaxSelectionRange: [0, 0];\n\n\t// Give every zoomBarClip a distinct ID\n\t// so they don't interfere the other zoom bars in a page\n\tclipId = 'zoomBarClip-' + Math.floor(Math.random() * 99999999999);\n\n\tbrush = brushX();\n\txScale: any;\n\tyScale: any;\n\n\thighlightStrokeWidth = 1;\n\n\tprotected model: ChartModelCartesian;\n\n\tinit() {\n\t\tthis.services.events.addEventListener(\n\t\t\tEvents.ZoomBar.UPDATE,\n\t\t\tthis.render.bind(this)\n\t\t);\n\t\t// check if pre-defined zoom bar data exists\n\t\tconst definedZoomBarData = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'data'\n\t\t);\n\n\t\t// load up the zoomBarData into this model\n\t\tthis.model.setZoomBarData(definedZoomBarData);\n\t}\n\n\trender(animate = true) {\n\t\tconst svg = this.getComponentContainer();\n\n\t\tconst isTopZoomBarLoading = this.services.zoom.isZoomBarLoading(\n\t\t\tAxisPositions.TOP\n\t\t);\n\t\tconst isTopZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\n\t\t// As zoom current only available on top only highlights corresponding to bottom axis will be shown\n\t\tconst highlight = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'axes',\n\t\t\tAxisPositions.BOTTOM,\n\t\t\t'highlights'\n\t\t);\n\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\t\t// initialization is not completed yet\n\t\tif (width === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0;\n\t\tconst axesMargins = this.model.get('axesMargins');\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left;\n\t\t}\n\n\t\tconst container = DOMUtils.appendOrSelect(svg, 'svg.zoom-container')\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', zoombarHeight)\n\t\t\t.attr('opacity', 1);\n\n\t\tconst spacer = DOMUtils.appendOrSelect(svg, 'rect.zoom-spacer')\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', zoombarHeight)\n\t\t\t.attr('width', '100%')\n\t\t\t.attr('height', Configuration.zoomBar.spacerHeight)\n\t\t\t.attr('opacity', 1)\n\t\t\t.attr('fill', 'none');\n\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t// Draw zoombar background rectangle\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', 0)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', '100%')\n\t\t\t\t.classed('zoom-bg-skeleton', isTopZoomBarLoading);\n\t\t} else if (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\t// Draw zoombar background line\n\t\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-bg')\n\t\t\t\t.attr('x', axesLeftMargin)\n\t\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t\t.attr('width', width - axesLeftMargin)\n\t\t\t\t.attr('height', 2)\n\t\t\t\t.classed('zoom-slider-bg-skeleton', isTopZoomBarLoading);\n\t\t}\n\n\t\tif (isTopZoomBarLoading) {\n\t\t\tthis.renderSkeleton(container, axesLeftMargin, width);\n\t\t\treturn;\n\t\t}\n\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXScale = cartesianScales.getMainXScale();\n\t\tconst mainYScale = cartesianScales.getMainYScale();\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType();\n\n\t\tif (mainXScale && mainXScaleType === ScaleTypes.TIME) {\n\t\t\tlet zoomBarData = this.services.zoom.getZoomBarData();\n\t\t\tif (Tools.isEmpty(zoomBarData)) {\n\t\t\t\t// if there's no zoom bar data we can't do anything\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.xScale = mainXScale.copy();\n\t\t\tthis.yScale = mainYScale.copy();\n\n\t\t\tconst defaultDomain = this.services.zoom.getDefaultZoomBarDomain(\n\t\t\t\tzoomBarData\n\t\t\t);\n\n\t\t\t// add value 0 to the extended domain for zoom bar area graph\n\t\t\tzoomBarData = this.compensateDataForDefaultDomain(\n\t\t\t\tzoomBarData,\n\t\t\t\tdefaultDomain\n\t\t\t);\n\n\t\t\t// get old initialZoomDomain from model\n\t\t\tconst oldInitialZoomDomain = this.model.get('initialZoomDomain');\n\t\t\t// get new initialZoomDomain from option\n\t\t\tconst newInitialZoomDomain = Tools.getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\tAxisPositions.TOP,\n\t\t\t\t'initialZoomDomain'\n\t\t\t);\n\t\t\t// change string date to Date object if necessary\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\tnewInitialZoomDomain[0] &&\n\t\t\t\tnewInitialZoomDomain[1]\n\t\t\t) {\n\t\t\t\tnewInitialZoomDomain[0] = new Date(newInitialZoomDomain[0]);\n\t\t\t\tnewInitialZoomDomain[1] = new Date(newInitialZoomDomain[1]);\n\t\t\t}\n\t\t\t// update initialZoomDomain and set zoomDomain in model only if the option is changed\n\t\t\t// not the same object, and both start date and end date are not equal\n\t\t\tif (\n\t\t\t\tnewInitialZoomDomain &&\n\t\t\t\t!(\n\t\t\t\t\toldInitialZoomDomain &&\n\t\t\t\t\toldInitialZoomDomain[0].valueOf() ===\n\t\t\t\t\t\tnewInitialZoomDomain[0].valueOf() &&\n\t\t\t\t\toldInitialZoomDomain[1].valueOf() ===\n\t\t\t\t\t\tnewInitialZoomDomain[1].valueOf()\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\t// use a new object instead of newInitialZoomDomain\n\t\t\t\t\t\tinitialZoomDomain: Tools.merge(\n\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\tnewInitialZoomDomain\n\t\t\t\t\t\t),\n\t\t\t\t\t\tzoomDomain: newInitialZoomDomain\n\t\t\t\t\t\t\t? Tools.merge([], newInitialZoomDomain)\n\t\t\t\t\t\t\t: defaultDomain,\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tnewInitialZoomDomain === null &&\n\t\t\t\toldInitialZoomDomain != null\n\t\t\t) {\n\t\t\t\t// if newInitialZoomDomain is set to null (when oldInitialZoomDomain is not null)\n\t\t\t\t// save initialZoomDomain and reset zoom domain to default domain\n\t\t\t\tthis.model.set(\n\t\t\t\t\t{\n\t\t\t\t\t\tinitialZoomDomain: null,\n\t\t\t\t\t\tzoomDomain: Tools.merge([], defaultDomain),\n\t\t\t\t\t},\n\t\t\t\t\t{ skipUpdate: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.xScale.range([axesLeftMargin, width]).domain(defaultDomain);\n\n\t\t\t// keep max selection range\n\t\t\tthis.maxSelectionRange = this.xScale.range();\n\n\t\t\tthis.yScale\n\t\t\t\t.range([0, zoombarHeight - 6])\n\t\t\t\t.domain(extent(zoomBarData, (d: any) => d.value));\n\n\t\t\tconst zoomDomain = this.model.get('zoomDomain');\n\n\t\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\t\tthis.renderZoomBarArea(\n\t\t\t\t\tcontainer,\n\t\t\t\t\t'path.zoom-graph-area-unselected',\n\t\t\t\t\tzoomBarData,\n\t\t\t\t\tnull\n\t\t\t\t);\n\t\t\t\tthis.updateClipPath(svg, this.clipId, 0, 0, 0, 0);\n\t\t\t\tthis.renderZoomBarArea(\n\t\t\t\t\tcontainer,\n\t\t\t\t\t'path.zoom-graph-area',\n\t\t\t\t\tzoomBarData,\n\t\t\t\t\tthis.clipId\n\t\t\t\t);\n\t\t\t\t// Draw the zoom bar base line\n\t\t\t\tthis.renderZoomBarBaseline(container, axesLeftMargin, width);\n\n\t\t\t\tif (highlight) {\n\t\t\t\t\tconst startHighlight = highlight.highlightStartMapsTo;\n\t\t\t\t\tconst endHighlight = highlight.highlightEndMapsTo;\n\t\t\t\t\tconst color = highlight.color;\n\t\t\t\t\tconst labelMapTo = highlight.labelMapsTo;\n\n\t\t\t\t\thighlight.data.forEach((element, index) => {\n\t\t\t\t\t\tDOMUtils.appendOrSelect(\n\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\t`rect.highlight-${index}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'height',\n\t\t\t\t\t\t\t\tzoombarHeight - 2 * this.highlightStrokeWidth\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.attr('y', this.highlightStrokeWidth)\n\t\t\t\t\t\t\t.attr('x', this.xScale(element[startHighlight]))\n\t\t\t\t\t\t\t.attr(\n\t\t\t\t\t\t\t\t'width',\n\t\t\t\t\t\t\t\tthis.xScale(element[endHighlight]) -\n\t\t\t\t\t\t\t\t\tthis.xScale(element[startHighlight])\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'fill',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]]\n\t\t\t\t\t\t\t\t\t? color.scale[element[labelMapTo]]\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t\t\t.style(\n\t\t\t\t\t\t\t\t'stroke',\n\t\t\t\t\t\t\t\tcolor && color.scale[element[labelMapTo]]\n\t\t\t\t\t\t\t\t\t? color.scale[element[labelMapTo]]\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t\t\t.attr('stroke-width', 1 + 'px');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Attach brushing event listeners\n\t\t\tthis.addBrushEventListener(zoomDomain, axesLeftMargin, width);\n\n\t\t\t// Draw the brushing area\n\t\t\tconst brushArea = DOMUtils.appendOrSelect(\n\t\t\t\tsvg,\n\t\t\t\tthis.brushSelector\n\t\t\t).call(this.brush);\n\n\t\t\tif (zoomDomain === undefined) {\n\t\t\t\t// do nothing, initialization not completed yet\n\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t} else if (zoomDomain[0].valueOf() === zoomDomain[1].valueOf()) {\n\t\t\t\tbrushArea.call(this.brush.move, this.xScale.range()); // default to full range\n\t\t\t\tthis.updateBrushHandle(\n\t\t\t\t\tthis.getComponentContainer(),\n\t\t\t\t\tthis.xScale.range(),\n\t\t\t\t\tthis.xScale.domain()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst selected = zoomDomain.map((domain) =>\n\t\t\t\t\tthis.xScale(domain)\n\t\t\t\t);\n\t\t\t\tif (selected[1] - selected[0] < this.MIN_SELECTION_DIFF) {\n\t\t\t\t\t// initialization not completed yet\n\t\t\t\t\t// don't update brushHandle to avoid flash\n\t\t\t\t} else {\n\t\t\t\t\tbrushArea.call(this.brush.move, selected); // set brush to correct position\n\t\t\t\t\tthis.updateBrushHandle(\n\t\t\t\t\t\tthis.getComponentContainer(),\n\t\t\t\t\t\tselected,\n\t\t\t\t\t\tzoomDomain\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isTopZoomBarLocked) {\n\t\t\t\tthis.brush.filter(() => {\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\t// reset all cursor to auto\n\t\t\t\tbrushArea.selectAll('rect').attr('cursor', 'auto');\n\t\t\t}\n\t\t}\n\t}\n\n\taddBrushEventListener(zoomDomain, axesLeftMargin, width) {\n\t\tconst brushEventListener = (event) => {\n\t\t\tconst selection = event.selection;\n\t\t\t// follow d3 behavior: when selection is null, reset default full range\n\t\t\t// select behavior is completed, but nothing selected\n\t\t\tif (selection === null) {\n\t\t\t\tthis.handleBrushedEvent(\n\t\t\t\t\tevent,\n\t\t\t\t\tzoomDomain,\n\t\t\t\t\tthis.xScale,\n\t\t\t\t\tthis.xScale.range()\n\t\t\t\t);\n\t\t\t} else if (selection[0] === selection[1]) {\n\t\t\t\t// select behavior is not completed yet, do nothing\n\t\t\t} else {\n\t\t\t\tthis.handleBrushedEvent(\n\t\t\t\t\tevent,\n\t\t\t\t\tzoomDomain,\n\t\t\t\t\tthis.xScale,\n\t\t\t\t\tselection\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\t// Initialize the d3 brush\n\t\tthis.brush\n\t\t\t.extent([\n\t\t\t\t[axesLeftMargin, 0],\n\t\t\t\t[width, zoombarHeight],\n\t\t\t])\n\t\t\t.on('start brush end', null) // remove old listener first\n\t\t\t.on('start brush end', brushEventListener);\n\t}\n\n\t// brush event listener\n\thandleBrushedEvent(event, zoomDomain, scale, selection) {\n\t\tconst newDomain = [\n\t\t\tscale.invert(selection[0]),\n\t\t\tscale.invert(selection[1]),\n\t\t];\n\n\t\t// update brush handle position\n\t\tthis.updateBrushHandle(\n\t\t\tthis.getComponentContainer(),\n\t\t\tselection,\n\t\t\tnewDomain\n\t\t);\n\n\t\t// be aware that the value of d3.event changes during an event!\n\t\t// update zoomDomain only if the event comes from mouse/touch event\n\t\tif (\n\t\t\tevent.sourceEvent != null &&\n\t\t\t(event.sourceEvent.type === 'mousemove' ||\n\t\t\t\tevent.sourceEvent.type === 'mouseup' ||\n\t\t\t\tevent.sourceEvent.type === 'mousedown' ||\n\t\t\t\tevent.sourceEvent.type === 'touchstart' ||\n\t\t\t\tevent.sourceEvent.type === 'touchmove' ||\n\t\t\t\tevent.sourceEvent.type === 'touchend')\n\t\t) {\n\t\t\t// only if zoomDomain is never set or needs update\n\t\t\tif (\n\t\t\t\tzoomDomain === undefined ||\n\t\t\t\tzoomDomain[0] !== newDomain[0] ||\n\t\t\t\tzoomDomain[1] !== newDomain[1]\n\t\t\t) {\n\t\t\t\t// don't dispatch event for all event types\n\t\t\t\t// let the following code to dispatch necessary events\n\t\t\t\tthis.services.zoom.handleDomainChange(newDomain, {\n\t\t\t\t\tdispatchEvent: false,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// dispatch selection events\n\t\t\tlet zoomBarEventType;\n\t\t\tif (event.type === 'start') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_START;\n\t\t\t} else if (event.type === 'brush') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_IN_PROGRESS;\n\t\t\t} else if (event.type === 'end') {\n\t\t\t\tzoomBarEventType = Events.ZoomBar.SELECTION_END;\n\t\t\t\t// only dispatch zoom domain change event for triggering api call when event type equals to end\n\t\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\t\tnewDomain,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.services.events.dispatchEvent(zoomBarEventType, {\n\t\t\t\tselection,\n\t\t\t\tnewDomain,\n\t\t\t});\n\t\t}\n\t}\n\n\tupdateBrushHandle(svg, selection, domain) {\n\t\tconst self = this;\n\t\tconst handleWidth = Configuration.zoomBar.handleWidth;\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst handleHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst handleXDiff = -handleWidth / 2;\n\n\t\tconst handleBarWidth = Configuration.zoomBar.handleBarWidth;\n\t\tconst handleBarHeight =\n\t\t\tzoombarType === ZoomBarTypes.GRAPH_VIEW\n\t\t\t\t? Configuration.zoomBar.handleBarHeight\n\t\t\t\t: 6;\n\t\tconst handleBarXDiff = -handleBarWidth / 2;\n\t\tconst handleYBarDiff = (handleHeight - handleBarHeight) / 2;\n\n\t\t// handle\n\t\tsvg.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }])\n\t\t\t.attr('x', function (d) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0]\n\t\t\t\t\t);\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\t// handle should not exceed zoom bar range\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] - handleWidth\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', 0)\n\t\t\t.attr('width', handleWidth)\n\t\t\t.attr('height', handleHeight)\n\t\t\t.attr('cursor', 'ew-resize')\n\t\t\t.style('display', null); // always display\n\n\t\t// handle-bar\n\t\tconst handleBars = svg\n\t\t\t.select(this.brushSelector)\n\t\t\t.selectAll('rect.handle-bar')\n\t\t\t.data([{ type: 'w' }, { type: 'e' }]);\n\t\t// create rect if not exists\n\t\thandleBars\n\t\t\t.enter()\n\t\t\t.append('rect')\n\t\t\t.attr('class', function (d) {\n\t\t\t\treturn 'handle-bar handle-bar--' + d.type;\n\t\t\t});\n\t\t// update positions\n\t\thandleBars\n\t\t\t.attr('x', function (d) {\n\t\t\t\tif (d.type === 'w') {\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\tselection[0] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[0] - handleXDiff + handleBarXDiff\n\t\t\t\t\t);\n\t\t\t\t} else if (d.type === 'e') {\n\t\t\t\t\treturn Math.min(\n\t\t\t\t\t\tselection[1] + handleBarXDiff,\n\t\t\t\t\t\tself.maxSelectionRange[1] + handleXDiff + handleBarXDiff\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('y', handleYBarDiff)\n\t\t\t.attr('width', handleBarWidth)\n\t\t\t.attr('height', handleBarHeight)\n\t\t\t.attr('cursor', 'ew-resize');\n\n\t\t// Update slider selected area\n\t\tif (zoombarType === ZoomBarTypes.SLIDER_VIEW) {\n\t\t\tthis.updateSliderSelectedArea(selection);\n\t\t}\n\n\t\tthis.updateClipPath(\n\t\t\tsvg,\n\t\t\tthis.clipId,\n\t\t\tselection[0],\n\t\t\t0,\n\t\t\tselection[1] - selection[0],\n\t\t\thandleHeight\n\t\t);\n\t}\n\n\tupdateSliderSelectedArea(selection) {\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\n\t\tconst { width } = DOMUtils.getSVGElementSize(this.parent, {\n\t\t\tuseAttrs: true,\n\t\t});\n\n\t\t// get axes margins\n\t\tlet axesLeftMargin = 0;\n\t\tconst axesMargins = this.model.get('axesMargins');\n\t\tif (axesMargins && axesMargins.left) {\n\t\t\taxesLeftMargin = axesMargins.left;\n\t\t}\n\n\t\tconst svg = this.getComponentContainer();\n\t\tconst container = svg.select('svg.zoom-container');\n\n\t\t// Draw zoombar background line\n\t\tDOMUtils.appendOrSelect(container, 'rect.zoom-slider-selected-area')\n\t\t\t.attr('x', selection[0])\n\t\t\t.attr('y', zoombarHeight / 2 - 1)\n\t\t\t.attr('width', selection[1] - selection[0])\n\t\t\t.attr('height', 2);\n\t}\n\n\trenderZoomBarArea(container, querySelector, data, clipId) {\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition();\n\t\tconst mainYAxisPosition = cartesianScales.getMainYAxisPosition();\n\t\tconst mainXScaleType = cartesianScales.getMainXScaleType();\n\t\tconst mainYScaleType = cartesianScales.getMainYScaleType();\n\n\t\tconst accessorFunction = (scale, scaleType, axisPosition) => {\n\t\t\treturn (d, i) => {\n\t\t\t\treturn cartesianScales.getValueFromScale(\n\t\t\t\t\tscale,\n\t\t\t\t\tscaleType,\n\t\t\t\t\taxisPosition,\n\t\t\t\t\td,\n\t\t\t\t\ti\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\n\t\tconst xAccessor = accessorFunction(\n\t\t\tthis.xScale,\n\t\t\tmainXScaleType,\n\t\t\tmainXAxisPosition\n\t\t);\n\t\tconst yAccessor = accessorFunction(\n\t\t\tthis.yScale,\n\t\t\tmainYScaleType,\n\t\t\tmainYAxisPosition\n\t\t);\n\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst areaGenerator = area()\n\t\t\t.x((d, i) => xAccessor(d, i))\n\t\t\t.y0(zoombarHeight)\n\t\t\t.y1((d, i) => zoombarHeight - yAccessor(d, i));\n\n\t\tconst areaGraph = DOMUtils.appendOrSelect(container, querySelector)\n\t\t\t.datum(data)\n\t\t\t.attr('d', areaGenerator);\n\n\t\tif (clipId) {\n\t\t\tareaGraph.attr('clip-path', `url(#${clipId})`);\n\t\t}\n\t}\n\n\tupdateClipPath(svg, clipId, x, y, width, height) {\n\t\tconst zoomBarClipPath = DOMUtils.appendOrSelect(svg, `clipPath`).attr(\n\t\t\t'id',\n\t\t\tclipId\n\t\t);\n\t\tDOMUtils.appendOrSelect(zoomBarClipPath, 'rect')\n\t\t\t.attr('x', x)\n\t\t\t.attr('y', y)\n\t\t\t.attr('width', width)\n\t\t\t.attr('height', height);\n\t}\n\n\t// assume the domains in data are already sorted\n\tcompensateDataForDefaultDomain(data, defaultDomain) {\n\t\tif (!data || data.length < 2) {\n\t\t\treturn;\n\t\t}\n\t\tconst zoomBarData = Tools.clone(data);\n\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\t// if min domain is extended\n\t\tif (\n\t\t\tNumber(defaultDomain[0]) < Number(zoomBarData[0][domainIdentifier])\n\t\t) {\n\t\t\tconst newDatum = {};\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[0];\n\t\t\tnewDatum[rangeIdentifier] = 0;\n\t\t\tzoomBarData.unshift(newDatum);\n\t\t}\n\t\t// if max domain is extended\n\t\tif (\n\t\t\tNumber(defaultDomain[1]) >\n\t\t\tNumber(zoomBarData[zoomBarData.length - 1][domainIdentifier])\n\t\t) {\n\t\t\tconst newDatum = {};\n\t\t\tnewDatum[domainIdentifier] = defaultDomain[1];\n\t\t\tnewDatum[rangeIdentifier] = 0;\n\t\t\tzoomBarData.push(newDatum);\n\t\t}\n\t\treturn zoomBarData;\n\t}\n\n\trenderZoomBarBaseline(container, startX, endX, skeletonClass = false) {\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tconst zoombarHeight = Configuration.zoomBar.height[zoombarType];\n\t\tconst baselineGenerator = line()([\n\t\t\t[startX, zoombarHeight],\n\t\t\t[endX, zoombarHeight],\n\t\t]);\n\t\tDOMUtils.appendOrSelect(container, 'path.zoom-bg-baseline')\n\t\t\t.attr('d', baselineGenerator)\n\t\t\t.classed('zoom-bg-baseline-skeleton', skeletonClass);\n\t}\n\n\trenderSkeleton(container, startX, endX) {\n\t\t// need to clear current zoom bar area\n\t\tthis.renderZoomBarArea(\n\t\t\tcontainer,\n\t\t\t'path.zoom-graph-area-unselected',\n\t\t\t[],\n\t\t\tnull\n\t\t);\n\t\tthis.renderZoomBarArea(\n\t\t\tcontainer,\n\t\t\t'path.zoom-graph-area',\n\t\t\t[],\n\t\t\tthis.clipId\n\t\t);\n\t\t// remove brush listener\n\t\tthis.brush.on('start brush end', null);\n\t\t// clear d3 brush\n\t\tDOMUtils.appendOrSelect(\n\t\t\tthis.getComponentContainer(),\n\t\t\tthis.brushSelector\n\t\t).html(null);\n\n\t\t// re-render baseline because no axis labels in skeleton so the baseline length needs to change\n\t\tconst zoombarType = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'type'\n\t\t);\n\t\tif (zoombarType === ZoomBarTypes.GRAPH_VIEW) {\n\t\t\tthis.renderZoomBarBaseline(container, startX, endX, true);\n\t\t}\n\t}\n\n\tdestroy() {\n\t\tthis.brush.on('start brush end', null); // remove event listener\n\t\tthis.services.events.removeEventListener(\n\t\t\tEvents.ZoomBar.UPDATE,\n\t\t\tthis.render.bind(this)\n\t\t);\n\t}\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { Component } from '../component';
2
+ import { ChartModel } from '../../model/model';
3
+ import { RenderTypes } from '../../interfaces';
4
+ import Position from '@carbon/utils-position';
5
+ export declare class Highlight extends Component {
6
+ type: string;
7
+ renderType: RenderTypes;
8
+ label: any;
9
+ positionService: Position;
10
+ highlightStrokeWidth: number;
11
+ constructor(model: ChartModel, services: any);
12
+ render(animate?: boolean): void;
13
+ }
@@ -0,0 +1,196 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __rest = (this && this.__rest) || function (s, e) {
15
+ var t = {};
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
17
+ t[p] = s[p];
18
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
19
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
21
+ t[p[i]] = s[p[i]];
22
+ }
23
+ return t;
24
+ };
25
+ import { Component } from '../component';
26
+ import { Tools } from '../../tools';
27
+ import { AxisPositions, RenderTypes } from '../../interfaces';
28
+ // D3 Imports
29
+ // @ts-ignore
30
+ // ts-ignore is needed because `@types/d3`
31
+ // is missing the `pointer` function
32
+ import { select } from 'd3-selection';
33
+ // Carbon position service
34
+ import Position from '@carbon/utils-position';
35
+ var Highlight = /** @class */ (function (_super) {
36
+ __extends(Highlight, _super);
37
+ function Highlight(model, services) {
38
+ var _this = _super.call(this, model, services) || this;
39
+ _this.type = 'highlight';
40
+ _this.renderType = RenderTypes.SVG;
41
+ _this.positionService = new Position();
42
+ _this.highlightStrokeWidth = 1;
43
+ return _this;
44
+ }
45
+ Highlight.prototype.render = function (animate) {
46
+ if (animate === void 0) { animate = false; }
47
+ var axesOptions = Tools.getProperty(this.getOptions(), 'axes');
48
+ var highlightData = [];
49
+ Object.keys(axesOptions).forEach(function (axisPosition) {
50
+ if (Object.values(AxisPositions).includes(axisPosition)) {
51
+ var axisOptions = axesOptions[axisPosition];
52
+ if (axisOptions.highlights &&
53
+ axisOptions.highlights.data.length > 0) {
54
+ highlightData.push({
55
+ axisPosition: axisPosition,
56
+ highlightStartMapsTo: axisOptions.highlights.highlightStartMapsTo,
57
+ highlightEndMapsTo: axisOptions.highlights.highlightEndMapsTo,
58
+ labelMapsTo: axisOptions.highlights.labelMapsTo,
59
+ highlight: axisOptions.highlights.data,
60
+ color: axisOptions.highlights.color,
61
+ });
62
+ }
63
+ }
64
+ });
65
+ // Grab container SVG
66
+ var svg = this.getComponentContainer({ withinChartClip: true });
67
+ // Update data on all axis highlight groups
68
+ var highlightAxisGroups = svg
69
+ .selectAll('g.axis-highlight')
70
+ .data(highlightData, function (highlightData) { return highlightData.axisPosition; });
71
+ // Remove axis highlight groups that are no longer needed
72
+ highlightAxisGroups.exit().attr('opacity', 0).remove();
73
+ // Add the axis highlight groups that need to be introduced
74
+ var highlightAxisGroupsEnter = highlightAxisGroups
75
+ .enter()
76
+ .append('g');
77
+ var highlightAxisGroupsMerge = highlightAxisGroupsEnter.merge(highlightAxisGroups);
78
+ highlightAxisGroupsMerge.attr('class', function (d) { return "axis-highlight " + d.axisPosition; });
79
+ var highlightGroups = highlightAxisGroupsMerge
80
+ .selectAll('g.highlight-group')
81
+ .data(function (d) {
82
+ return d.highlight.map(function (highlight) {
83
+ highlight.axisPosition = d.axisPosition;
84
+ highlight.highlightStartMapsTo = d.highlightStartMapsTo;
85
+ highlight.labelMapsTo = d.labelMapsTo;
86
+ highlight.color = d.color;
87
+ highlight.highlightEndMapsTo = d.highlightEndMapsTo;
88
+ return highlight;
89
+ });
90
+ });
91
+ // Remove highlight groups that are no longer needed
92
+ highlightGroups.exit().attr('opacity', 0).remove();
93
+ // Add the highlight groups that need to be introduced
94
+ var highlightGroupsEnter = highlightGroups.enter().append('g');
95
+ highlightGroupsEnter.append('rect').attr('class', 'highlight-bar');
96
+ highlightGroupsEnter.append('line').attr('class', 'highlight-line');
97
+ var highlightGroupsMerge = highlightGroupsEnter.merge(highlightGroups);
98
+ highlightGroupsMerge.attr('class', 'highlight-group');
99
+ var self = this;
100
+ highlightAxisGroupsMerge.each(function (_a) {
101
+ var axisPosition = _a.axisPosition;
102
+ var mainXScale = self.services.cartesianScales.getMainXScale();
103
+ var mainYScale = self.services.cartesianScales.getMainYScale();
104
+ var _b = mainXScale.range(), xScaleStart = _b[0], xScaleEnd = _b[1];
105
+ var _c = mainYScale.range(), yScaleEnd = _c[0], yScaleStart = _c[1];
106
+ var cartesianScales = self.services.cartesianScales;
107
+ var orientation = cartesianScales.getOrientation();
108
+ var getDomainValue = function (d) { return cartesianScales.getDomainValue(d); };
109
+ var getRangeValue = function (d) { return cartesianScales.getRangeValue(d); };
110
+ var _d = Tools.flipDomainAndRangeBasedOnOrientation(getDomainValue, getRangeValue, orientation), getXValue = _d[0], getYValue = _d[1];
111
+ var group = select(this);
112
+ if (axisPosition === AxisPositions.TOP ||
113
+ axisPosition === AxisPositions.BOTTOM) {
114
+ group
115
+ .selectAll('rect.highlight-bar')
116
+ .transition()
117
+ .call(function (t) {
118
+ return self.services.transitions.setupTransition({
119
+ transition: t,
120
+ name: 'highlight-bar-update',
121
+ animate: animate,
122
+ });
123
+ })
124
+ // Stroke width added to stop overflow of highlight
125
+ .attr('y', Math.max(yScaleStart + self.highlightStrokeWidth, 0))
126
+ // Stroke width subtracted to stop overflow of highlight
127
+ .attr('height', Math.max(yScaleEnd - 2 * self.highlightStrokeWidth, 0))
128
+ .attr('x', function (_a) {
129
+ var highlightStartMapsTo = _a.highlightStartMapsTo, d = __rest(_a, ["highlightStartMapsTo"]);
130
+ return getXValue(d[highlightStartMapsTo]);
131
+ })
132
+ .attr('width', function (_a) {
133
+ var highlightStartMapsTo = _a.highlightStartMapsTo, highlightEndMapsTo = _a.highlightEndMapsTo, d = __rest(_a, ["highlightStartMapsTo", "highlightEndMapsTo"]);
134
+ return Math.max(getXValue(d[highlightEndMapsTo]) -
135
+ getXValue(d[highlightStartMapsTo]), 0);
136
+ })
137
+ .style('stroke', function (_a) {
138
+ var color = _a.color, labelMapsTo = _a.labelMapsTo, data = __rest(_a, ["color", "labelMapsTo"]);
139
+ return color && color.scale[data[labelMapsTo]]
140
+ ? color.scale[data[labelMapsTo]]
141
+ : null;
142
+ })
143
+ .style('stroke-dasharray', '2, 2')
144
+ .attr('stroke-width', self.highlightStrokeWidth + 'px')
145
+ .style('fill-opacity', 0.1)
146
+ .style('fill', function (_a) {
147
+ var color = _a.color, labelMapsTo = _a.labelMapsTo, data = __rest(_a, ["color", "labelMapsTo"]);
148
+ return color && color.scale[data[labelMapsTo]]
149
+ ? color.scale[data[labelMapsTo]]
150
+ : null;
151
+ });
152
+ }
153
+ else {
154
+ group
155
+ .selectAll('rect.highlight-bar')
156
+ .transition()
157
+ .call(function (t) {
158
+ return self.services.transitions.setupTransition({
159
+ transition: t,
160
+ name: 'highlight-bar-update',
161
+ animate: animate,
162
+ });
163
+ })
164
+ .attr('x', xScaleStart)
165
+ .attr('width', Math.max(xScaleEnd - xScaleStart, 0))
166
+ .attr('y', function (_a) {
167
+ var highlightEndMapsTo = _a.highlightEndMapsTo, d = __rest(_a, ["highlightEndMapsTo"]);
168
+ return getYValue(d[highlightEndMapsTo]);
169
+ })
170
+ .attr('height', function (_a) {
171
+ var highlightStartMapsTo = _a.highlightStartMapsTo, highlightEndMapsTo = _a.highlightEndMapsTo, d = __rest(_a, ["highlightStartMapsTo", "highlightEndMapsTo"]);
172
+ return Math.max(getYValue(d[highlightStartMapsTo]) -
173
+ getYValue(d[highlightEndMapsTo]), 0);
174
+ })
175
+ .style('stroke', function (_a) {
176
+ var color = _a.color, labelMapsTo = _a.labelMapsTo, data = __rest(_a, ["color", "labelMapsTo"]);
177
+ return color && color.scale[data[labelMapsTo]]
178
+ ? color.scale[data[labelMapsTo]]
179
+ : null;
180
+ })
181
+ .style('stroke-dasharray', '2, 2')
182
+ .attr('stroke-width', self.highlightStrokeWidth + 'px')
183
+ .style('fill-opacity', 0.1)
184
+ .style('fill', function (_a) {
185
+ var color = _a.color, labelMapsTo = _a.labelMapsTo, data = __rest(_a, ["color", "labelMapsTo"]);
186
+ return color && color.scale[data[labelMapsTo]]
187
+ ? color.scale[data[labelMapsTo]]
188
+ : null;
189
+ });
190
+ }
191
+ });
192
+ };
193
+ return Highlight;
194
+ }(Component));
195
+ export { Highlight };
196
+ //# sourceMappingURL=../../../src/components/essentials/highlights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlights.js","sourceRoot":"","sources":["highlights.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAE1E,aAAa;AACb,aAAa;AACb,0CAA0C;AAC1C,oCAAoC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,0BAA0B;AAC1B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C;IAA+B,6BAAS;IASvC,mBAAY,KAAiB,EAAE,QAAa;QAA5C,YACC,kBAAM,KAAK,EAAE,QAAQ,CAAC,SACtB;QAVD,UAAI,GAAG,WAAW,CAAC;QACnB,gBAAU,GAAG,WAAW,CAAC,GAAG,CAAC;QAI7B,qBAAe,GAAG,IAAI,QAAQ,EAAE,CAAC;QACjC,0BAAoB,GAAG,CA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AC,IAAI,CAAC,WAAW,CAAC,CAAC;wBAC7C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;wBAChC,CAAC,CAAC,IAAI,CAAC;gBACT,CAAC,CAAC;qBACD,KAAK,CAAC,kBAAkB,EAAE,MAAM,CAAC;qBACjC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;qBACtD,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC;qBAC1B,KAAK,CAAC,MAAM,EAAE,UAAC,EAA+B;oBAA7B,IAAA,gBAAK,EAAE,4BAAW,EAAE,2CAAO;oBAC5C,OAAO,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;wBAC7C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;wBAChC,CAAC,CAAC,IAAI,CAAC;gBACT,CAAC,CAAC,CAAC;aACJ;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IACF,gBAAC;AAAD,CAAC,AAxMD,CAA+B,SAAS,GAwMvC","sourcesContent":["import { Component } from '../component';\nimport { Tools } from '../../tools';\nimport { ChartModel } from '../../model/model';\nimport { AxisPositions, RenderTypes, ScaleTypes } from '../../interfaces';\n\n// D3 Imports\n// @ts-ignore\n// ts-ignore is needed because `@types/d3`\n// is missing the `pointer` function\nimport { select } from 'd3-selection';\n\n// Carbon position service\nimport Position from '@carbon/utils-position';\n\nexport class Highlight extends Component {\n\ttype = 'highlight';\n\trenderType = RenderTypes.SVG;\n\n\tlabel: any;\n\n\tpositionService = new Position();\n\thighlightStrokeWidth = 1;\n\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services);\n\t}\n\n\trender(animate = false) {\n\t\tconst axesOptions = Tools.getProperty(this.getOptions(), 'axes');\n\t\tconst highlightData = [];\n\n\t\tObject.keys(axesOptions).forEach((axisPosition) => {\n\t\t\tif (Object.values(AxisPositions).includes(axisPosition as any)) {\n\t\t\t\tconst axisOptions = axesOptions[axisPosition];\n\t\t\t\tif (\n\t\t\t\t\taxisOptions.highlights &&\n\t\t\t\t\taxisOptions.highlights.data.length > 0\n\t\t\t\t) {\n\t\t\t\t\thighlightData.push({\n\t\t\t\t\t\taxisPosition,\n\t\t\t\t\t\thighlightStartMapsTo:\n\t\t\t\t\t\t\taxisOptions.highlights.highlightStartMapsTo,\n\t\t\t\t\t\thighlightEndMapsTo:\n\t\t\t\t\t\t\taxisOptions.highlights.highlightEndMapsTo,\n\t\t\t\t\t\tlabelMapsTo: axisOptions.highlights.labelMapsTo,\n\t\t\t\t\t\thighlight: axisOptions.highlights.data,\n\t\t\t\t\t\tcolor: axisOptions.highlights.color,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Grab container SVG\n\t\tconst svg = this.getComponentContainer({ withinChartClip: true });\n\n\t\t// Update data on all axis highlight groups\n\t\tconst highlightAxisGroups = svg\n\t\t\t.selectAll('g.axis-highlight')\n\t\t\t.data(highlightData, (highlightData) => highlightData.axisPosition);\n\n\t\t// Remove axis highlight groups that are no longer needed\n\t\thighlightAxisGroups.exit().attr('opacity', 0).remove();\n\n\t\t// Add the axis highlight groups that need to be introduced\n\t\tconst highlightAxisGroupsEnter = highlightAxisGroups\n\t\t\t.enter()\n\t\t\t.append('g');\n\n\t\tconst highlightAxisGroupsMerge = highlightAxisGroupsEnter.merge(\n\t\t\thighlightAxisGroups\n\t\t);\n\t\thighlightAxisGroupsMerge.attr(\n\t\t\t'class',\n\t\t\t(d) => `axis-highlight ${d.axisPosition}`\n\t\t);\n\n\t\tconst highlightGroups = highlightAxisGroupsMerge\n\t\t\t.selectAll('g.highlight-group')\n\t\t\t.data((d) =>\n\t\t\t\td.highlight.map((highlight) => {\n\t\t\t\t\thighlight.axisPosition = d.axisPosition;\n\t\t\t\t\thighlight.highlightStartMapsTo = d.highlightStartMapsTo;\n\t\t\t\t\thighlight.labelMapsTo = d.labelMapsTo;\n\t\t\t\t\thighlight.color = d.color;\n\t\t\t\t\thighlight.highlightEndMapsTo = d.highlightEndMapsTo;\n\t\t\t\t\treturn highlight;\n\t\t\t\t})\n\t\t\t);\n\n\t\t// Remove highlight groups that are no longer needed\n\t\thighlightGroups.exit().attr('opacity', 0).remove();\n\n\t\t// Add the highlight groups that need to be introduced\n\t\tconst highlightGroupsEnter = highlightGroups.enter().append('g');\n\n\t\thighlightGroupsEnter.append('rect').attr('class', 'highlight-bar');\n\t\thighlightGroupsEnter.append('line').attr('class', 'highlight-line');\n\n\t\tconst highlightGroupsMerge = highlightGroupsEnter.merge(\n\t\t\thighlightGroups\n\t\t);\n\t\thighlightGroupsMerge.attr('class', 'highlight-group');\n\n\t\tconst self = this;\n\t\thighlightAxisGroupsMerge.each(function ({ axisPosition }) {\n\t\t\tconst mainXScale = self.services.cartesianScales.getMainXScale();\n\t\t\tconst mainYScale = self.services.cartesianScales.getMainYScale();\n\t\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range();\n\t\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range();\n\n\t\t\tconst { cartesianScales } = self.services;\n\t\t\tconst orientation = cartesianScales.getOrientation();\n\t\t\tconst getDomainValue = (d) => cartesianScales.getDomainValue(d);\n\t\t\tconst getRangeValue = (d) => cartesianScales.getRangeValue(d);\n\t\t\tconst [\n\t\t\t\tgetXValue,\n\t\t\t\tgetYValue,\n\t\t\t] = Tools.flipDomainAndRangeBasedOnOrientation(\n\t\t\t\tgetDomainValue,\n\t\t\t\tgetRangeValue,\n\t\t\t\torientation\n\t\t\t);\n\n\t\t\tconst group = select(this);\n\t\t\tif (\n\t\t\t\taxisPosition === AxisPositions.TOP ||\n\t\t\t\taxisPosition === AxisPositions.BOTTOM\n\t\t\t) {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t// Stroke width added to stop overflow of highlight\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'y',\n\t\t\t\t\t\tMath.max(yScaleStart + self.highlightStrokeWidth, 0)\n\t\t\t\t\t)\n\t\t\t\t\t// Stroke width subtracted to stop overflow of highlight\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'height',\n\t\t\t\t\t\tMath.max(yScaleEnd - 2 * self.highlightStrokeWidth, 0)\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x', ({ highlightStartMapsTo, ...d }) =>\n\t\t\t\t\t\tgetXValue(d[highlightStartMapsTo])\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'width',\n\t\t\t\t\t\t({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\t\tMath.max(\n\t\t\t\t\t\t\t\tgetXValue(d[highlightEndMapsTo]) -\n\t\t\t\t\t\t\t\t\tgetXValue(d[highlightStartMapsTo]),\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t? color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t? color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgroup\n\t\t\t\t\t.selectAll('rect.highlight-bar')\n\t\t\t\t\t.transition()\n\t\t\t\t\t.call((t) =>\n\t\t\t\t\t\tself.services.transitions.setupTransition({\n\t\t\t\t\t\t\ttransition: t,\n\t\t\t\t\t\t\tname: 'highlight-bar-update',\n\t\t\t\t\t\t\tanimate,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.attr('x', xScaleStart)\n\t\t\t\t\t.attr('width', Math.max(xScaleEnd - xScaleStart, 0))\n\t\t\t\t\t.attr('y', ({ highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\tgetYValue(d[highlightEndMapsTo])\n\t\t\t\t\t)\n\t\t\t\t\t.attr(\n\t\t\t\t\t\t'height',\n\t\t\t\t\t\t({ highlightStartMapsTo, highlightEndMapsTo, ...d }) =>\n\t\t\t\t\t\t\tMath.max(\n\t\t\t\t\t\t\t\tgetYValue(d[highlightStartMapsTo]) -\n\t\t\t\t\t\t\t\t\tgetYValue(d[highlightEndMapsTo]),\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t.style('stroke', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t? color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t})\n\t\t\t\t\t.style('stroke-dasharray', '2, 2')\n\t\t\t\t\t.attr('stroke-width', self.highlightStrokeWidth + 'px')\n\t\t\t\t\t.style('fill-opacity', 0.1)\n\t\t\t\t\t.style('fill', ({ color, labelMapsTo, ...data }) => {\n\t\t\t\t\t\treturn color && color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t? color.scale[data[labelMapsTo]]\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
@@ -7,6 +7,7 @@ export * from './essentials/title-meter';
7
7
  export * from './essentials/tooltip';
8
8
  export * from './essentials/tooltip-axis';
9
9
  export * from './essentials/canvas-chart-clip';
10
+ export * from './essentials/highlights';
10
11
  export * from './graphs/area';
11
12
  export * from './graphs/area-stacked';
12
13
  export * from './graphs/bar-simple';
@@ -8,6 +8,7 @@ export * from './essentials/title-meter';
8
8
  export * from './essentials/tooltip';
9
9
  export * from './essentials/tooltip-axis';
10
10
  export * from './essentials/canvas-chart-clip';
11
+ export * from './essentials/highlights';
11
12
  // GRAPHS
12
13
  export * from './graphs/area';
13
14
  export * from './graphs/area-stacked';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAE/C,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,WAAW;AACX,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './component';\n\n// ESSENTIALS\nexport * from './essentials/legend';\nexport * from './essentials/modal';\nexport * from './essentials/threshold';\nexport * from './essentials/title';\nexport * from './essentials/title-meter';\nexport * from './essentials/tooltip';\nexport * from './essentials/tooltip-axis';\nexport * from './essentials/canvas-chart-clip';\n\n// GRAPHS\nexport * from './graphs/area';\nexport * from './graphs/area-stacked';\nexport * from './graphs/bar-simple';\nexport * from './graphs/bar-grouped';\nexport * from './graphs/bar-stacked';\nexport * from './graphs/boxplot';\nexport * from './graphs/bubble';\nexport * from './graphs/bullet';\nexport * from './graphs/histogram';\nexport * from './graphs/line';\nexport * from './graphs/lollipop';\nexport * from './graphs/scatter';\nexport * from './graphs/scatter-stacked';\nexport * from './graphs/pie';\nexport * from './graphs/gauge';\nexport * from './graphs/donut';\nexport * from './graphs/skeleton';\nexport * from './graphs/skeleton-lines';\nexport * from './graphs/tree';\nexport * from './graphs/treemap';\nexport * from './graphs/radar';\nexport * from './graphs/circle-pack';\nexport * from './graphs/wordcloud';\n\n// Layout\nexport * from './layout/spacer';\nexport * from './layout/layout';\n\n// MISC\nexport * from './axes/two-dimensional-axes';\nexport * from './axes/axis';\nexport * from './axes/grid-brush';\nexport * from './axes/chart-clip';\nexport * from './axes/grid';\nexport * from './axes/ruler';\nexport * from './axes/ruler-binned';\nexport * from './axes/ruler-stacked';\nexport * from './axes/toolbar';\nexport * from './axes/zero-line';\nexport * from './axes/zoom-bar';\n\n// Diagrams\nexport * from './diagrams/buildPaths';\nexport * from './diagrams/markerDefinitions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AAExC,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,WAAW;AACX,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './component';\n\n// ESSENTIALS\nexport * from './essentials/legend';\nexport * from './essentials/modal';\nexport * from './essentials/threshold';\nexport * from './essentials/title';\nexport * from './essentials/title-meter';\nexport * from './essentials/tooltip';\nexport * from './essentials/tooltip-axis';\nexport * from './essentials/canvas-chart-clip';\nexport * from './essentials/highlights';\n\n// GRAPHS\nexport * from './graphs/area';\nexport * from './graphs/area-stacked';\nexport * from './graphs/bar-simple';\nexport * from './graphs/bar-grouped';\nexport * from './graphs/bar-stacked';\nexport * from './graphs/boxplot';\nexport * from './graphs/bubble';\nexport * from './graphs/bullet';\nexport * from './graphs/histogram';\nexport * from './graphs/line';\nexport * from './graphs/lollipop';\nexport * from './graphs/scatter';\nexport * from './graphs/scatter-stacked';\nexport * from './graphs/pie';\nexport * from './graphs/gauge';\nexport * from './graphs/donut';\nexport * from './graphs/skeleton';\nexport * from './graphs/skeleton-lines';\nexport * from './graphs/tree';\nexport * from './graphs/treemap';\nexport * from './graphs/radar';\nexport * from './graphs/circle-pack';\nexport * from './graphs/wordcloud';\n\n// Layout\nexport * from './layout/spacer';\nexport * from './layout/layout';\n\n// MISC\nexport * from './axes/two-dimensional-axes';\nexport * from './axes/axis';\nexport * from './axes/grid-brush';\nexport * from './axes/chart-clip';\nexport * from './axes/grid';\nexport * from './axes/ruler';\nexport * from './axes/ruler-binned';\nexport * from './axes/ruler-stacked';\nexport * from './axes/toolbar';\nexport * from './axes/zero-line';\nexport * from './axes/zoom-bar';\n\n// Diagrams\nexport * from './diagrams/buildPaths';\nexport * from './diagrams/markerDefinitions';\n"]}
@@ -183,6 +183,39 @@ export declare const boundedAreaTimeSeriesOptions: {
183
183
  };
184
184
  curve: string;
185
185
  };
186
+ export declare const boundedAreaTimeSeriesWithHighlightsOptions: {
187
+ title: string;
188
+ legend: {
189
+ enabled: boolean;
190
+ };
191
+ bounds: {
192
+ upperBoundMapsTo: string;
193
+ lowerBoundMapsTo: string;
194
+ };
195
+ axes: {
196
+ bottom: {
197
+ title: string;
198
+ mapsTo: string;
199
+ scaleType: string;
200
+ highlights: {
201
+ highlightStartMapsTo: string;
202
+ highlightEndMapsTo: string;
203
+ labelMapsTo: string;
204
+ data: {
205
+ startHighlight: Date;
206
+ label: string;
207
+ endHighlight: Date;
208
+ }[];
209
+ };
210
+ };
211
+ left: {
212
+ mapsTo: string;
213
+ scaleType: string;
214
+ };
215
+ };
216
+ curve: string;
217
+ };
218
+ export declare const boundedAreaTimeSeriesWithHighlightsZoomOptions: any;
186
219
  export declare const areaEmptyData: any[];
187
220
  export declare const areaEmptyOptions: {
188
221
  title: string;
package/demo/data/area.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { addZoomBarToOptions } from './zoom-bar';
1
2
  export var areaTimeSeriesData = [
2
3
  { group: 'Dataset 1', date: new Date(2019, 0, 1), value: 0 },
3
4
  { group: 'Dataset 1', date: new Date(2019, 0, 6), value: 57312 },
@@ -292,6 +293,46 @@ export var boundedAreaTimeSeriesOptions = {
292
293
  },
293
294
  curve: 'curveNatural',
294
295
  };
296
+ export var boundedAreaTimeSeriesWithHighlightsOptions = {
297
+ title: 'Bounded area (time series - natural curve)',
298
+ legend: {
299
+ enabled: false,
300
+ },
301
+ bounds: {
302
+ upperBoundMapsTo: 'max',
303
+ lowerBoundMapsTo: 'min',
304
+ },
305
+ axes: {
306
+ bottom: {
307
+ title: '2019 Annual Sales Figures',
308
+ mapsTo: 'date',
309
+ scaleType: 'time',
310
+ highlights: {
311
+ highlightStartMapsTo: 'startHighlight',
312
+ highlightEndMapsTo: 'endHighlight',
313
+ labelMapsTo: 'label',
314
+ data: [
315
+ {
316
+ startHighlight: new Date(2019, 0, 7),
317
+ label: 'Custom formatter',
318
+ endHighlight: new Date(2019, 0, 8),
319
+ },
320
+ {
321
+ startHighlight: new Date(2019, 0, 13),
322
+ label: 'Custom formatter',
323
+ endHighlight: new Date(2019, 0, 14),
324
+ },
325
+ ],
326
+ },
327
+ },
328
+ left: {
329
+ mapsTo: 'value',
330
+ scaleType: 'linear',
331
+ },
332
+ },
333
+ curve: 'curveNatural',
334
+ };
335
+ export var boundedAreaTimeSeriesWithHighlightsZoomOptions = addZoomBarToOptions(Object.assign({}, boundedAreaTimeSeriesWithHighlightsOptions));
295
336
  // area - empty state
296
337
  export var areaEmptyData = [];
297
338
  export var areaEmptyOptions = {