@carbon/charts 1.8.0 → 1.9.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -155
- package/README.md +18 -20
- package/dist/_baseEach-603421de.mjs +21 -0
- package/dist/_baseEach-603421de.mjs.map +1 -0
- package/dist/_baseEach-cdac417f.js +2 -0
- package/dist/_baseEach-cdac417f.js.map +1 -0
- package/dist/a11y-7bad4f48.mjs +5 -0
- package/dist/a11y-7bad4f48.mjs.map +1 -0
- package/dist/a11y-c7c9d087.js +2 -0
- package/dist/a11y-c7c9d087.js.map +1 -0
- package/dist/angle-utils-6f166b40.js +2 -0
- package/dist/angle-utils-6f166b40.js.map +1 -0
- package/dist/angle-utils-8b6ce998.mjs +387 -0
- package/dist/angle-utils-8b6ce998.mjs.map +1 -0
- package/dist/axis-chart.d.ts +13 -0
- package/dist/chart.d.ts +18 -0
- package/dist/charts/alluvial.d.ts +10 -0
- package/dist/charts/area-stacked.d.ts +8 -0
- package/dist/charts/area.d.ts +8 -0
- package/dist/charts/bar-grouped.d.ts +8 -0
- package/dist/charts/bar-simple.d.ts +8 -0
- package/dist/charts/bar-stacked.d.ts +8 -0
- package/dist/charts/boxplot.d.ts +10 -0
- package/dist/charts/bubble.d.ts +8 -0
- package/dist/charts/bullet.d.ts +10 -0
- package/dist/charts/choropleth.d.ts +14 -0
- package/dist/charts/circle-pack.d.ts +10 -0
- package/dist/charts/combo.d.ts +9 -0
- package/dist/charts/donut.d.ts +8 -0
- package/dist/charts/gauge.d.ts +10 -0
- package/dist/charts/heatmap.d.ts +14 -0
- package/dist/charts/histogram.d.ts +10 -0
- package/dist/charts/index.d.ts +27 -0
- package/dist/charts/line.d.ts +8 -0
- package/dist/charts/lollipop.d.ts +8 -0
- package/dist/charts/meter.d.ts +10 -0
- package/dist/charts/pie.d.ts +10 -0
- package/dist/charts/radar.d.ts +10 -0
- package/dist/charts/scatter.d.ts +8 -0
- package/dist/charts/tree.d.ts +10 -0
- package/dist/charts/treemap.d.ts +10 -0
- package/dist/charts/wordcloud.d.ts +10 -0
- package/dist/choropleth-4ac6ac20.js +82 -0
- package/dist/choropleth-4ac6ac20.js.map +1 -0
- package/dist/choropleth-f473ea0d.mjs +7997 -0
- package/dist/choropleth-f473ea0d.mjs.map +1 -0
- package/dist/color-scale-utils-5eb3eeaa.mjs +3809 -0
- package/dist/color-scale-utils-5eb3eeaa.mjs.map +1 -0
- package/dist/color-scale-utils-7d463811.js +3 -0
- package/dist/color-scale-utils-7d463811.js.map +1 -0
- package/dist/components/axes/axis.d.ts +24 -0
- package/dist/components/axes/chart-clip.d.ts +13 -0
- package/dist/components/axes/grid-brush.d.ts +10 -0
- package/dist/components/axes/grid.d.ts +22 -0
- package/dist/components/axes/index.d.ts +12 -0
- package/dist/components/axes/ruler-binned.d.ts +10 -0
- package/dist/components/axes/ruler.d.ts +30 -0
- package/dist/components/axes/toolbar.d.ts +40 -0
- package/dist/components/axes/two-dimensional-axes.d.ts +16 -0
- package/dist/components/axes/zero-line.d.ts +7 -0
- package/dist/components/axes/zoom-bar.d.ts +31 -0
- package/dist/components/component.d.ts +30 -0
- package/dist/components/diagrams/buildPaths.d.ts +40 -0
- package/dist/components/diagrams/index.d.ts +2 -0
- package/dist/components/essentials/canvas-chart-clip.d.ts +6 -0
- package/dist/components/essentials/color-scale-legend.d.ts +20 -0
- package/dist/components/essentials/geo-projection.d.ts +16 -0
- package/dist/components/essentials/highlights.d.ts +13 -0
- package/dist/components/essentials/index.d.ts +11 -0
- package/dist/components/essentials/legend.d.ts +11 -0
- package/dist/components/essentials/modal.d.ts +14 -0
- package/dist/components/essentials/threshold.d.ts +20 -0
- package/dist/components/essentials/title-meter.d.ts +30 -0
- package/dist/components/essentials/title.d.ts +20 -0
- package/dist/components/essentials/tooltip.d.ts +22 -0
- package/dist/components/graphs/alluvial.d.ts +14 -0
- package/dist/components/graphs/area-stacked.d.ts +11 -0
- package/dist/components/graphs/area.d.ts +12 -0
- package/dist/components/graphs/bar-grouped.d.ts +22 -0
- package/dist/components/graphs/bar-simple.d.ts +12 -0
- package/dist/components/graphs/bar-stacked.d.ts +13 -0
- package/dist/components/graphs/bar.d.ts +5 -0
- package/dist/components/graphs/boxplot.d.ts +9 -0
- package/dist/components/graphs/bubble.d.ts +13 -0
- package/dist/components/graphs/bullet.d.ts +12 -0
- package/dist/components/graphs/choropleth.d.ts +6 -0
- package/dist/components/graphs/circle-pack.d.ts +19 -0
- package/dist/components/graphs/donut.d.ts +9 -0
- package/dist/components/graphs/gauge.d.ts +27 -0
- package/dist/components/graphs/heatmap.d.ts +25 -0
- package/dist/components/graphs/histogram.d.ts +12 -0
- package/dist/components/graphs/index.d.ts +28 -0
- package/dist/components/graphs/line.d.ts +11 -0
- package/dist/components/graphs/lollipop.d.ts +14 -0
- package/dist/components/graphs/meter.d.ts +10 -0
- package/dist/components/graphs/pie.d.ts +16 -0
- package/dist/components/graphs/radar.d.ts +25 -0
- package/dist/components/graphs/scatter-stacked.d.ts +8 -0
- package/dist/components/graphs/scatter.d.ts +21 -0
- package/dist/components/graphs/skeleton-lines.d.ts +12 -0
- package/dist/components/graphs/skeleton.d.ts +23 -0
- package/dist/components/graphs/tree.d.ts +9 -0
- package/dist/components/graphs/treemap.d.ts +11 -0
- package/dist/components/graphs/wordcloud.d.ts +12 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +76 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/layout.d.ts +18 -0
- package/dist/components/layout/spacer.d.ts +5 -0
- package/dist/configuration-non-customizable.d.ts +263 -0
- package/dist/configuration.d.ts +48 -0
- package/dist/demo/charts/alluvial.d.ts +109 -0
- package/dist/demo/charts/area.d.ts +224 -0
- package/dist/demo/charts/bar.d.ts +681 -0
- package/dist/demo/charts/boxplot.d.ts +34 -0
- package/dist/demo/charts/bubble.d.ts +141 -0
- package/dist/demo/charts/bullet.d.ts +24 -0
- package/dist/demo/charts/chart-types.d.ts +128 -0
- package/dist/demo/charts/choropleth.d.ts +738 -0
- package/dist/demo/charts/circle-pack.d.ts +91 -0
- package/dist/demo/charts/combo.d.ts +482 -0
- package/dist/demo/charts/donut.d.ts +64 -0
- package/dist/demo/charts/gauge.d.ts +40 -0
- package/dist/demo/charts/heatmap.d.ts +125 -0
- package/dist/demo/charts/hightlight.d.ts +40 -0
- package/dist/demo/charts/histogram.d.ts +63 -0
- package/dist/demo/charts/index.d.ts +62 -0
- package/dist/demo/charts/line.d.ts +361 -0
- package/dist/demo/charts/lollipop.d.ts +39 -0
- package/dist/demo/charts/meter.d.ts +95 -0
- package/dist/demo/charts/pie.d.ts +46 -0
- package/dist/demo/charts/radar.d.ts +63 -0
- package/dist/demo/charts/scatter.d.ts +118 -0
- package/dist/demo/charts/step.d.ts +96 -0
- package/dist/demo/charts/time-series-axis.d.ts +293 -0
- package/dist/demo/charts/toolbar.d.ts +12 -0
- package/dist/demo/charts/topojson-110.d.ts +360 -0
- package/dist/demo/charts/tree.d.ts +30 -0
- package/dist/demo/charts/treemap.d.ts +15 -0
- package/dist/demo/charts/wordcloud.d.ts +14 -0
- package/dist/demo/charts/zoom-bar.d.ts +79 -0
- package/dist/demo/index.d.ts +4 -0
- package/dist/demo/index.js +470 -0
- package/dist/demo/index.js.map +1 -0
- package/dist/demo/index.mjs +51789 -0
- package/dist/demo/index.mjs.map +1 -0
- package/dist/demo/styles.css +30574 -0
- package/dist/demo/styles.css.map +1 -0
- package/dist/demo/utils/index.d.ts +2 -0
- package/dist/demo/utils/sandbox.d.ts +39 -0
- package/dist/demo/utils/story-widgets.d.ts +7 -0
- package/dist/enums-a96ef472.mjs +89 -0
- package/dist/enums-a96ef472.mjs.map +1 -0
- package/dist/enums-aa2efd99.js +2 -0
- package/dist/enums-aa2efd99.js.map +1 -0
- package/dist/index-822564ed.js +2 -0
- package/dist/index-822564ed.js.map +1 -0
- package/dist/index-a266373c.mjs +749 -0
- package/dist/index-a266373c.mjs.map +1 -0
- package/dist/index-becfb567.mjs +72 -0
- package/dist/index-becfb567.mjs.map +1 -0
- package/dist/index-d865d500.js +2 -0
- package/dist/index-d865d500.js.map +1 -0
- package/dist/index-ec554115.mjs +62 -0
- package/dist/index-ec554115.mjs.map +1 -0
- package/dist/index-f23685eb.js +2 -0
- package/dist/index-f23685eb.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1121 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces/axis-scales.d.ts +201 -0
- package/dist/interfaces/charts.d.ts +520 -0
- package/dist/interfaces/components.d.ts +231 -0
- package/dist/interfaces/index.d.ts +12 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/index.mjs +58 -0
- package/dist/interfaces/index.mjs.map +1 -0
- package/dist/interfaces/layout.d.ts +21 -0
- package/dist/interfaces/model.d.ts +35 -0
- package/dist/interfaces/services.d.ts +20 -0
- package/dist/interfaces/truncation.d.ts +17 -0
- package/dist/model/binned-charts.d.ts +7 -0
- package/dist/model/cartesian-charts.d.ts +24 -0
- package/dist/model/heatmap.d.ts +57 -0
- package/dist/model/index.d.ts +16 -0
- package/dist/model/index.js +3 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/index.mjs +1107 -0
- package/dist/model/index.mjs.map +1 -0
- package/dist/model/meter.d.ts +20 -0
- package/dist/model/model.d.ts +110 -0
- package/dist/services/angle-utils.d.ts +15 -0
- package/dist/services/curves.d.ts +24 -0
- package/dist/services/essentials/dom-utils.d.ts +45 -0
- package/dist/services/essentials/events.d.ts +8 -0
- package/dist/services/essentials/files.d.ts +7 -0
- package/dist/services/essentials/gradient-utils.d.ts +6 -0
- package/dist/services/essentials/index.d.ts +5 -0
- package/dist/services/essentials/transitions.d.ts +13 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +32 -0
- package/dist/services/index.mjs.map +1 -0
- package/dist/services/scales-cartesian.d.ts +89 -0
- package/dist/services/service.d.ts +11 -0
- package/dist/services/zoom.d.ts +21 -0
- package/dist/styles/_chart-holder.scss +50 -0
- package/dist/styles/color-palatte.scss +458 -0
- package/dist/styles/colors.scss +131 -0
- package/dist/styles/components/_color-legend.scss +11 -0
- package/dist/styles/components/_edge.scss +65 -0
- package/dist/styles/components/_grid.scss +30 -0
- package/dist/styles/components/_marker.scss +7 -0
- package/dist/styles/components/_meter-title.scss +37 -0
- package/dist/styles/components/_tooltip.scss +132 -0
- package/dist/styles/components/diagrams/_card-node.scss +97 -0
- package/dist/styles/components/diagrams/_edge.scss +66 -0
- package/dist/styles/components/diagrams/_shape-node.scss +89 -0
- package/dist/styles/components/diagrams/index.scss +4 -0
- package/dist/styles/graphs/_alluvial.scss +17 -0
- package/dist/styles/graphs/_bullet.scss +36 -0
- package/dist/styles/graphs/_circle-pack.scss +36 -0
- package/dist/styles/graphs/_gauge.scss +23 -0
- package/dist/styles/graphs/_heatmap.scss +60 -0
- package/dist/styles/graphs/_meter.scss +34 -0
- package/dist/styles/graphs/_radar.scss +18 -0
- package/dist/styles/graphs/_scatter-stacked.scss +12 -0
- package/dist/styles/graphs/_tree.scss +46 -0
- package/dist/styles/styles.scss +40 -0
- package/dist/styles/tokens.scss +407 -0
- package/dist/styles.css +28463 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.min.css +1 -0
- package/dist/styles.min.css.map +1 -0
- package/dist/tools.d.ts +150 -0
- package/package.json +140 -102
- package/axis-chart.d.ts +0 -10
- package/axis-chart.js +0 -169
- package/axis-chart.js.map +0 -1
- package/build/demo/create-codesandbox.d.ts +0 -113
- package/build/demo/data/CHART_TYPES.d.ts +0 -128
- package/build/demo/data/alluvial.d.ts +0 -109
- package/build/demo/data/area.d.ts +0 -224
- package/build/demo/data/bar.d.ts +0 -681
- package/build/demo/data/boxplot.d.ts +0 -34
- package/build/demo/data/bubble.d.ts +0 -141
- package/build/demo/data/bullet.d.ts +0 -24
- package/build/demo/data/choropleth.d.ts +0 -738
- package/build/demo/data/circle-pack.d.ts +0 -91
- package/build/demo/data/combo.d.ts +0 -482
- package/build/demo/data/donut.d.ts +0 -64
- package/build/demo/data/gauge.d.ts +0 -40
- package/build/demo/data/heatmap.d.ts +0 -125
- package/build/demo/data/high-scale.d.ts +0 -1
- package/build/demo/data/hightlight.d.ts +0 -40
- package/build/demo/data/histogram.d.ts +0 -63
- package/build/demo/data/index.d.ts +0 -33
- package/build/demo/data/line.d.ts +0 -361
- package/build/demo/data/lollipop.d.ts +0 -39
- package/build/demo/data/meter.d.ts +0 -95
- package/build/demo/data/pie.d.ts +0 -46
- package/build/demo/data/radar.d.ts +0 -63
- package/build/demo/data/scatter.d.ts +0 -118
- package/build/demo/data/step.d.ts +0 -96
- package/build/demo/data/time-series-axis.d.ts +0 -368
- package/build/demo/data/toolbar.d.ts +0 -12
- package/build/demo/data/topojson-110.d.ts +0 -360
- package/build/demo/data/tree.d.ts +0 -30
- package/build/demo/data/treemap.d.ts +0 -15
- package/build/demo/data/wordcloud.d.ts +0 -14
- package/build/demo/data/zoom-bar.d.ts +0 -94
- package/build/demo/utils.d.ts +0 -40
- package/build/src/axis-chart.d.ts +0 -10
- package/build/src/chart.d.ts +0 -14
- package/build/src/charts/alluvial.d.ts +0 -8
- package/build/src/charts/area-stacked.d.ts +0 -6
- package/build/src/charts/area.d.ts +0 -6
- package/build/src/charts/bar-grouped.d.ts +0 -6
- package/build/src/charts/bar-simple.d.ts +0 -6
- package/build/src/charts/bar-stacked.d.ts +0 -6
- package/build/src/charts/boxplot.d.ts +0 -8
- package/build/src/charts/bubble.d.ts +0 -6
- package/build/src/charts/bullet.d.ts +0 -8
- package/build/src/charts/choropleth.d.ts +0 -10
- package/build/src/charts/circle-pack.d.ts +0 -8
- package/build/src/charts/combo.d.ts +0 -7
- package/build/src/charts/donut.d.ts +0 -6
- package/build/src/charts/gauge.d.ts +0 -8
- package/build/src/charts/heatmap.d.ts +0 -10
- package/build/src/charts/histogram.d.ts +0 -8
- package/build/src/charts/index.d.ts +0 -25
- package/build/src/charts/line.d.ts +0 -6
- package/build/src/charts/lollipop.d.ts +0 -6
- package/build/src/charts/meter.d.ts +0 -8
- package/build/src/charts/pie.d.ts +0 -8
- package/build/src/charts/radar.d.ts +0 -8
- package/build/src/charts/scatter.d.ts +0 -6
- package/build/src/charts/tree.d.ts +0 -8
- package/build/src/charts/treemap.d.ts +0 -8
- package/build/src/charts/wordcloud.d.ts +0 -8
- package/build/src/components/axes/axis.d.ts +0 -24
- package/build/src/components/axes/chart-clip.d.ts +0 -13
- package/build/src/components/axes/grid-brush.d.ts +0 -10
- package/build/src/components/axes/grid.d.ts +0 -22
- package/build/src/components/axes/hover-axis.d.ts +0 -10
- package/build/src/components/axes/ruler-binned.d.ts +0 -7
- package/build/src/components/axes/ruler-stacked.d.ts +0 -4
- package/build/src/components/axes/ruler.d.ts +0 -27
- package/build/src/components/axes/toolbar.d.ts +0 -40
- package/build/src/components/axes/two-dimensional-axes.d.ts +0 -16
- package/build/src/components/axes/zero-line.d.ts +0 -7
- package/build/src/components/axes/zoom-bar.d.ts +0 -28
- package/build/src/components/component.d.ts +0 -28
- package/build/src/components/diagrams/buildPaths.d.ts +0 -63
- package/build/src/components/diagrams/markerDefinitions.d.ts +0 -37
- package/build/src/components/essentials/canvas-chart-clip.d.ts +0 -6
- package/build/src/components/essentials/color-scale-legend.d.ts +0 -20
- package/build/src/components/essentials/geo-projection.d.ts +0 -16
- package/build/src/components/essentials/highlights.d.ts +0 -13
- package/build/src/components/essentials/legend.d.ts +0 -11
- package/build/src/components/essentials/modal.d.ts +0 -14
- package/build/src/components/essentials/threshold.d.ts +0 -20
- package/build/src/components/essentials/title-meter.d.ts +0 -30
- package/build/src/components/essentials/title.d.ts +0 -20
- package/build/src/components/essentials/tooltip-axis.d.ts +0 -4
- package/build/src/components/essentials/tooltip.d.ts +0 -22
- package/build/src/components/graphs/alluvial.d.ts +0 -14
- package/build/src/components/graphs/area-stacked.d.ts +0 -11
- package/build/src/components/graphs/area.d.ts +0 -12
- package/build/src/components/graphs/bar-grouped.d.ts +0 -22
- package/build/src/components/graphs/bar-simple.d.ts +0 -12
- package/build/src/components/graphs/bar-stacked.d.ts +0 -13
- package/build/src/components/graphs/bar.d.ts +0 -5
- package/build/src/components/graphs/boxplot.d.ts +0 -9
- package/build/src/components/graphs/bubble.d.ts +0 -13
- package/build/src/components/graphs/bullet.d.ts +0 -12
- package/build/src/components/graphs/choropleth.d.ts +0 -6
- package/build/src/components/graphs/circle-pack.d.ts +0 -19
- package/build/src/components/graphs/donut.d.ts +0 -9
- package/build/src/components/graphs/gauge.d.ts +0 -27
- package/build/src/components/graphs/heatmap.d.ts +0 -25
- package/build/src/components/graphs/histogram.d.ts +0 -12
- package/build/src/components/graphs/line.d.ts +0 -11
- package/build/src/components/graphs/lollipop.d.ts +0 -14
- package/build/src/components/graphs/meter.d.ts +0 -10
- package/build/src/components/graphs/pie.d.ts +0 -16
- package/build/src/components/graphs/radar.d.ts +0 -25
- package/build/src/components/graphs/scatter-stacked.d.ts +0 -8
- package/build/src/components/graphs/scatter.d.ts +0 -21
- package/build/src/components/graphs/skeleton-lines.d.ts +0 -11
- package/build/src/components/graphs/skeleton.d.ts +0 -22
- package/build/src/components/graphs/tree.d.ts +0 -9
- package/build/src/components/graphs/treemap.d.ts +0 -11
- package/build/src/components/graphs/wordcloud.d.ts +0 -12
- package/build/src/components/index.d.ts +0 -53
- package/build/src/components/layout/layout.d.ts +0 -17
- package/build/src/components/layout/spacer.d.ts +0 -5
- package/build/src/configuration-non-customizable.d.ts +0 -263
- package/build/src/configuration.d.ts +0 -46
- package/build/src/interfaces/a11y.d.ts +0 -12
- package/build/src/interfaces/axis-scales.d.ts +0 -201
- package/build/src/interfaces/charts.d.ts +0 -512
- package/build/src/interfaces/components.d.ts +0 -231
- package/build/src/interfaces/enums.d.ts +0 -261
- package/build/src/interfaces/events.d.ts +0 -239
- package/build/src/interfaces/index.d.ts +0 -7
- package/build/src/interfaces/layout.d.ts +0 -15
- package/build/src/interfaces/model.d.ts +0 -35
- package/build/src/interfaces/truncation.d.ts +0 -17
- package/build/src/model/alluvial.d.ts +0 -8
- package/build/src/model/binned-charts.d.ts +0 -7
- package/build/src/model/boxplot.d.ts +0 -14
- package/build/src/model/bullet.d.ts +0 -14
- package/build/src/model/cartesian-charts.d.ts +0 -24
- package/build/src/model/choropleth.d.ts +0 -29
- package/build/src/model/circle-pack.d.ts +0 -36
- package/build/src/model/gauge.d.ts +0 -9
- package/build/src/model/heatmap.d.ts +0 -52
- package/build/src/model/meter.d.ts +0 -19
- package/build/src/model/model.d.ts +0 -107
- package/build/src/model/pie.d.ts +0 -9
- package/build/src/model/radar.d.ts +0 -7
- package/build/src/model/tree.d.ts +0 -14
- package/build/src/model/treemap.d.ts +0 -8
- package/build/src/model/wordcloud.d.ts +0 -7
- package/build/src/services/angle-utils.d.ts +0 -205
- package/build/src/services/canvas-zoom.d.ts +0 -11
- package/build/src/services/color-scale-utils.d.ts +0 -10
- package/build/src/services/curves.d.ts +0 -25
- package/build/src/services/essentials/dom-utils.d.ts +0 -39
- package/build/src/services/essentials/events.d.ts +0 -8
- package/build/src/services/essentials/files.d.ts +0 -6
- package/build/src/services/essentials/gradient-utils.d.ts +0 -6
- package/build/src/services/essentials/transitions.d.ts +0 -13
- package/build/src/services/index.d.ts +0 -10
- package/build/src/services/scales-cartesian.d.ts +0 -86
- package/build/src/services/service.d.ts +0 -10
- package/build/src/services/time-series.d.ts +0 -787
- package/build/src/services/zoom.d.ts +0 -21
- package/build/src/tools.d.ts +0 -2427
- package/build/stories/all.stories.d.ts +0 -1
- package/build/stories/tutorials/api.d.ts +0 -4
- package/build/stories/tutorials/color-palette.d.ts +0 -4
- package/build/stories/tutorials/combo-charts.d.ts +0 -4
- package/build/stories/tutorials/dual-axes.d.ts +0 -4
- package/build/stories/tutorials/event-listeners.d.ts +0 -4
- package/build/stories/tutorials/getting-started/angular.d.ts +0 -5
- package/build/stories/tutorials/getting-started/react.d.ts +0 -5
- package/build/stories/tutorials/getting-started/vanilla.d.ts +0 -5
- package/build/stories/tutorials/getting-started/vue.d.ts +0 -5
- package/build/stories/tutorials/index.d.ts +0 -11
- package/build/stories/tutorials/tabular-data-format.d.ts +0 -4
- package/build/stories/tutorials/themes.d.ts +0 -4
- package/build/stories/tutorials.stories.d.ts +0 -1
- package/bundle.js +0 -17
- package/chart.d.ts +0 -14
- package/chart.js +0 -198
- package/chart.js.map +0 -1
- package/charts/alluvial.d.ts +0 -8
- package/charts/alluvial.js +0 -46
- package/charts/alluvial.js.map +0 -1
- package/charts/area-stacked.d.ts +0 -6
- package/charts/area-stacked.js +0 -55
- package/charts/area-stacked.js.map +0 -1
- package/charts/area.d.ts +0 -6
- package/charts/area.js +0 -54
- package/charts/area.js.map +0 -1
- package/charts/bar-grouped.d.ts +0 -6
- package/charts/bar-grouped.js +0 -49
- package/charts/bar-grouped.js.map +0 -1
- package/charts/bar-simple.d.ts +0 -6
- package/charts/bar-simple.js +0 -49
- package/charts/bar-simple.js.map +0 -1
- package/charts/bar-stacked.d.ts +0 -6
- package/charts/bar-stacked.js +0 -50
- package/charts/bar-stacked.js.map +0 -1
- package/charts/boxplot.d.ts +0 -8
- package/charts/boxplot.js +0 -55
- package/charts/boxplot.js.map +0 -1
- package/charts/bubble.d.ts +0 -6
- package/charts/bubble.js +0 -49
- package/charts/bubble.js.map +0 -1
- package/charts/bullet.d.ts +0 -8
- package/charts/bullet.js +0 -50
- package/charts/bullet.js.map +0 -1
- package/charts/choropleth.d.ts +0 -10
- package/charts/choropleth.js +0 -141
- package/charts/choropleth.js.map +0 -1
- package/charts/circle-pack.d.ts +0 -8
- package/charts/circle-pack.js +0 -45
- package/charts/circle-pack.js.map +0 -1
- package/charts/combo.d.ts +0 -7
- package/charts/combo.js +0 -132
- package/charts/combo.js.map +0 -1
- package/charts/donut.d.ts +0 -6
- package/charts/donut.js +0 -46
- package/charts/donut.js.map +0 -1
- package/charts/gauge.d.ts +0 -8
- package/charts/gauge.js +0 -42
- package/charts/gauge.js.map +0 -1
- package/charts/heatmap.d.ts +0 -10
- package/charts/heatmap.js +0 -142
- package/charts/heatmap.js.map +0 -1
- package/charts/histogram.d.ts +0 -8
- package/charts/histogram.js +0 -48
- package/charts/histogram.js.map +0 -1
- package/charts/index.d.ts +0 -25
- package/charts/index.js +0 -26
- package/charts/index.js.map +0 -1
- package/charts/line.d.ts +0 -6
- package/charts/line.js +0 -48
- package/charts/line.js.map +0 -1
- package/charts/lollipop.d.ts +0 -6
- package/charts/lollipop.js +0 -50
- package/charts/lollipop.js.map +0 -1
- package/charts/meter.d.ts +0 -8
- package/charts/meter.js +0 -94
- package/charts/meter.js.map +0 -1
- package/charts/pie.d.ts +0 -8
- package/charts/pie.js +0 -55
- package/charts/pie.js.map +0 -1
- package/charts/radar.d.ts +0 -8
- package/charts/radar.js +0 -44
- package/charts/radar.js.map +0 -1
- package/charts/scatter.d.ts +0 -6
- package/charts/scatter.js +0 -49
- package/charts/scatter.js.map +0 -1
- package/charts/tree.d.ts +0 -8
- package/charts/tree.js +0 -47
- package/charts/tree.js.map +0 -1
- package/charts/treemap.d.ts +0 -8
- package/charts/treemap.js +0 -43
- package/charts/treemap.js.map +0 -1
- package/charts/wordcloud.d.ts +0 -8
- package/charts/wordcloud.js +0 -49
- package/charts/wordcloud.js.map +0 -1
- package/components/axes/axis.d.ts +0 -24
- package/components/axes/axis.js +0 -587
- package/components/axes/axis.js.map +0 -1
- package/components/axes/chart-clip.d.ts +0 -13
- package/components/axes/chart-clip.js +0 -63
- package/components/axes/chart-clip.js.map +0 -1
- package/components/axes/grid-brush.d.ts +0 -10
- package/components/axes/grid-brush.js +0 -170
- package/components/axes/grid-brush.js.map +0 -1
- package/components/axes/grid.d.ts +0 -22
- package/components/axes/grid.js +0 -235
- package/components/axes/grid.js.map +0 -1
- package/components/axes/hover-axis.js +0 -243
- package/components/axes/hover-axis.js.map +0 -1
- package/components/axes/ruler-binned.d.ts +0 -7
- package/components/axes/ruler-binned.js +0 -136
- package/components/axes/ruler-binned.js.map +0 -1
- package/components/axes/ruler-stacked.js +0 -26
- package/components/axes/ruler-stacked.js.map +0 -1
- package/components/axes/ruler.d.ts +0 -27
- package/components/axes/ruler.js +0 -209
- package/components/axes/ruler.js.map +0 -1
- package/components/axes/toolbar.d.ts +0 -40
- package/components/axes/toolbar.js +0 -558
- package/components/axes/toolbar.js.map +0 -1
- package/components/axes/two-dimensional-axes.d.ts +0 -16
- package/components/axes/two-dimensional-axes.js +0 -134
- package/components/axes/two-dimensional-axes.js.map +0 -1
- package/components/axes/zero-line.d.ts +0 -7
- package/components/axes/zero-line.js +0 -76
- package/components/axes/zero-line.js.map +0 -1
- package/components/axes/zoom-bar.d.ts +0 -28
- package/components/axes/zoom-bar.js +0 -490
- package/components/axes/zoom-bar.js.map +0 -1
- package/components/component.d.ts +0 -28
- package/components/component.js +0 -102
- package/components/component.js.map +0 -1
- package/components/diagrams/buildPaths.d.ts +0 -39
- package/components/diagrams/buildPaths.js +0 -71
- package/components/diagrams/buildPaths.js.map +0 -1
- package/components/diagrams/markerDefinitions.js +0 -38
- package/components/diagrams/markerDefinitions.js.map +0 -1
- package/components/essentials/canvas-chart-clip.d.ts +0 -6
- package/components/essentials/canvas-chart-clip.js +0 -46
- package/components/essentials/canvas-chart-clip.js.map +0 -1
- package/components/essentials/color-scale-legend.d.ts +0 -20
- package/components/essentials/color-scale-legend.js +0 -237
- package/components/essentials/color-scale-legend.js.map +0 -1
- package/components/essentials/geo-projection.d.ts +0 -16
- package/components/essentials/geo-projection.js +0 -160
- package/components/essentials/geo-projection.js.map +0 -1
- package/components/essentials/highlights.d.ts +0 -13
- package/components/essentials/highlights.js +0 -196
- package/components/essentials/highlights.js.map +0 -1
- package/components/essentials/legend.d.ts +0 -11
- package/components/essentials/legend.js +0 -428
- package/components/essentials/legend.js.map +0 -1
- package/components/essentials/modal.d.ts +0 -14
- package/components/essentials/modal.js +0 -89
- package/components/essentials/modal.js.map +0 -1
- package/components/essentials/threshold.d.ts +0 -20
- package/components/essentials/threshold.js +0 -306
- package/components/essentials/threshold.js.map +0 -1
- package/components/essentials/title-meter.d.ts +0 -30
- package/components/essentials/title-meter.js +0 -279
- package/components/essentials/title-meter.js.map +0 -1
- package/components/essentials/title.d.ts +0 -20
- package/components/essentials/title.js +0 -138
- package/components/essentials/title.js.map +0 -1
- package/components/essentials/tooltip-axis.js +0 -142
- package/components/essentials/tooltip-axis.js.map +0 -1
- package/components/essentials/tooltip.d.ts +0 -22
- package/components/essentials/tooltip.js +0 -263
- package/components/essentials/tooltip.js.map +0 -1
- package/components/graphs/alluvial.d.ts +0 -14
- package/components/graphs/alluvial.js +0 -535
- package/components/graphs/alluvial.js.map +0 -1
- package/components/graphs/area-stacked.d.ts +0 -11
- package/components/graphs/area-stacked.js +0 -131
- package/components/graphs/area-stacked.js.map +0 -1
- package/components/graphs/area.d.ts +0 -12
- package/components/graphs/area.js +0 -260
- package/components/graphs/area.js.map +0 -1
- package/components/graphs/bar-grouped.d.ts +0 -22
- package/components/graphs/bar-grouped.js +0 -312
- package/components/graphs/bar-grouped.js.map +0 -1
- package/components/graphs/bar-simple.d.ts +0 -12
- package/components/graphs/bar-simple.js +0 -218
- package/components/graphs/bar-simple.js.map +0 -1
- package/components/graphs/bar-stacked.d.ts +0 -13
- package/components/graphs/bar-stacked.js +0 -281
- package/components/graphs/bar-stacked.js.map +0 -1
- package/components/graphs/bar.d.ts +0 -5
- package/components/graphs/bar.js +0 -58
- package/components/graphs/bar.js.map +0 -1
- package/components/graphs/boxplot.d.ts +0 -9
- package/components/graphs/boxplot.js +0 -485
- package/components/graphs/boxplot.js.map +0 -1
- package/components/graphs/bubble.d.ts +0 -13
- package/components/graphs/bubble.js +0 -113
- package/components/graphs/bubble.js.map +0 -1
- package/components/graphs/bullet.d.ts +0 -12
- package/components/graphs/bullet.js +0 -395
- package/components/graphs/bullet.js.map +0 -1
- package/components/graphs/choropleth.d.ts +0 -6
- package/components/graphs/choropleth.js +0 -106
- package/components/graphs/choropleth.js.map +0 -1
- package/components/graphs/circle-pack.d.ts +0 -19
- package/components/graphs/circle-pack.js +0 -388
- package/components/graphs/circle-pack.js.map +0 -1
- package/components/graphs/donut.d.ts +0 -9
- package/components/graphs/donut.js +0 -116
- package/components/graphs/donut.js.map +0 -1
- package/components/graphs/gauge.d.ts +0 -27
- package/components/graphs/gauge.js +0 -347
- package/components/graphs/gauge.js.map +0 -1
- package/components/graphs/heatmap.d.ts +0 -25
- package/components/graphs/heatmap.js +0 -388
- package/components/graphs/heatmap.js.map +0 -1
- package/components/graphs/histogram.d.ts +0 -12
- package/components/graphs/histogram.js +0 -220
- package/components/graphs/histogram.js.map +0 -1
- package/components/graphs/line.d.ts +0 -11
- package/components/graphs/line.js +0 -179
- package/components/graphs/line.js.map +0 -1
- package/components/graphs/lollipop.d.ts +0 -14
- package/components/graphs/lollipop.js +0 -164
- package/components/graphs/lollipop.js.map +0 -1
- package/components/graphs/meter.d.ts +0 -10
- package/components/graphs/meter.js +0 -284
- package/components/graphs/meter.js.map +0 -1
- package/components/graphs/pie.d.ts +0 -16
- package/components/graphs/pie.js +0 -438
- package/components/graphs/pie.js.map +0 -1
- package/components/graphs/radar.d.ts +0 -25
- package/components/graphs/radar.js +0 -737
- package/components/graphs/radar.js.map +0 -1
- package/components/graphs/scatter-stacked.d.ts +0 -8
- package/components/graphs/scatter-stacked.js +0 -140
- package/components/graphs/scatter-stacked.js.map +0 -1
- package/components/graphs/scatter.d.ts +0 -21
- package/components/graphs/scatter.js +0 -360
- package/components/graphs/scatter.js.map +0 -1
- package/components/graphs/skeleton-lines.d.ts +0 -11
- package/components/graphs/skeleton-lines.js +0 -84
- package/components/graphs/skeleton-lines.js.map +0 -1
- package/components/graphs/skeleton.d.ts +0 -22
- package/components/graphs/skeleton.js +0 -272
- package/components/graphs/skeleton.js.map +0 -1
- package/components/graphs/tree.d.ts +0 -9
- package/components/graphs/tree.js +0 -262
- package/components/graphs/tree.js.map +0 -1
- package/components/graphs/treemap.d.ts +0 -11
- package/components/graphs/treemap.js +0 -344
- package/components/graphs/treemap.js.map +0 -1
- package/components/graphs/wordcloud.d.ts +0 -12
- package/components/graphs/wordcloud.js +0 -268
- package/components/graphs/wordcloud.js.map +0 -1
- package/components/index.d.ts +0 -53
- package/components/index.js +0 -59
- package/components/index.js.map +0 -1
- package/components/layout/layout.d.ts +0 -17
- package/components/layout/layout.js +0 -191
- package/components/layout/layout.js.map +0 -1
- package/components/layout/spacer.d.ts +0 -5
- package/components/layout/spacer.js +0 -33
- package/components/layout/spacer.js.map +0 -1
- package/configuration-non-customizable.d.ts +0 -263
- package/configuration-non-customizable.js +0 -276
- package/configuration-non-customizable.js.map +0 -1
- package/configuration.d.ts +0 -46
- package/configuration.js +0 -552
- package/configuration.js.map +0 -1
- package/demo/create-codesandbox.d.ts +0 -65
- package/demo/create-codesandbox.js +0 -173
- package/demo/create-codesandbox.js.map +0 -1
- package/demo/data/CHART_TYPES.d.ts +0 -128
- package/demo/data/CHART_TYPES.js +0 -128
- package/demo/data/CHART_TYPES.js.map +0 -1
- package/demo/data/alluvial.d.ts +0 -109
- package/demo/data/alluvial.js +0 -328
- package/demo/data/alluvial.js.map +0 -1
- package/demo/data/area.d.ts +0 -224
- package/demo/data/area.js +0 -330
- package/demo/data/area.js.map +0 -1
- package/demo/data/bar.d.ts +0 -681
- package/demo/data/bar.js +0 -915
- package/demo/data/bar.js.map +0 -1
- package/demo/data/boxplot.d.ts +0 -34
- package/demo/data/boxplot.js +0 -48
- package/demo/data/boxplot.js.map +0 -1
- package/demo/data/bubble.d.ts +0 -141
- package/demo/data/bubble.js +0 -182
- package/demo/data/bubble.js.map +0 -1
- package/demo/data/bullet.d.ts +0 -24
- package/demo/data/bullet.js +0 -55
- package/demo/data/bullet.js.map +0 -1
- package/demo/data/bundle.js +0 -1
- package/demo/data/choropleth.d.ts +0 -738
- package/demo/data/choropleth.js +0 -1684
- package/demo/data/choropleth.js.map +0 -1
- package/demo/data/circle-pack.d.ts +0 -91
- package/demo/data/circle-pack.js +0 -224
- package/demo/data/circle-pack.js.map +0 -1
- package/demo/data/combo.d.ts +0 -482
- package/demo/data/combo.js +0 -571
- package/demo/data/combo.js.map +0 -1
- package/demo/data/donut.d.ts +0 -64
- package/demo/data/donut.js +0 -60
- package/demo/data/donut.js.map +0 -1
- package/demo/data/gauge.d.ts +0 -40
- package/demo/data/gauge.js +0 -41
- package/demo/data/gauge.js.map +0 -1
- package/demo/data/heatmap.d.ts +0 -125
- package/demo/data/heatmap.js +0 -1149
- package/demo/data/heatmap.js.map +0 -1
- package/demo/data/high-scale.d.ts +0 -1
- package/demo/data/high-scale.js +0 -5
- package/demo/data/high-scale.js.map +0 -1
- package/demo/data/hightlight.d.ts +0 -40
- package/demo/data/hightlight.js +0 -44
- package/demo/data/hightlight.js.map +0 -1
- package/demo/data/histogram.d.ts +0 -63
- package/demo/data/histogram.js +0 -312
- package/demo/data/histogram.js.map +0 -1
- package/demo/data/index.d.ts +0 -33
- package/demo/data/index.js +0 -1305
- package/demo/data/index.js.map +0 -1
- package/demo/data/line.d.ts +0 -361
- package/demo/data/line.js +0 -480
- package/demo/data/line.js.map +0 -1
- package/demo/data/lollipop.d.ts +0 -39
- package/demo/data/lollipop.js +0 -37
- package/demo/data/lollipop.js.map +0 -1
- package/demo/data/meter.d.ts +0 -95
- package/demo/data/meter.js +0 -114
- package/demo/data/meter.js.map +0 -1
- package/demo/data/pie.d.ts +0 -46
- package/demo/data/pie.js +0 -55
- package/demo/data/pie.js.map +0 -1
- package/demo/data/radar.d.ts +0 -63
- package/demo/data/radar.js +0 -118
- package/demo/data/radar.js.map +0 -1
- package/demo/data/scatter.d.ts +0 -118
- package/demo/data/scatter.js +0 -143
- package/demo/data/scatter.js.map +0 -1
- package/demo/data/step.d.ts +0 -96
- package/demo/data/step.js +0 -27
- package/demo/data/step.js.map +0 -1
- package/demo/data/time-series-axis.d.ts +0 -368
- package/demo/data/time-series-axis.js +0 -436
- package/demo/data/time-series-axis.js.map +0 -1
- package/demo/data/toolbar.d.ts +0 -12
- package/demo/data/toolbar.js +0 -67
- package/demo/data/toolbar.js.map +0 -1
- package/demo/data/topojson-110.d.ts +0 -360
- package/demo/data/topojson-110.js +0 -40724
- package/demo/data/topojson-110.js.map +0 -1
- package/demo/data/tree.d.ts +0 -30
- package/demo/data/tree.js +0 -209
- package/demo/data/tree.js.map +0 -1
- package/demo/data/treemap.d.ts +0 -15
- package/demo/data/treemap.js +0 -93
- package/demo/data/treemap.js.map +0 -1
- package/demo/data/wordcloud.d.ts +0 -14
- package/demo/data/wordcloud.js +0 -105
- package/demo/data/wordcloud.js.map +0 -1
- package/demo/data/zoom-bar.d.ts +0 -94
- package/demo/data/zoom-bar.js +0 -187
- package/demo/data/zoom-bar.js.map +0 -1
- package/demo/styles.css +0 -31231
- package/demo/styles.css.map +0 -1
- package/demo/styles.min.css +0 -1
- package/demo/styles.min.css.map +0 -1
- package/demo/tsconfig.tsbuildinfo +0 -1451
- package/demo/utils.d.ts +0 -24
- package/demo/utils.js +0 -222
- package/demo/utils.js.map +0 -1
- package/index.d.ts +0 -4
- package/index.js +0 -6
- package/index.js.map +0 -1
- package/interfaces/a11y.js +0 -14
- package/interfaces/a11y.js.map +0 -1
- package/interfaces/axis-scales.d.ts +0 -201
- package/interfaces/axis-scales.js +0 -1
- package/interfaces/axis-scales.js.map +0 -1
- package/interfaces/charts.d.ts +0 -512
- package/interfaces/charts.js +0 -1
- package/interfaces/charts.js.map +0 -1
- package/interfaces/components.d.ts +0 -231
- package/interfaces/components.js +0 -1
- package/interfaces/components.js.map +0 -1
- package/interfaces/enums.js +0 -296
- package/interfaces/enums.js.map +0 -1
- package/interfaces/events.js +0 -269
- package/interfaces/events.js.map +0 -1
- package/interfaces/index.d.ts +0 -7
- package/interfaces/index.js +0 -3
- package/interfaces/index.js.map +0 -1
- package/interfaces/layout.d.ts +0 -15
- package/interfaces/layout.js +0 -1
- package/interfaces/layout.js.map +0 -1
- package/interfaces/model.d.ts +0 -35
- package/interfaces/model.js +0 -1
- package/interfaces/model.js.map +0 -1
- package/interfaces/truncation.d.ts +0 -17
- package/interfaces/truncation.js +0 -1
- package/interfaces/truncation.js.map +0 -1
- package/model/alluvial.js +0 -47
- package/model/alluvial.js.map +0 -1
- package/model/binned-charts.d.ts +0 -7
- package/model/binned-charts.js +0 -52
- package/model/binned-charts.js.map +0 -1
- package/model/boxplot.js +0 -174
- package/model/boxplot.js.map +0 -1
- package/model/bullet.js +0 -74
- package/model/bullet.js.map +0 -1
- package/model/cartesian-charts.d.ts +0 -24
- package/model/cartesian-charts.js +0 -202
- package/model/cartesian-charts.js.map +0 -1
- package/model/choropleth.js +0 -105
- package/model/choropleth.js.map +0 -1
- package/model/circle-pack.js +0 -189
- package/model/circle-pack.js.map +0 -1
- package/model/gauge.js +0 -51
- package/model/gauge.js.map +0 -1
- package/model/heatmap.d.ts +0 -52
- package/model/heatmap.js +0 -220
- package/model/heatmap.js.map +0 -1
- package/model/meter.d.ts +0 -19
- package/model/meter.js +0 -118
- package/model/meter.js.map +0 -1
- package/model/model.d.ts +0 -107
- package/model/model.js +0 -712
- package/model/model.js.map +0 -1
- package/model/pie.js +0 -66
- package/model/pie.js.map +0 -1
- package/model/radar.js +0 -52
- package/model/radar.js.map +0 -1
- package/model/tree.js +0 -56
- package/model/tree.js.map +0 -1
- package/model/treemap.js +0 -44
- package/model/treemap.js.map +0 -1
- package/model/wordcloud.js +0 -47
- package/model/wordcloud.js.map +0 -1
- package/polyfills.d.ts +0 -0
- package/polyfills.js +0 -29
- package/polyfills.js.map +0 -1
- package/services/angle-utils.d.ts +0 -16
- package/services/angle-utils.js +0 -82
- package/services/angle-utils.js.map +0 -1
- package/services/canvas-zoom.js +0 -72
- package/services/canvas-zoom.js.map +0 -1
- package/services/color-scale-utils.js +0 -64
- package/services/color-scale-utils.js.map +0 -1
- package/services/curves.d.ts +0 -25
- package/services/curves.js +0 -77
- package/services/curves.js.map +0 -1
- package/services/essentials/dom-utils.d.ts +0 -39
- package/services/essentials/dom-utils.js +0 -423
- package/services/essentials/dom-utils.js.map +0 -1
- package/services/essentials/events.d.ts +0 -8
- package/services/essentials/events.js +0 -53
- package/services/essentials/events.js.map +0 -1
- package/services/essentials/files.d.ts +0 -6
- package/services/essentials/files.js +0 -60
- package/services/essentials/files.js.map +0 -1
- package/services/essentials/gradient-utils.d.ts +0 -6
- package/services/essentials/gradient-utils.js +0 -85
- package/services/essentials/gradient-utils.js.map +0 -1
- package/services/essentials/transitions.d.ts +0 -13
- package/services/essentials/transitions.js +0 -51
- package/services/essentials/transitions.js.map +0 -1
- package/services/index.d.ts +0 -10
- package/services/index.js +0 -13
- package/services/index.js.map +0 -1
- package/services/scales-cartesian.d.ts +0 -86
- package/services/scales-cartesian.js +0 -656
- package/services/scales-cartesian.js.map +0 -1
- package/services/service.d.ts +0 -10
- package/services/service.js +0 -24
- package/services/service.js.map +0 -1
- package/services/time-series.js +0 -147
- package/services/time-series.js.map +0 -1
- package/services/zoom.d.ts +0 -21
- package/services/zoom.js +0 -217
- package/services/zoom.js.map +0 -1
- package/styles/_chart-holder.scss +0 -50
- package/styles/color-palatte.scss +0 -458
- package/styles/colors.scss +0 -155
- package/styles/components/_color-legend.scss +0 -11
- package/styles/components/_edge.scss +0 -65
- package/styles/components/_grid.scss +0 -30
- package/styles/components/_marker.scss +0 -7
- package/styles/components/_meter-title.scss +0 -37
- package/styles/components/_tooltip.scss +0 -132
- package/styles/components/diagrams/_card-node.scss +0 -97
- package/styles/components/diagrams/_edge.scss +0 -66
- package/styles/components/diagrams/_shape-node.scss +0 -89
- package/styles/components/diagrams/index.scss +0 -4
- package/styles/graphs/_alluvial.scss +0 -17
- package/styles/graphs/_bullet.scss +0 -36
- package/styles/graphs/_circle-pack.scss +0 -36
- package/styles/graphs/_gauge.scss +0 -23
- package/styles/graphs/_heatmap.scss +0 -60
- package/styles/graphs/_meter.scss +0 -34
- package/styles/graphs/_radar.scss +0 -18
- package/styles/graphs/_scatter-stacked.scss +0 -12
- package/styles/graphs/_tree.scss +0 -47
- package/styles/styles.scss +0 -35
- package/styles/tokens.scss +0 -416
- package/styles.css +0 -6325
- package/styles.css.map +0 -1
- package/styles.min.css +0 -1
- package/styles.min.css.map +0 -1
- package/tools.d.ts +0 -144
- package/tools.js +0 -348
- package/tools.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -3816
- /package/{components → dist/components}/axes/hover-axis.d.ts +0 -0
- /package/{components → dist/components}/axes/ruler-stacked.d.ts +0 -0
- /package/{components → dist/components}/diagrams/markerDefinitions.d.ts +0 -0
- /package/{components → dist/components}/essentials/tooltip-axis.d.ts +0 -0
- /package/{interfaces → dist/interfaces}/a11y.d.ts +0 -0
- /package/{interfaces → dist/interfaces}/enums.d.ts +0 -0
- /package/{interfaces → dist/interfaces}/events.d.ts +0 -0
- /package/{model → dist/model}/alluvial.d.ts +0 -0
- /package/{model → dist/model}/boxplot.d.ts +0 -0
- /package/{model → dist/model}/bullet.d.ts +0 -0
- /package/{model → dist/model}/choropleth.d.ts +0 -0
- /package/{model → dist/model}/circle-pack.d.ts +0 -0
- /package/{model → dist/model}/gauge.d.ts +0 -0
- /package/{model → dist/model}/pie.d.ts +0 -0
- /package/{model → dist/model}/radar.d.ts +0 -0
- /package/{model → dist/model}/tree.d.ts +0 -0
- /package/{model → dist/model}/treemap.d.ts +0 -0
- /package/{model → dist/model}/wordcloud.d.ts +0 -0
- /package/{services → dist/services}/canvas-zoom.d.ts +0 -0
- /package/{services → dist/services}/color-scale-utils.d.ts +0 -0
- /package/{services → dist/services}/time-series.d.ts +0 -0
- /package/{styles → dist/styles}/_type.scss +0 -0
- /package/{styles → dist/styles}/components/_axis.scss +0 -0
- /package/{styles → dist/styles}/components/_callouts.scss +0 -0
- /package/{styles → dist/styles}/components/_grid-brush.scss +0 -0
- /package/{styles → dist/styles}/components/_highlights.scss +0 -0
- /package/{styles → dist/styles}/components/_layout.scss +0 -0
- /package/{styles → dist/styles}/components/_legend.scss +0 -0
- /package/{styles → dist/styles}/components/_modal.scss +0 -0
- /package/{styles → dist/styles}/components/_ruler.scss +0 -0
- /package/{styles → dist/styles}/components/_skeleton-lines.scss +0 -0
- /package/{styles → dist/styles}/components/_skeleton.scss +0 -0
- /package/{styles → dist/styles}/components/_threshold.scss +0 -0
- /package/{styles → dist/styles}/components/_title.scss +0 -0
- /package/{styles → dist/styles}/components/_toolbar.scss +0 -0
- /package/{styles → dist/styles}/components/_zero-line.scss +0 -0
- /package/{styles → dist/styles}/components/_zoom-bar.scss +0 -0
- /package/{styles → dist/styles}/components/diagrams/_marker.scss +0 -0
- /package/{styles → dist/styles}/components/index.scss +0 -0
- /package/{styles → dist/styles}/graphs/_area.scss +0 -0
- /package/{styles → dist/styles}/graphs/_bubble.scss +0 -0
- /package/{styles → dist/styles}/graphs/_choropleth.scss +0 -0
- /package/{styles → dist/styles}/graphs/_donut.scss +0 -0
- /package/{styles → dist/styles}/graphs/_line.scss +0 -0
- /package/{styles → dist/styles}/graphs/_lollipop.scss +0 -0
- /package/{styles → dist/styles}/graphs/_pie.scss +0 -0
- /package/{styles → dist/styles}/graphs/_scatter.scss +0 -0
- /package/{styles → dist/styles}/graphs/_treemap.scss +0 -0
- /package/{styles → dist/styles}/graphs/_wordcloud.scss +0 -0
- /package/{styles → dist/styles}/graphs/index.scss +0 -0
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
// Internal Imports
|
|
15
|
-
import { Title } from './title';
|
|
16
|
-
import { DOMUtils } from '../../services';
|
|
17
|
-
import * as Tools from '../../tools';
|
|
18
|
-
import { RenderTypes, Statuses } from './../../interfaces/enums';
|
|
19
|
-
import * as Configuration from '../../configuration';
|
|
20
|
-
var MeterTitle = /** @class */ (function (_super) {
|
|
21
|
-
__extends(MeterTitle, _super);
|
|
22
|
-
function MeterTitle() {
|
|
23
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
_this.type = 'meter-title';
|
|
25
|
-
_this.renderType = RenderTypes.SVG;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
MeterTitle.prototype.render = function () {
|
|
29
|
-
var dataset = Tools.getProperty(this.model.getDisplayData(), 0);
|
|
30
|
-
var options = this.getOptions();
|
|
31
|
-
var svg = this.getComponentContainer();
|
|
32
|
-
var groupMapsTo = options.data.groupMapsTo;
|
|
33
|
-
var proportional = Tools.getProperty(options, 'meter', 'proportional');
|
|
34
|
-
if (proportional) {
|
|
35
|
-
this.displayTotal();
|
|
36
|
-
this.displayBreakdownTitle();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// the title for a meter, is the label for that dataset
|
|
40
|
-
var title = svg
|
|
41
|
-
.selectAll('text.meter-title')
|
|
42
|
-
.data([dataset[groupMapsTo]]);
|
|
43
|
-
title
|
|
44
|
-
.enter()
|
|
45
|
-
.append('text')
|
|
46
|
-
.classed('meter-title', true)
|
|
47
|
-
.merge(title)
|
|
48
|
-
.attr('x', 0)
|
|
49
|
-
.attr('y', '1em')
|
|
50
|
-
.text(function (d) { return d; });
|
|
51
|
-
title.exit().remove();
|
|
52
|
-
// appends the associated percentage after title
|
|
53
|
-
this.appendPercentage();
|
|
54
|
-
}
|
|
55
|
-
// if status ranges are provided (custom or default), display indicator
|
|
56
|
-
this.displayStatus();
|
|
57
|
-
// get the max width of a title (with consideration for the status/percentage)
|
|
58
|
-
var maxWidth = this.getMaxTitleWidth();
|
|
59
|
-
var titleElement = DOMUtils.appendOrSelect(svg, 'text.meter-title');
|
|
60
|
-
if (maxWidth > 0 &&
|
|
61
|
-
titleElement.node().getComputedTextLength() > maxWidth) {
|
|
62
|
-
this.truncateTitle(titleElement, maxWidth);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
MeterTitle.prototype.displayBreakdownTitle = function () {
|
|
66
|
-
var self = this;
|
|
67
|
-
var svg = this.getComponentContainer();
|
|
68
|
-
var options = this.getOptions();
|
|
69
|
-
var datasetsTotal = this.model.getMaximumDomain(this.model.getDisplayData());
|
|
70
|
-
var total = Tools.getProperty(options, 'meter', 'proportional', 'total');
|
|
71
|
-
var unit = Tools.getProperty(options, 'meter', 'proportional', 'unit')
|
|
72
|
-
? Tools.getProperty(options, 'meter', 'proportional', 'unit')
|
|
73
|
-
: '';
|
|
74
|
-
var data;
|
|
75
|
-
if (datasetsTotal === total) {
|
|
76
|
-
data = null;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
var difference = total !== null ? total - datasetsTotal : datasetsTotal;
|
|
80
|
-
//breakdownFormatter
|
|
81
|
-
var breakdownFormatter = Tools.getProperty(options, 'meter', 'proportional', 'breakdownFormatter');
|
|
82
|
-
data =
|
|
83
|
-
breakdownFormatter !== null
|
|
84
|
-
? breakdownFormatter({
|
|
85
|
-
datasetsTotal: datasetsTotal,
|
|
86
|
-
total: total,
|
|
87
|
-
})
|
|
88
|
-
: datasetsTotal + " " + unit + " used (" + difference + " " + unit + " available)";
|
|
89
|
-
}
|
|
90
|
-
// the breakdown part to whole of the datasets to the overall total
|
|
91
|
-
var title = svg
|
|
92
|
-
.selectAll('text.proportional-meter-title')
|
|
93
|
-
.data([data]);
|
|
94
|
-
title
|
|
95
|
-
.enter()
|
|
96
|
-
.append('text')
|
|
97
|
-
.classed('proportional-meter-title', true)
|
|
98
|
-
.merge(title)
|
|
99
|
-
.attr('x', 0)
|
|
100
|
-
.attr('y', '1em')
|
|
101
|
-
.text(function (d) { return d; });
|
|
102
|
-
title.exit().remove();
|
|
103
|
-
var maxWidth = this.getMaxTitleWidth();
|
|
104
|
-
var titleElement = DOMUtils.appendOrSelect(svg, 'text.proportional-meter-title');
|
|
105
|
-
if (maxWidth > 0 &&
|
|
106
|
-
titleElement.node().getComputedTextLength() > maxWidth) {
|
|
107
|
-
this.truncateTitle(titleElement, maxWidth);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
// show the total for prop meter
|
|
111
|
-
MeterTitle.prototype.displayTotal = function () {
|
|
112
|
-
var self = this;
|
|
113
|
-
var svg = this.getComponentContainer();
|
|
114
|
-
var options = this.getOptions();
|
|
115
|
-
var total = Tools.getProperty(options, 'meter', 'proportional', 'total');
|
|
116
|
-
var totalValue = total
|
|
117
|
-
? Tools.getProperty(options, 'meter', 'proportional', 'total')
|
|
118
|
-
: this.model.getMaximumDomain(this.model.getDisplayData());
|
|
119
|
-
var unit = Tools.getProperty(options, 'meter', 'proportional', 'unit')
|
|
120
|
-
? Tools.getProperty(options, 'meter', 'proportional', 'unit')
|
|
121
|
-
: '';
|
|
122
|
-
// totalFormatter function
|
|
123
|
-
var totalFormatter = Tools.getProperty(options, 'meter', 'proportional', 'totalFormatter');
|
|
124
|
-
var totalString = totalFormatter !== null
|
|
125
|
-
? totalFormatter(totalValue)
|
|
126
|
-
: total + " " + unit + " total";
|
|
127
|
-
var containerBounds = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer());
|
|
128
|
-
// need to check if the width is 0, and try to use the parent attribute
|
|
129
|
-
// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions
|
|
130
|
-
var containerWidth = containerBounds.width
|
|
131
|
-
? containerBounds.width
|
|
132
|
-
: this.parent.node().getAttribute('width');
|
|
133
|
-
var title = svg
|
|
134
|
-
.selectAll('text.proportional-meter-total')
|
|
135
|
-
.data([totalString]);
|
|
136
|
-
title
|
|
137
|
-
.enter()
|
|
138
|
-
.append('text')
|
|
139
|
-
.classed('proportional-meter-total', true)
|
|
140
|
-
.merge(title)
|
|
141
|
-
// Position the total text -24 pixels to add spacing between text and status icon (if status exists)
|
|
142
|
-
.attr('x', this.model.getStatus() && typeof containerWidth !== 'string'
|
|
143
|
-
? containerWidth - Configuration.meter.total.paddingRight
|
|
144
|
-
: containerWidth)
|
|
145
|
-
.attr('y', '1em')
|
|
146
|
-
.attr('text-anchor', 'end')
|
|
147
|
-
.text(function (d) { return d; });
|
|
148
|
-
title.exit().remove();
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* Appends the corresponding status based on the value and the peak.
|
|
152
|
-
*/
|
|
153
|
-
MeterTitle.prototype.displayStatus = function () {
|
|
154
|
-
var self = this;
|
|
155
|
-
var svg = this.getComponentContainer();
|
|
156
|
-
var containerBounds = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer());
|
|
157
|
-
// need to check if the width is 0, and try to use the parent attribute
|
|
158
|
-
// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions
|
|
159
|
-
var containerWidth = containerBounds.width
|
|
160
|
-
? containerBounds.width
|
|
161
|
-
: 0;
|
|
162
|
-
// get the status from the model
|
|
163
|
-
var status = this.model.getStatus();
|
|
164
|
-
var radius = Configuration.meter.status.indicatorSize / 2;
|
|
165
|
-
// create a group for the icon/inner path
|
|
166
|
-
var statusGroup = DOMUtils.appendOrSelect(svg, "g.status-indicator")
|
|
167
|
-
.attr('class', status !== null ? "status-indicator status--" + status : '')
|
|
168
|
-
.attr('transform', "translate(" + (containerWidth - radius) + ", 0)");
|
|
169
|
-
var data = status ? [status] : [];
|
|
170
|
-
var icon = statusGroup.selectAll('circle.status').data(data);
|
|
171
|
-
icon.enter()
|
|
172
|
-
.append('circle')
|
|
173
|
-
.merge(icon)
|
|
174
|
-
.attr('class', 'status')
|
|
175
|
-
.attr('r', radius)
|
|
176
|
-
.attr('cx', 0)
|
|
177
|
-
.attr('cy', "calc(1em / 2)");
|
|
178
|
-
var innerIcon = statusGroup.selectAll('path.innerFill').data(data);
|
|
179
|
-
innerIcon
|
|
180
|
-
.enter()
|
|
181
|
-
.append('path')
|
|
182
|
-
.merge(innerIcon)
|
|
183
|
-
.attr('d', self.getStatusIconPathString(status))
|
|
184
|
-
.attr('transform', "translate(-" + radius + ", 0)")
|
|
185
|
-
.attr('class', 'innerFill');
|
|
186
|
-
innerIcon.exit().remove();
|
|
187
|
-
icon.exit().remove();
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Appends the associated percentage to the end of the title
|
|
191
|
-
*/
|
|
192
|
-
MeterTitle.prototype.appendPercentage = function () {
|
|
193
|
-
var dataValue = Tools.getProperty(this.model.getDisplayData(), 0, 'value');
|
|
194
|
-
// use the title's position to append the percentage to the end
|
|
195
|
-
var svg = this.getComponentContainer();
|
|
196
|
-
var title = DOMUtils.appendOrSelect(svg, 'text.meter-title');
|
|
197
|
-
// check if it is enabled
|
|
198
|
-
var data = Tools.getProperty(this.getOptions(), 'meter', 'statusBar', 'percentageIndicator', 'enabled') === true
|
|
199
|
-
? [dataValue]
|
|
200
|
-
: [];
|
|
201
|
-
// append a percentage if it is enabled, update it
|
|
202
|
-
var percentage = svg.selectAll('text.percent-value').data(data);
|
|
203
|
-
// the horizontal offset of the percentage value from the title
|
|
204
|
-
var offset = Configuration.meter.statusBar.paddingRight;
|
|
205
|
-
percentage
|
|
206
|
-
.enter()
|
|
207
|
-
.append('text')
|
|
208
|
-
.classed('percent-value', true)
|
|
209
|
-
.merge(percentage)
|
|
210
|
-
.text(function (d) { return d + "%"; })
|
|
211
|
-
.attr('x', +title.attr('x') + title.node().getComputedTextLength() + offset) // set the position to after the title
|
|
212
|
-
.attr('y', title.attr('y'));
|
|
213
|
-
percentage.exit().remove();
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* Uses the parent class truncate logic
|
|
217
|
-
* @param title d3 selection of title element that will be truncated
|
|
218
|
-
* @param titlestring the original string that needs truncation
|
|
219
|
-
* @param maxWidth the max width the title can take
|
|
220
|
-
*/
|
|
221
|
-
MeterTitle.prototype.truncateTitle = function (title, maxWidth) {
|
|
222
|
-
_super.prototype.truncateTitle.call(this, title, maxWidth);
|
|
223
|
-
// update the position on the percentage to be inline with the title
|
|
224
|
-
var tspan = DOMUtils.appendOrSelect(this.parent, 'tspan');
|
|
225
|
-
var offset = Configuration.meter.statusBar.paddingRight;
|
|
226
|
-
var tspanLength = Math.ceil(tspan.node().getComputedTextLength());
|
|
227
|
-
var percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value');
|
|
228
|
-
percentage.attr('x', +title.attr('x') +
|
|
229
|
-
title.node().getComputedTextLength() +
|
|
230
|
-
tspanLength +
|
|
231
|
-
offset);
|
|
232
|
-
};
|
|
233
|
-
// computes the maximum space a title can take
|
|
234
|
-
MeterTitle.prototype.getMaxTitleWidth = function () {
|
|
235
|
-
// get a reference to the title elements to calculate the size the title can be
|
|
236
|
-
var containerBounds = DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer());
|
|
237
|
-
var proportional = Tools.getProperty(this.getOptions(), 'meter', 'proportional');
|
|
238
|
-
// need to check if the width is 0, and try to use the parent attribute
|
|
239
|
-
var containerWidth = containerBounds.width
|
|
240
|
-
? containerBounds.width
|
|
241
|
-
: this.parent.node().getAttribute('width');
|
|
242
|
-
if (proportional !== null) {
|
|
243
|
-
var total = DOMUtils.appendOrSelect(this.parent, 'text.proportional-meter-total').node();
|
|
244
|
-
var totalWidth = DOMUtils.getSVGElementSize(total, {
|
|
245
|
-
useBBox: true,
|
|
246
|
-
}).width;
|
|
247
|
-
return (containerWidth -
|
|
248
|
-
totalWidth -
|
|
249
|
-
Configuration.meter.total.paddingLeft);
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
var percentage = DOMUtils.appendOrSelect(this.parent, 'text.percent-value');
|
|
253
|
-
// the title needs to fit the width of the container without crowding the status, and percentage value
|
|
254
|
-
var offset = Configuration.meter.statusBar.paddingRight;
|
|
255
|
-
var percentageWidth = percentage.node().getComputedTextLength();
|
|
256
|
-
var statusGroup = DOMUtils.appendOrSelect(this.parent, 'g.status-indicator').node();
|
|
257
|
-
var statusWidth = DOMUtils.getSVGElementSize(statusGroup, { useBBox: true })
|
|
258
|
-
.width + Configuration.meter.status.paddingLeft;
|
|
259
|
-
return containerWidth - percentageWidth - offset - statusWidth;
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
/**
|
|
263
|
-
* Get the associated status icon for the data
|
|
264
|
-
* @param status the active status for the meter chart
|
|
265
|
-
*/
|
|
266
|
-
MeterTitle.prototype.getStatusIconPathString = function (status) {
|
|
267
|
-
switch (status) {
|
|
268
|
-
case Statuses.SUCCESS:
|
|
269
|
-
return 'M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z';
|
|
270
|
-
case Statuses.DANGER:
|
|
271
|
-
return 'M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z';
|
|
272
|
-
case Statuses.WARNING:
|
|
273
|
-
return 'M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z';
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
return MeterTitle;
|
|
277
|
-
}(Title));
|
|
278
|
-
export { MeterTitle };
|
|
279
|
-
//# sourceMappingURL=../../../src/components/essentials/title-meter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"title-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PAA0P,CAAC;SACnQ;IACF,CAAC;IACF,iBAAC;AAAD,CAAC,AAnYD,CAAgC,KAAK,GAmYpC","sourcesContent":["// Internal Imports\nimport { Title } from './title';\nimport { DOMUtils } from '../../services';\nimport * as Tools from '../../tools';\nimport { RenderTypes, Statuses } from './../../interfaces/enums';\nimport * as Configuration from '../../configuration';\n\nexport class MeterTitle extends Title {\n\ttype = 'meter-title';\n\trenderType = RenderTypes.SVG;\n\n\trender() {\n\t\tconst dataset = Tools.getProperty(this.model.getDisplayData(), 0);\n\t\tconst options = this.getOptions();\n\t\tconst svg = this.getComponentContainer();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst proportional = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'meter',\n\t\t\t'proportional'\n\t\t);\n\n\t\tif (proportional) {\n\t\t\tthis.displayTotal();\n\t\t\tthis.displayBreakdownTitle();\n\t\t} else {\n\t\t\t// the title for a meter, is the label for that dataset\n\t\t\tconst title = svg\n\t\t\t\t.selectAll('text.meter-title')\n\t\t\t\t.data([dataset[groupMapsTo]]);\n\n\t\t\ttitle\n\t\t\t\t.enter()\n\t\t\t\t.append('text')\n\t\t\t\t.classed('meter-title', true)\n\t\t\t\t.merge(title)\n\t\t\t\t.attr('x', 0)\n\t\t\t\t.attr('y', '1em')\n\t\t\t\t.text((d) => d);\n\n\t\t\ttitle.exit().remove();\n\n\t\t\t// appends the associated percentage after title\n\t\t\tthis.appendPercentage();\n\t\t}\n\n\t\t// if status ranges are provided (custom or default), display indicator\n\t\tthis.displayStatus();\n\n\t\t// get the max width of a title (with consideration for the status/percentage)\n\t\tconst maxWidth = this.getMaxTitleWidth();\n\t\tconst titleElement = DOMUtils.appendOrSelect(svg, 'text.meter-title');\n\n\t\tif (\n\t\t\tmaxWidth > 0 &&\n\t\t\ttitleElement.node().getComputedTextLength() > maxWidth\n\t\t) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth);\n\t\t}\n\t}\n\n\tdisplayBreakdownTitle() {\n\t\tconst self = this;\n\t\tconst svg = this.getComponentContainer();\n\t\tconst options = this.getOptions();\n\t\tconst datasetsTotal = this.model.getMaximumDomain(\n\t\t\tthis.model.getDisplayData()\n\t\t);\n\t\tconst total = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'meter',\n\t\t\t'proportional',\n\t\t\t'total'\n\t\t);\n\t\tconst unit = Tools.getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? Tools.getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: '';\n\n\t\tlet data;\n\t\tif (datasetsTotal === total) {\n\t\t\tdata = null;\n\t\t} else {\n\t\t\tconst difference =\n\t\t\t\ttotal !== null ? total - datasetsTotal : datasetsTotal;\n\t\t\t//breakdownFormatter\n\t\t\tconst breakdownFormatter = Tools.getProperty(\n\t\t\t\toptions,\n\t\t\t\t'meter',\n\t\t\t\t'proportional',\n\t\t\t\t'breakdownFormatter'\n\t\t\t);\n\t\t\tdata =\n\t\t\t\tbreakdownFormatter !== null\n\t\t\t\t\t? breakdownFormatter({\n\t\t\t\t\t\t\tdatasetsTotal: datasetsTotal,\n\t\t\t\t\t\t\ttotal: total,\n\t\t\t\t\t })\n\t\t\t\t\t: `${datasetsTotal} ${unit} used (${difference} ${unit} available)`;\n\t\t}\n\n\t\t// the breakdown part to whole of the datasets to the overall total\n\t\tconst title = svg\n\t\t\t.selectAll('text.proportional-meter-title')\n\t\t\t.data([data]);\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-title', true)\n\t\t\t.merge(title)\n\t\t\t.attr('x', 0)\n\t\t\t.attr('y', '1em')\n\t\t\t.text((d) => d);\n\n\t\ttitle.exit().remove();\n\n\t\tconst maxWidth = this.getMaxTitleWidth();\n\t\tconst titleElement = DOMUtils.appendOrSelect(\n\t\t\tsvg,\n\t\t\t'text.proportional-meter-title'\n\t\t);\n\n\t\tif (\n\t\t\tmaxWidth > 0 &&\n\t\t\ttitleElement.node().getComputedTextLength() > maxWidth\n\t\t) {\n\t\t\tthis.truncateTitle(titleElement, maxWidth);\n\t\t}\n\t}\n\n\t// show the total for prop meter\n\tdisplayTotal() {\n\t\tconst self = this;\n\t\tconst svg = this.getComponentContainer();\n\t\tconst options = this.getOptions();\n\n\t\tconst total = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'meter',\n\t\t\t'proportional',\n\t\t\t'total'\n\t\t);\n\n\t\tconst totalValue = total\n\t\t\t? Tools.getProperty(options, 'meter', 'proportional', 'total')\n\t\t\t: this.model.getMaximumDomain(this.model.getDisplayData());\n\n\t\tconst unit = Tools.getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t? Tools.getProperty(options, 'meter', 'proportional', 'unit')\n\t\t\t: '';\n\n\t\t// totalFormatter function\n\t\tconst totalFormatter = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'meter',\n\t\t\t'proportional',\n\t\t\t'totalFormatter'\n\t\t);\n\n\t\tconst totalString =\n\t\t\ttotalFormatter !== null\n\t\t\t\t? totalFormatter(totalValue)\n\t\t\t\t: `${total} ${unit} total`;\n\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(\n\t\t\tthis.services.domUtils.getMainContainer()\n\t\t);\n\n\t\t// need to check if the width is 0, and try to use the parent attribute\n\t\t// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions\n\t\tconst containerWidth = containerBounds.width\n\t\t\t? containerBounds.width\n\t\t\t: <string | number>this.parent.node().getAttribute('width');\n\n\t\tconst title = svg\n\t\t\t.selectAll('text.proportional-meter-total')\n\t\t\t.data([totalString]);\n\n\t\ttitle\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('proportional-meter-total', true)\n\t\t\t.merge(title)\n\t\t\t// Position the total text -24 pixels to add spacing between text and status icon (if status exists)\n\t\t\t.attr(\n\t\t\t\t'x',\n\t\t\t\tthis.model.getStatus() && typeof containerWidth !== 'string'\n\t\t\t\t\t? containerWidth - Configuration.meter.total.paddingRight\n\t\t\t\t\t: containerWidth\n\t\t\t)\n\t\t\t.attr('y', '1em')\n\t\t\t.attr('text-anchor', 'end')\n\t\t\t.text((d) => d);\n\n\t\ttitle.exit().remove();\n\t}\n\n\t/**\n\t * Appends the corresponding status based on the value and the peak.\n\t */\n\tdisplayStatus() {\n\t\tconst self = this;\n\t\tconst svg = this.getComponentContainer();\n\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(\n\t\t\tthis.services.domUtils.getMainContainer()\n\t\t);\n\n\t\t// need to check if the width is 0, and try to use the parent attribute\n\t\t// this can happen if the chart is toggled on/off and the height is 0 for the parent, it wont validateDimensions\n\t\tconst containerWidth = containerBounds.width\n\t\t\t? containerBounds.width\n\t\t\t: 0;\n\n\t\t// get the status from the model\n\t\tconst status = this.model.getStatus();\n\t\tconst radius = Configuration.meter.status.indicatorSize / 2;\n\n\t\t// create a group for the icon/inner path\n\t\tconst statusGroup = DOMUtils.appendOrSelect(svg, `g.status-indicator`)\n\t\t\t.attr(\n\t\t\t\t'class',\n\t\t\t\tstatus !== null ? `status-indicator status--${status}` : ''\n\t\t\t)\n\t\t\t.attr('transform', `translate(${containerWidth - radius}, 0)`);\n\n\t\tconst data = status ? [status] : [];\n\t\tconst icon = statusGroup.selectAll('circle.status').data(data);\n\n\t\ticon.enter()\n\t\t\t.append('circle')\n\t\t\t.merge(icon)\n\t\t\t.attr('class', 'status')\n\t\t\t.attr('r', radius)\n\t\t\t.attr('cx', 0)\n\t\t\t.attr('cy', `calc(1em / 2)`);\n\n\t\tconst innerIcon = statusGroup.selectAll('path.innerFill').data(data);\n\n\t\tinnerIcon\n\t\t\t.enter()\n\t\t\t.append('path')\n\t\t\t.merge(innerIcon)\n\t\t\t.attr('d', self.getStatusIconPathString(status))\n\t\t\t.attr('transform', `translate(-${radius}, 0)`)\n\t\t\t.attr('class', 'innerFill');\n\n\t\tinnerIcon.exit().remove();\n\t\ticon.exit().remove();\n\t}\n\n\t/**\n\t * Appends the associated percentage to the end of the title\n\t */\n\tappendPercentage() {\n\t\tconst dataValue = Tools.getProperty(\n\t\t\tthis.model.getDisplayData(),\n\t\t\t0,\n\t\t\t'value'\n\t\t);\n\n\t\t// use the title's position to append the percentage to the end\n\t\tconst svg = this.getComponentContainer();\n\t\tconst title = DOMUtils.appendOrSelect(svg, 'text.meter-title');\n\n\t\t// check if it is enabled\n\t\tconst data =\n\t\t\tTools.getProperty(\n\t\t\t\tthis.getOptions(),\n\t\t\t\t'meter',\n\t\t\t\t'statusBar',\n\t\t\t\t'percentageIndicator',\n\t\t\t\t'enabled'\n\t\t\t) === true\n\t\t\t\t? [dataValue]\n\t\t\t\t: [];\n\n\t\t// append a percentage if it is enabled, update it\n\t\tconst percentage = svg.selectAll('text.percent-value').data(data);\n\n\t\t// the horizontal offset of the percentage value from the title\n\t\tconst offset = Configuration.meter.statusBar.paddingRight;\n\n\t\tpercentage\n\t\t\t.enter()\n\t\t\t.append('text')\n\t\t\t.classed('percent-value', true)\n\t\t\t.merge(percentage)\n\t\t\t.text((d) => `${d}%`)\n\t\t\t.attr(\n\t\t\t\t'x',\n\t\t\t\t+title.attr('x') + title.node().getComputedTextLength() + offset\n\t\t\t) // set the position to after the title\n\t\t\t.attr('y', title.attr('y'));\n\n\t\tpercentage.exit().remove();\n\t}\n\n\t/**\n\t * Uses the parent class truncate logic\n\t * @param title d3 selection of title element that will be truncated\n\t * @param titlestring the original string that needs truncation\n\t * @param maxWidth the max width the title can take\n\t */\n\ttruncateTitle(title, maxWidth) {\n\t\tsuper.truncateTitle(title, maxWidth);\n\n\t\t// update the position on the percentage to be inline with the title\n\t\tconst tspan = DOMUtils.appendOrSelect(this.parent, 'tspan');\n\t\tconst offset = Configuration.meter.statusBar.paddingRight;\n\t\tconst tspanLength = Math.ceil(tspan.node().getComputedTextLength());\n\n\t\tconst percentage = DOMUtils.appendOrSelect(\n\t\t\tthis.parent,\n\t\t\t'text.percent-value'\n\t\t);\n\t\tpercentage.attr(\n\t\t\t'x',\n\t\t\t+title.attr('x') +\n\t\t\t\ttitle.node().getComputedTextLength() +\n\t\t\t\ttspanLength +\n\t\t\t\toffset\n\t\t);\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\t// get a reference to the title elements to calculate the size the title can be\n\t\tconst containerBounds = DOMUtils.getHTMLElementSize(\n\t\t\tthis.services.domUtils.getMainContainer()\n\t\t);\n\n\t\tconst proportional = Tools.getProperty(\n\t\t\tthis.getOptions(),\n\t\t\t'meter',\n\t\t\t'proportional'\n\t\t);\n\n\t\t// need to check if the width is 0, and try to use the parent attribute\n\t\tconst containerWidth = containerBounds.width\n\t\t\t? containerBounds.width\n\t\t\t: this.parent.node().getAttribute('width');\n\n\t\tif (proportional !== null) {\n\t\t\tconst total = DOMUtils.appendOrSelect(\n\t\t\t\tthis.parent,\n\t\t\t\t'text.proportional-meter-total'\n\t\t\t).node();\n\n\t\t\tconst totalWidth = DOMUtils.getSVGElementSize(total, {\n\t\t\t\tuseBBox: true,\n\t\t\t}).width;\n\n\t\t\treturn (\n\t\t\t\tcontainerWidth -\n\t\t\t\ttotalWidth -\n\t\t\t\tConfiguration.meter.total.paddingLeft\n\t\t\t);\n\t\t} else {\n\t\t\tconst percentage = DOMUtils.appendOrSelect(\n\t\t\t\tthis.parent,\n\t\t\t\t'text.percent-value'\n\t\t\t);\n\t\t\t// the title needs to fit the width of the container without crowding the status, and percentage value\n\t\t\tconst offset = Configuration.meter.statusBar.paddingRight;\n\t\t\tconst percentageWidth = percentage.node().getComputedTextLength();\n\n\t\t\tconst statusGroup = DOMUtils.appendOrSelect(\n\t\t\t\tthis.parent,\n\t\t\t\t'g.status-indicator'\n\t\t\t).node();\n\t\t\tconst statusWidth =\n\t\t\t\tDOMUtils.getSVGElementSize(statusGroup, { useBBox: true })\n\t\t\t\t\t.width + Configuration.meter.status.paddingLeft;\n\n\t\t\treturn containerWidth - percentageWidth - offset - statusWidth;\n\t\t}\n\t}\n\n\t/**\n\t * Get the associated status icon for the data\n\t * @param status the active status for the meter chart\n\t */\n\tprotected getStatusIconPathString(status) {\n\t\tswitch (status) {\n\t\t\tcase Statuses.SUCCESS:\n\t\t\t\treturn 'M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z';\n\t\t\tcase Statuses.DANGER:\n\t\t\t\treturn 'M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z';\n\t\t\tcase Statuses.WARNING:\n\t\t\t\treturn 'M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z';\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Component } from '../component';
|
|
2
|
-
import { RenderTypes } from './../../interfaces';
|
|
3
|
-
export declare class Title extends Component {
|
|
4
|
-
type: string;
|
|
5
|
-
renderType: RenderTypes;
|
|
6
|
-
render(): void;
|
|
7
|
-
/**
|
|
8
|
-
* Truncates title creating ellipses and attaching tooltip for exposing full title.
|
|
9
|
-
*/
|
|
10
|
-
truncateTitle(title: any, maxWidth: any): void;
|
|
11
|
-
protected getMaxTitleWidth(): any;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the index for a maximum length substring that is less than the width parameter.
|
|
14
|
-
* @param title the title node used for getting the text lengths of substrings
|
|
15
|
-
* @param start the start index for the binary search
|
|
16
|
-
* @param end the end index for the binary search
|
|
17
|
-
* @param width the width of the svg container that holds the title
|
|
18
|
-
*/
|
|
19
|
-
protected getSubstringIndex(title: any, start: any, end: any, width: any): any;
|
|
20
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
// Internal Imports
|
|
15
|
-
import { Component } from '../component';
|
|
16
|
-
import { DOMUtils } from '../../services';
|
|
17
|
-
import { Events, RenderTypes } from './../../interfaces';
|
|
18
|
-
import * as Tools from '../../tools';
|
|
19
|
-
var Title = /** @class */ (function (_super) {
|
|
20
|
-
__extends(Title, _super);
|
|
21
|
-
function Title() {
|
|
22
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
-
_this.type = 'title';
|
|
24
|
-
_this.renderType = RenderTypes.HTML;
|
|
25
|
-
return _this;
|
|
26
|
-
}
|
|
27
|
-
Title.prototype.render = function () {
|
|
28
|
-
var svg = this.getComponentContainer();
|
|
29
|
-
var title = Tools.getProperty(this.getOptions(), 'title');
|
|
30
|
-
var text = svg.selectAll('p.title').data([title]);
|
|
31
|
-
text.enter()
|
|
32
|
-
.append('p')
|
|
33
|
-
.classed('title', true)
|
|
34
|
-
.attr('role', 'heading')
|
|
35
|
-
.attr('aria-level', 2)
|
|
36
|
-
.merge(text)
|
|
37
|
-
.html(function (d) { return d; });
|
|
38
|
-
// check if title needs truncation (and tooltip support)
|
|
39
|
-
if (text.node() && text.node().offsetWidth < text.node().scrollWidth) {
|
|
40
|
-
// add events for displaying the tooltip with the title
|
|
41
|
-
var self_1 = this;
|
|
42
|
-
text.on('mouseover', function (event) {
|
|
43
|
-
self_1.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
44
|
-
event: event,
|
|
45
|
-
hoveredElement: text,
|
|
46
|
-
content: text.text(),
|
|
47
|
-
});
|
|
48
|
-
})
|
|
49
|
-
.on('mousemove', function (event) {
|
|
50
|
-
self_1.services.events.dispatchEvent(Events.Tooltip.MOVE, {
|
|
51
|
-
event: event,
|
|
52
|
-
});
|
|
53
|
-
})
|
|
54
|
-
.on('mouseout', function () {
|
|
55
|
-
self_1.services.events.dispatchEvent(Events.Tooltip.HIDE);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
text.exit().remove();
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Truncates title creating ellipses and attaching tooltip for exposing full title.
|
|
62
|
-
*/
|
|
63
|
-
Title.prototype.truncateTitle = function (title, maxWidth) {
|
|
64
|
-
// sanity check to prevent stack overflow on binary search
|
|
65
|
-
if (maxWidth <= 0) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
var untruncatedTitle = title.text();
|
|
69
|
-
// check if the title is too big for the containing svg
|
|
70
|
-
if (title.node().getComputedTextLength() > maxWidth) {
|
|
71
|
-
// append the ellipses to their own tspan to calculate the text length
|
|
72
|
-
title.append('tspan').text('...');
|
|
73
|
-
// get the bounding width including the elipses '...'
|
|
74
|
-
var tspanLength = DOMUtils.appendOrSelect(title, 'tspan')
|
|
75
|
-
.node()
|
|
76
|
-
.getComputedTextLength();
|
|
77
|
-
// with elipses
|
|
78
|
-
var titleString = title.text();
|
|
79
|
-
// get the index for creating the max length substring that fit within the svg
|
|
80
|
-
// use one less than the index to avoid crowding (the elipsis)
|
|
81
|
-
var substringIndex = this.getSubstringIndex(title.node(), 0, titleString.length - 1, maxWidth - tspanLength);
|
|
82
|
-
// use the substring as the title
|
|
83
|
-
title
|
|
84
|
-
.html(titleString.substring(0, substringIndex - 1))
|
|
85
|
-
.append('tspan')
|
|
86
|
-
.text('...');
|
|
87
|
-
// add events for displaying the tooltip with the title
|
|
88
|
-
var self_2 = this;
|
|
89
|
-
title
|
|
90
|
-
.on('mouseover', function (event) {
|
|
91
|
-
self_2.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
92
|
-
event: event,
|
|
93
|
-
hoveredElement: title,
|
|
94
|
-
content: untruncatedTitle,
|
|
95
|
-
});
|
|
96
|
-
})
|
|
97
|
-
.on('mousemove', function (event) {
|
|
98
|
-
self_2.services.events.dispatchEvent(Events.Tooltip.MOVE, {
|
|
99
|
-
event: event,
|
|
100
|
-
});
|
|
101
|
-
})
|
|
102
|
-
.on('mouseout', function () {
|
|
103
|
-
self_2.services.events.dispatchEvent(Events.Tooltip.HIDE);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
// computes the maximum space a title can take
|
|
108
|
-
Title.prototype.getMaxTitleWidth = function () {
|
|
109
|
-
return DOMUtils.getSVGElementSize(this.parent.node(), {
|
|
110
|
-
useAttrs: true,
|
|
111
|
-
}).width;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Returns the index for a maximum length substring that is less than the width parameter.
|
|
115
|
-
* @param title the title node used for getting the text lengths of substrings
|
|
116
|
-
* @param start the start index for the binary search
|
|
117
|
-
* @param end the end index for the binary search
|
|
118
|
-
* @param width the width of the svg container that holds the title
|
|
119
|
-
*/
|
|
120
|
-
Title.prototype.getSubstringIndex = function (title, start, end, width) {
|
|
121
|
-
var mid = Math.floor((end + start) / 2);
|
|
122
|
-
if (title.getSubStringLength(0, mid) > width) {
|
|
123
|
-
return this.getSubstringIndex(title, start, mid, width);
|
|
124
|
-
}
|
|
125
|
-
else if (title.getSubStringLength(0, mid) < width) {
|
|
126
|
-
if (title.getSubStringLength(0, mid + 1) > width) {
|
|
127
|
-
return mid;
|
|
128
|
-
}
|
|
129
|
-
return this.getSubstringIndex(title, mid, end, width);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
return mid;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
return Title;
|
|
136
|
-
}(Component));
|
|
137
|
-
export { Title };
|
|
138
|
-
//# sourceMappingURL=../../../src/components/essentials/title.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"title.js","sourceRoot":"","sources":["title.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAErC;IAA2B,yBAAS;IAApC;QAAA,qEAgIC;QA/HA,UAAI,GAAG,OAAO,CAAC;QACf,gBAAU,GAAG,WAAW,CAAC,IAAI,CAAC;;IA8H/B,CAAC;IA5HA,sBAAM,GAAN;QACC,IAAM,GAAG,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACzC,IAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,KAAK,EAAE;aACV,MAAM,CAAC,GAAG,CAAC;aACX,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;aACtB,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC;aACvB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;aACrB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC;QAEjB,wDAAwD;QACxD,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACrE,uDAAuD;YACvD,IAAM,MAAI,GAAG,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AC;IACV,CAAC;IAED;;;;;;OAMG;IACO,iCAAiB,GAA3B,UAA4B,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK;QACnD,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1C,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,EAAE;YAC7C,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;SACxD;aAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,EAAE;YACpD,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE;gBACjD,OAAO,GAAG,CAAC;aACX;YACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;SACtD;aAAM;YACN,OAAO,GAAG,CAAC;SACX;IACF,CAAC;IACF,YAAC;AAAD,CAAC,AAhID,CAA2B,SAAS,GAgInC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport { DOMUtils } from '../../services';\nimport { Events, RenderTypes } from './../../interfaces';\nimport * as Tools from '../../tools';\n\nexport class Title extends Component {\n\ttype = 'title';\n\trenderType = RenderTypes.HTML;\n\n\trender() {\n\t\tconst svg = this.getComponentContainer();\n\t\tconst title = Tools.getProperty(this.getOptions(), 'title');\n\n\t\tconst text = svg.selectAll('p.title').data([title]);\n\n\t\ttext.enter()\n\t\t\t.append('p')\n\t\t\t.classed('title', true)\n\t\t\t.attr('role', 'heading')\n\t\t\t.attr('aria-level', 2)\n\t\t\t.merge(text)\n\t\t\t.html((d) => d);\n\n\t\t// check if title needs truncation (and tooltip support)\n\t\tif (text.node() && text.node().offsetWidth < text.node().scrollWidth) {\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this;\n\t\t\ttext.on('mouseover', function (event) {\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\tevent,\n\t\t\t\t\thoveredElement: text,\n\t\t\t\t\tcontent: text.text(),\n\t\t\t\t});\n\t\t\t})\n\t\t\t\t.on('mousemove', function (event) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE);\n\t\t\t\t});\n\t\t}\n\n\t\ttext.exit().remove();\n\t}\n\n\t/**\n\t * Truncates title creating ellipses and attaching tooltip for exposing full title.\n\t */\n\ttruncateTitle(title, maxWidth) {\n\t\t// sanity check to prevent stack overflow on binary search\n\t\tif (maxWidth <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst untruncatedTitle = title.text();\n\t\t// check if the title is too big for the containing svg\n\t\tif (title.node().getComputedTextLength() > maxWidth) {\n\t\t\t// append the ellipses to their own tspan to calculate the text length\n\t\t\ttitle.append('tspan').text('...');\n\n\t\t\t// get the bounding width including the elipses '...'\n\t\t\tconst tspanLength = DOMUtils.appendOrSelect(title, 'tspan')\n\t\t\t\t.node()\n\t\t\t\t.getComputedTextLength();\n\n\t\t\t// with elipses\n\t\t\tconst titleString = title.text();\n\n\t\t\t// get the index for creating the max length substring that fit within the svg\n\t\t\t// use one less than the index to avoid crowding (the elipsis)\n\t\t\tconst substringIndex = this.getSubstringIndex(\n\t\t\t\ttitle.node(),\n\t\t\t\t0,\n\t\t\t\ttitleString.length - 1,\n\t\t\t\tmaxWidth - tspanLength\n\t\t\t);\n\n\t\t\t// use the substring as the title\n\t\t\ttitle\n\t\t\t\t.html(titleString.substring(0, substringIndex - 1))\n\t\t\t\t.append('tspan')\n\t\t\t\t.text('...');\n\n\t\t\t// add events for displaying the tooltip with the title\n\t\t\tconst self = this;\n\t\t\ttitle\n\t\t\t\t.on('mouseover', function (event) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\thoveredElement: title,\n\t\t\t\t\t\tcontent: untruncatedTitle,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.on('mousemove', function (event) {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.on('mouseout', function () {\n\t\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE);\n\t\t\t\t});\n\t\t}\n\t}\n\n\t// computes the maximum space a title can take\n\tprotected getMaxTitleWidth() {\n\t\treturn DOMUtils.getSVGElementSize(this.parent.node(), {\n\t\t\tuseAttrs: true,\n\t\t}).width;\n\t}\n\n\t/**\n\t * Returns the index for a maximum length substring that is less than the width parameter.\n\t * @param title the title node used for getting the text lengths of substrings\n\t * @param start the start index for the binary search\n\t * @param end the end index for the binary search\n\t * @param width the width of the svg container that holds the title\n\t */\n\tprotected getSubstringIndex(title, start, end, width) {\n\t\tconst mid = Math.floor((end + start) / 2);\n\t\tif (title.getSubStringLength(0, mid) > width) {\n\t\t\treturn this.getSubstringIndex(title, start, mid, width);\n\t\t} else if (title.getSubStringLength(0, mid) < width) {\n\t\t\tif (title.getSubStringLength(0, mid + 1) > width) {\n\t\t\t\treturn mid;\n\t\t\t}\n\t\t\treturn this.getSubstringIndex(title, mid, end, width);\n\t\t} else {\n\t\t\treturn mid;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
15
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
16
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
17
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
18
|
-
r[k] = a[j];
|
|
19
|
-
return r;
|
|
20
|
-
};
|
|
21
|
-
import { Tooltip } from './tooltip';
|
|
22
|
-
import { ColorClassNameTypes } from '../../interfaces';
|
|
23
|
-
import * as Tools from '../../tools';
|
|
24
|
-
import { get } from 'lodash-es';
|
|
25
|
-
var AxisChartsTooltip = /** @class */ (function (_super) {
|
|
26
|
-
__extends(AxisChartsTooltip, _super);
|
|
27
|
-
function AxisChartsTooltip() {
|
|
28
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
-
}
|
|
30
|
-
AxisChartsTooltip.prototype.getItems = function (e) {
|
|
31
|
-
var _this = this;
|
|
32
|
-
if (e.detail.items) {
|
|
33
|
-
return e.detail.items;
|
|
34
|
-
}
|
|
35
|
-
var data = e.detail.data;
|
|
36
|
-
if (!Array.isArray(data) || !data.length || !data[0]) {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
var options = this.getOptions();
|
|
40
|
-
var cartesianScales = this.services.cartesianScales;
|
|
41
|
-
var domainIdentifier = cartesianScales.getDomainIdentifier();
|
|
42
|
-
var dualAxes = cartesianScales.isDualAxes();
|
|
43
|
-
// Generate default tooltip
|
|
44
|
-
var groupMapsTo = options.data.groupMapsTo;
|
|
45
|
-
var domainLabel = cartesianScales.getDomainLabel();
|
|
46
|
-
var rangeLabel = cartesianScales.getRangeLabel();
|
|
47
|
-
var domainValue = data[0][domainIdentifier];
|
|
48
|
-
var items;
|
|
49
|
-
if (data.length === 1) {
|
|
50
|
-
var datum = data[0];
|
|
51
|
-
var rangeIdentifier = cartesianScales.getRangeIdentifier(datum);
|
|
52
|
-
if (dualAxes) {
|
|
53
|
-
var position = cartesianScales.getRangeAxisPosition({
|
|
54
|
-
datum: datum,
|
|
55
|
-
groups: [datum[groupMapsTo]],
|
|
56
|
-
});
|
|
57
|
-
rangeLabel = cartesianScales.getScaleLabel(position);
|
|
58
|
-
}
|
|
59
|
-
var value = datum[rangeIdentifier];
|
|
60
|
-
items = __spreadArrays([
|
|
61
|
-
{
|
|
62
|
-
label: domainLabel,
|
|
63
|
-
value: domainValue,
|
|
64
|
-
}
|
|
65
|
-
], (Array.isArray(value) && value.length === 2
|
|
66
|
-
? [
|
|
67
|
-
{
|
|
68
|
-
label: 'Start',
|
|
69
|
-
value: value[0],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: 'End',
|
|
73
|
-
value: value[1],
|
|
74
|
-
},
|
|
75
|
-
]
|
|
76
|
-
: [
|
|
77
|
-
{
|
|
78
|
-
label: rangeLabel,
|
|
79
|
-
value: datum[rangeIdentifier],
|
|
80
|
-
},
|
|
81
|
-
]));
|
|
82
|
-
if (e.detail.additionalItems) {
|
|
83
|
-
e.detail.additionalItems.forEach(function (additionalItem) {
|
|
84
|
-
return items.push({
|
|
85
|
-
label: additionalItem.label,
|
|
86
|
-
value: additionalItem.value,
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
items.push({
|
|
91
|
-
label: options.tooltip.groupLabel,
|
|
92
|
-
value: datum[groupMapsTo],
|
|
93
|
-
color: this.model.getFillColor(datum[groupMapsTo]),
|
|
94
|
-
class: this.model.getColorClassName({
|
|
95
|
-
classNameTypes: [ColorClassNameTypes.TOOLTIP],
|
|
96
|
-
dataGroupName: datum[groupMapsTo],
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
else if (data.length > 1) {
|
|
101
|
-
items = [
|
|
102
|
-
{
|
|
103
|
-
label: domainLabel,
|
|
104
|
-
value: domainValue,
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
items = items.concat(data
|
|
108
|
-
.map(function (datum) {
|
|
109
|
-
// Format value if is array
|
|
110
|
-
var value = datum[cartesianScales.getRangeIdentifier(datum)];
|
|
111
|
-
return {
|
|
112
|
-
label: datum[groupMapsTo],
|
|
113
|
-
value: Array.isArray(value) && value.length === 2
|
|
114
|
-
? value[0] + " - " + value[1]
|
|
115
|
-
: value,
|
|
116
|
-
color: _this.model.getFillColor(datum[groupMapsTo]),
|
|
117
|
-
class: _this.model.getColorClassName({
|
|
118
|
-
classNameTypes: [ColorClassNameTypes.TOOLTIP],
|
|
119
|
-
dataGroupName: datum[groupMapsTo],
|
|
120
|
-
}),
|
|
121
|
-
};
|
|
122
|
-
})
|
|
123
|
-
.sort(function (a, b) { return b.value - a.value; }));
|
|
124
|
-
if (!dualAxes &&
|
|
125
|
-
Tools.getProperty(options, 'tooltip', 'showTotal') === true) {
|
|
126
|
-
// use the primary/only range id
|
|
127
|
-
var rangeIdentifier_1 = cartesianScales.getRangeIdentifier();
|
|
128
|
-
items.push({
|
|
129
|
-
label: get(options, 'tooltip.totalLabel') || 'Total',
|
|
130
|
-
value: data.reduce(function (accumulator, datum) {
|
|
131
|
-
return accumulator + datum[rangeIdentifier_1];
|
|
132
|
-
}, 0),
|
|
133
|
-
bold: true,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return items;
|
|
138
|
-
};
|
|
139
|
-
return AxisChartsTooltip;
|
|
140
|
-
}(Tooltip));
|
|
141
|
-
export { AxisChartsTooltip };
|
|
142
|
-
//# sourceMappingURL=../../../src/components/essentials/tooltip-axis.js.map
|