@carbon/charts 0.46.3 → 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 (98) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/axis-chart.js +2 -1
  3. package/axis-chart.js.map +1 -1
  4. package/build/demo/data/CHART_TYPES.d.ts +5 -0
  5. package/build/demo/data/area.d.ts +33 -0
  6. package/build/demo/data/tree.d.ts +30 -0
  7. package/build/src/chart.d.ts +2 -2
  8. package/build/src/charts/index.d.ts +1 -0
  9. package/build/src/charts/tree.d.ts +6 -0
  10. package/build/src/components/axes/zoom-bar.d.ts +1 -0
  11. package/build/src/components/essentials/highlights.d.ts +13 -0
  12. package/build/src/components/graphs/tree.d.ts +9 -0
  13. package/build/src/components/index.d.ts +2 -0
  14. package/build/src/configuration.d.ts +2 -1
  15. package/build/src/interfaces/charts.d.ts +7 -1
  16. package/build/src/interfaces/enums.d.ts +7 -0
  17. package/build/src/interfaces/events.d.ts +8 -0
  18. package/build/stories/utils.d.ts +1 -1
  19. package/bundle.js +1 -1
  20. package/chart.d.ts +2 -2
  21. package/chart.js +4 -4
  22. package/chart.js.map +1 -1
  23. package/charts/index.d.ts +1 -0
  24. package/charts/index.js +1 -0
  25. package/charts/index.js.map +1 -1
  26. package/charts/meter.js +3 -1
  27. package/charts/meter.js.map +1 -1
  28. package/charts/tree.d.ts +6 -0
  29. package/charts/tree.js +45 -0
  30. package/charts/tree.js.map +1 -0
  31. package/components/axes/zoom-bar.d.ts +1 -0
  32. package/components/axes/zoom-bar.js +26 -0
  33. package/components/axes/zoom-bar.js.map +1 -1
  34. package/components/essentials/highlights.d.ts +13 -0
  35. package/components/essentials/highlights.js +196 -0
  36. package/components/essentials/highlights.js.map +1 -0
  37. package/components/graphs/pie.js.map +1 -1
  38. package/components/graphs/radar.js +2 -1
  39. package/components/graphs/radar.js.map +1 -1
  40. package/components/graphs/tree.d.ts +9 -0
  41. package/components/graphs/tree.js +262 -0
  42. package/components/graphs/tree.js.map +1 -0
  43. package/components/index.d.ts +2 -0
  44. package/components/index.js +2 -0
  45. package/components/index.js.map +1 -1
  46. package/configuration.d.ts +2 -1
  47. package/configuration.js +10 -1
  48. package/configuration.js.map +1 -1
  49. package/demo/data/CHART_TYPES.d.ts +5 -0
  50. package/demo/data/CHART_TYPES.js +5 -0
  51. package/demo/data/CHART_TYPES.js.map +1 -1
  52. package/demo/data/area.d.ts +33 -0
  53. package/demo/data/area.js +41 -0
  54. package/demo/data/area.js.map +1 -1
  55. package/demo/data/bundle.js +1 -1
  56. package/demo/data/index.js +35 -0
  57. package/demo/data/index.js.map +1 -1
  58. package/demo/data/tree.d.ts +30 -0
  59. package/demo/data/tree.js +209 -0
  60. package/demo/data/tree.js.map +1 -0
  61. package/demo/styles.css +148 -0
  62. package/demo/styles.css.map +1 -1
  63. package/demo/styles.min.css +1 -1
  64. package/demo/styles.min.css.map +1 -1
  65. package/demo/tsconfig.tsbuildinfo +82 -68
  66. package/interfaces/charts.d.ts +7 -1
  67. package/interfaces/charts.js.map +1 -1
  68. package/interfaces/enums.d.ts +7 -0
  69. package/interfaces/enums.js +8 -0
  70. package/interfaces/enums.js.map +1 -1
  71. package/interfaces/events.d.ts +8 -0
  72. package/interfaces/events.js +9 -0
  73. package/interfaces/events.js.map +1 -1
  74. package/package.json +1 -1
  75. package/styles/components/_highlights.scss +6 -0
  76. package/styles/components/_zoom-bar.scss +5 -0
  77. package/styles/components/index.scss +1 -0
  78. package/styles/graphs/_tree.scss +43 -0
  79. package/styles/graphs/index.scss +1 -0
  80. package/styles-g10.css +39 -0
  81. package/styles-g10.css.map +1 -1
  82. package/styles-g10.min.css +1 -1
  83. package/styles-g10.min.css.map +1 -1
  84. package/styles-g100.css +39 -0
  85. package/styles-g100.css.map +1 -1
  86. package/styles-g100.min.css +1 -1
  87. package/styles-g100.min.css.map +1 -1
  88. package/styles-g90.css +39 -0
  89. package/styles-g90.css.map +1 -1
  90. package/styles-g90.min.css +1 -1
  91. package/styles-g90.min.css.map +1 -1
  92. package/styles.css +39 -0
  93. package/styles.css.map +1 -1
  94. package/styles.min.css +1 -1
  95. package/styles.min.css.map +1 -1
  96. package/tools.js +12 -6
  97. package/tools.js.map +1 -1
  98. package/tsconfig.tsbuildinfo +95 -22
