@carbon/charts 0.53.1 → 0.53.5

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.
@@ -4,6 +4,7 @@ import * as lineChart from './line';
4
4
  var addToolbarOptions = function (options, configs) {
5
5
  options.toolbar = {
6
6
  enabled: true,
7
+ numberOfIcons: 3,
7
8
  };
8
9
  options.zoomBar = {
9
10
  top: {
@@ -20,6 +21,17 @@ var addToolbarOptions = function (options, configs) {
20
21
  {
21
22
  type: 'Reset zoom',
22
23
  },
24
+ {
25
+ type: 'Custom',
26
+ text: 'Custom button',
27
+ shouldBeDisabled: function () { return false; },
28
+ clickFunction: function () {
29
+ console.log('Custom click function executed. Event `toolbar-button-click` has also been dispatched.');
30
+ },
31
+ iconSVG: {
32
+ content: "<path d=\"M23,13H18v2h5v2H19a2,2,0,0,0-2,2v2a2,2,0,0,0,2,2h6V15A2,2,0,0,0,23,13Zm0,8H19V19h4Z\"/>\n\t\t\t\t<path d=\"M13,9H9a2,2,0,0,0-2,2V23H9V18h4v5h2V11A2,2,0,0,0,13,9ZM9,16V11h4v5Z\"/><rect data-name=\"&lt;Transparent Rectangle&gt;\" width=\"32\" height=\"32\" style=\"fill: none\"/>",
33
+ },
34
+ },
23
35
  ];
24
36
  if (configs) {
25
37
  if (configs.titleSuffix) {
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC;AAEpC,4CAA4C;AAC5C,IAAM,iBAAiB,GAAG,UAAC,OAAO,EAAE,OAAQ;IAC3C,OAAO,CAAC,OAAO,GAAG;QACjB,OAAO,EAAE,IAAI;KACb,CAAC;IACF,OAAO,CAAC,OAAO,GAAG;QACjB,GAAG,EAAE;YACJ,OAAO,EAAE,IAAI;SACb;KACD,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG;QAC1B;YACC,IAAI,EAAE,SAAS;SACf;QACD;YACC,IAAI,EAAE,UAAU;SAChB;QACD;YACC,IAAI,EAAE,YAAY;SAClB;KACD,CAAC;IAEF,IAAI,OAAO,EAAE;QACZ,IAAI,OAAO,CAAC,WAAW,EAAE;YACxB,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;SACrC;QACD,IAAI,OAAO,CAAC,aAAa,EAAE;YAC1B,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;SACtD;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE;YACrB,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;SAC5C;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,+BAA+B,GAC3C,QAAQ,CAAC,wBAAwB,CAAC;AACnC,MAAM,CAAC,IAAM,kCAAkC,GAAG,iBAAiB,CAClE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CACvD,CAAC;AAEF,MAAM,CAAC,IAAM,yBAAyB,GAAG,SAAS,CAAC,kBAAkB,CAAC;AACtE,MAAM,CAAC,IAAM,4BAA4B,GAAG,iBAAiB,CAC5D,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,qBAAqB,CAAC,EAClD;IACC,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE;QACT;YACC,IAAI,EAAE,YAAY;SAClB;QACD;YACC,IAAI,EAAE,SAAS;SACf;QACD;YACC,IAAI,EAAE,UAAU;SAChB;KACD;CACD,CACD,CAAC","sourcesContent":["import * as barChart from './bar';\nimport * as lineChart from './line';\n\n// utility function to enable toolbar option\nconst addToolbarOptions = (options, configs?) => {\n\toptions.toolbar = {\n\t\tenabled: true,\n\t};\n\toptions.zoomBar = {\n\t\ttop: {\n\t\t\tenabled: true,\n\t\t},\n\t};\n\toptions.toolbar.controls = [\n\t\t{\n\t\t\ttype: 'Zoom in',\n\t\t},\n\t\t{\n\t\t\ttype: 'Zoom out',\n\t\t},\n\t\t{\n\t\t\ttype: 'Reset zoom',\n\t\t},\n\t];\n\n\tif (configs) {\n\t\tif (configs.titleSuffix) {\n\t\t\toptions.title += configs.titleSuffix;\n\t\t}\n\t\tif (configs.numberOfIcons) {\n\t\t\toptions.toolbar.numberOfIcons = configs.numberOfIcons;\n\t\t}\n\t\tif (configs.controls) {\n\t\t\toptions.toolbar.controls = configs.controls;\n\t\t}\n\t}\n\n\treturn options;\n};\n\nexport const toolbarStackedBarTimeSeriesData =\n\tbarChart.stackedBarTimeSeriesData;\nexport const toolbarStackedBarTimeSeriesOptions = addToolbarOptions(\n\tObject.assign({}, barChart.stackedBarTimeSeriesOptions)\n);\n\nexport const toolbarLineTimeSeriesData = lineChart.lineTimeSeriesData;\nexport const toolbarLineTimeSeriesOptions = addToolbarOptions(\n\tObject.assign({}, lineChart.lineTimeSeriesOptions),\n\t{\n\t\ttitleSuffix: ' - two icons',\n\t\tnumberOfIcons: 2,\n\t\tcontrols: [\n\t\t\t{\n\t\t\t\ttype: 'Reset zoom',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'Zoom in',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'Zoom out',\n\t\t\t},\n\t\t],\n\t}\n);\n"]}
1
+ {"version":3,"file":"toolbar.js","sourceRoot":"","sources":["toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC;AAEpC,4CAA4C;AAC5C,IAAM,iBAAiB,GAAG,UAAC,OAAO,EAAE,OAAQ;IAC3C,OAAO,CAAC,OAAO,GAAG;QACjB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,CAAC;KAChB,CAAC;IACF,OAAO,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AClD;IACC,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE;QACT;YACC,IAAI,EAAE,YAAY;SAClB;QACD;YACC,IAAI,EAAE,SAAS;SACf;QACD;YACC,IAAI,EAAE,UAAU;SAChB;KACD;CACD,CACD,CAAC","sourcesContent":["import * as barChart from './bar';\nimport * as lineChart from './line';\n\n// utility function to enable toolbar option\nconst addToolbarOptions = (options, configs?) => {\n\toptions.toolbar = {\n\t\tenabled: true,\n\t\tnumberOfIcons: 3,\n\t};\n\toptions.zoomBar = {\n\t\ttop: {\n\t\t\tenabled: true,\n\t\t},\n\t};\n\toptions.toolbar.controls = [\n\t\t{\n\t\t\ttype: 'Zoom in',\n\t\t},\n\t\t{\n\t\t\ttype: 'Zoom out',\n\t\t},\n\t\t{\n\t\t\ttype: 'Reset zoom',\n\t\t},\n\t\t{\n\t\t\ttype: 'Custom',\n\t\t\ttext: 'Custom button',\n\t\t\tshouldBeDisabled: () => false,\n\t\t\tclickFunction: () => {\n\t\t\t\tconsole.log(\n\t\t\t\t\t'Custom click function executed. Event `toolbar-button-click` has also been dispatched.'\n\t\t\t\t);\n\t\t\t},\n\t\t\ticonSVG: {\n\t\t\t\tcontent: `<path d=\"M23,13H18v2h5v2H19a2,2,0,0,0-2,2v2a2,2,0,0,0,2,2h6V15A2,2,0,0,0,23,13Zm0,8H19V19h4Z\"/>\n\t\t\t\t<path d=\"M13,9H9a2,2,0,0,0-2,2V23H9V18h4v5h2V11A2,2,0,0,0,13,9ZM9,16V11h4v5Z\"/><rect data-name=\"&lt;Transparent Rectangle&gt;\" width=\"32\" height=\"32\" style=\"fill: none\"/>`,\n\t\t\t},\n\t\t},\n\t];\n\n\tif (configs) {\n\t\tif (configs.titleSuffix) {\n\t\t\toptions.title += configs.titleSuffix;\n\t\t}\n\t\tif (configs.numberOfIcons) {\n\t\t\toptions.toolbar.numberOfIcons = configs.numberOfIcons;\n\t\t}\n\t\tif (configs.controls) {\n\t\t\toptions.toolbar.controls = configs.controls;\n\t\t}\n\t}\n\n\treturn options;\n};\n\nexport const toolbarStackedBarTimeSeriesData =\n\tbarChart.stackedBarTimeSeriesData;\nexport const toolbarStackedBarTimeSeriesOptions = addToolbarOptions(\n\tObject.assign({}, barChart.stackedBarTimeSeriesOptions)\n);\n\nexport const toolbarLineTimeSeriesData = lineChart.lineTimeSeriesData;\nexport const toolbarLineTimeSeriesOptions = addToolbarOptions(\n\tObject.assign({}, lineChart.lineTimeSeriesOptions),\n\t{\n\t\ttitleSuffix: ' - two icons',\n\t\tnumberOfIcons: 2,\n\t\tcontrols: [\n\t\t\t{\n\t\t\t\ttype: 'Reset zoom',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'Zoom in',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'Zoom out',\n\t\t\t},\n\t\t],\n\t}\n);\n"]}
@@ -246,7 +246,7 @@
246
246
  "signature": "953f0c6eacdabbbc75e4f119fcc0a4eb2003671e6b6560cfea8ec80fe37fc0eb"
247
247
  },
248
248
  "../../demo/data/toolbar.ts": {
249
- "version": "a448c23441e957e91a76209f1a4a3ee8bd347f5bcca22f40a10b5505b3dc476e",
249
+ "version": "e926e89d7df8776cc3348cbed7e47ca33f2df27c95209c413b6944ca13926850",
250
250
  "signature": "366baf83310f18e4bf48cc82c3df5df4c8754adf1bbdcbbbf67554073e2663ff"
251
251
  },
252
252
  "../../demo/data/wordcloud.ts": {
@@ -152,6 +152,25 @@ export interface ToolbarControl {
152
152
  * type value will be displayed if text is not available
153
153
  */
154
154
  text?: string;
155
+ /**
156
+ * custom id for button
157
+ */
158
+ id?: String;
159
+ /**
160
+ * SVG HTML element
161
+ */
162
+ iconSVG?: {
163
+ content?: string;
164
+ height?: string;
165
+ width?: string;
166
+ };
167
+ shouldBeDisabled?: Function;
168
+ /**
169
+ * function to execute on button click
170
+ * alternatively, users can choose to not pass in a function and can
171
+ * listen for events to execute asynchronously
172
+ */
173
+ clickFunction?: Function;
155
174
  }
156
175
  /**
157
176
  * customize the ZoomBars in a chart
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["components.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tLayoutGrowth,\n\tLegendPositions,\n\tAlignments,\n\tToolbarControlTypes,\n\tZoomBarTypes,\n} from './enums';\nimport { Component } from '../components/component';\nimport { TruncationOptions } from './truncation';\n\n/**\n * customize the overlay contents\n */\nexport interface LayoutComponentChild {\n\tid: string;\n\t/**\n\t * the component that'll be rendered inside layout child\n\t */\n\tcomponents: Component[];\n\t/**\n\t * size of the layout child\n\t */\n\tsize?: number;\n\t/**\n\t * how the layout child will grow or shrink\n\t */\n\tgrowth: LayoutGrowth;\n}\n\n/**\n * customize the legend component\n */\nexport interface LegendOptions {\n\tenabled?: boolean;\n\tposition?: LegendPositions;\n\t/**\n\t * the clickability of legend items\n\t */\n\tclickable?: boolean;\n\ttruncation?: TruncationOptions;\n\talignment?: Alignments;\n\torder?: string[];\n\t/**\n\t * customized legend items\n\t */\n\tadditionalItems?: LegendItem[];\n}\n\n/**\n * customize the legend item\n */\nexport interface LegendItem {\n\ttype: string;\n\tname: string;\n\tfill?: string;\n\tstroke?: string;\n}\n\nexport interface TooltipOptions {\n\t/**\n\t * enable or disable tooltip\n\t */\n\tenabled?: boolean;\n\t/**\n\t * a function to format the tooltip values\n\t */\n\tvalueFormatter?: Function;\n\t/**\n\t * custom function for returning tooltip HTML\n\t * passed an array or object with the data, and then the default tooltip markup\n\t */\n\tcustomHTML?: Function;\n\t/**\n\t * customizes the `Group` label shown inside tooltips\n\t */\n\tgroupLabel?: string;\n\t/**\n\t * show total of items\n\t */\n\tshowTotal?: boolean;\n\t/**\n\t * customizes the `Total` label shown inside tooltips\n\t */\n\ttotalLabel?: string;\n\ttruncation?: TruncationOptions;\n}\n\n/**\n * Threshold options\n */\nexport interface ThresholdOptions {\n\t/**\n\t * threshold value\n\t */\n\tvalue: number | Date;\n\t/**\n\t * a function to format the threshold values\n\t */\n\tvalueFormatter?: Function;\n\t/**\n\t * hex threshold line color\n\t */\n\tfillColor: string;\n\t/**\n\t * threshold label\n\t */\n\tlabel: string;\n}\n\nexport interface GridOptions {\n\ty?: {\n\t\tenabled?: boolean;\n\t\tnumberOfTicks?: number;\n\t\talignWithAxisTicks?: boolean;\n\t};\n\tx?: {\n\t\tenabled?: boolean;\n\t\tnumberOfTicks?: number;\n\t\talignWithAxisTicks?: boolean;\n\t};\n}\n\n/**\n * Ruler options\n */\nexport interface RulerOptions {\n\tenabled?: boolean;\n}\n\nexport interface BarOptions {\n\twidth?: number;\n\tmaxWidth?: number;\n}\n\nexport interface StackedBarOptions extends BarOptions {\n\tdividerSize?: number;\n}\n\n/**\n * customize the Toolbar component\n */\nexport interface ToolbarOptions {\n\t/**\n\t * is the toolbar visible or not\n\t */\n\tenabled?: boolean;\n\t/**\n\t * the maximum toolbar controls to be displayed as icons\n\t * controls more than this number will appear in the overflow menu\n\t * minimum is 1. (all toolbar controls are in overflow menu)\n\t */\n\tnumberOfIcons?: number;\n\t/**\n\t * toolbar controls which will be displayed following the array order\n\t */\n\tcontrols?: ToolbarControl[];\n}\n\n/**\n * options for each toolbar control\n */\nexport interface ToolbarControl {\n\t/**\n\t * the toolbar control type\n\t */\n\ttype: ToolbarControlTypes;\n\t/**\n\t * the text to display (if this control is displayed in overflow menu)\n\t * type value will be displayed if text is not available\n\t */\n\ttext?: string;\n}\n\n/**\n * customize the ZoomBars in a chart\n */\nexport interface ZoomBarsOptions {\n\t/**\n\t * a variable to handle default zoom in ratio (0 ~ 1.0)\n\t * ex: shift click zoom in ratio\n\t */\n\tzoomRatio?: number;\n\t/**\n\t * a variable to define the minimum zoom ratio (0 ~ 1.0)\n\t * If ( zoom domain / max domain ) < minZoomRatio, zoom-in functions will be disabled\n\t */\n\tminZoomRatio?: number;\n\t/**\n\t * currently only the top position is supported\n\t */\n\ttop?: ZoomBarOptions;\n\t/**\n\t * whether keep updating range axis in real time while zoom domain is changing\n\t */\n\tupdateRangeAxis?: boolean;\n}\n\n/**\n * customize the ZoomBar component\n */\nexport interface ZoomBarOptions {\n\t/**\n\t * is the zoom-bar visible or not\n\t */\n\tenabled?: boolean;\n\t/**\n\t * is the zoom-bar in loading state\n\t */\n\tloading?: boolean;\n\t/**\n\t * is the zoom-bar in locked state\n\t */\n\tlocked?: boolean;\n\t/**\n\t * whether the zoom bar is showing a slider view or a graph view etc.\n\t */\n\ttype?: ZoomBarTypes;\n\t/**\n\t * an two element array which represents the initial zoom domain\n\t */\n\tinitialZoomDomain?: Object[];\n\t/**\n\t * options related to zoom bar data\n\t */\n\tdata?: Object[];\n}\n"]}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["components.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tLayoutGrowth,\n\tLegendPositions,\n\tAlignments,\n\tToolbarControlTypes,\n\tZoomBarTypes,\n} from './enums';\nimport { Component } from '../components/component';\nimport { TruncationOptions } from './truncation';\n\n/**\n * customize the overlay contents\n */\nexport interface LayoutComponentChild {\n\tid: string;\n\t/**\n\t * the component that'll be rendered inside layout child\n\t */\n\tcomponents: Component[];\n\t/**\n\t * size of the layout child\n\t */\n\tsize?: number;\n\t/**\n\t * how the layout child will grow or shrink\n\t */\n\tgrowth: LayoutGrowth;\n}\n\n/**\n * customize the legend component\n */\nexport interface LegendOptions {\n\tenabled?: boolean;\n\tposition?: LegendPositions;\n\t/**\n\t * the clickability of legend items\n\t */\n\tclickable?: boolean;\n\ttruncation?: TruncationOptions;\n\talignment?: Alignments;\n\torder?: string[];\n\t/**\n\t * customized legend items\n\t */\n\tadditionalItems?: LegendItem[];\n}\n\n/**\n * customize the legend item\n */\nexport interface LegendItem {\n\ttype: string;\n\tname: string;\n\tfill?: string;\n\tstroke?: string;\n}\n\nexport interface TooltipOptions {\n\t/**\n\t * enable or disable tooltip\n\t */\n\tenabled?: boolean;\n\t/**\n\t * a function to format the tooltip values\n\t */\n\tvalueFormatter?: Function;\n\t/**\n\t * custom function for returning tooltip HTML\n\t * passed an array or object with the data, and then the default tooltip markup\n\t */\n\tcustomHTML?: Function;\n\t/**\n\t * customizes the `Group` label shown inside tooltips\n\t */\n\tgroupLabel?: string;\n\t/**\n\t * show total of items\n\t */\n\tshowTotal?: boolean;\n\t/**\n\t * customizes the `Total` label shown inside tooltips\n\t */\n\ttotalLabel?: string;\n\ttruncation?: TruncationOptions;\n}\n\n/**\n * Threshold options\n */\nexport interface ThresholdOptions {\n\t/**\n\t * threshold value\n\t */\n\tvalue: number | Date;\n\t/**\n\t * a function to format the threshold values\n\t */\n\tvalueFormatter?: Function;\n\t/**\n\t * hex threshold line color\n\t */\n\tfillColor: string;\n\t/**\n\t * threshold label\n\t */\n\tlabel: string;\n}\n\nexport interface GridOptions {\n\ty?: {\n\t\tenabled?: boolean;\n\t\tnumberOfTicks?: number;\n\t\talignWithAxisTicks?: boolean;\n\t};\n\tx?: {\n\t\tenabled?: boolean;\n\t\tnumberOfTicks?: number;\n\t\talignWithAxisTicks?: boolean;\n\t};\n}\n\n/**\n * Ruler options\n */\nexport interface RulerOptions {\n\tenabled?: boolean;\n}\n\nexport interface BarOptions {\n\twidth?: number;\n\tmaxWidth?: number;\n}\n\nexport interface StackedBarOptions extends BarOptions {\n\tdividerSize?: number;\n}\n\n/**\n * customize the Toolbar component\n */\nexport interface ToolbarOptions {\n\t/**\n\t * is the toolbar visible or not\n\t */\n\tenabled?: boolean;\n\t/**\n\t * the maximum toolbar controls to be displayed as icons\n\t * controls more than this number will appear in the overflow menu\n\t * minimum is 1. (all toolbar controls are in overflow menu)\n\t */\n\tnumberOfIcons?: number;\n\t/**\n\t * toolbar controls which will be displayed following the array order\n\t */\n\tcontrols?: ToolbarControl[];\n}\n\n/**\n * options for each toolbar control\n */\nexport interface ToolbarControl {\n\t/**\n\t * the toolbar control type\n\t */\n\ttype: ToolbarControlTypes;\n\t/**\n\t * the text to display (if this control is displayed in overflow menu)\n\t * type value will be displayed if text is not available\n\t */\n\ttext?: string;\n\t/**\n\t * custom id for button\n\t */\n\tid?: String;\n\t/**\n\t * SVG HTML element\n\t */\n\ticonSVG?: {\n\t\tcontent?: string;\n\t\theight?: string;\n\t\twidth?: string;\n\t};\n\tshouldBeDisabled?: Function;\n\t/**\n\t * function to execute on button click\n\t * alternatively, users can choose to not pass in a function and can\n\t * listen for events to execute asynchronously\n\t */\n\tclickFunction?: Function;\n}\n\n/**\n * customize the ZoomBars in a chart\n */\nexport interface ZoomBarsOptions {\n\t/**\n\t * a variable to handle default zoom in ratio (0 ~ 1.0)\n\t * ex: shift click zoom in ratio\n\t */\n\tzoomRatio?: number;\n\t/**\n\t * a variable to define the minimum zoom ratio (0 ~ 1.0)\n\t * If ( zoom domain / max domain ) < minZoomRatio, zoom-in functions will be disabled\n\t */\n\tminZoomRatio?: number;\n\t/**\n\t * currently only the top position is supported\n\t */\n\ttop?: ZoomBarOptions;\n\t/**\n\t * whether keep updating range axis in real time while zoom domain is changing\n\t */\n\tupdateRangeAxis?: boolean;\n}\n\n/**\n * customize the ZoomBar component\n */\nexport interface ZoomBarOptions {\n\t/**\n\t * is the zoom-bar visible or not\n\t */\n\tenabled?: boolean;\n\t/**\n\t * is the zoom-bar in loading state\n\t */\n\tloading?: boolean;\n\t/**\n\t * is the zoom-bar in locked state\n\t */\n\tlocked?: boolean;\n\t/**\n\t * whether the zoom bar is showing a slider view or a graph view etc.\n\t */\n\ttype?: ZoomBarTypes;\n\t/**\n\t * an two element array which represents the initial zoom domain\n\t */\n\tinitialZoomDomain?: Object[];\n\t/**\n\t * options related to zoom bar data\n\t */\n\tdata?: Object[];\n}\n"]}
@@ -203,7 +203,8 @@ export declare enum ToolbarControlTypes {
203
203
  ZOOM_OUT = "Zoom out",
204
204
  RESET_ZOOM = "Reset zoom",
205
205
  MAKE_FULLSCREEN = "Make fullscreen",
206
- SHOW_AS_DATATABLE = "Show as data-table"
206
+ SHOW_AS_DATATABLE = "Show as data-table",
207
+ CUSTOM = "Custom"
207
208
  }
208
209
  /**
209
210
  * enum of title orientations for _vertical axes_
@@ -229,6 +229,7 @@ export var ToolbarControlTypes;
229
229
  ToolbarControlTypes["RESET_ZOOM"] = "Reset zoom";
230
230
  ToolbarControlTypes["MAKE_FULLSCREEN"] = "Make fullscreen";
231
231
  ToolbarControlTypes["SHOW_AS_DATATABLE"] = "Show as data-table";
232
+ ToolbarControlTypes["CUSTOM"] = "Custom";
232
233
  })(ToolbarControlTypes || (ToolbarControlTypes = {}));
233
234
  /**
234
235
  * enum of title orientations for _vertical axes_
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,MAAM,CAAC,IAAM,MAAM,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,4BAAa,CAAA;IACb,0BAAW,CAAA;AACZ,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,yBAAW,CAAA;AACZ,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC9B,gDAAyB,CAAA;IACzB,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;AACpB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,4BAAW,CAAA;IACX,kCAAiB,CAAA;AAClB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACvB,yCAAyB,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ACzB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACd,CAAC,EARW,cAAc,KAAd,cAAc,QAQzB","sourcesContent":["import * as EventEnums from './events';\nexport const Events = EventEnums;\n\nexport enum RenderTypes {\n\tHTML = 'html',\n\tSVG = 'svg',\n}\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tDEFAULT = 'default',\n\tG100 = 'g100',\n\tG90 = 'g90',\n\tG10 = 'g10',\n}\n\n/**\n * enum of all color classname types\n */\nexport enum ColorClassNameTypes {\n\tBACKGROUND = 'background',\n\tFILL = 'fill',\n\tSTROKE = 'stroke',\n\tTOOLTIP = 'tooltip',\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n\tTOP = 'top',\n\tBOTTOM = 'bottom',\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum ZoomBarTypes {\n\tGRAPH_VIEW = 'graph_view',\n\tSLIDER_VIEW = 'slider_view',\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = 'end_line',\n\tMID_LINE = 'mid_line',\n\tFRONT_LINE = 'front_line',\n\tNONE = 'none',\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = 'vertical',\n\tHORIZONTAL = 'horizontal',\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = 'time',\n\tLINEAR = 'linear',\n\tLOG = 'log',\n\tLABELS = 'labels',\n\tLABELS_RATIO = 'labels-ratio',\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = 'right',\n\tLEFT = 'left',\n\tTOP = 'top',\n\tBOTTOM = 'bottom',\n}\n\n/**\n * enum of all possible alignments\n */\nexport enum Alignments {\n\tLEFT = 'left',\n\tCENTER = 'center',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\n\n/**\n * enum of tree types for the tree chart\n */\nexport enum TreeTypes {\n\tTREE = 'tree',\n\tDENDROGRAM = 'dendrogram',\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = 'row',\n\tCOLUMN = 'column',\n\tROW_REVERSE = 'row-reverse',\n\tCOLUMN_REVERSE = 'column-reverse',\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = 'fixed',\n\tPREFERRED = 'preferred',\n\tSTRETCH = 'stretch',\n}\n\n/**\n * enum of all possible layout align-items values\n */\nexport enum LayoutAlignItems {\n\tCENTER = 'center',\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = 'grid',\n\tVERT_OR_HORIZ = 'vertOrHoriz',\n\tPIE = 'pie',\n\tDONUT = 'donut',\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = 'start',\n\tMIDDLE = 'middle',\n\tEND = 'end',\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = 'baseline',\n\tMIDDLE = 'middle',\n\tHANGING = 'hanging',\n}\n\nexport enum GaugeTypes {\n\tSEMI = 'semi',\n\tFULL = 'full',\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = 'up',\n\tDOWN = 'down',\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = 'success',\n\tWARNING = 'warning',\n\tDANGER = 'danger',\n}\n\n/**\n * enum of axis ticks rotation\n */\nexport enum TickRotations {\n\tALWAYS = 'always',\n\tAUTO = 'auto',\n\tNEVER = 'never',\n}\n\n/**\n * enum of chartTypes that work with combo chart\n */\nexport enum ChartTypes {\n\tSCATTER = 'scatter',\n\tLINE = 'line',\n\tSIMPLE_BAR = 'simple-bar',\n\tSTACKED_BAR = 'stacked-bar',\n\tGROUPED_BAR = 'grouped-bar',\n\tAREA = 'area',\n\tSTACKED_AREA = 'stacked-area',\n}\n\n/**\n * enum of supported toolbar control types\n */\nexport enum ToolbarControlTypes {\n\tEXPORT_CSV = 'Export as CSV',\n\tEXPORT_PNG = 'Export as PNG',\n\tEXPORT_JPG = 'Export as JPG',\n\tZOOM_IN = 'Zoom in',\n\tZOOM_OUT = 'Zoom out',\n\tRESET_ZOOM = 'Reset zoom',\n\tMAKE_FULLSCREEN = 'Make fullscreen',\n\tSHOW_AS_DATATABLE = 'Show as data-table',\n}\n/**\n * enum of title orientations for _vertical axes_\n */\nexport enum AxisTitleOrientations {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of legend item type\n */\nexport enum LegendItemType {\n\tCHECKBOX = 'checkbox',\n\tRADIUS = 'radius',\n\tAREA = 'area',\n\tSIZE = 'size',\n\tLINE = 'line',\n\tQUARTILE = 'quartile',\n\tZOOM = 'zoom',\n}\n"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,MAAM,CAAC,IAAM,MAAM,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,4BAAa,CAAA;IACb,0BAAW,CAAA;AACZ,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,yBAAW,C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KAAV,UAAU,QAQrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,mDAA4B,CAAA;IAC5B,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;IACzB,0DAAmC,CAAA;IACnC,+DAAwC,CAAA;IACxC,wCAAiB,CAAA;AAClB,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAChC,sCAAa,CAAA;IACb,wCAAe,CAAA;AAChB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAQX;AARD,WAAY,cAAc;IACzB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,+BAAa,CAAA;AACd,CAAC,EARW,cAAc,KAAd,cAAc,QAQzB","sourcesContent":["import * as EventEnums from './events';\nexport const Events = EventEnums;\n\nexport enum RenderTypes {\n\tHTML = 'html',\n\tSVG = 'svg',\n}\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tDEFAULT = 'default',\n\tG100 = 'g100',\n\tG90 = 'g90',\n\tG10 = 'g10',\n}\n\n/**\n * enum of all color classname types\n */\nexport enum ColorClassNameTypes {\n\tBACKGROUND = 'background',\n\tFILL = 'fill',\n\tSTROKE = 'stroke',\n\tTOOLTIP = 'tooltip',\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n\tTOP = 'top',\n\tBOTTOM = 'bottom',\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum ZoomBarTypes {\n\tGRAPH_VIEW = 'graph_view',\n\tSLIDER_VIEW = 'slider_view',\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = 'end_line',\n\tMID_LINE = 'mid_line',\n\tFRONT_LINE = 'front_line',\n\tNONE = 'none',\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = 'vertical',\n\tHORIZONTAL = 'horizontal',\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = 'time',\n\tLINEAR = 'linear',\n\tLOG = 'log',\n\tLABELS = 'labels',\n\tLABELS_RATIO = 'labels-ratio',\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = 'right',\n\tLEFT = 'left',\n\tTOP = 'top',\n\tBOTTOM = 'bottom',\n}\n\n/**\n * enum of all possible alignments\n */\nexport enum Alignments {\n\tLEFT = 'left',\n\tCENTER = 'center',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\n\n/**\n * enum of tree types for the tree chart\n */\nexport enum TreeTypes {\n\tTREE = 'tree',\n\tDENDROGRAM = 'dendrogram',\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = 'row',\n\tCOLUMN = 'column',\n\tROW_REVERSE = 'row-reverse',\n\tCOLUMN_REVERSE = 'column-reverse',\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = 'fixed',\n\tPREFERRED = 'preferred',\n\tSTRETCH = 'stretch',\n}\n\n/**\n * enum of all possible layout align-items values\n */\nexport enum LayoutAlignItems {\n\tCENTER = 'center',\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = 'grid',\n\tVERT_OR_HORIZ = 'vertOrHoriz',\n\tPIE = 'pie',\n\tDONUT = 'donut',\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = 'start',\n\tMIDDLE = 'middle',\n\tEND = 'end',\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = 'baseline',\n\tMIDDLE = 'middle',\n\tHANGING = 'hanging',\n}\n\nexport enum GaugeTypes {\n\tSEMI = 'semi',\n\tFULL = 'full',\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = 'up',\n\tDOWN = 'down',\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = 'success',\n\tWARNING = 'warning',\n\tDANGER = 'danger',\n}\n\n/**\n * enum of axis ticks rotation\n */\nexport enum TickRotations {\n\tALWAYS = 'always',\n\tAUTO = 'auto',\n\tNEVER = 'never',\n}\n\n/**\n * enum of chartTypes that work with combo chart\n */\nexport enum ChartTypes {\n\tSCATTER = 'scatter',\n\tLINE = 'line',\n\tSIMPLE_BAR = 'simple-bar',\n\tSTACKED_BAR = 'stacked-bar',\n\tGROUPED_BAR = 'grouped-bar',\n\tAREA = 'area',\n\tSTACKED_AREA = 'stacked-area',\n}\n\n/**\n * enum of supported toolbar control types\n */\nexport enum ToolbarControlTypes {\n\tEXPORT_CSV = 'Export as CSV',\n\tEXPORT_PNG = 'Export as PNG',\n\tEXPORT_JPG = 'Export as JPG',\n\tZOOM_IN = 'Zoom in',\n\tZOOM_OUT = 'Zoom out',\n\tRESET_ZOOM = 'Reset zoom',\n\tMAKE_FULLSCREEN = 'Make fullscreen',\n\tSHOW_AS_DATATABLE = 'Show as data-table',\n\tCUSTOM = 'Custom',\n}\n\n/**\n * enum of title orientations for _vertical axes_\n */\nexport enum AxisTitleOrientations {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\n/**\n * enum of legend item type\n */\nexport enum LegendItemType {\n\tCHECKBOX = 'checkbox',\n\tRADIUS = 'radius',\n\tAREA = 'area',\n\tSIZE = 'size',\n\tLINE = 'line',\n\tQUARTILE = 'quartile',\n\tZOOM = 'zoom',\n}\n"]}
@@ -25,7 +25,8 @@ export declare enum Model {
25
25
  */
26
26
  export declare enum Toolbar {
27
27
  SHOW_OVERFLOW_MENU = "show-toolbar-overflow-menu",
28
- HIDE_OVERFLOW_MENU = "hide-toolbar-overflow-menu"
28
+ HIDE_OVERFLOW_MENU = "hide-toolbar-overflow-menu",
29
+ BUTTON_CLICK = "toolbar-button-click"
29
30
  }
30
31
  /**
31
32
  * enum of all events related to the zoom-bar
@@ -32,6 +32,7 @@ export var Toolbar;
32
32
  (function (Toolbar) {
33
33
  Toolbar["SHOW_OVERFLOW_MENU"] = "show-toolbar-overflow-menu";
34
34
  Toolbar["HIDE_OVERFLOW_MENU"] = "hide-toolbar-overflow-menu";
35
+ Toolbar["BUTTON_CLICK"] = "toolbar-button-click";
35
36
  })(Toolbar || (Toolbar = {}));
36
37
  /**
37
38
  * enum of all events related to the zoom-bar
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,KAOX;AAPD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,gCAAuB,CAAA;IACvB,sCAA6B,CAAA;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,oCAA2B,CAAA;AAC5B,CAAC,EAPW,KAAK,KAAL,KAAK,QAOhB;AACD;;GAEG;AACH,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IAChB,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;AACpB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAEX;AAFD,WAAY,KAAK;IAChB,gCAAuB,CAAA;AACxB,CAAC,EAFW,KAAK,KAA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A;IAC1C,8CAAkC,CAAA;IAClC,oDAAwC,CAAA;IACxC,sDAA0C,CAAA;AAC3C,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAKX;AALD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,oCAA2B,CAAA;IAC3B,0CAAiC,CAAA;IACjC,4CAAmC,CAAA;AACpC,CAAC,EALW,KAAK,KAAL,KAAK,QAKhB","sourcesContent":["/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = 'render-finished',\n\tRESIZE = 'chart-resize',\n\tMOUSEOVER = 'chart-mouseover',\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = 'chart-mouseout',\n}\n/**\n * enum of all events related to the overlay modal\n */\nexport enum Modal {\n\tSHOW = 'show-modal',\n\tHIDE = 'hide-modal',\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = 'model-update',\n}\n\n/**\n * enum of all toolbar events\n */\nexport enum Toolbar {\n\tSHOW_OVERFLOW_MENU = 'show-toolbar-overflow-menu',\n\tHIDE_OVERFLOW_MENU = 'hide-toolbar-overflow-menu',\n}\n\n/**\n * enum of all events related to the zoom-bar\n */\nexport enum ZoomBar {\n\tUPDATE = 'zoom-bar-update',\n\tSELECTION_START = 'zoom-bar-selection-start',\n\tSELECTION_IN_PROGRESS = 'zoom-bar-selection-in-progress',\n\tSELECTION_END = 'zoom-bar-selection-end',\n}\n\n/**\n * enum of all events related to the zoom domain\n */\nexport enum ZoomDomain {\n\tCHANGE = 'zoom-domain-change',\n}\n\n/** enum of all events related to canvas zoom *\n *\n */\nexport enum CanvasZoom {\n\tCANVAS_ZOOM_IN = 'canvas-zoom-in',\n\tCANVAS_ZOOM_OUT = 'canvas-zoom-out',\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = 'axis-label-mouseover',\n\tLABEL_MOUSEMOVE = 'axis-label-mousemove',\n\tLABEL_CLICK = 'axis-label-click',\n\tLABEL_MOUSEOUT = 'axis-label-mouseout',\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all wordcloud graph events\n */\nexport enum WordCloud {\n\tWORD_MOUSEOVER = 'wordcloud-word-mouseover',\n\tWORD_MOUSEMOVE = 'wordcloud-word-mousemove',\n\tWORD_CLICK = 'wordcloud-word-click',\n\tWORD_MOUSEOUT = 'wordcloud-word-mouseout',\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = 'pie-slice-mouseover',\n\tSLICE_MOUSEMOVE = 'pie-slice-mousemove',\n\tSLICE_CLICK = 'pie-slice-click',\n\tSLICE_MOUSEOUT = 'pie-slice-mouseout',\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = 'gauge-arc-mouseover',\n\tARC_MOUSEMOVE = 'gauge-arc-mousemove',\n\tARC_CLICK = 'gauge-arc-click',\n\tARC_MOUSEOUT = 'gauge-arc-mouseout',\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = 'bar-mouseover',\n\tBAR_MOUSEMOVE = 'bar-mousemove',\n\tBAR_CLICK = 'bar-click',\n\tBAR_MOUSEOUT = 'bar-mouseout',\n}\n\n/**\n * enum of all boxplot graph events\n */\nexport enum Boxplot {\n\tBOX_MOUSEOVER = 'box-mouseover',\n\tBOX_MOUSEMOVE = 'box-mousemove',\n\tBOX_CLICK = 'box-click',\n\tBOX_MOUSEOUT = 'box-mouseout',\n\tOUTLIER_MOUSEOVER = 'outlier-mouseover',\n\tOUTLIER_MOUSEMOVE = 'outlier-mousemove',\n\tOUTLIER_CLICK = 'outlier-click',\n\tOUTLIER_MOUSEOUT = 'outlier-mouseout',\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = 'scatter-mouseover',\n\tSCATTER_MOUSEMOVE = 'scatter-mousemove',\n\tSCATTER_CLICK = 'scatter-click',\n\tSCATTER_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = 'radar-x-axis-mouseover',\n\tX_AXIS_MOUSEMOVE = 'radar-x-axis-mousemove',\n\tX_AXIS_CLICK = 'radar-x-axis-click',\n\tX_AXIS_MOUSEOUT = 'radar-x-axis-mouseout',\n}\n\n/**\n * enum of all tree graph events\n */\nexport enum Tree {\n\tNODE_MOUSEOVER = 'tree-node-mouseover',\n\tNODE_CLICK = 'tree-node-click',\n\tNODE_MOUSEOUT = 'tree-node-mouseout'\n}\n\n/**\n * enum of all treemap graph events\n */\nexport enum Treemap {\n\tLEAF_MOUSEOVER = 'leaf-mouseover',\n\tLEAF_MOUSEMOVE = 'leaf-mousemove',\n\tLEAF_CLICK = 'leaf-click',\n\tLEAF_MOUSEOUT = 'leaf-mouseout',\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = 'show-tooltip',\n\tMOVE = 'move-tooltip',\n\tHIDE = 'hide-tooltip',\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = 'show-threshold',\n\tHIDE = 'hide-threshold',\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = 'legend-item-onhover',\n\tITEM_CLICK = 'legend-item-onclick',\n\tITEM_MOUSEOUT = 'legend-item-onmouseout',\n\tITEMS_UPDATE = 'legend-items-update',\n}\n\n/**\n * enum of all circlepack related events\n */\nexport enum CirclePack {\n\tCIRCLE_MOUSEOVER = 'circle-leaf-mouseover',\n\tCIRCLE_CLICK = 'circle-leaf-click',\n\tCIRCLE_MOUSEOUT = 'circle-leaf-mouseout',\n\tCIRCLE_MOUSEMOVE = 'circle-leaf-mousemove',\n}\n\n/**\n * enum of all alluvial related events\n */\nexport enum Alluvial {\n\tNODE_MOUSEOVER = 'alluvial-node-mouseover',\n\tNODE_CLICK = 'alluvial-node-click',\n\tNODE_MOUSEOUT = 'alluvial-node-mouseout',\n\tNODE_MOUSEMOVE = 'alluvial-node-mousemove',\n\tLINE_MOUSEOVER = 'alluvial-line-mouseover',\n\tLINE_CLICK = 'alluvial-line-click',\n\tLINE_MOUSEOUT = 'alluvial-line-mouseout',\n\tLINE_MOUSEMOVE = 'alluvial-line-mousemove',\n}\n\n/**\n * enum of all meter related events\n */\nexport enum Meter {\n\tMETER_MOUSEOVER = 'meter-mouseover',\n\tMETER_CLICK = 'meter-click',\n\tMETER_MOUSEOUT = 'meter-mouseout',\n\tMETER_MOUSEMOVE = 'meter-mousemove',\n}\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,KAOX;AAPD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,gCAAuB,CAAA;IACvB,sCAA6B,CAAA;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,oCAA2B,CAAA;AAC5B,CAAC,EAPW,KAAK,KAAL,KAAK,QAOhB;AACD;;GAEG;AACH,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IAChB,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;AACpB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAEX;AAFD,WA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1C,8CAAkC,CAAA;IAClC,oDAAwC,CAAA;IACxC,sDAA0C,CAAA;IAC1C,sDAA0C,CAAA;IAC1C,8CAAkC,CAAA;IAClC,oDAAwC,CAAA;IACxC,sDAA0C,CAAA;AAC3C,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAKX;AALD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,oCAA2B,CAAA;IAC3B,0CAAiC,CAAA;IACjC,4CAAmC,CAAA;AACpC,CAAC,EALW,KAAK,KAAL,KAAK,QAKhB","sourcesContent":["/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = 'render-finished',\n\tRESIZE = 'chart-resize',\n\tMOUSEOVER = 'chart-mouseover',\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = 'chart-mouseout',\n}\n/**\n * enum of all events related to the overlay modal\n */\nexport enum Modal {\n\tSHOW = 'show-modal',\n\tHIDE = 'hide-modal',\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = 'model-update',\n}\n\n/**\n * enum of all toolbar events\n */\nexport enum Toolbar {\n\tSHOW_OVERFLOW_MENU = 'show-toolbar-overflow-menu',\n\tHIDE_OVERFLOW_MENU = 'hide-toolbar-overflow-menu',\n\tBUTTON_CLICK = 'toolbar-button-click',\n}\n\n/**\n * enum of all events related to the zoom-bar\n */\nexport enum ZoomBar {\n\tUPDATE = 'zoom-bar-update',\n\tSELECTION_START = 'zoom-bar-selection-start',\n\tSELECTION_IN_PROGRESS = 'zoom-bar-selection-in-progress',\n\tSELECTION_END = 'zoom-bar-selection-end',\n}\n\n/**\n * enum of all events related to the zoom domain\n */\nexport enum ZoomDomain {\n\tCHANGE = 'zoom-domain-change',\n}\n\n/** enum of all events related to canvas zoom *\n *\n */\nexport enum CanvasZoom {\n\tCANVAS_ZOOM_IN = 'canvas-zoom-in',\n\tCANVAS_ZOOM_OUT = 'canvas-zoom-out',\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = 'axis-label-mouseover',\n\tLABEL_MOUSEMOVE = 'axis-label-mousemove',\n\tLABEL_CLICK = 'axis-label-click',\n\tLABEL_MOUSEOUT = 'axis-label-mouseout',\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all wordcloud graph events\n */\nexport enum WordCloud {\n\tWORD_MOUSEOVER = 'wordcloud-word-mouseover',\n\tWORD_MOUSEMOVE = 'wordcloud-word-mousemove',\n\tWORD_CLICK = 'wordcloud-word-click',\n\tWORD_MOUSEOUT = 'wordcloud-word-mouseout',\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = 'pie-slice-mouseover',\n\tSLICE_MOUSEMOVE = 'pie-slice-mousemove',\n\tSLICE_CLICK = 'pie-slice-click',\n\tSLICE_MOUSEOUT = 'pie-slice-mouseout',\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = 'gauge-arc-mouseover',\n\tARC_MOUSEMOVE = 'gauge-arc-mousemove',\n\tARC_CLICK = 'gauge-arc-click',\n\tARC_MOUSEOUT = 'gauge-arc-mouseout',\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = 'bar-mouseover',\n\tBAR_MOUSEMOVE = 'bar-mousemove',\n\tBAR_CLICK = 'bar-click',\n\tBAR_MOUSEOUT = 'bar-mouseout',\n}\n\n/**\n * enum of all boxplot graph events\n */\nexport enum Boxplot {\n\tBOX_MOUSEOVER = 'box-mouseover',\n\tBOX_MOUSEMOVE = 'box-mousemove',\n\tBOX_CLICK = 'box-click',\n\tBOX_MOUSEOUT = 'box-mouseout',\n\tOUTLIER_MOUSEOVER = 'outlier-mouseover',\n\tOUTLIER_MOUSEMOVE = 'outlier-mousemove',\n\tOUTLIER_CLICK = 'outlier-click',\n\tOUTLIER_MOUSEOUT = 'outlier-mouseout',\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = 'scatter-mouseover',\n\tSCATTER_MOUSEMOVE = 'scatter-mousemove',\n\tSCATTER_CLICK = 'scatter-click',\n\tSCATTER_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = 'scatter-mouseover',\n\tPOINT_MOUSEMOVE = 'scatter-mousemove',\n\tPOINT_CLICK = 'scatter-click',\n\tPOINT_MOUSEOUT = 'scatter-mouseout',\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = 'radar-x-axis-mouseover',\n\tX_AXIS_MOUSEMOVE = 'radar-x-axis-mousemove',\n\tX_AXIS_CLICK = 'radar-x-axis-click',\n\tX_AXIS_MOUSEOUT = 'radar-x-axis-mouseout',\n}\n\n/**\n * enum of all tree graph events\n */\nexport enum Tree {\n\tNODE_MOUSEOVER = 'tree-node-mouseover',\n\tNODE_CLICK = 'tree-node-click',\n\tNODE_MOUSEOUT = 'tree-node-mouseout',\n}\n\n/**\n * enum of all treemap graph events\n */\nexport enum Treemap {\n\tLEAF_MOUSEOVER = 'leaf-mouseover',\n\tLEAF_MOUSEMOVE = 'leaf-mousemove',\n\tLEAF_CLICK = 'leaf-click',\n\tLEAF_MOUSEOUT = 'leaf-mouseout',\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = 'show-tooltip',\n\tMOVE = 'move-tooltip',\n\tHIDE = 'hide-tooltip',\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = 'show-threshold',\n\tHIDE = 'hide-threshold',\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = 'legend-item-onhover',\n\tITEM_CLICK = 'legend-item-onclick',\n\tITEM_MOUSEOUT = 'legend-item-onmouseout',\n\tITEMS_UPDATE = 'legend-items-update',\n}\n\n/**\n * enum of all circlepack related events\n */\nexport enum CirclePack {\n\tCIRCLE_MOUSEOVER = 'circle-leaf-mouseover',\n\tCIRCLE_CLICK = 'circle-leaf-click',\n\tCIRCLE_MOUSEOUT = 'circle-leaf-mouseout',\n\tCIRCLE_MOUSEMOVE = 'circle-leaf-mousemove',\n}\n\n/**\n * enum of all alluvial related events\n */\nexport enum Alluvial {\n\tNODE_MOUSEOVER = 'alluvial-node-mouseover',\n\tNODE_CLICK = 'alluvial-node-click',\n\tNODE_MOUSEOUT = 'alluvial-node-mouseout',\n\tNODE_MOUSEMOVE = 'alluvial-node-mousemove',\n\tLINE_MOUSEOVER = 'alluvial-line-mouseover',\n\tLINE_CLICK = 'alluvial-line-click',\n\tLINE_MOUSEOUT = 'alluvial-line-mouseout',\n\tLINE_MOUSEMOVE = 'alluvial-line-mousemove',\n}\n\n/**\n * enum of all meter related events\n */\nexport enum Meter {\n\tMETER_MOUSEOVER = 'meter-mouseover',\n\tMETER_CLICK = 'meter-click',\n\tMETER_MOUSEOUT = 'meter-mouseout',\n\tMETER_MOUSEMOVE = 'meter-mousemove',\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts",
3
- "version": "0.53.1",
3
+ "version": "0.53.5",
4
4
  "description": "Carbon charting components",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
package/services/zoom.js CHANGED
@@ -58,6 +58,11 @@ var Zoom = /** @class */ (function (_super) {
58
58
  var cartesianScales = this.services.cartesianScales;
59
59
  var mainXAxisPosition = cartesianScales.getMainXAxisPosition();
60
60
  var domainIdentifier = cartesianScales.getDomainIdentifier();
61
+ var customDomain = Tools.getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain');
62
+ // return custom domain if exists && valid
63
+ if (Array.isArray(customDomain) && customDomain.length === 2) {
64
+ return customDomain;
65
+ }
61
66
  // default to full range with extended domain
62
67
  return cartesianScales.extendsDomain(mainXAxisPosition, extent(allZoomBarData, function (d) { return d[domainIdentifier]; }));
63
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"zoom.js","sourceRoot":"","sources":["zoom.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAGlD,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;IAA0B,wBAAO;IAAjC;;IA+QA,CAAC;IA5QA,+BAAgB,GAAhB;QACC,2DAA2D;QAC3D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YACnC,OAAO,KAAK,CAAC;SACb;QAED,+FAA+F;QAC/F,sBAAsB;QACtB,IACC,CAAC,KAAK,CAAC,WAAW,CACjB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,KAAK,EACL,SAAS,CACT,EACA;YACD,OAAO,KAAK,CAAC;SACb;QAED,iFAAiF;QACjF,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC,gDAAgD;QACxG,IAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAAC;QAC/E,IAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACvC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,MAAM,EACN,iBAAiB,EACjB,WAAW,CACX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BAAY,GAAZ;QACC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,+BAAgB,GAAhB,UAAiB,QAAQ;QACxB,OAAO,KAAK,CAAC,WAAW,CACvB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,QAAQ,EACR,SAAS,CACT,CAAC;IACH,CAAC;IAED,8BAAe,GAAf,UAAgB,QAAQ;QACvB,OAAO,KAAK,CAAC,WAAW,CACvB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,CACR,CAAC;IACH,CAAC;IACF,WAAC;AAAD,CAAC,AA/QD,CAA0B,OAAO,GA+QhC","sourcesContent":["// Internal Imports\nimport { AxisPositions, Events, ScaleTypes } from '../interfaces';\nimport { Service } from './service';\nimport { Tools } from '../tools';\nimport * as Configuration from '../configuration';\nimport { ChartModelCartesian } from '../model/cartesian-charts';\n\n// D3 imports\nimport { extent } from 'd3-array';\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian;\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (\n\t\t\t!Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\t'top',\n\t\t\t\t'enabled'\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\n\t\treturn (\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME\n\t\t);\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData();\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData;\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData();\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?) {\n\t\tconst allZoomBarData =\n\t\t\tzoomBarData || this.services.zoom.getZoomBarData();\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition();\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\n\t\t// default to full range with extended domain\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t);\n\t}\n\n\thandleDomainChange(newDomain, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false });\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain,\n\t\t\t});\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'zoomRatio'\n\t\t);\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain');\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t);\n\t\tconst shouldUpdateRangeAxis = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'updateRangeAxis'\n\t\t);\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales.getDomainIdentifier();\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t);\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData;\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData;\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst handleWidth = Configuration.zoomBar.handleWidth;\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy();\n\t\txScale.domain(this.getDefaultZoomBarDomain()); // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0]);\n\t\tconst currentX1 = xScale(currentZoomDomain[1]);\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn;\n\t\t}\n\t\tconst fullRange = xScale.range();\n\t\tconst gap = currentX1 - currentX0;\n\t\tconst diff = Math.min(\n\t\t\t((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2),\n\t\t\tgap / 2\n\t\t);\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff;\n\t\tlet newX1 = currentX1 - diff;\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2;\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2;\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)];\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy();\n\t\txScale.domain(this.getDefaultZoomBarDomain()); // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0]);\n\t\tconst currentX1 = xScale(currentZoomDomain[1]);\n\n\t\tconst fullRange = xScale.range();\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2);\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0]);\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1]);\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)];\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst newDomain = this.getDefaultZoomBarDomain();\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain();\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentZoomDomainPeriod =\n\t\t\tcurrentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf();\n\t\tconst maxZoomDomainPeriod =\n\t\t\tmaxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf();\n\t\tconst minZoomRatio = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'minZoomRatio'\n\t\t);\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain();\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0;\n\t}\n\n\tisZoomBarLoading(position) {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tposition,\n\t\t\t'loading'\n\t\t);\n\t}\n\n\tisZoomBarLocked(position) {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tposition,\n\t\t\t'locked'\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"zoom.js","sourceRoot":"","sources":["zoom.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAGlD,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;IAA0B,wBAAO;IAAjC;;IA2RA,CAAC;IAxRA,+BAAgB,GAAhB;QACC,2DAA2D;QAC3D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YACnC,OAAO,KAAK,CAAC;SACb;QAED,+FAA+F;QAC/F,sBAAsB;QACtB,IACC,CAAC,KAAK,CAAC,WAAW,CACjB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,KAAK,EACL,SAAS,CACT,EACA;YACD,OAAO,KAAK,CAAC;SACb;QAED,iFAAiF;QACjF,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC,gDAAgD;QACxG,IAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAAC;QAC/E,IAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACvC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,MAAM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,IACC,iBAAiB;YACjB,aAAa;YACb,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;YAC7D,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAC5D;YACD,OAAO,IAAI,CAAC;SACZ;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAED,2BAAY,GAAZ;QACC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,+BAAgB,GAAhB,UAAiB,QAAQ;QACxB,OAAO,KAAK,CAAC,WAAW,CACvB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,QAAQ,EACR,SAAS,CACT,CAAC;IACH,CAAC;IAED,8BAAe,GAAf,UAAgB,QAAQ;QACvB,OAAO,KAAK,CAAC,WAAW,CACvB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,CACR,CAAC;IACH,CAAC;IACF,WAAC;AAAD,CAAC,AA3RD,CAA0B,OAAO,GA2RhC","sourcesContent":["// Internal Imports\nimport { AxisPositions, Events, ScaleTypes } from '../interfaces';\nimport { Service } from './service';\nimport { Tools } from '../tools';\nimport * as Configuration from '../configuration';\nimport { ChartModelCartesian } from '../model/cartesian-charts';\n\n// D3 imports\nimport { extent } from 'd3-array';\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian;\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (\n\t\t\t!Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'zoomBar',\n\t\t\t\t'top',\n\t\t\t\t'enabled'\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\n\t\treturn (\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME\n\t\t);\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData();\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData;\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData();\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?) {\n\t\tconst allZoomBarData =\n\t\t\tzoomBarData || this.services.zoom.getZoomBarData();\n\t\tconst { cartesianScales } = this.services;\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition();\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier();\n\n\t\tconst customDomain = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'domain'\n\t\t);\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain;\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t);\n\t}\n\n\thandleDomainChange(newDomain, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false });\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain,\n\t\t\t});\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'zoomRatio'\n\t\t);\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain');\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t);\n\t\tconst shouldUpdateRangeAxis = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'updateRangeAxis'\n\t\t);\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales.getDomainIdentifier();\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t);\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData;\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData;\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst handleWidth = Configuration.zoomBar.handleWidth;\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy();\n\t\txScale.domain(this.getDefaultZoomBarDomain()); // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0]);\n\t\tconst currentX1 = xScale(currentZoomDomain[1]);\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn;\n\t\t}\n\t\tconst fullRange = xScale.range();\n\t\tconst gap = currentX1 - currentX0;\n\t\tconst diff = Math.min(\n\t\t\t((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2),\n\t\t\tgap / 2\n\t\t);\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff;\n\t\tlet newX1 = currentX1 - diff;\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2;\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2;\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)];\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy();\n\t\txScale.domain(this.getDefaultZoomBarDomain()); // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0]);\n\t\tconst currentX1 = xScale(currentZoomDomain[1]);\n\n\t\tconst fullRange = xScale.range();\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2);\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0]);\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1]);\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)];\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\tconst newDomain = this.getDefaultZoomBarDomain();\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain);\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain();\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst currentZoomDomainPeriod =\n\t\t\tcurrentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf();\n\t\tconst maxZoomDomainPeriod =\n\t\t\tmaxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf();\n\t\tconst minZoomRatio = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\t'minZoomRatio'\n\t\t);\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain');\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain();\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0;\n\t}\n\n\tisZoomBarLoading(position) {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tposition,\n\t\t\t'loading'\n\t\t);\n\t}\n\n\tisZoomBarLocked(position) {\n\t\treturn Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'zoomBar',\n\t\t\tposition,\n\t\t\t'locked'\n\t\t);\n\t}\n}\n"]}
@@ -118,12 +118,12 @@
118
118
  "signature": "95edee9e66eb5c6dd0060018df015a4a079945b22b2b5788573094ea68a928be"
119
119
  },
120
120
  "../src/interfaces/events.ts": {
121
- "version": "40cefe7174feb4fdc450d202b598ff790cc41a0733cc089656ddd0b456ce1fa5",
122
- "signature": "4be93eac46e6402cee83137533ab10f8f13b47629e8e3fbea120a330ce58a191"
121
+ "version": "bceaa4a222326f00fae696adad611e20b7c3a077f9bb430607ea6b5fb7669fe6",
122
+ "signature": "7e41ebe9ef1fc83cbe7ef4c0d26bda75127e50a2e5922f1e30e254042a1da906"
123
123
  },
124
124
  "../src/interfaces/enums.ts": {
125
- "version": "222c96b8f0c084adef7670855f2ef47c11c3281e0ebd1dbea420cc6775a24724",
126
- "signature": "d9088a662417471eedf05341651f85ada95a4d34ff5fd234379cb2bcb2a5e628"
125
+ "version": "5d754750c06ae5a18439d87502b7996dc1582e23af1e7efd426d1b6e2a288a03",
126
+ "signature": "e497cbf73698f94fb5e420d8a8fffabb011d0f953dc6178b1b974231b62845a6"
127
127
  },
128
128
  "../../../node_modules/@types/d3-ease/index.d.ts": {
129
129
  "version": "10967c128101cfdb8f70b9bc8d53c23919c8dfc0699753d22258262cf34f38d7",
@@ -222,7 +222,7 @@
222
222
  "signature": "566fbdc897aabdc1177fe576d6be2e6ef92d23b47feb3319a81bdd968e575e59"
223
223
  },
224
224
  "../src/services/zoom.ts": {
225
- "version": "8c8d4bc82ba8cc6ca45ca32dfb7eb21df7f7814a1b4fb8e45f416d88eb0891da",
225
+ "version": "76eb7d5cb2375a47717e940f7194dd694fc3c5dbe37d4c451b06458a08bb4a54",
226
226
  "signature": "3c43121dd89697d1b1967c164d7ce5658d6b6af57a1fbd46b8d17013593b22de"
227
227
  },
228
228
  "../src/services/canvas-zoom.ts": {
@@ -242,8 +242,8 @@
242
242
  "signature": "e13ca1760c1d894f0cbb054be895f12207ff8a8708be12a18944832c02dd7ab2"
243
243
  },
244
244
  "../src/interfaces/components.ts": {
245
- "version": "f8af27369b8f4871ec39961f52dc9c170fef48e82e97d686b7a22c5ab994fce8",
246
- "signature": "ae4414694b0fadfddf0f4a29682c94d8b26cf37278bb20ea3244c399017d8cf4"
245
+ "version": "80fe4232873339c0c0784e72803cd2106e7ffddd7d59f150033569ad70eb5db1",
246
+ "signature": "7a0ada0ed8acfcd1948f211a92cc74a0d739ba295177aaac19d5897e91ab33d4"
247
247
  },
248
248
  "../../../node_modules/@types/d3-axis/index.d.ts": {
249
249
  "version": "b3393902df89f63a8da74a8003ee951164b2556608d256c248d6d79510becbb2",
@@ -302,7 +302,7 @@
302
302
  "signature": "03c2081ebe8e32a16aa2c3ed3ae49083ce863392e2bb8d1369c0fc29f938cf7a"
303
303
  },
304
304
  "../src/components/essentials/tooltip-axis.ts": {
305
- "version": "ff29b6d7249d8af76a67ef07558e209de9bba1477669919efb7dfaa5b2dcb254",
305
+ "version": "f116fa057340d29e3934a1ec632250fb534e5b8303098bce67caf1889f8cf275",
306
306
  "signature": "d70e6454ac2a015783f9d10096feaab036b6f73479030f2808547d9579c885be"
307
307
  },
308
308
  "../src/components/axes/chart-clip.ts": {
@@ -474,8 +474,8 @@
474
474
  "signature": "d3eb371b7f7b9a5f928c5273da425542b5e479ba654216cd1df65d255c36c072"
475
475
  },
476
476
  "../src/components/axes/toolbar.ts": {
477
- "version": "08fdfde156cb98dfdc0d709549b11ff033e01ada9e0f30b3ec11dae8a0f8b0dd",
478
- "signature": "f21d3389796d77e9e987bb9f8145b254b53302a5663c9d291da326dcf97740e7"
477
+ "version": "2f54972fb87fc3c1539b41b2493e9e1cb2a8998925c5147cbcc1ab6d56adc6a1",
478
+ "signature": "03683f3e42ff724f1a4a3556e18f9e3d6a1c73e9ca965a90b686a758b29d5447"
479
479
  },
480
480
  "../src/components/axes/zero-line.ts": {
481
481
  "version": "6fe5bfbbd525b3992dd8c117675641e9290d54c2c583748845c8c685ad6fc6e7",