@carbon/charts 0.41.43 → 0.41.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -10
- package/build/src/components/essentials/tooltip.d.ts +1 -1
- package/build/src/interfaces/components.d.ts +2 -0
- package/bundle.js +1 -1
- package/components/axes/grid.js +32 -6
- package/components/axes/grid.js.map +1 -1
- package/components/essentials/tooltip-axis.js +5 -13
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/essentials/tooltip.d.ts +1 -1
- package/components/essentials/tooltip.js +7 -3
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/area.js +11 -2
- package/components/graphs/area.js.map +1 -1
- package/configuration.js +2 -1
- package/configuration.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/index.js +116 -161
- package/demo/data/index.js.map +1 -1
- package/demo/data/toolbar.js +0 -1
- package/demo/data/toolbar.js.map +1 -1
- package/demo/tsconfig.tsbuildinfo +4 -4
- package/interfaces/components.d.ts +2 -0
- package/interfaces/components.js.map +1 -1
- package/package.json +1 -1
- package/services/scales-cartesian.js +2 -2
- package/services/scales-cartesian.js.map +1 -1
- package/tsconfig.tsbuildinfo +9 -9
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
"signature": "953f0c6eacdabbbc75e4f119fcc0a4eb2003671e6b6560cfea8ec80fe37fc0eb"
|
|
339
339
|
},
|
|
340
340
|
"../../demo/data/toolbar.ts": {
|
|
341
|
-
"version": "
|
|
341
|
+
"version": "a448c23441e957e91a76209f1a4a3ee8bd347f5bcca22f40a10b5505b3dc476e",
|
|
342
342
|
"signature": "366baf83310f18e4bf48cc82c3df5df4c8754adf1bbdcbbbf67554073e2663ff"
|
|
343
343
|
},
|
|
344
344
|
"../../src/interfaces/a11y.ts": {
|
|
@@ -366,8 +366,8 @@
|
|
|
366
366
|
"signature": "e13ca1760c1d894f0cbb054be895f12207ff8a8708be12a18944832c02dd7ab2"
|
|
367
367
|
},
|
|
368
368
|
"../../src/interfaces/components.ts": {
|
|
369
|
-
"version": "
|
|
370
|
-
"signature": "
|
|
369
|
+
"version": "8b229f443a4932bebcaa4dd283276b8f676933cdbfcf6790549323b71c06ff59",
|
|
370
|
+
"signature": "8b229f443a4932bebcaa4dd283276b8f676933cdbfcf6790549323b71c06ff59"
|
|
371
371
|
},
|
|
372
372
|
"../../src/interfaces/axis-scales.ts": {
|
|
373
373
|
"version": "5c97b5470761d6a1efca59cf6e995e6e6e4cd5bb3054bc6b71c366049464ce5d",
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
"signature": "b766c38614e2a36e1261b020b9b9b8ff8ccb7fb756c1de28bbbbcd0f606bd741"
|
|
395
395
|
},
|
|
396
396
|
"../../demo/data/index.ts": {
|
|
397
|
-
"version": "
|
|
397
|
+
"version": "eaed09d6806b4e7257173d1ca56ba2ca3aaec53a713dc9dfcfecf1c25fbd515e",
|
|
398
398
|
"signature": "6fe1ac55b9ef03ab21d3f0397dc411725e9baf4bd81b30b0c6cda269fe948141"
|
|
399
399
|
},
|
|
400
400
|
"../../node_modules/@types/node/globals.d.ts": {
|
|
@@ -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 in x & y directions\n\t */\n\tgrowth?: {\n\t\tx: LayoutGrowth;\n\t\ty: LayoutGrowth;\n\t};\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}\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};\n\tx?: {\n\t\tenabled?: boolean;\n\t\tnumberOfTicks?: number;\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 in x & y directions\n\t */\n\tgrowth?: {\n\t\tx: LayoutGrowth;\n\t\ty: LayoutGrowth;\n\t};\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}\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"]}
|
package/package.json
CHANGED
|
@@ -237,10 +237,10 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
237
237
|
var mapsTo = axisOptions.mapsTo;
|
|
238
238
|
var value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;
|
|
239
239
|
var boundedValues = [
|
|
240
|
-
scale(datum
|
|
240
|
+
scale(Tools.getProperty(datum, bounds.upperBoundMapsTo) !== null
|
|
241
241
|
? datum[bounds.upperBoundMapsTo]
|
|
242
242
|
: value),
|
|
243
|
-
scale(datum
|
|
243
|
+
scale(Tools.getProperty(datum, bounds.lowerBoundMapsTo) !== null
|
|
244
244
|
? datum[bounds.lowerBoundMapsTo]
|
|
245
245
|
: value),
|
|
246
246
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scales-cartesian.js","sourceRoot":"","sources":["scales-cartesian.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,UAAU,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO;AACP,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,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AAG,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC;IAEzE,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// Internal Imports\nimport * as Configuration from '../configuration';\nimport { Service } from './service';\nimport {\n\tAxisPositions,\n\tCartesianOrientations,\n\tScaleTypes,\n\tThresholdOptions,\n} from '../interfaces';\nimport { Tools } from '../tools';\n\n// D3 Imports\nimport { scaleBand, scaleLinear, scaleTime, scaleLog } from 'd3-scale';\nimport { extent, sum } from 'd3-array';\nimport { map, values } from 'd3-collection';\n\n// Misc\nimport {\n\tdifferenceInYears,\n\taddYears,\n\tsubYears,\n\tdifferenceInMonths,\n\taddMonths,\n\tsubMonths,\n\tdifferenceInDays,\n\taddDays,\n\tsubDays,\n\tdifferenceInHours,\n\taddHours,\n\tsubHours,\n\tdifferenceInMinutes,\n\taddMinutes,\n\tsubMinutes,\n\tdifferenceInSeconds,\n\tsubSeconds,\n\taddSeconds,\n} from 'date-fns';\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null,\n\t\tright: null,\n\t\tbottom: null,\n\t\tleft: null,\n\t};\n\n\tprotected scales = {\n\t\ttop: null,\n\t\tright: null,\n\t\tbottom: null,\n\t\tleft: null,\n\t};\n\n\tprotected domainAxisPosition: AxisPositions;\n\tprotected rangeAxisPosition: AxisPositions;\n\tprotected secondaryDomainAxisPosition: AxisPositions;\n\tprotected secondaryRangeAxisPosition: AxisPositions;\n\n\tprotected dualAxes: Boolean;\n\n\tprotected orientation: CartesianOrientations;\n\n\tgetDomainAxisPosition({ datum = null } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions();\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst axesOptions = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'axes',\n\t\t\t\tthis.secondaryDomainAxisPosition\n\t\t\t);\n\t\t\tconst dataset = datum[groupMapsTo];\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition;\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition;\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions();\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst axisOptions = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'axes',\n\t\t\t\tthis.secondaryRangeAxisPosition\n\t\t\t);\n\t\t\tlet dataset;\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo];\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0];\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition;\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition;\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn Tools.getProperty(this.model.getOptions(), 'axes', position);\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\t\treturn this.getAxisOptions(domainAxisPosition);\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\t\treturn this.getAxisOptions(rangeAxisPosition);\n\t}\n\n\tupdate(animate = true) {\n\t\tthis.determineAxisDuality();\n\t\tthis.findDomainAndRangeAxes();\n\t\tthis.determineOrientation();\n\t\tconst axisPositions = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey) => AxisPositions[axisPositionKey]\n\t\t);\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition);\n\t\t});\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions();\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions();\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t);\n\n\t\tthis.domainAxisPosition =\n\t\t\tdomainAndRangeAxesPositions.primaryDomainAxisPosition;\n\t\tthis.rangeAxisPosition =\n\t\t\tdomainAndRangeAxesPositions.primaryRangeAxisPosition;\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition =\n\t\t\t\tdomainAndRangeAxesPositions.secondaryDomainAxisPosition;\n\t\t\tthis.secondaryRangeAxisPosition =\n\t\t\t\tdomainAndRangeAxesPositions.secondaryRangeAxisPosition;\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL;\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL;\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes;\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true;\n\t\t}\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation;\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition];\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition];\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition);\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition);\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition];\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition];\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [\n\t\t\tAxisPositions.BOTTOM,\n\t\t\tAxisPositions.TOP,\n\t\t];\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleXAxisPositions.indexOf(position) > -1\n\t\t);\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [\n\t\t\tAxisPositions.LEFT,\n\t\t\tAxisPositions.RIGHT,\n\t\t];\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleYAxisPositions.indexOf(position) > -1\n\t\t);\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()];\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()];\n\t}\n\n\tgetValueFromScale(\n\t\tscale: any,\n\t\tscaleType: ScaleTypes,\n\t\taxisPosition: AxisPositions,\n\t\tdatum: any,\n\t\tindex?: number\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst axisOptions = axesOptions[axisPosition];\n\t\tconst { mapsTo } = axisOptions;\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;\n\t\tlet scaledValue;\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2;\n\t\t\t\tbreak;\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value);\n\t\t}\n\t\treturn scaledValue;\n\t}\n\n\tgetBoundedScaledValues(datum: any, index?: number) {\n\t\tconst { bounds } = this.model.getOptions();\n\t\tconst scale = this.scales[this.rangeAxisPosition];\n\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst axisOptions = axesOptions[this.rangeAxisPosition];\n\t\tconst { mapsTo } = axisOptions;\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tdatum[bounds.upperBoundMapsTo]\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tdatum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t];\n\n\t\treturn boundedValues;\n\t}\n\n\tgetValueThroughAxisPosition(\n\t\taxisPosition: AxisPositions,\n\t\tdatum: any,\n\t\tindex?: number\n\t) {\n\t\tconst scaleType = this.scaleTypes[axisPosition];\n\t\tconst scale = this.scales[axisPosition];\n\n\t\treturn this.getValueFromScale(\n\t\t\tscale,\n\t\t\tscaleType,\n\t\t\taxisPosition,\n\t\t\tdatum,\n\t\t\tindex\n\t\t);\n\t}\n\n\tgetDomainValue(d, i) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d });\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d, i);\n\t}\n\n\tgetRangeValue(d, i) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d });\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d, i);\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition());\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition());\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions();\n\t\treturn Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tthis.getDomainAxisPosition({ datum: datum }),\n\t\t\t'mapsTo'\n\t\t);\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions();\n\t\treturn Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tthis.getRangeAxisPosition({ datum: datum }),\n\t\t\t'mapsTo'\n\t\t);\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'timeScale',\n\t\t\t\t'addSpaceOnEdges'\n\t\t\t);\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges);\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(\n\t\t\t\tdomain,\n\t\t\t\tConfiguration.axis.paddingRatio\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst dualAxes = this.isDualAxes();\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(Tools.getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tTools.getProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tTools.getProperty(axesOptions, AxisPositions.RIGHT, 'main') ===\n\t\t\t\ttrue ||\n\t\t\t(dualAxes &&\n\t\t\t\tTools.getProperty(\n\t\t\t\t\taxesOptions,\n\t\t\t\t\tAxisPositions.LEFT,\n\t\t\t\t\t'correspondingDatasets'\n\t\t\t\t))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT,\n\t\t\t};\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT };\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst dualAxes = this.isDualAxes();\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(Tools.getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tTools.getProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tTools.getProperty(axesOptions, AxisPositions.TOP, 'main') ===\n\t\t\t\ttrue ||\n\t\t\t(dualAxes &&\n\t\t\t\tTools.getProperty(\n\t\t\t\t\taxesOptions,\n\t\t\t\t\tAxisPositions.BOTTOM,\n\t\t\t\t\t'correspondingDatasets'\n\t\t\t\t))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM,\n\t\t\t};\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP };\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions,\n\t\thorizontalAxesPositions\n\t) {\n\t\tconst options = this.model.getOptions();\n\n\t\tconst mainVerticalAxisOptions = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tverticalAxesPositions.primary\n\t\t);\n\t\tconst mainHorizontalAxisOptions = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\thorizontalAxesPositions.primary\n\t\t);\n\n\t\tconst mainVerticalScaleType =\n\t\t\tmainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR;\n\t\tconst mainHorizontalScaleType =\n\t\t\tmainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR;\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null,\n\t\t\tsecondaryDomainAxisPosition: null,\n\t\t\tprimaryRangeAxisPosition: null,\n\t\t\tsecondaryRangeAxisPosition: null,\n\t\t};\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary;\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary;\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary;\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary;\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS ||\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary;\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary;\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition =\n\t\t\t\tverticalAxesPositions.secondary;\n\t\t\tresult.secondaryRangeAxisPosition =\n\t\t\t\thorizontalAxesPositions.secondary;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected getScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\t\tconst bounds = Tools.getProperty(options, 'bounds');\n\t\tconst { includeZero } = axisOptions;\n\t\tconst scaleType =\n\t\t\tTools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData();\n\t\tconst { mapsTo, percentage } = axisOptions;\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain;\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain);\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100];\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn map(displayData, (d) => d[mapsTo]).keys();\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain;\n\t\tlet allDataValues;\n\t\tconst dataGroupNames = this.model.getDataGroupNames();\n\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map(\n\t\t\t\t(datum) => +new Date(datum[mapsTo])\n\t\t\t);\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = [];\n\n\t\t\tdisplayData.forEach((datum) => {\n\t\t\t\tallDataValues.push(datum[mapsTo]);\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo]);\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo]);\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys(\n\t\t\t\tdataGroupNames\n\t\t\t);\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t);\n\t\t\tconst stackedValues = dataValuesGroupedByKeys.map((dataValues) => {\n\t\t\t\tconst { sharedStackKey, ...numericalValues } = dataValues;\n\t\t\t\treturn sum(values(numericalValues) as number[]);\n\t\t\t});\n\n\t\t\tallDataValues = [\n\t\t\t\t...stackedValues,\n\t\t\t\t...nonStackedGroupsData.map((datum) => datum[mapsTo]),\n\t\t\t];\n\t\t} else {\n\t\t\tallDataValues = displayData.map((datum) => datum[mapsTo]);\n\t\t}\n\n\t\tif (scaleType !== ScaleTypes.TIME && includeZero) {\n\t\t\tallDataValues.push(0);\n\t\t}\n\n\t\tdomain = extent(allDataValues);\n\t\tdomain = this.extendsDomain(axisPosition, domain);\n\n\t\treturn domain;\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\n\t\tif (!axisOptions) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst scaleType =\n\t\t\tTools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;\n\t\tthis.scaleTypes[axisPosition] = scaleType;\n\n\t\tlet scale;\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime();\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10);\n\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\tscale = scaleBand();\n\t\t} else {\n\t\t\tscale = scaleLinear();\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition));\n\n\t\treturn scale;\n\t}\n\n\tprotected getHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions;\n\t\tscaleValue: number;\n\t} {\n\t\tconst axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition];\n\n\t\tif (!thresholds) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale();\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort(\n\t\t\t(a, b) => b.value - a.value\n\t\t)[0];\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition);\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' ||\n\t\t\t\thighestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value);\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value),\n\t\t};\n\t}\n\n\tprotected getHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions;\n\t\tscaleValue: number;\n\t} {\n\t\tconst axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition];\n\n\t\tif (!thresholds) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale();\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort(\n\t\t\t(a, b) => b.value - a.value\n\t\t)[0];\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value),\n\t\t};\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0]);\n\tconst endDate = new Date(domain[1]);\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubYears(startDate, spaceToAddToEdges),\n\t\t\taddYears(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubMonths(startDate, spaceToAddToEdges),\n\t\t\taddMonths(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubDays(startDate, spaceToAddToEdges),\n\t\t\taddDays(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubHours(startDate, spaceToAddToEdges),\n\t\t\taddHours(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30),\n\t\t];\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges),\n\t\t\taddMinutes(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15),\n\t\t];\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges),\n\t\t\taddSeconds(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\treturn [startDate, endDate];\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number\n) {\n\tconst domainLength = upper - lower;\n\tconst padding = domainLength * paddingRatio;\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding;\n\t// If padding crosses 0, keep 0 as new lower bound\n\tconst newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding;\n\n\treturn [newLower, newUpper];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scales-cartesian.js","sourceRoot":"","sources":["scales-cartesian.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,UAAU,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO;AACP,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,SA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kDAAkD;IAClD,IAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC;IACzE,kDAAkD;IAClD,IAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC;IAEzE,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// Internal Imports\nimport * as Configuration from '../configuration';\nimport { Service } from './service';\nimport {\n\tAxisPositions,\n\tCartesianOrientations,\n\tScaleTypes,\n\tThresholdOptions,\n} from '../interfaces';\nimport { Tools } from '../tools';\n\n// D3 Imports\nimport { scaleBand, scaleLinear, scaleTime, scaleLog } from 'd3-scale';\nimport { extent, sum } from 'd3-array';\nimport { map, values } from 'd3-collection';\n\n// Misc\nimport {\n\tdifferenceInYears,\n\taddYears,\n\tsubYears,\n\tdifferenceInMonths,\n\taddMonths,\n\tsubMonths,\n\tdifferenceInDays,\n\taddDays,\n\tsubDays,\n\tdifferenceInHours,\n\taddHours,\n\tsubHours,\n\tdifferenceInMinutes,\n\taddMinutes,\n\tsubMinutes,\n\tdifferenceInSeconds,\n\tsubSeconds,\n\taddSeconds,\n} from 'date-fns';\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null,\n\t\tright: null,\n\t\tbottom: null,\n\t\tleft: null,\n\t};\n\n\tprotected scales = {\n\t\ttop: null,\n\t\tright: null,\n\t\tbottom: null,\n\t\tleft: null,\n\t};\n\n\tprotected domainAxisPosition: AxisPositions;\n\tprotected rangeAxisPosition: AxisPositions;\n\tprotected secondaryDomainAxisPosition: AxisPositions;\n\tprotected secondaryRangeAxisPosition: AxisPositions;\n\n\tprotected dualAxes: Boolean;\n\n\tprotected orientation: CartesianOrientations;\n\n\tgetDomainAxisPosition({ datum = null } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions();\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst axesOptions = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'axes',\n\t\t\t\tthis.secondaryDomainAxisPosition\n\t\t\t);\n\t\t\tconst dataset = datum[groupMapsTo];\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition;\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition;\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions();\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst axisOptions = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'axes',\n\t\t\t\tthis.secondaryRangeAxisPosition\n\t\t\t);\n\t\t\tlet dataset;\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo];\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0];\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition;\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition;\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn Tools.getProperty(this.model.getOptions(), 'axes', position);\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\t\treturn this.getAxisOptions(domainAxisPosition);\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\t\treturn this.getAxisOptions(rangeAxisPosition);\n\t}\n\n\tupdate(animate = true) {\n\t\tthis.determineAxisDuality();\n\t\tthis.findDomainAndRangeAxes();\n\t\tthis.determineOrientation();\n\t\tconst axisPositions = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey) => AxisPositions[axisPositionKey]\n\t\t);\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition);\n\t\t});\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions();\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions();\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t);\n\n\t\tthis.domainAxisPosition =\n\t\t\tdomainAndRangeAxesPositions.primaryDomainAxisPosition;\n\t\tthis.rangeAxisPosition =\n\t\t\tdomainAndRangeAxesPositions.primaryRangeAxisPosition;\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition =\n\t\t\t\tdomainAndRangeAxesPositions.secondaryDomainAxisPosition;\n\t\t\tthis.secondaryRangeAxisPosition =\n\t\t\t\tdomainAndRangeAxesPositions.secondaryRangeAxisPosition;\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL;\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL;\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes;\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true;\n\t\t}\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation;\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition];\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition];\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition);\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition);\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition];\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition];\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [\n\t\t\tAxisPositions.BOTTOM,\n\t\t\tAxisPositions.TOP,\n\t\t];\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleXAxisPositions.indexOf(position) > -1\n\t\t);\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [\n\t\t\tAxisPositions.LEFT,\n\t\t\tAxisPositions.RIGHT,\n\t\t];\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleYAxisPositions.indexOf(position) > -1\n\t\t);\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()];\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()];\n\t}\n\n\tgetValueFromScale(\n\t\tscale: any,\n\t\tscaleType: ScaleTypes,\n\t\taxisPosition: AxisPositions,\n\t\tdatum: any,\n\t\tindex?: number\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst axisOptions = axesOptions[axisPosition];\n\t\tconst { mapsTo } = axisOptions;\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;\n\t\tlet scaledValue;\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2;\n\t\t\t\tbreak;\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value);\n\t\t}\n\t\treturn scaledValue;\n\t}\n\n\tgetBoundedScaledValues(datum: any, index?: number) {\n\t\tconst { bounds } = this.model.getOptions();\n\t\tconst scale = this.scales[this.rangeAxisPosition];\n\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst axisOptions = axesOptions[this.rangeAxisPosition];\n\t\tconst { mapsTo } = axisOptions;\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tTools.getProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tTools.getProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t];\n\n\t\treturn boundedValues;\n\t}\n\n\tgetValueThroughAxisPosition(\n\t\taxisPosition: AxisPositions,\n\t\tdatum: any,\n\t\tindex?: number\n\t) {\n\t\tconst scaleType = this.scaleTypes[axisPosition];\n\t\tconst scale = this.scales[axisPosition];\n\n\t\treturn this.getValueFromScale(\n\t\t\tscale,\n\t\t\tscaleType,\n\t\t\taxisPosition,\n\t\t\tdatum,\n\t\t\tindex\n\t\t);\n\t}\n\n\tgetDomainValue(d, i) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d });\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d, i);\n\t}\n\n\tgetRangeValue(d, i) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d });\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d, i);\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition());\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition());\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions();\n\t\treturn Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tthis.getDomainAxisPosition({ datum: datum }),\n\t\t\t'mapsTo'\n\t\t);\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions();\n\t\treturn Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tthis.getRangeAxisPosition({ datum: datum }),\n\t\t\t'mapsTo'\n\t\t);\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'timeScale',\n\t\t\t\t'addSpaceOnEdges'\n\t\t\t);\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges);\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(\n\t\t\t\tdomain,\n\t\t\t\tConfiguration.axis.paddingRatio\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst dualAxes = this.isDualAxes();\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(Tools.getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tTools.getProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tTools.getProperty(axesOptions, AxisPositions.RIGHT, 'main') ===\n\t\t\t\ttrue ||\n\t\t\t(dualAxes &&\n\t\t\t\tTools.getProperty(\n\t\t\t\t\taxesOptions,\n\t\t\t\t\tAxisPositions.LEFT,\n\t\t\t\t\t'correspondingDatasets'\n\t\t\t\t))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT,\n\t\t\t};\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT };\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions();\n\t\tconst axesOptions = Tools.getProperty(options, 'axes');\n\t\tconst dualAxes = this.isDualAxes();\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(Tools.getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tTools.getProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tTools.getProperty(axesOptions, AxisPositions.TOP, 'main') ===\n\t\t\t\ttrue ||\n\t\t\t(dualAxes &&\n\t\t\t\tTools.getProperty(\n\t\t\t\t\taxesOptions,\n\t\t\t\t\tAxisPositions.BOTTOM,\n\t\t\t\t\t'correspondingDatasets'\n\t\t\t\t))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM,\n\t\t\t};\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP };\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions,\n\t\thorizontalAxesPositions\n\t) {\n\t\tconst options = this.model.getOptions();\n\n\t\tconst mainVerticalAxisOptions = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tverticalAxesPositions.primary\n\t\t);\n\t\tconst mainHorizontalAxisOptions = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\thorizontalAxesPositions.primary\n\t\t);\n\n\t\tconst mainVerticalScaleType =\n\t\t\tmainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR;\n\t\tconst mainHorizontalScaleType =\n\t\t\tmainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR;\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null,\n\t\t\tsecondaryDomainAxisPosition: null,\n\t\t\tprimaryRangeAxisPosition: null,\n\t\t\tsecondaryRangeAxisPosition: null,\n\t\t};\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary;\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary;\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary;\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary;\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS ||\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary;\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary;\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition =\n\t\t\t\tverticalAxesPositions.secondary;\n\t\t\tresult.secondaryRangeAxisPosition =\n\t\t\t\thorizontalAxesPositions.secondary;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprotected getScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\t\tconst bounds = Tools.getProperty(options, 'bounds');\n\t\tconst { includeZero } = axisOptions;\n\t\tconst scaleType =\n\t\t\tTools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData();\n\t\tconst { mapsTo, percentage } = axisOptions;\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain;\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain);\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100];\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn map(displayData, (d) => d[mapsTo]).keys();\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain;\n\t\tlet allDataValues;\n\t\tconst dataGroupNames = this.model.getDataGroupNames();\n\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map(\n\t\t\t\t(datum) => +new Date(datum[mapsTo])\n\t\t\t);\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = [];\n\n\t\t\tdisplayData.forEach((datum) => {\n\t\t\t\tallDataValues.push(datum[mapsTo]);\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo]);\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo]);\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data;\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys(\n\t\t\t\tdataGroupNames\n\t\t\t);\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t);\n\t\t\tconst stackedValues = dataValuesGroupedByKeys.map((dataValues) => {\n\t\t\t\tconst { sharedStackKey, ...numericalValues } = dataValues;\n\t\t\t\treturn sum(values(numericalValues) as number[]);\n\t\t\t});\n\n\t\t\tallDataValues = [\n\t\t\t\t...stackedValues,\n\t\t\t\t...nonStackedGroupsData.map((datum) => datum[mapsTo]),\n\t\t\t];\n\t\t} else {\n\t\t\tallDataValues = displayData.map((datum) => datum[mapsTo]);\n\t\t}\n\n\t\tif (scaleType !== ScaleTypes.TIME && includeZero) {\n\t\t\tallDataValues.push(0);\n\t\t}\n\n\t\tdomain = extent(allDataValues);\n\t\tdomain = this.extendsDomain(axisPosition, domain);\n\n\t\treturn domain;\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions();\n\t\tconst axisOptions = Tools.getProperty(options, 'axes', axisPosition);\n\n\t\tif (!axisOptions) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst scaleType =\n\t\t\tTools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;\n\t\tthis.scaleTypes[axisPosition] = scaleType;\n\n\t\tlet scale;\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime();\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10);\n\t\t} else if (scaleType === ScaleTypes.LABELS) {\n\t\t\tscale = scaleBand();\n\t\t} else {\n\t\t\tscale = scaleLinear();\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition));\n\n\t\treturn scale;\n\t}\n\n\tprotected getHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions;\n\t\tscaleValue: number;\n\t} {\n\t\tconst axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');\n\t\tconst domainAxisPosition = this.getDomainAxisPosition();\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition];\n\n\t\tif (!thresholds) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale();\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort(\n\t\t\t(a, b) => b.value - a.value\n\t\t)[0];\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition);\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' ||\n\t\t\t\thighestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value);\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value),\n\t\t};\n\t}\n\n\tprotected getHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions;\n\t\tscaleValue: number;\n\t} {\n\t\tconst axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition();\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition];\n\n\t\tif (!thresholds) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale();\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort(\n\t\t\t(a, b) => b.value - a.value\n\t\t)[0];\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value),\n\t\t};\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0]);\n\tconst endDate = new Date(domain[1]);\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubYears(startDate, spaceToAddToEdges),\n\t\t\taddYears(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubMonths(startDate, spaceToAddToEdges),\n\t\t\taddMonths(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubDays(startDate, spaceToAddToEdges),\n\t\t\taddDays(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubHours(startDate, spaceToAddToEdges),\n\t\t\taddHours(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30),\n\t\t];\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges),\n\t\t\taddMinutes(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15),\n\t\t];\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges),\n\t\t\taddSeconds(endDate, spaceToAddToEdges),\n\t\t];\n\t}\n\n\treturn [startDate, endDate];\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number\n) {\n\tconst domainLength = upper - lower;\n\tconst padding = domainLength * paddingRatio;\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding;\n\t// If padding crosses 0, keep 0 as new lower bound\n\tconst newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding;\n\n\treturn [newLower, newUpper];\n}\n"]}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
"signature": "5abf822485491f5442038d5c08e7e0027d417f08aed30b7715fc562828b59259"
|
|
271
271
|
},
|
|
272
272
|
"../src/configuration.ts": {
|
|
273
|
-
"version": "
|
|
273
|
+
"version": "98fb27261737218c09b7b13566b0bb4478a62d147f12a2f24b061d9b38f33d42",
|
|
274
274
|
"signature": "f7e921e439550b550a855a0084f5312d04efb70a32924a21c45185ac700f6ae5"
|
|
275
275
|
},
|
|
276
276
|
"../src/model.ts": {
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
"signature": "7b51ac945f253db7d26cdbdf47268cf6a53f6e920fcdb407d9479a7f8ebeed27"
|
|
303
303
|
},
|
|
304
304
|
"../src/services/scales-cartesian.ts": {
|
|
305
|
-
"version": "
|
|
305
|
+
"version": "9573e3e9e318432cf9d743f29771dd1e5916ab5853b8b40229a4e0eefd97d6c1",
|
|
306
306
|
"signature": "4fb2aac342c888934a80cb64d1c825a4f86265714cba5773f253f568aeb0c63f"
|
|
307
307
|
},
|
|
308
308
|
"../src/services/curves.ts": {
|
|
@@ -330,8 +330,8 @@
|
|
|
330
330
|
"signature": "e13ca1760c1d894f0cbb054be895f12207ff8a8708be12a18944832c02dd7ab2"
|
|
331
331
|
},
|
|
332
332
|
"../src/interfaces/components.ts": {
|
|
333
|
-
"version": "
|
|
334
|
-
"signature": "
|
|
333
|
+
"version": "cc0b0b69c0498a1abc4d6a167ce0595fffcdd3c68699dee334f138975113c813",
|
|
334
|
+
"signature": "8b229f443a4932bebcaa4dd283276b8f676933cdbfcf6790549323b71c06ff59"
|
|
335
335
|
},
|
|
336
336
|
"../src/interfaces/axis-scales.ts": {
|
|
337
337
|
"version": "b7d4ebfb4f4fa1850765c3b64a544732d4d790fe6b3fa6488acb9306c70ad831",
|
|
@@ -378,15 +378,15 @@
|
|
|
378
378
|
"signature": "0dbaa84bbd05676403c8b4dbf652a9778a0666bc080607c0574a72dc5fd63ceb"
|
|
379
379
|
},
|
|
380
380
|
"../src/components/essentials/tooltip.ts": {
|
|
381
|
-
"version": "
|
|
382
|
-
"signature": "
|
|
381
|
+
"version": "c60d5e71cdab54f5033f7e84125b5c9035bb038becdc3dfb16a0b15f72bfadc1",
|
|
382
|
+
"signature": "45ad705bf7a31c98ae6c03069c730f51410b318acdc664be88386fe5affdad5c"
|
|
383
383
|
},
|
|
384
384
|
"../src/components/essentials/tooltip-axis.ts": {
|
|
385
|
-
"version": "
|
|
385
|
+
"version": "440b2cf73f84b67b67dfdbc785e010d427c5082f61f5c5583c915bb30f5ede98",
|
|
386
386
|
"signature": "d70e6454ac2a015783f9d10096feaab036b6f73479030f2808547d9579c885be"
|
|
387
387
|
},
|
|
388
388
|
"../src/components/graphs/area.ts": {
|
|
389
|
-
"version": "
|
|
389
|
+
"version": "6a3deba17c3356e4387938176184495aac0db4d4f7ab1cd2120b7c20dc6aa3fa",
|
|
390
390
|
"signature": "f78b7e8ec4d4223ce6cab4a1c2fbb4790c40da1ddee449874055123836908d45"
|
|
391
391
|
},
|
|
392
392
|
"../src/components/graphs/area-stacked.ts": {
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
"signature": "46c93d3c10058339d43d64a253b6e0ce6764e55ee98f7fa6b5ca7040b6402227"
|
|
491
491
|
},
|
|
492
492
|
"../src/components/axes/grid.ts": {
|
|
493
|
-
"version": "
|
|
493
|
+
"version": "a1fd801f4a40ba152f0f46a0d4e75aca021835857a976791f7af575e0bc8f36e",
|
|
494
494
|
"signature": "d23c62731b31aee81460aa7cf5d980854d4e096a3b8e5592f8d228bf48af25b6"
|
|
495
495
|
},
|
|
496
496
|
"../src/components/axes/ruler.ts": {
|