@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8
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 +10 -0
- package/lib/cjs/AnimatedClipPath.js +28 -41
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +187 -223
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +248 -327
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +162 -185
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +219 -248
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +448 -482
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +349 -396
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -86
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +78 -93
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +149 -167
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +178 -207
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +182 -222
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +124 -126
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +100 -126
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +576 -681
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +518 -571
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +147 -178
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +64 -82
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +169 -199
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +135 -177
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +60 -73
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +193 -208
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +182 -217
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -97
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +97 -91
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +17 -23
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +16 -16
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +72 -75
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +354 -525
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +5 -5
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +12 -19
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +164 -203
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +7 -6
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/module/de.json +2 -2
- package/lib/cjs/a11y/translations/module/en.json +2 -2
- package/lib/cjs/a11y/translations/module/es.json +2 -2
- package/lib/cjs/a11y/translations/module/fr.json +2 -2
- package/lib/cjs/a11y/translations/module/it.json +2 -2
- package/lib/cjs/a11y/translations/module/ja.json +2 -2
- package/lib/cjs/a11y/translations/module/ko.json +2 -2
- package/lib/cjs/a11y/translations/module/nl.json +2 -2
- package/lib/cjs/a11y/translations/module/pl.json +2 -2
- package/lib/cjs/a11y/translations/module/pt.json +2 -2
- package/lib/cjs/a11y/translations/module/sv.json +2 -2
- package/lib/cjs/a11y/translations/module/tr.json +2 -2
- package/lib/cjs/a11y/translations/module/vi.json +2 -2
- package/lib/cjs/a11y/translations/module/zh.json +2 -2
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +1 -1
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +421 -466
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +97 -115
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +229 -216
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +114 -136
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +80 -95
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +126 -148
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +95 -113
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +84 -110
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +103 -122
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +2 -2
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/index.js +4 -4
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +7 -7
- package/lib/cjs/component/SvgElement.js.map +1 -1
- package/lib/cjs/createElement.js +66 -65
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/style/axis.shadow.css +3 -0
- package/lib/cjs/style/plot.shadow.css +1 -3
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +13 -26
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +80 -80
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +122 -145
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +24 -37
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +179 -215
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +242 -321
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +154 -177
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +206 -235
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +433 -467
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +337 -384
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +60 -79
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +74 -89
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +141 -159
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +174 -203
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +173 -213
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +68 -74
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +95 -121
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +554 -659
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +500 -553
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +140 -171
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +58 -76
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +161 -191
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +130 -172
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +56 -69
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +183 -198
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +169 -204
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +35 -95
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +89 -84
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js +16 -23
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +15 -16
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +67 -73
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +353 -524
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js +4 -5
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +11 -18
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +162 -203
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js +6 -6
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/module/de.json +2 -2
- package/lib/es6/a11y/translations/module/en.json +2 -2
- package/lib/es6/a11y/translations/module/es.json +2 -2
- package/lib/es6/a11y/translations/module/fr.json +2 -2
- package/lib/es6/a11y/translations/module/it.json +2 -2
- package/lib/es6/a11y/translations/module/ja.json +2 -2
- package/lib/es6/a11y/translations/module/ko.json +2 -2
- package/lib/es6/a11y/translations/module/nl.json +2 -2
- package/lib/es6/a11y/translations/module/pl.json +2 -2
- package/lib/es6/a11y/translations/module/pt.json +2 -2
- package/lib/es6/a11y/translations/module/sv.json +2 -2
- package/lib/es6/a11y/translations/module/tr.json +2 -2
- package/lib/es6/a11y/translations/module/vi.json +2 -2
- package/lib/es6/a11y/translations/module/zh.json +2 -2
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/color.js +1 -1
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +416 -462
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +92 -111
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +225 -213
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +109 -132
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +276 -301
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +74 -90
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +121 -144
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +90 -109
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +80 -107
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +97 -117
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +108 -122
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/SvgElement.js +4 -5
- package/lib/es6/component/SvgElement.js.map +1 -1
- package/lib/es6/createElement.js +55 -54
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -0
- package/lib/es6/style/plot.shadow.css +1 -3
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +13 -26
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/es6/utils.js +105 -144
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +24 -36
- package/lib/esm/Area.mjs +178 -149
- package/lib/esm/Axis.mjs +241 -242
- package/lib/esm/Bar.mjs +155 -137
- package/lib/esm/Bubble.mjs +205 -171
- package/lib/esm/CompactHorizontalBar.mjs +428 -383
- package/lib/esm/Donut.mjs +315 -266
- package/lib/esm/Dots.mjs +60 -49
- package/lib/esm/GroupBar.mjs +71 -75
- package/lib/esm/HorizontalBar.mjs +142 -120
- package/lib/esm/Hover.mjs +173 -163
- package/lib/esm/Line.mjs +174 -145
- package/lib/esm/Pattern.mjs +67 -63
- package/lib/esm/Plot.mjs +98 -95
- package/lib/esm/Radar.mjs +550 -498
- package/lib/esm/RadialTree.mjs +512 -416
- package/lib/esm/Reference.mjs +137 -122
- package/lib/esm/ResponsiveContainer.mjs +58 -69
- package/lib/esm/ScatterPlot.mjs +163 -162
- package/lib/esm/StackBar.mjs +126 -147
- package/lib/esm/StackedArea.mjs +53 -61
- package/lib/esm/Tooltip.mjs +185 -175
- package/lib/esm/Venn.mjs +170 -170
- package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
- package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
- package/lib/esm/a11y/PlotA11yView.mjs +99 -74
- package/lib/esm/a11y/bezier.mjs +16 -23
- package/lib/esm/a11y/focus.mjs +15 -16
- package/lib/esm/a11y/hints.mjs +65 -71
- package/lib/esm/a11y/insights.mjs +347 -495
- package/lib/esm/a11y/intl.mjs +4 -5
- package/lib/esm/a11y/locale.mjs +12 -14
- package/lib/esm/a11y/serialize.mjs +139 -152
- package/lib/esm/a11y/summarize.mjs +3 -3
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/color.mjs +1 -1
- package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
- package/lib/esm/component/Chart/AreaChart.mjs +92 -91
- package/lib/esm/component/Chart/BarChart.mjs +225 -177
- package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
- package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
- package/lib/esm/component/Chart/DonutChart.mjs +74 -84
- package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
- package/lib/esm/component/Chart/LineChart.mjs +90 -89
- package/lib/esm/component/Chart/RadarChart.mjs +81 -97
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
- package/lib/esm/component/Chart/VennChart.mjs +98 -111
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
- package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
- package/lib/esm/component/SvgElement.mjs +4 -4
- package/lib/esm/createElement.mjs +54 -37
- package/lib/esm/style/axis.shadow.css +3 -0
- package/lib/esm/style/plot.shadow.css +1 -3
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +13 -26
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils.mjs +103 -138
- package/lib/types/Axis.d.ts +4 -0
- package/lib/types/CompactHorizontalBar.d.ts +1 -1
- package/lib/types/Hover.d.ts +1 -1
- package/lib/types/Line.d.ts +1 -1
- package/lib/types/Plot.d.ts +1 -1
- package/lib/types/Radar.d.ts +1 -1
- package/lib/types/ResponsiveContainer.d.ts +1 -1
- package/lib/types/Tooltip.d.ts +1 -3
- package/lib/types/Venn.d.ts +1 -1
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +12 -1
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
- package/lib/types/utils.d.ts +10 -10
- package/package.json +11 -14
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
6
|
-
import _superPropGet from "@babel/runtime/helpers/superPropGet";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
2
|
import { assignProps as _assignProps4 } from "@semcore/core";
|
|
10
3
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
11
4
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
12
5
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
6
|
+
import { Box, Flex } from '@semcore/base-components';
|
|
13
7
|
import { createComponent, Root, sstyled } from '@semcore/core';
|
|
14
8
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
15
9
|
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
16
10
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
17
11
|
import Divider from '@semcore/divider';
|
|
18
|
-
import { Flex, Box } from '@semcore/flex-box';
|
|
19
12
|
import { Text } from '@semcore/typography';
|
|
20
13
|
import { scaleBand, scaleLinear } from 'd3-scale';
|
|
21
14
|
import React from 'react';
|
|
@@ -27,258 +20,229 @@ import AnimatedClipPath from '../../AnimatedClipPath';
|
|
|
27
20
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
28
21
|
import { interpolateValue, scaleToBand } from '../../utils';
|
|
29
22
|
import Cigarette from '../Cigarette/Cigarette';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
args[_key] = arguments[_key];
|
|
37
|
-
}
|
|
38
|
-
_this = _callSuper(this, CigaretteChartComponent, [].concat(args));
|
|
39
|
-
_defineProperty(_this, "plotPadding", 0);
|
|
40
|
-
_defineProperty(_this, "offset", 0);
|
|
41
|
-
return _this;
|
|
23
|
+
const wMin = 2;
|
|
24
|
+
class CigaretteChartComponent extends AbstractChart {
|
|
25
|
+
constructor(...args) {
|
|
26
|
+
super(...args);
|
|
27
|
+
_defineProperty(this, "plotPadding", 0);
|
|
28
|
+
_defineProperty(this, "offset", 0);
|
|
42
29
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
30
|
+
resolveColor(id, index) {
|
|
31
|
+
return this.props.colorMap?.[id] ?? `blue-${5 - index}00`;
|
|
32
|
+
}
|
|
33
|
+
getDefaultDataDefinitions() {
|
|
34
|
+
const dataDefinitions = super.getDefaultDataDefinitions();
|
|
35
|
+
return dataDefinitions.map(dataDef => {
|
|
36
|
+
dataDef.columns = dataDef.columns.slice(1);
|
|
37
|
+
return dataDef;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
defaultLegendProps() {
|
|
41
|
+
return {
|
|
42
|
+
legendType: 'Table',
|
|
43
|
+
w: 'fit-content'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
get xScale() {
|
|
47
|
+
const {
|
|
48
|
+
invertAxis
|
|
49
|
+
} = this.asProps;
|
|
50
|
+
return invertAxis ? this.valueScale : this.categoryScale;
|
|
51
|
+
}
|
|
52
|
+
get yScale() {
|
|
53
|
+
const {
|
|
54
|
+
invertAxis
|
|
55
|
+
} = this.asProps;
|
|
56
|
+
return invertAxis ? this.categoryScale : this.valueScale;
|
|
57
|
+
}
|
|
58
|
+
renderChart() {
|
|
59
|
+
const {
|
|
60
|
+
invertAxis,
|
|
61
|
+
data,
|
|
62
|
+
uid,
|
|
63
|
+
duration,
|
|
64
|
+
patterns,
|
|
65
|
+
plotHeight,
|
|
66
|
+
plotWidth,
|
|
67
|
+
onClick
|
|
68
|
+
} = this.asProps;
|
|
69
|
+
const {
|
|
70
|
+
dataDefinitions,
|
|
71
|
+
highlightedLine
|
|
72
|
+
} = this.state;
|
|
73
|
+
this.offset = 0;
|
|
74
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (invertAxis ? dataDefinitions : [...dataDefinitions].reverse()).map((item, index) => {
|
|
75
|
+
const value = data[item.id];
|
|
76
|
+
if (!item.checked || value === interpolateValue || value === null) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const absWidth = Math.abs(this.valueScale(value) - Math.max(this.valueScale(this.valueScale.domain()[0]), this.valueScale(0)));
|
|
80
|
+
const height = scaleToBand(this.categoryScale).bandwidth() - 4;
|
|
81
|
+
const width = value === 0 ? 0 : Math.max(absWidth, wMin * 2) - wMin;
|
|
82
|
+
const y = 2;
|
|
83
|
+
const x = index === 0 ? 0 : this.offset;
|
|
84
|
+
const r = height < 28 ? 2 : 4;
|
|
85
|
+
this.offset = this.offset + width + wMin;
|
|
86
|
+
return /*#__PURE__*/React.createElement(Cigarette, {
|
|
87
|
+
key: item.id,
|
|
88
|
+
dataKey: item.id,
|
|
89
|
+
index: index,
|
|
90
|
+
y: invertAxis ? y : x,
|
|
91
|
+
x: invertAxis ? x : y,
|
|
92
|
+
width: invertAxis ? width : height,
|
|
93
|
+
height: invertAxis ? height : width,
|
|
94
|
+
uid: uid,
|
|
95
|
+
hide: !item.checked,
|
|
96
|
+
duration: duration,
|
|
97
|
+
r: index === 0 || index === dataDefinitions.length - 1 ? r : 0,
|
|
98
|
+
color: item.color,
|
|
99
|
+
patterns: patterns,
|
|
100
|
+
direction: invertAxis ? 'horizontal' : 'vertical',
|
|
101
|
+
onClick: onClick,
|
|
102
|
+
hovered: highlightedLine === index ? true : highlightedLine === -1 ? undefined : false
|
|
57
103
|
});
|
|
104
|
+
}), /*#__PURE__*/React.createElement(AnimatedClipPath, {
|
|
105
|
+
"aria-hidden": true,
|
|
106
|
+
duration: duration,
|
|
107
|
+
id: uid,
|
|
108
|
+
x: "0",
|
|
109
|
+
y: "0",
|
|
110
|
+
width: invertAxis ? 0 : plotWidth,
|
|
111
|
+
height: invertAxis ? plotHeight : 0
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
renderTooltip() {
|
|
115
|
+
var _ref = this.asProps;
|
|
116
|
+
const {
|
|
117
|
+
data,
|
|
118
|
+
invertAxis,
|
|
119
|
+
tooltipTitle,
|
|
120
|
+
tooltipViewType,
|
|
121
|
+
showPercentValueInTooltip,
|
|
122
|
+
styles,
|
|
123
|
+
showTooltip
|
|
124
|
+
} = this.asProps;
|
|
125
|
+
const {
|
|
126
|
+
dataDefinitions
|
|
127
|
+
} = this.state;
|
|
128
|
+
const STooltipChildrenWrapper = Box;
|
|
129
|
+
if (!showTooltip) {
|
|
130
|
+
return null;
|
|
58
131
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "yScale",
|
|
75
|
-
get: function get() {
|
|
76
|
-
var invertAxis = this.asProps.invertAxis;
|
|
77
|
-
return invertAxis ? this.categoryScale : this.valueScale;
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "renderChart",
|
|
81
|
-
value: function renderChart() {
|
|
82
|
-
var _this2 = this;
|
|
83
|
-
var _this$asProps = this.asProps,
|
|
84
|
-
invertAxis = _this$asProps.invertAxis,
|
|
85
|
-
data = _this$asProps.data,
|
|
86
|
-
uid = _this$asProps.uid,
|
|
87
|
-
duration = _this$asProps.duration,
|
|
88
|
-
patterns = _this$asProps.patterns,
|
|
89
|
-
plotHeight = _this$asProps.plotHeight,
|
|
90
|
-
plotWidth = _this$asProps.plotWidth,
|
|
91
|
-
onClick = _this$asProps.onClick;
|
|
92
|
-
var _this$state = this.state,
|
|
93
|
-
dataDefinitions = _this$state.dataDefinitions,
|
|
94
|
-
highlightedLine = _this$state.highlightedLine;
|
|
95
|
-
this.offset = 0;
|
|
96
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, (invertAxis ? dataDefinitions : _toConsumableArray(dataDefinitions).reverse()).map(function (item, index) {
|
|
97
|
-
var value = data[item.id];
|
|
98
|
-
if (!item.checked || value === interpolateValue || value === null) {
|
|
132
|
+
return /*#__PURE__*/React.createElement(HoverRect.Tooltip, {
|
|
133
|
+
x: invertAxis ? '' : undefined,
|
|
134
|
+
y: invertAxis ? undefined : '',
|
|
135
|
+
wMin: 100,
|
|
136
|
+
hideHoverLine: true
|
|
137
|
+
}, tooltipProps => {
|
|
138
|
+
var _ref4;
|
|
139
|
+
const dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;
|
|
140
|
+
const showPercentColumn = showPercentValueInTooltip && this.totalValue(data) !== 0;
|
|
141
|
+
if (tooltipViewType === 'single') {
|
|
142
|
+
var _ref3;
|
|
143
|
+
const item = dataDefinitions.find(dataDefItem => dataDefItem.id === dataKey);
|
|
144
|
+
if (!item) {
|
|
99
145
|
return null;
|
|
100
146
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var y = 2;
|
|
105
|
-
var x = index === 0 ? 0 : _this2.offset;
|
|
106
|
-
var r = height < 28 ? 2 : 4;
|
|
107
|
-
_this2.offset = _this2.offset + width + wMin;
|
|
108
|
-
return /*#__PURE__*/React.createElement(Cigarette, {
|
|
109
|
-
key: item.id,
|
|
110
|
-
dataKey: item.id,
|
|
111
|
-
index: index,
|
|
112
|
-
y: invertAxis ? y : x,
|
|
113
|
-
x: invertAxis ? x : y,
|
|
114
|
-
width: invertAxis ? width : height,
|
|
115
|
-
height: invertAxis ? height : width,
|
|
116
|
-
uid: uid,
|
|
117
|
-
hide: !item.checked,
|
|
118
|
-
duration: duration,
|
|
119
|
-
r: index === 0 || index === dataDefinitions.length - 1 ? r : 0,
|
|
120
|
-
color: item.color,
|
|
121
|
-
patterns: patterns,
|
|
122
|
-
direction: invertAxis ? 'horizontal' : 'vertical',
|
|
123
|
-
onClick: onClick,
|
|
124
|
-
hovered: highlightedLine === index ? true : highlightedLine === -1 ? undefined : false
|
|
125
|
-
});
|
|
126
|
-
}), /*#__PURE__*/React.createElement(AnimatedClipPath, {
|
|
127
|
-
"aria-hidden": true,
|
|
128
|
-
duration: duration,
|
|
129
|
-
id: uid,
|
|
130
|
-
x: "0",
|
|
131
|
-
y: "0",
|
|
132
|
-
width: invertAxis ? 0 : plotWidth,
|
|
133
|
-
height: invertAxis ? plotHeight : 0
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
key: "renderTooltip",
|
|
138
|
-
value: function renderTooltip() {
|
|
139
|
-
var _ref = this.asProps,
|
|
140
|
-
_this3 = this;
|
|
141
|
-
var _this$asProps2 = this.asProps,
|
|
142
|
-
data = _this$asProps2.data,
|
|
143
|
-
invertAxis = _this$asProps2.invertAxis,
|
|
144
|
-
tooltipTitle = _this$asProps2.tooltipTitle,
|
|
145
|
-
tooltipViewType = _this$asProps2.tooltipViewType,
|
|
146
|
-
showPercentValueInTooltip = _this$asProps2.showPercentValueInTooltip,
|
|
147
|
-
styles = _this$asProps2.styles,
|
|
148
|
-
showTooltip = _this$asProps2.showTooltip;
|
|
149
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
150
|
-
var STooltipChildrenWrapper = Box;
|
|
151
|
-
if (!showTooltip) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
return /*#__PURE__*/React.createElement(HoverRect.Tooltip, {
|
|
155
|
-
x: invertAxis ? '' : undefined,
|
|
156
|
-
y: invertAxis ? undefined : '',
|
|
157
|
-
wMin: 100,
|
|
158
|
-
hideHoverLine: true
|
|
159
|
-
}, function (tooltipProps) {
|
|
160
|
-
var _ref4;
|
|
161
|
-
var dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;
|
|
162
|
-
var showPercentColumn = showPercentValueInTooltip && _this3.totalValue(data) !== 0;
|
|
163
|
-
if (tooltipViewType === 'single') {
|
|
164
|
-
var _ref3;
|
|
165
|
-
var item = dataDefinitions.find(function (dataDefItem) {
|
|
166
|
-
return dataDefItem.id === dataKey;
|
|
167
|
-
});
|
|
168
|
-
if (!item) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
children: (_ref3 = sstyled(styles), /*#__PURE__*/React.createElement(STooltipChildrenWrapper, _ref3.cn("STooltipChildrenWrapper", _objectSpread({}, _assignProps({
|
|
147
|
+
return {
|
|
148
|
+
children: (_ref3 = sstyled(styles), /*#__PURE__*/React.createElement(STooltipChildrenWrapper, _ref3.cn("STooltipChildrenWrapper", {
|
|
149
|
+
..._assignProps({
|
|
173
150
|
"columnsCount": showPercentColumn ? '3' : '2',
|
|
174
151
|
"__excludeProps": ['data']
|
|
175
|
-
}, _ref)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
children: (_ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Flex, _ref4.cn("Flex", {
|
|
189
|
-
"direction": 'column'
|
|
190
|
-
}), tooltipTitle && /*#__PURE__*/React.createElement(HoverRect.Tooltip.Title, null, "Some tooltip title"), /*#__PURE__*/React.createElement(STooltipChildrenWrapper, _ref4.cn("STooltipChildrenWrapper", _objectSpread({}, _assignProps2({
|
|
191
|
-
"columnsCount": showPercentColumn ? '3' : '2',
|
|
192
|
-
"__excludeProps": ['data']
|
|
193
|
-
}, _ref))), dataDefinitions.map(function (item) {
|
|
194
|
-
var style = {
|
|
195
|
-
opacity: item.id === dataKey ? 1 : 0.3
|
|
196
|
-
};
|
|
197
|
-
return item.checked && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
198
|
-
key: item.id
|
|
199
|
-
}, /*#__PURE__*/React.createElement(HoverRect.Tooltip.Dot, {
|
|
200
|
-
mr: 2,
|
|
201
|
-
color: item.color,
|
|
202
|
-
style: style
|
|
203
|
-
}, item.label), showPercentColumn && /*#__PURE__*/React.createElement(Text, {
|
|
204
|
-
textAlign: "end",
|
|
205
|
-
color: "text-secondary",
|
|
206
|
-
style: style
|
|
207
|
-
}, _this3.percentValue(data, item.id)), /*#__PURE__*/React.createElement(Text, {
|
|
208
|
-
textAlign: "end",
|
|
209
|
-
bold: true,
|
|
210
|
-
style: style
|
|
211
|
-
}, _this3.tooltipValueFormatter(data[item.id])));
|
|
212
|
-
}), _this3.renderTooltipTotalLine(data))))
|
|
152
|
+
}, _ref)
|
|
153
|
+
}), /*#__PURE__*/React.createElement(HoverRect.Tooltip.Dot, {
|
|
154
|
+
mr: 2,
|
|
155
|
+
color: item.color
|
|
156
|
+
}, item.label), showPercentColumn && /*#__PURE__*/React.createElement(Text, _ref3.cn("Text", {
|
|
157
|
+
"textAlign": 'end',
|
|
158
|
+
"color": 'text-secondary'
|
|
159
|
+
}), this.percentValue(data, item.id)), /*#__PURE__*/React.createElement(Text, _ref3.cn("Text", {
|
|
160
|
+
"textAlign": 'end',
|
|
161
|
+
"bold": true
|
|
162
|
+
}), this.tooltipValueFormatter(data[item.id]))))
|
|
213
163
|
};
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "renderTooltipTotalLine",
|
|
218
|
-
value: function renderTooltipTotalLine(dataItem) {
|
|
219
|
-
var _this$asProps3 = this.asProps,
|
|
220
|
-
showTotalInTooltip = _this$asProps3.showTotalInTooltip,
|
|
221
|
-
showPercentValueInTooltip = _this$asProps3.showPercentValueInTooltip;
|
|
222
|
-
if (!showTotalInTooltip) {
|
|
223
|
-
return null;
|
|
224
164
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
165
|
+
return {
|
|
166
|
+
children: (_ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Flex, _ref4.cn("Flex", {
|
|
167
|
+
"direction": 'column'
|
|
168
|
+
}), tooltipTitle && /*#__PURE__*/React.createElement(HoverRect.Tooltip.Title, null, "Some tooltip title"), /*#__PURE__*/React.createElement(STooltipChildrenWrapper, _ref4.cn("STooltipChildrenWrapper", {
|
|
169
|
+
..._assignProps2({
|
|
170
|
+
"columnsCount": showPercentColumn ? '3' : '2',
|
|
171
|
+
"__excludeProps": ['data']
|
|
172
|
+
}, _ref)
|
|
173
|
+
}), dataDefinitions.map(item => {
|
|
174
|
+
const style = {
|
|
175
|
+
opacity: item.id === dataKey ? 1 : 0.3
|
|
176
|
+
};
|
|
177
|
+
return item.checked && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
178
|
+
key: item.id
|
|
179
|
+
}, /*#__PURE__*/React.createElement(HoverRect.Tooltip.Dot, {
|
|
180
|
+
mr: 2,
|
|
181
|
+
color: item.color,
|
|
182
|
+
style: style
|
|
183
|
+
}, item.label), showPercentColumn && /*#__PURE__*/React.createElement(Text, {
|
|
184
|
+
textAlign: "end",
|
|
185
|
+
color: "text-secondary",
|
|
186
|
+
style: style
|
|
187
|
+
}, this.percentValue(data, item.id)), /*#__PURE__*/React.createElement(Text, {
|
|
188
|
+
textAlign: "end",
|
|
189
|
+
bold: true,
|
|
190
|
+
style: style
|
|
191
|
+
}, this.tooltipValueFormatter(data[item.id])));
|
|
192
|
+
}), this.renderTooltipTotalLine(data))))
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
renderTooltipTotalLine(dataItem) {
|
|
197
|
+
const {
|
|
198
|
+
showTotalInTooltip,
|
|
199
|
+
showPercentValueInTooltip
|
|
200
|
+
} = this.asProps;
|
|
201
|
+
if (!showTotalInTooltip) {
|
|
202
|
+
return null;
|
|
244
203
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
204
|
+
const total = this.totalValue(dataItem);
|
|
205
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
206
|
+
mt: 2,
|
|
207
|
+
mr: 2
|
|
208
|
+
}, "Total"), showPercentValueInTooltip && total !== 0 && /*#__PURE__*/React.createElement(Text, {
|
|
209
|
+
mt: 2,
|
|
210
|
+
textAlign: "end",
|
|
211
|
+
color: "text-secondary"
|
|
212
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : '100%'), /*#__PURE__*/React.createElement(Text, {
|
|
213
|
+
mt: 2,
|
|
214
|
+
textAlign: "end",
|
|
215
|
+
bold: true
|
|
216
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : total));
|
|
217
|
+
}
|
|
218
|
+
renderHeader() {
|
|
219
|
+
return this.asProps.header ?? null;
|
|
220
|
+
}
|
|
221
|
+
render() {
|
|
222
|
+
var _ref2 = this.asProps,
|
|
223
|
+
_ref6;
|
|
224
|
+
const SChart = Flex;
|
|
225
|
+
const {
|
|
226
|
+
styles,
|
|
227
|
+
plotWidth,
|
|
228
|
+
plotHeight,
|
|
229
|
+
data,
|
|
230
|
+
patterns,
|
|
231
|
+
invertAxis,
|
|
232
|
+
a11yAltTextConfig
|
|
233
|
+
} = this.asProps;
|
|
234
|
+
const header = this.renderHeader();
|
|
235
|
+
if (invertAxis) {
|
|
236
|
+
var _ref5;
|
|
237
|
+
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SChart, _ref5.cn("SChart", {
|
|
238
|
+
..._assignProps3({
|
|
263
239
|
"gap": 6,
|
|
264
240
|
"direction": 'column',
|
|
265
241
|
"__excludeProps": ['onClick', 'data']
|
|
266
|
-
}, _ref2)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
"scale": [this.xScale, this.yScale],
|
|
271
|
-
"width": plotWidth,
|
|
272
|
-
"height": plotHeight,
|
|
273
|
-
"dataHints": this.dataHints,
|
|
274
|
-
"patterns": patterns,
|
|
275
|
-
"a11yAltTextConfig": a11yAltTextConfig
|
|
276
|
-
}), this.renderTooltip(), this.renderChart())), this.renderLegend());
|
|
277
|
-
}
|
|
278
|
-
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SChart, _ref6.cn("SChart", _objectSpread({}, _assignProps4({
|
|
279
|
-
"gap": 6,
|
|
280
|
-
"__excludeProps": ['onClick', 'data']
|
|
281
|
-
}, _ref2))), /*#__PURE__*/React.createElement(Plot, _ref6.cn("Plot", {
|
|
242
|
+
}, _ref2)
|
|
243
|
+
}), /*#__PURE__*/React.createElement(Flex, _ref5.cn("Flex", {
|
|
244
|
+
"direction": 'column'
|
|
245
|
+
}), header, /*#__PURE__*/React.createElement(Plot, _ref5.cn("Plot", {
|
|
282
246
|
"data": data,
|
|
283
247
|
"scale": [this.xScale, this.yScale],
|
|
284
248
|
"width": plotWidth,
|
|
@@ -286,61 +250,72 @@ var CigaretteChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
286
250
|
"dataHints": this.dataHints,
|
|
287
251
|
"patterns": patterns,
|
|
288
252
|
"a11yAltTextConfig": a11yAltTextConfig
|
|
289
|
-
}), this.renderTooltip(), this.renderChart()),
|
|
290
|
-
"direction": 'column',
|
|
291
|
-
"gap": 2
|
|
292
|
-
}), header && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, _ref6.cn("Box", {}), header), /*#__PURE__*/React.createElement(Divider, _ref6.cn("Divider", {}))), this.renderLegend()));
|
|
293
|
-
}
|
|
294
|
-
}, {
|
|
295
|
-
key: "getLegendAriaLabel",
|
|
296
|
-
value: function getLegendAriaLabel() {
|
|
297
|
-
return this.asProps.getI18nText('legendForChart', {
|
|
298
|
-
chartType: 'Cigarette'
|
|
299
|
-
});
|
|
253
|
+
}), this.renderTooltip(), this.renderChart())), this.renderLegend());
|
|
300
254
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
}
|
|
255
|
+
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SChart, _ref6.cn("SChart", {
|
|
256
|
+
..._assignProps4({
|
|
257
|
+
"gap": 6,
|
|
258
|
+
"__excludeProps": ['onClick', 'data']
|
|
259
|
+
}, _ref2)
|
|
260
|
+
}), /*#__PURE__*/React.createElement(Plot, _ref6.cn("Plot", {
|
|
261
|
+
"data": data,
|
|
262
|
+
"scale": [this.xScale, this.yScale],
|
|
263
|
+
"width": plotWidth,
|
|
264
|
+
"height": plotHeight,
|
|
265
|
+
"dataHints": this.dataHints,
|
|
266
|
+
"patterns": patterns,
|
|
267
|
+
"a11yAltTextConfig": a11yAltTextConfig
|
|
268
|
+
}), this.renderTooltip(), this.renderChart()), /*#__PURE__*/React.createElement(Flex, _ref6.cn("Flex", {
|
|
269
|
+
"direction": 'column',
|
|
270
|
+
"gap": 2
|
|
271
|
+
}), header && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, _ref6.cn("Box", {}), header), /*#__PURE__*/React.createElement(Divider, _ref6.cn("Divider", {}))), this.renderLegend()));
|
|
272
|
+
}
|
|
273
|
+
getLegendAriaLabel() {
|
|
274
|
+
return this.asProps.getI18nText('legendForChart', {
|
|
275
|
+
chartType: 'Cigarette'
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
get selectedData() {
|
|
279
|
+
const {
|
|
280
|
+
data
|
|
281
|
+
} = this.asProps;
|
|
282
|
+
const {
|
|
283
|
+
dataDefinitions
|
|
284
|
+
} = this.state;
|
|
285
|
+
const result = new Map();
|
|
286
|
+
dataDefinitions.forEach(dataDefItem => {
|
|
287
|
+
const value = data[dataDefItem.id];
|
|
288
|
+
if (dataDefItem.checked && value !== interpolateValue) {
|
|
289
|
+
result.set(dataDefItem.id, value);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
get categoryScale() {
|
|
295
|
+
const {
|
|
296
|
+
plotWidth,
|
|
297
|
+
plotHeight,
|
|
298
|
+
invertAxis
|
|
299
|
+
} = this.asProps;
|
|
300
|
+
const range = invertAxis ? [plotHeight, 0] : [0, plotWidth];
|
|
301
|
+
return scaleBand([0], range);
|
|
302
|
+
}
|
|
303
|
+
get valueScale() {
|
|
304
|
+
const {
|
|
305
|
+
plotWidth,
|
|
306
|
+
plotHeight,
|
|
307
|
+
invertAxis
|
|
308
|
+
} = this.asProps;
|
|
309
|
+
let max = 0;
|
|
310
|
+
this.selectedData.forEach(value => {
|
|
311
|
+
max = max + value;
|
|
312
|
+
});
|
|
313
|
+
return scaleLinear().range(invertAxis ? [0, plotWidth] : [plotHeight, 0]).domain([0, max]);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
340
316
|
_defineProperty(CigaretteChartComponent, "displayName", 'Cigarette.Bar');
|
|
341
|
-
_defineProperty(CigaretteChartComponent, "defaultProps",
|
|
342
|
-
|
|
343
|
-
var invertAxis = (_props$invertAxis = props.invertAxis) !== null && _props$invertAxis !== void 0 ? _props$invertAxis : true;
|
|
317
|
+
_defineProperty(CigaretteChartComponent, "defaultProps", props => {
|
|
318
|
+
const invertAxis = props.invertAxis ?? true;
|
|
344
319
|
return {
|
|
345
320
|
invertAxis: invertAxis,
|
|
346
321
|
showXAxis: false,
|
|
@@ -356,5 +331,5 @@ _defineProperty(CigaretteChartComponent, "defaultProps", function (props) {
|
|
|
356
331
|
};
|
|
357
332
|
});
|
|
358
333
|
_defineProperty(CigaretteChartComponent, "enhance", [resolveColorEnhance(), uniqueIDEnhancement(), i18nEnhance(localizedMessages)]);
|
|
359
|
-
export
|
|
334
|
+
export const CigaretteChart = createComponent(CigaretteChartComponent);
|
|
360
335
|
//# sourceMappingURL=CigaretteChart.js.map
|