@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.9
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 +9 -12
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
|
-
import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
2
|
import { createComponent } from "@semcore/core";
|
|
9
3
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
@@ -12,89 +6,78 @@ import React from "react";
|
|
|
12
6
|
import CompactHorizontalBar from "../../CompactHorizontalBar.mjs";
|
|
13
7
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
14
8
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return _callSuper(this, CompactHorizontalBarChartComponent2, arguments);
|
|
9
|
+
class CompactHorizontalBarChartComponent extends AbstractChart {
|
|
10
|
+
get xScale() {
|
|
11
|
+
return this.asProps.xScale ?? this.valueScale;
|
|
19
12
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
}, {
|
|
52
|
-
key: "renderCompactHorizontalBarTooltip",
|
|
53
|
-
value: function renderCompactHorizontalBarTooltip() {
|
|
54
|
-
var _this$asProps2 = this.asProps, data = _this$asProps2.data, x = _this$asProps2.x, y = _this$asProps2.y, showTooltip = _this$asProps2.showTooltip;
|
|
55
|
-
if (!showTooltip) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip, {
|
|
59
|
-
wMin: 100
|
|
60
|
-
}, function(_ref) {
|
|
61
|
-
var index = _ref.index;
|
|
62
|
-
return {
|
|
63
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip.Title, null, data[index][y]), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip.Dot, null, data[index][x]))
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "renderTooltip",
|
|
69
|
-
value: function renderTooltip() {
|
|
13
|
+
get yScale() {
|
|
14
|
+
return this.asProps.yScale ?? this.categoryScale;
|
|
15
|
+
}
|
|
16
|
+
defaultLegendProps() {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
renderChart() {
|
|
20
|
+
const {
|
|
21
|
+
x,
|
|
22
|
+
y,
|
|
23
|
+
onClickHoverRect,
|
|
24
|
+
onClickBar
|
|
25
|
+
} = this.asProps;
|
|
26
|
+
return /* @__PURE__ */ React.createElement(CompactHorizontalBar, {
|
|
27
|
+
x,
|
|
28
|
+
y
|
|
29
|
+
}, this.renderCompactHorizontalBarTooltip(), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Hover, {
|
|
30
|
+
onClick: onClickHoverRect
|
|
31
|
+
}), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Annotation, null, /* @__PURE__ */ React.createElement(CompactHorizontalBar.Label, null), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Percent, null), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Value, null)), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Bar, {
|
|
32
|
+
onClick: onClickBar
|
|
33
|
+
}, /* @__PURE__ */ React.createElement(CompactHorizontalBar.Bar.Background, null), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Bar.Fill, null)));
|
|
34
|
+
}
|
|
35
|
+
renderCompactHorizontalBarTooltip() {
|
|
36
|
+
const {
|
|
37
|
+
data,
|
|
38
|
+
x,
|
|
39
|
+
y,
|
|
40
|
+
showTooltip
|
|
41
|
+
} = this.asProps;
|
|
42
|
+
if (!showTooltip) {
|
|
70
43
|
return null;
|
|
71
44
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
45
|
+
return /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip, {
|
|
46
|
+
wMin: 100
|
|
47
|
+
}, ({
|
|
48
|
+
index
|
|
49
|
+
}) => {
|
|
50
|
+
return {
|
|
51
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip.Title, null, data[index][y]), /* @__PURE__ */ React.createElement(CompactHorizontalBar.Tooltip.Dot, null, data[index][x]))
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
renderTooltip() {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
getLegendAriaLabel() {
|
|
59
|
+
return this.asProps.getI18nText("legendForChart", {
|
|
60
|
+
chartType: "CompactHorizontalBar"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
get categoryScale() {
|
|
64
|
+
const {
|
|
65
|
+
marginY = 40,
|
|
66
|
+
plotHeight,
|
|
67
|
+
data,
|
|
68
|
+
y
|
|
69
|
+
} = this.asProps;
|
|
70
|
+
return scaleBand().range([plotHeight - marginY, marginY]).domain([...data].reverse().map((d) => d[y])).paddingInner(0.6).paddingOuter(0.2);
|
|
71
|
+
}
|
|
72
|
+
get valueScale() {
|
|
73
|
+
const {
|
|
74
|
+
marginY = 0,
|
|
75
|
+
plotWidth
|
|
76
|
+
} = this.asProps;
|
|
77
|
+
const sum = [...super.flatValues.values()].reduce((acc, d) => acc + d, 0);
|
|
78
|
+
return scaleLinear().range([marginY, plotWidth]).domain([marginY, sum]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
98
81
|
_defineProperty(CompactHorizontalBarChartComponent, "displayName", "Chart.CompactHorizontalBar");
|
|
99
82
|
_defineProperty(CompactHorizontalBarChartComponent, "defaultProps", {
|
|
100
83
|
direction: "column",
|
|
@@ -104,7 +87,7 @@ _defineProperty(CompactHorizontalBarChartComponent, "defaultProps", {
|
|
|
104
87
|
showLegend: false
|
|
105
88
|
});
|
|
106
89
|
_defineProperty(CompactHorizontalBarChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
107
|
-
|
|
90
|
+
const CompactHorizontalBarChart = createComponent(CompactHorizontalBarChartComponent);
|
|
108
91
|
export {
|
|
109
92
|
CompactHorizontalBarChart
|
|
110
93
|
};
|
|
@@ -1,99 +1,89 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import { Flex } from "@semcore/base-components";
|
|
6
3
|
import { createComponent } from "@semcore/core";
|
|
7
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
8
|
-
import { Flex } from "@semcore/flex-box";
|
|
9
5
|
import { Text } from "@semcore/typography";
|
|
10
6
|
import { scaleLinear } from "d3-scale";
|
|
11
7
|
import React from "react";
|
|
12
8
|
import Donut from "../../Donut.mjs";
|
|
13
9
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
14
10
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
key: "xScale",
|
|
23
|
-
get: function get() {
|
|
24
|
-
var xScale = this.asProps.xScale;
|
|
25
|
-
if (xScale) {
|
|
26
|
-
return xScale;
|
|
27
|
-
}
|
|
28
|
-
return scaleLinear();
|
|
11
|
+
class DonutChartComponent extends AbstractChart {
|
|
12
|
+
get xScale() {
|
|
13
|
+
const {
|
|
14
|
+
xScale
|
|
15
|
+
} = this.asProps;
|
|
16
|
+
if (xScale) {
|
|
17
|
+
return xScale;
|
|
29
18
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
19
|
+
return scaleLinear();
|
|
20
|
+
}
|
|
21
|
+
get yScale() {
|
|
22
|
+
const {
|
|
23
|
+
yScale
|
|
24
|
+
} = this.asProps;
|
|
25
|
+
if (yScale) {
|
|
26
|
+
return yScale;
|
|
38
27
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
return scaleLinear();
|
|
29
|
+
}
|
|
30
|
+
defaultLegendProps() {
|
|
31
|
+
return {
|
|
32
|
+
legendType: "Table"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
renderChart() {
|
|
36
|
+
const {
|
|
37
|
+
innerRadius,
|
|
38
|
+
halfsize,
|
|
39
|
+
innerLabel,
|
|
40
|
+
onClickPie
|
|
41
|
+
} = this.asProps;
|
|
42
|
+
const {
|
|
43
|
+
dataDefinitions,
|
|
44
|
+
highlightedLine
|
|
45
|
+
} = this.state;
|
|
46
|
+
const checkedLegendItems = dataDefinitions.filter((item) => item.checked);
|
|
47
|
+
return /* @__PURE__ */ React.createElement(Donut, {
|
|
48
|
+
onClick: onClickPie,
|
|
49
|
+
halfsize,
|
|
50
|
+
innerRadius
|
|
51
|
+
}, checkedLegendItems.length === 0 && /* @__PURE__ */ React.createElement(Donut.EmptyData, null), checkedLegendItems.map((item, index) => {
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Donut.Pie, {
|
|
53
|
+
key: item.id,
|
|
54
|
+
dataKey: item.id,
|
|
55
|
+
name: item.label,
|
|
56
|
+
color: item.color,
|
|
57
|
+
active: highlightedLine === index
|
|
58
|
+
});
|
|
59
|
+
}), innerLabel && /* @__PURE__ */ React.createElement(Donut.Label, null, innerLabel));
|
|
60
|
+
}
|
|
61
|
+
renderTooltip() {
|
|
62
|
+
const {
|
|
63
|
+
data
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const {
|
|
66
|
+
dataDefinitions
|
|
67
|
+
} = this.state;
|
|
68
|
+
return /* @__PURE__ */ React.createElement(Donut.Tooltip, null, ({
|
|
69
|
+
dataKey
|
|
70
|
+
}) => {
|
|
71
|
+
const title = dataDefinitions.find((item) => item.id === dataKey);
|
|
42
72
|
return {
|
|
43
|
-
|
|
73
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Donut.Tooltip.Title, null, (title == null ? void 0 : title.label) || dataKey), /* @__PURE__ */ React.createElement(Flex, {
|
|
74
|
+
justifyContent: "space-between"
|
|
75
|
+
}, /* @__PURE__ */ React.createElement(Text, {
|
|
76
|
+
bold: true
|
|
77
|
+
}, this.tooltipValueFormatter(data[dataKey]))))
|
|
44
78
|
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
return /* @__PURE__ */ React.createElement(Donut, {
|
|
55
|
-
onClick: onClickPie,
|
|
56
|
-
halfsize,
|
|
57
|
-
innerRadius
|
|
58
|
-
}, checkedLegendItems.length === 0 && /* @__PURE__ */ React.createElement(Donut.EmptyData, null), checkedLegendItems.map(function(item, index) {
|
|
59
|
-
return /* @__PURE__ */ React.createElement(Donut.Pie, {
|
|
60
|
-
key: item.id,
|
|
61
|
-
dataKey: item.id,
|
|
62
|
-
name: item.label,
|
|
63
|
-
color: item.color,
|
|
64
|
-
active: highlightedLine === index
|
|
65
|
-
});
|
|
66
|
-
}), innerLabel && /* @__PURE__ */ React.createElement(Donut.Label, null, innerLabel));
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "renderTooltip",
|
|
70
|
-
value: function renderTooltip() {
|
|
71
|
-
var _this = this;
|
|
72
|
-
var data = this.asProps.data;
|
|
73
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
74
|
-
return /* @__PURE__ */ React.createElement(Donut.Tooltip, null, function(_ref) {
|
|
75
|
-
var dataKey = _ref.dataKey;
|
|
76
|
-
var title = dataDefinitions.find(function(item) {
|
|
77
|
-
return item.id === dataKey;
|
|
78
|
-
});
|
|
79
|
-
return {
|
|
80
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Donut.Tooltip.Title, null, (title === null || title === void 0 ? void 0 : title.label) || dataKey), /* @__PURE__ */ React.createElement(Flex, {
|
|
81
|
-
justifyContent: "space-between"
|
|
82
|
-
}, /* @__PURE__ */ React.createElement(Text, {
|
|
83
|
-
bold: true
|
|
84
|
-
}, _this.tooltipValueFormatter(data[dataKey]))))
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
key: "getLegendAriaLabel",
|
|
90
|
-
value: function getLegendAriaLabel() {
|
|
91
|
-
return this.asProps.getI18nText("legendForChart", {
|
|
92
|
-
chartType: "Donut"
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}]);
|
|
96
|
-
})(AbstractChart);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getLegendAriaLabel() {
|
|
82
|
+
return this.asProps.getI18nText("legendForChart", {
|
|
83
|
+
chartType: "Donut"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
97
87
|
_defineProperty(DonutChartComponent, "displayName", "Chart.Donut");
|
|
98
88
|
_defineProperty(DonutChartComponent, "defaultProps", {
|
|
99
89
|
direction: "row-reverse",
|
|
@@ -103,7 +93,7 @@ _defineProperty(DonutChartComponent, "defaultProps", {
|
|
|
103
93
|
marginY: 0
|
|
104
94
|
});
|
|
105
95
|
_defineProperty(DonutChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
106
|
-
|
|
96
|
+
const DonutChart = createComponent(DonutChartComponent);
|
|
107
97
|
export {
|
|
108
98
|
DonutChart
|
|
109
99
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
-
import _superPropGet from "@babel/runtime/helpers/esm/superPropGet";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
3
|
import { createComponent } from "@semcore/core";
|
|
10
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
@@ -16,126 +10,136 @@ import { HoverRect } from "../../Hover.mjs";
|
|
|
16
10
|
import { minMax } from "../../utils.mjs";
|
|
17
11
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
18
12
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var range = invertAxis ? [plotHeight - marginX, this.plotPadding] : [marginY, plotWidth - this.plotPadding];
|
|
34
|
-
if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
|
|
35
|
-
var _domain = minMax(data, groupKey);
|
|
36
|
-
return scaleTime(_domain, range);
|
|
37
|
-
}
|
|
38
|
-
var domain = data.map(function(item) {
|
|
39
|
-
return item[groupKey];
|
|
40
|
-
});
|
|
41
|
-
return scaleBand(domain, range).paddingInner(0.05).paddingOuter(0.2);
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
key: "yScale",
|
|
45
|
-
get: function get() {
|
|
46
|
-
var _this$asProps2 = this.asProps, yScale = _this$asProps2.yScale, _this$asProps2$margin = _this$asProps2.marginY, marginY = _this$asProps2$margin === void 0 ? 30 : _this$asProps2$margin, _this$asProps2$margin2 = _this$asProps2.marginX, marginX = _this$asProps2$margin2 === void 0 ? 30 : _this$asProps2$margin2, plotHeight = _this$asProps2.plotHeight, plotWidth = _this$asProps2.plotWidth, invertAxis = _this$asProps2.invertAxis, data = _this$asProps2.data;
|
|
47
|
-
var max;
|
|
48
|
-
if (this.isStack) {
|
|
49
|
-
max = data.reduce(function(max2, item) {
|
|
50
|
-
var barSum = Object.values(item).reduce(function(sum, val) {
|
|
51
|
-
if (val instanceof Date && !Number.isNaN(val.getMilliseconds())) {
|
|
52
|
-
return sum + val.getMilliseconds();
|
|
53
|
-
}
|
|
54
|
-
return sum + val;
|
|
55
|
-
}, 0);
|
|
56
|
-
if (barSum > max2) {
|
|
57
|
-
max2 = barSum;
|
|
58
|
-
}
|
|
59
|
-
return max2;
|
|
60
|
-
}, 0);
|
|
61
|
-
} else {
|
|
62
|
-
var flatValues = _superPropGet(HistogramChartComponent2, "flatValues", this, 1);
|
|
63
|
-
max = Math.max.apply(Math, _toConsumableArray(flatValues));
|
|
64
|
-
}
|
|
65
|
-
return yScale !== null && yScale !== void 0 ? yScale : scaleLinear().range(invertAxis ? [marginY, plotWidth - this.plotPadding] : [plotHeight - marginX, this.plotPadding]).domain([0, max]);
|
|
13
|
+
class HistogramChartComponent extends AbstractChart {
|
|
14
|
+
get xScale() {
|
|
15
|
+
const {
|
|
16
|
+
xScale,
|
|
17
|
+
marginY = 30,
|
|
18
|
+
marginX = 30,
|
|
19
|
+
plotWidth,
|
|
20
|
+
plotHeight,
|
|
21
|
+
invertAxis,
|
|
22
|
+
data,
|
|
23
|
+
groupKey
|
|
24
|
+
} = this.asProps;
|
|
25
|
+
if (xScale) {
|
|
26
|
+
return xScale;
|
|
66
27
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return
|
|
28
|
+
const testItem = data[0][groupKey];
|
|
29
|
+
const range = invertAxis ? [plotHeight - marginX, this.plotPadding] : [marginY, plotWidth - this.plotPadding];
|
|
30
|
+
if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
|
|
31
|
+
const domain2 = minMax(data, groupKey);
|
|
32
|
+
return scaleTime(domain2, range);
|
|
72
33
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
34
|
+
const domain = data.map((item) => item[groupKey]);
|
|
35
|
+
return scaleBand(domain, range).paddingInner(0.05).paddingOuter(0.2);
|
|
36
|
+
}
|
|
37
|
+
get yScale() {
|
|
38
|
+
const {
|
|
39
|
+
yScale,
|
|
40
|
+
marginY = 30,
|
|
41
|
+
marginX = 30,
|
|
42
|
+
plotHeight,
|
|
43
|
+
plotWidth,
|
|
44
|
+
invertAxis,
|
|
45
|
+
data
|
|
46
|
+
} = this.asProps;
|
|
47
|
+
let max;
|
|
48
|
+
if (this.isStack) {
|
|
49
|
+
max = data.reduce((max2, item) => {
|
|
50
|
+
const barSum = Object.values(item).reduce((sum, val) => {
|
|
51
|
+
if (val instanceof Date && !Number.isNaN(val.getMilliseconds())) {
|
|
52
|
+
return sum + val.getMilliseconds();
|
|
92
53
|
}
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
color: item.color
|
|
104
|
-
});
|
|
54
|
+
return sum + val;
|
|
55
|
+
}, 0);
|
|
56
|
+
if (barSum > max2) {
|
|
57
|
+
max2 = barSum;
|
|
58
|
+
}
|
|
59
|
+
return max2;
|
|
60
|
+
}, 0);
|
|
61
|
+
} else {
|
|
62
|
+
const flatValues = super.flatValues;
|
|
63
|
+
max = Math.max(...flatValues);
|
|
105
64
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
65
|
+
return yScale ?? scaleLinear().range(invertAxis ? [marginY, plotWidth - this.plotPadding] : [plotHeight - marginX, this.plotPadding]).domain([0, max]);
|
|
66
|
+
}
|
|
67
|
+
get isStack() {
|
|
68
|
+
const {
|
|
69
|
+
dataDefinitions
|
|
70
|
+
} = this.state;
|
|
71
|
+
return dataDefinitions.length > 1;
|
|
72
|
+
}
|
|
73
|
+
renderChart() {
|
|
74
|
+
const {
|
|
75
|
+
groupKey,
|
|
76
|
+
invertAxis
|
|
77
|
+
} = this.asProps;
|
|
78
|
+
const {
|
|
79
|
+
dataDefinitions,
|
|
80
|
+
highlightedLine
|
|
81
|
+
} = this.state;
|
|
82
|
+
if (this.isStack) {
|
|
83
|
+
return /* @__PURE__ */ React.createElement(StackBar, {
|
|
112
84
|
x: invertAxis ? void 0 : groupKey,
|
|
113
|
-
y: invertAxis ? groupKey : void 0
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
children: _this.getTooltipChildren({
|
|
121
|
-
Tooltip: HoverRect.Tooltip,
|
|
122
|
-
dataItem
|
|
123
|
-
})
|
|
85
|
+
y: invertAxis ? groupKey : void 0
|
|
86
|
+
}, dataDefinitions.map((item2, index) => {
|
|
87
|
+
const BarComponent = invertAxis ? StackBar.HorizontalBar : StackBar.Bar;
|
|
88
|
+
const commonBarComponentProps = {
|
|
89
|
+
color: item2.color,
|
|
90
|
+
transparent: highlightedLine !== -1 && highlightedLine !== index
|
|
124
91
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
92
|
+
if (invertAxis) {
|
|
93
|
+
commonBarComponentProps.x = item2.id;
|
|
94
|
+
} else {
|
|
95
|
+
commonBarComponentProps.y = item2.id;
|
|
96
|
+
}
|
|
97
|
+
return item2.checked && /* @__PURE__ */ React.createElement(BarComponent, _extends({
|
|
98
|
+
key: item2.id
|
|
99
|
+
}, commonBarComponentProps));
|
|
100
|
+
}));
|
|
133
101
|
}
|
|
134
|
-
|
|
135
|
-
|
|
102
|
+
const item = dataDefinitions[0];
|
|
103
|
+
return item.checked && /* @__PURE__ */ React.createElement(Bar, {
|
|
104
|
+
x: invertAxis ? item.id : groupKey,
|
|
105
|
+
y: invertAxis ? groupKey : item.id,
|
|
106
|
+
key: item.id,
|
|
107
|
+
color: item.color
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
renderTooltip() {
|
|
111
|
+
const {
|
|
112
|
+
data,
|
|
113
|
+
groupKey,
|
|
114
|
+
invertAxis
|
|
115
|
+
} = this.asProps;
|
|
116
|
+
return /* @__PURE__ */ React.createElement(HoverRect.Tooltip, {
|
|
117
|
+
x: invertAxis ? void 0 : groupKey,
|
|
118
|
+
y: invertAxis ? groupKey : void 0,
|
|
119
|
+
wMin: 100
|
|
120
|
+
}, ({
|
|
121
|
+
xIndex,
|
|
122
|
+
yIndex
|
|
123
|
+
}) => {
|
|
124
|
+
const index = invertAxis ? yIndex : xIndex;
|
|
125
|
+
const dataItem = data[index];
|
|
126
|
+
return {
|
|
127
|
+
children: this.getTooltipChildren({
|
|
128
|
+
Tooltip: HoverRect.Tooltip,
|
|
129
|
+
dataItem
|
|
130
|
+
})
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
getLegendAriaLabel() {
|
|
135
|
+
return this.asProps.getI18nText("legendForChart", {
|
|
136
|
+
chartType: "Histogram"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
136
140
|
_defineProperty(HistogramChartComponent, "displayName", "Chart.Histogram");
|
|
137
141
|
_defineProperty(HistogramChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
138
|
-
|
|
142
|
+
const HistogramChart = createComponent(HistogramChartComponent);
|
|
139
143
|
export {
|
|
140
144
|
HistogramChart
|
|
141
145
|
};
|