package/chart.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChartConfig, BaseChartOptions, RenderTypes } from './interfaces';
1
+ import { ChartConfig, BaseChartOptions } from './interfaces';
2
2
  import { ChartModel } from './model/model';
3
3
  import { Component, Modal, LayoutComponent, Tooltip } from './components';
4
4
  export declare class Chart {
@@ -10,5 +10,5 @@ export declare class Chart {
10
10
  getComponents(): any[];
11
11
  update(animate?: boolean): void;
12
12
  destroy(): void;
13
- protected getChartComponents(graphFrameComponents: any[], graphFrameRenderType?: RenderTypes): (LayoutComponent | Tooltip | Modal)[];
13
+ protected getChartComponents(graphFrameComponents: any[], configs?: object): (LayoutComponent | Tooltip | Modal)[];
14
14
  }
package/chart.js CHANGED
@@ -86,8 +86,7 @@ var Chart = /** @class */ (function () {
86
86
  this.services.domUtils.getHolder().remove();
87
87
  this.model.set({ destroyed: true }, { skipUpdate: true });
88
88
  };
89
- Chart.prototype.getChartComponents = function (graphFrameComponents, graphFrameRenderType) {
90
- if (graphFrameRenderType === void 0) { graphFrameRenderType = RenderTypes.SVG; }
89
+ Chart.prototype.getChartComponents = function (graphFrameComponents, configs) {
91
90
  var titleComponent = {
92
91
  id: 'title',
93
92
  components: [new Title(this.model, this.services)],
@@ -107,9 +106,10 @@ var Chart = /** @class */ (function () {
107
106
  id: 'graph-frame',
108
107
  components: graphFrameComponents,
109
108
  growth: LayoutGrowth.STRETCH,
110
- renderType: graphFrameRenderType,
109
+ renderType: Tools.getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG,
111
110
  };
112
- var isLegendEnabled = this.model.getOptions().legend.enabled !== false;
111
+ var isLegendEnabled = Tools.getProperty(configs, 'excludeLegend') !== true &&
112
+ this.model.getOptions().legend.enabled !== false;
113
113
  // TODORF - REUSE BETWEEN AXISCHART & CHART
114
114
  // Decide the position of the legend in reference to the chart
115
115
  var fullFrameComponentDirection = LayoutDirection.COLUMN;
package/chart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":";;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAGN,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,MAAM,IAAI,WAAW,EACrB,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEN,KAAK,EACL,KAAK,EACL,MAAM,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,WAAW;AACX,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,aAAa,EACb,WAAW,GACX,MAAM,kBAAkB,CAAC;AAE1B;IAYC,eAAY,MAAe,EAAE,YAA2C;QAVxE,aAAQ,GAAQ;YACf,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,aAAa;YAC5B,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,UAAU;SACtB,CAAC;QACF,UAAK,GAAe,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEyB,CAAC;IAE5E,iFAAiF;IACjF,oBAAI,GAAJ,UAAK,MAAe,EAAE,YAA2C;QAAjE,iBA8BC;QA7BA,gCAAgC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,QAAA,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAEjD,0BAA0B;QAC1B,MAAM,CAAC,IAAI,CAA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1C,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBACnD,mBAAmB;oBAEpB;oBACC,SAAS,EAAE,2BAA2B;iBACtC,CACD;aACD;YACD,MAAM,EAAE,YAAY,CAAC,OAAO;SAC5B,CAAC;QAEF,+BAA+B;QAC/B,IAAM,wBAAwB,GAAG,EAAE,CAAC;QACpC,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE;YAClC,wBAAwB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAE9C,IAAM,oBAAoB,GAAG;gBAC5B,EAAE,EAAE,QAAQ;gBACZ,UAAU,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACnD,MAAM,EAAE,YAAY,CAAC,SAAS;aAC9B,CAAC;YAEF,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACpD;QACD,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACtC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,YAAC;AAAD,CAAC,AArND,IAqNC","sourcesContent":["// Internal Imports\nimport {\n\tChartConfig,\n\tBaseChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes,\n} from './interfaces';\n\n// Misc\nimport { ChartModel } from './model/model';\nimport {\n\tComponent,\n\tModal,\n\tTitle,\n\tLegend,\n\tLayoutComponent,\n\tTooltip,\n\tSpacer,\n\tCanvasChartClip,\n} from './components';\nimport { Tools } from './tools';\n\n// Services\nimport {\n\tCanvasZoom,\n\tDOMUtils,\n\tEvents,\n\tFiles,\n\tGradientUtils,\n\tTransitions,\n} from './services/index';\n\nexport class Chart {\n\tcomponents: Component[];\n\tservices: any = {\n\t\tdomUtils: DOMUtils,\n\t\tfiles: Files,\n\t\tevents: Events,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions,\n\t\tcanvasZoom: CanvasZoom,\n\t};\n\tmodel: ChartModel = new ChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true });\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tthis.services[serviceName] = new serviceObj(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services\n\t\t\t);\n\t\t});\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e) => {\n\t\t\tconst animate = !!Tools.getProperty(e, 'detail', 'animate');\n\t\t\tthis.update(animate);\n\t\t});\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data);\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false);\n\t\t});\n\n\t\tthis.components = this.getComponents();\n\n\t\tthis.update();\n\t}\n\n\tgetComponents(): any[] {\n\t\tconsole.error('getComponents() method is not implemented');\n\n\t\treturn null;\n\t}\n\n\tupdate(animate = true) {\n\t\tif (!this.components) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tserviceObj.update();\n\t\t});\n\n\t\t// Render all components\n\t\tthis.components.forEach((component) => component.render(animate));\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions();\n\t\tconst promises = Object.keys(pendingTransitions).map((transitionID) => {\n\t\t\tconst transition = pendingTransitions[transitionID];\n\t\t\treturn transition.end().catch((e) => e); // Skip rejects since we don't care about those;\n\t\t});\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tChartEvents.Chart.RENDER_FINISHED\n\t\t\t)\n\t\t);\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach((component) => component.destroy());\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove();\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true });\n\t}\n\n\tprotected getChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tgraphFrameRenderType = RenderTypes.SVG\n\t) {\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'canvasZoom',\n\t\t\t'enabled'\n\t\t);\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew CanvasChartClip(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: graphFrameRenderType,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\t\t// TODORF - REUSE BETWEEN AXISCHART & CHART\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === 'left') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'right') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'bottom') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
1
+ {"version":3,"file":"chart.js","sourceRoot":"","sources":["chart.ts"],"names":[],"mappings":";;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAGN,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,MAAM,IAAI,WAAW,EACrB,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEN,KAAK,EACL,KAAK,EACL,MAAM,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,WAAW;AACX,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,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AY,CAAC,SAAS;aAC9B,CAAC;YAEF,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACpD;QACD,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACtC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,YAAC;AAAD,CAAC,AAtND,IAsNC","sourcesContent":["// Internal Imports\nimport {\n\tChartConfig,\n\tBaseChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tLegendOrientations,\n\tEvents as ChartEvents,\n\tRenderTypes,\n} from './interfaces';\n\n// Misc\nimport { ChartModel } from './model/model';\nimport {\n\tComponent,\n\tModal,\n\tTitle,\n\tLegend,\n\tLayoutComponent,\n\tTooltip,\n\tSpacer,\n\tCanvasChartClip,\n} from './components';\nimport { Tools } from './tools';\n\n// Services\nimport {\n\tCanvasZoom,\n\tDOMUtils,\n\tEvents,\n\tFiles,\n\tGradientUtils,\n\tTransitions,\n} from './services/index';\n\nexport class Chart {\n\tcomponents: Component[];\n\tservices: any = {\n\t\tdomUtils: DOMUtils,\n\t\tfiles: Files,\n\t\tevents: Events,\n\t\tgradientUtils: GradientUtils,\n\t\ttransitions: Transitions,\n\t\tcanvasZoom: CanvasZoom,\n\t};\n\tmodel: ChartModel = new ChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {}\n\n\t// Contains the code that uses properties that are overridable by the super-class\n\tinit(holder: Element, chartConfigs: ChartConfig<BaseChartOptions>) {\n\t\t// Store the holder in the model\n\t\tthis.model.set({ holder }, { skipUpdate: true });\n\n\t\t// Initialize all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tthis.services[serviceName] = new serviceObj(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services\n\t\t\t);\n\t\t});\n\n\t\t// Call update() when model has been updated\n\t\tthis.services.events.addEventListener(ChartEvents.Model.UPDATE, (e) => {\n\t\t\tconst animate = !!Tools.getProperty(e, 'detail', 'animate');\n\t\t\tthis.update(animate);\n\t\t});\n\n\t\t// Set model data & options\n\t\tthis.model.setData(chartConfigs.data);\n\n\t\t// Set chart resize event listener\n\t\tthis.services.events.addEventListener(ChartEvents.Chart.RESIZE, () => {\n\t\t\tthis.update(false);\n\t\t});\n\n\t\tthis.components = this.getComponents();\n\n\t\tthis.update();\n\t}\n\n\tgetComponents(): any[] {\n\t\tconsole.error('getComponents() method is not implemented');\n\n\t\treturn null;\n\t}\n\n\tupdate(animate = true) {\n\t\tif (!this.components) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update all services\n\t\tObject.keys(this.services).forEach((serviceName) => {\n\t\t\tconst serviceObj = this.services[serviceName];\n\t\t\tserviceObj.update();\n\t\t});\n\n\t\t// Render all components\n\t\tthis.components.forEach((component) => component.render(animate));\n\n\t\t// Asynchronously dispatch a \"render-finished\" event\n\t\t// This is needed because of d3-transitions\n\t\t// Since at the start of the transition\n\t\t// Elements do not hold their final size or position\n\t\tconst pendingTransitions = this.services.transitions.getPendingTransitions();\n\t\tconst promises = Object.keys(pendingTransitions).map((transitionID) => {\n\t\t\tconst transition = pendingTransitions[transitionID];\n\t\t\treturn transition.end().catch((e) => e); // Skip rejects since we don't care about those;\n\t\t});\n\n\t\tPromise.all(promises).then(() =>\n\t\t\tthis.services.events.dispatchEvent(\n\t\t\t\tChartEvents.Chart.RENDER_FINISHED\n\t\t\t)\n\t\t);\n\t}\n\n\tdestroy() {\n\t\t// Call the destroy() method on all components\n\t\tthis.components.forEach((component) => component.destroy());\n\n\t\t// Remove the chart holder\n\t\tthis.services.domUtils.getHolder().remove();\n\n\t\tthis.model.set({ destroyed: true }, { skipUpdate: true });\n\t}\n\n\tprotected getChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: object\n\t) {\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if canvas zoom is enabled\n\t\tconst isZoomEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'canvasZoom',\n\t\t\t'enabled'\n\t\t);\n\n\t\tif (isZoomEnabled && isZoomEnabled === true) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew CanvasChartClip(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: Tools.getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'excludeLegend') !== true &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\t\t// TODORF - REUSE BETWEEN AXISCHART & CHART\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === 'left') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'right') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === 'bottom') {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew Tooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
package/charts/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './meter';
16
16
  export * from './radar';
17
17
  export * from './gauge';
18
18
  export * from './combo';
19
+ export * from './tree';
19
20
  export * from './treemap';
20
21
  export * from './circle-pack';
21
22
  export * from './wordcloud';
package/charts/index.js CHANGED
@@ -16,6 +16,7 @@ export * from './meter';
16
16
  export * from './radar';
17
17
  export * from './gauge';
18
18
  export * from './combo';
19
+ export * from './tree';
19
20
  export * from './treemap';
20
21
  export * from './circle-pack';
21
22
  export * from './wordcloud';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","sourcesContent":["export * from './area';\nexport * from './area-stacked';\nexport * from './bar-simple';\nexport * from './bar-grouped';\nexport * from './bar-stacked';\nexport * from './boxplot';\nexport * from './bubble';\nexport * from './bullet';\nexport * from './histogram';\nexport * from './line';\nexport * from './lollipop';\nexport * from './scatter';\nexport * from './pie';\nexport * from './donut';\nexport * from './meter';\nexport * from './radar';\nexport * from './gauge';\nexport * from './combo';\nexport * from './treemap';\nexport * from './circle-pack';\nexport * from './wordcloud';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","sourcesContent":["export * from './area';\nexport * from './area-stacked';\nexport * from './bar-simple';\nexport * from './bar-grouped';\nexport * from './bar-stacked';\nexport * from './boxplot';\nexport * from './bubble';\nexport * from './bullet';\nexport * from './histogram';\nexport * from './line';\nexport * from './lollipop';\nexport * from './scatter';\nexport * from './pie';\nexport * from './donut';\nexport * from './meter';\nexport * from './radar';\nexport * from './gauge';\nexport * from './combo';\nexport * from './tree';\nexport * from './treemap';\nexport * from './circle-pack';\nexport * from './wordcloud';\n"]}
package/charts/meter.js CHANGED
@@ -64,7 +64,9 @@ var MeterChart = /** @class */ (function (_super) {
64
64
  }),
65
65
  ];
66
66
  // add the meter title as a top level component
67
- var components = this.getChartComponents(graphFrame, RenderTypes.HTML);
67
+ var components = this.getChartComponents(graphFrame, {
68
+ graphFrameRenderType: RenderTypes.HTML,
69
+ });
68
70
  return components;
69
71
  };
70
72
  return MeterChart;
@@ -1 +1 @@
1
- {"version":3,"file":"meter.js","sourceRoot":"","sources":["meter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAGN,YAAY,EACZ,eAAe,EACf,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,aAAa;AACb,OAAO,EAKN,eAAe,EACf,UAAU,EACV,MAAM,GACN,MAAM,qBAAqB,CAAC;AAE7B;IAAgC,8BAAK;IAGpC,oBAAY,MAAe,EAAE,YAA4C;QAAzE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAmB3B;QAtBD,WAAK,GAAG,IAAI,eAAe,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAK1C,kDAAkD;QAClD,IAAI,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY;YACpD,CAAC,CAAC,KAAK,CAAC,KAAK,CACX,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,sBAAsB,CAAC,EACzD,YAAY,CAAC,OAAO,CACnB;YACH,CAAC,CAAC,KAAK,CAAC,KAAK,CACX,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,EAC7C,YAAY,CAAC,OAAO,CACnB,CAAC;QAEL,2CAA2C;QA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,IAAI,CAChB,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,iBAAC;AAAD,CAAC,AArED,CAAgC,KAAK,GAqEpC","sourcesContent":["// Internal Imports\nimport { MeterChartModel } from '../model/meter';\nimport { Chart } from '../chart';\nimport * as Configuration from '../configuration';\nimport {\n\tChartConfig,\n\tMeterChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tRenderTypes,\n} from '../interfaces/index';\nimport { Tools } from '../tools';\nimport { Meter } from './../components/graphs/meter';\n\n// Components\nimport {\n\tPie,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tTooltip,\n\tLegend,\n\tLayoutComponent,\n\tMeterTitle,\n\tSpacer,\n} from '../components/index';\n\nexport class MeterChart extends Chart {\n\tmodel = new MeterChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<MeterChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// use prop meter options or regular meter options\n\t\tlet options = chartConfigs.options.meter.proportional\n\t\t\t? Tools.merge(\n\t\t\t\t\tTools.clone(Configuration.options.proportionalMeterChart),\n\t\t\t\t\tchartConfigs.options\n\t\t\t )\n\t\t\t: Tools.merge(\n\t\t\t\t\tTools.clone(Configuration.options.meterChart),\n\t\t\t\t\tchartConfigs.options\n\t\t\t );\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(options);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph only\n\t\tconst graph = {\n\t\t\tid: 'meter-graph',\n\t\t\tcomponents: [new Meter(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\t// Meter has an unique dataset title within the graph\n\t\tconst titleComponent = {\n\t\t\tid: 'meter-title',\n\t\t\tcomponents: [new MeterTitle(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\t// create the title spacer\n\t\tconst titleSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 8 })],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\t// the graph frame for meter includes the custom title (and spacer)\n\t\tconst graphFrame = [\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\t[titleComponent, titleSpacerComponent, graph],\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\n\t\t// add the meter title as a top level component\n\t\tconst components: any[] = this.getChartComponents(\n\t\t\tgraphFrame,\n\t\t\tRenderTypes.HTML\n\t\t);\n\n\t\treturn components;\n\t}\n}\n"]}
1
+ {"version":3,"file":"meter.js","sourceRoot":"","sources":["meter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAGN,YAAY,EACZ,eAAe,EACf,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,aAAa;AACb,OAAO,EAKN,eAAe,EACf,UAAU,EACV,MAAM,GACN,MAAM,qBAAqB,CAAC;AAE7B;IAAgC,8BAAK;IAGpC,oBAAY,MAAe,EAAE,YAA4C;QAAzE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAmB3B;QAtBD,WAAK,GAAG,IAAI,eAAe,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;QAK1C,kDAAkD;Q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E,MAAM,EAAE,YAAY,CAAC,OAAO;SAC5B,CAAC;QAEF,mEAAmE;QACnE,IAAM,UAAU,GAAG;YAClB,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,CAAC,cAAc,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAC7C;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;QAEF,+CAA+C;QAC/C,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;YAC7D,oBAAoB,EAAE,WAAW,CAAC,IAAI;SACtC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,iBAAC;AAAD,CAAC,AApED,CAAgC,KAAK,GAoEpC","sourcesContent":["// Internal Imports\nimport { MeterChartModel } from '../model/meter';\nimport { Chart } from '../chart';\nimport * as Configuration from '../configuration';\nimport {\n\tChartConfig,\n\tMeterChartOptions,\n\tLayoutGrowth,\n\tLayoutDirection,\n\tRenderTypes,\n} from '../interfaces/index';\nimport { Tools } from '../tools';\nimport { Meter } from './../components/graphs/meter';\n\n// Components\nimport {\n\tPie,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tTooltip,\n\tLegend,\n\tLayoutComponent,\n\tMeterTitle,\n\tSpacer,\n} from '../components/index';\n\nexport class MeterChart extends Chart {\n\tmodel = new MeterChartModel(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<MeterChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// use prop meter options or regular meter options\n\t\tlet options = chartConfigs.options.meter.proportional\n\t\t\t? Tools.merge(\n\t\t\t\t\tTools.clone(Configuration.options.proportionalMeterChart),\n\t\t\t\t\tchartConfigs.options\n\t\t\t )\n\t\t\t: Tools.merge(\n\t\t\t\t\tTools.clone(Configuration.options.meterChart),\n\t\t\t\t\tchartConfigs.options\n\t\t\t );\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(options);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph only\n\t\tconst graph = {\n\t\t\tid: 'meter-graph',\n\t\t\tcomponents: [new Meter(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\t// Meter has an unique dataset title within the graph\n\t\tconst titleComponent = {\n\t\t\tid: 'meter-title',\n\t\t\tcomponents: [new MeterTitle(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\t// create the title spacer\n\t\tconst titleSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services, { size: 8 })],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\t// the graph frame for meter includes the custom title (and spacer)\n\t\tconst graphFrame = [\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\t[titleComponent, titleSpacerComponent, graph],\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\n\t\t// add the meter title as a top level component\n\t\tconst components: any[] = this.getChartComponents(graphFrame, {\n\t\t\tgraphFrameRenderType: RenderTypes.HTML,\n\t\t});\n\n\t\treturn components;\n\t}\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Chart } from '../chart';
2
+ import { ChartConfig, TreeChartOptions } from '../interfaces/index';
3
+ export declare class TreeChart extends Chart {
4
+ constructor(holder: Element, chartConfigs: ChartConfig<TreeChartOptions>);
5
+ getComponents(): any[];
6
+ }
package/charts/tree.js ADDED
@@ -0,0 +1,45 @@
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
+ // Internal Imports
15
+ import { Chart } from '../chart';
16
+ import * as Configuration from '../configuration';
17
+ import { Tools } from '../tools';
18
+ // Components
19
+ import { Tree, } from '../components/index';
20
+ var TreeChart = /** @class */ (function (_super) {
21
+ __extends(TreeChart, _super);
22
+ function TreeChart(holder, chartConfigs) {
23
+ var _this = _super.call(this, holder, chartConfigs) || this;
24
+ // Merge the default options for this chart
25
+ // With the user provided options
26
+ _this.model.setOptions(Tools.mergeDefaultChartOptions(Configuration.options.treeChart, chartConfigs.options));
27
+ // Initialize data, services, components etc.
28
+ _this.init(holder, chartConfigs);
29
+ return _this;
30
+ }
31
+ TreeChart.prototype.getComponents = function () {
32
+ // Specify what to render inside the graph-frame
33
+ var graphFrameComponents = [
34
+ new Tree(this.model, this.services),
35
+ ];
36
+ // get the base chart components and export with tooltip
37
+ var components = this.getChartComponents(graphFrameComponents, {
38
+ excludeLegend: true,
39
+ });
40
+ return components;
41
+ };
42
+ return TreeChart;
43
+ }(Chart));
44
+ export { TreeChart };
45
+ //# sourceMappingURL=../../src/charts/tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.js","sourceRoot":"","sources":["tree.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EACN,IAAI,GAKJ,MAAM,qBAAqB,CAAC;AAE7B;IAA+B,6BAAK;IACnC,mBAAY,MAAe,EAAE,YAA2C;QAAxE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAa3B;QAXA,2CAA2C;QAC3C,iCAAiC;QACjC,KAAI,CAAC,KAAK,CAAC,UAAU,CACpB,KAAK,CAAC,wBAAwB,CAC7B,aAAa,CAAC,OAAO,CAAC,SAAS,EAC/B,YAAY,CAAC,OAAO,CACpB,CACD,CAAC;QAEF,6CAA6C;QAC7C,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;IACjC,CAAC;IAED,iCAAa,GAAb;QACC,gDAAgD;QAChD,IAAM,oBAAoB,GAAU;YACnC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;SACnC,CAAC;QAEF,wDAAwD;QACxD,IAAM,UAAU,GAAU,IAAI,CAAC,kBAAkB,CAChD,oBAAoB,EACpB;YACC,aAAa,EAAE,IAAI;SACnB,CACD,CAAC;QACF,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,gBAAC;AAAD,CAAC,AAhCD,CAA+B,KAAK,GAgCnC","sourcesContent":["// Internal Imports\nimport { Chart } from '../chart';\nimport * as Configuration from '../configuration';\nimport { ChartConfig, TreeChartOptions } from '../interfaces/index';\nimport { Tools } from '../tools';\n\n// Components\nimport {\n\tTree,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tLegend,\n\tLayoutComponent,\n\tSkeleton,\n} from '../components/index';\n\nexport class TreeChart extends Chart {\n\tconstructor(holder: Element, chartConfigs: ChartConfig<TreeChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\n\t\t// Merge the default options for this chart\n\t\t// With the user provided options\n\t\tthis.model.setOptions(\n\t\t\tTools.mergeDefaultChartOptions(\n\t\t\t\tConfiguration.options.treeChart,\n\t\t\t\tchartConfigs.options\n\t\t\t)\n\t\t);\n\n\t\t// Initialize data, services, components etc.\n\t\tthis.init(holder, chartConfigs);\n\t}\n\n\tgetComponents() {\n\t\t// Specify what to render inside the graph-frame\n\t\tconst graphFrameComponents: any[] = [\n\t\t\tnew Tree(this.model, this.services),\n\t\t];\n\n\t\t// get the base chart components and export with tooltip\n\t\tconst components: any[] = this.getChartComponents(\n\t\t\tgraphFrameComponents,\n\t\t\t{\n\t\t\t\texcludeLegend: true,\n\t\t\t}\n\t\t);\n\t\treturn components;\n\t}\n}\n"]}
@@ -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;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EACT,iCAAiC,EACjC,EAAE,EACF,IAAI,CACJ,CAAC;QACF,IAAI,CAAC,iBAAiB,CACrB,SAAS,EACT,sBAAsB,EACtB,EAAE,EACF,IAAI,CAAC,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,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AAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CACtB,CAAC;IACH,CAAC;IACF,cAAC;AAAD,CAAC,AAtrBD,CAA6B,SAAS,GAsrBrC","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\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
+ }