@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,24 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
7
|
+
exports.default = exports.MIN_WIDTH = void 0;
|
|
15
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
9
|
var _core = require("@semcore/core");
|
|
10
|
+
var _baseComponents = require("@semcore/base-components");
|
|
17
11
|
var _assignProps5 = require("@semcore/core/lib/utils/assignProps");
|
|
18
12
|
var _canUseDOM = _interopRequireDefault(require("@semcore/core/lib/utils/canUseDOM"));
|
|
19
13
|
var _rafTrottle = _interopRequireDefault(require("@semcore/core/lib/utils/rafTrottle"));
|
|
20
14
|
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
21
|
-
var _flexBox = require("@semcore/flex-box");
|
|
22
15
|
var _react = _interopRequireDefault(require("react"));
|
|
23
16
|
var _AnimatedClipPath = _interopRequireDefault(require("./AnimatedClipPath"));
|
|
24
17
|
var _createElement = _interopRequireDefault(require("./createElement"));
|
|
@@ -26,279 +19,247 @@ var _Pattern = require("./Pattern");
|
|
|
26
19
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
27
20
|
var _utils = require("./utils");
|
|
28
21
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
29
|
-
|
|
22
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBar_1j50a_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1j50a);transition-timing-function:ease-in-out}.___SBar_1j50a_gg_.__color_1j50a_gg_{fill:var(--color_1j50a)}.___SBar_1j50a_gg_.__pattern_1j50a_gg_.__color_1j50a_gg_{fill:var(--pattern_1j50a);stroke:var(--color_1j50a);stroke-width:1px}.___SBar_1j50a_gg_.__hide_1j50a_gg_{display:none}.___SBar_1j50a_gg_.__transparent_1j50a_gg_{opacity:.3}.___SBackground_1j50a_gg_.__onClick_1j50a_gg_,.___SBar_1j50a_gg_.__onClick_1j50a_gg_{cursor:pointer}.___SBackground_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1j50a_gg_{display:flex;justify-content:space-between}.___SBarLabel_1j50a_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1j50a_gg_,.___SBarPercent_1j50a_gg_,.___SBarValue_1j50a_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1j50a_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1j50a_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}", /*__inner_css_end__*/"1j50a_gg_"),
|
|
30
23
|
/*__reshadow_css_end__*/
|
|
31
24
|
{
|
|
32
|
-
"__SBar": "
|
|
33
|
-
"--duration": "--
|
|
34
|
-
"_color": "
|
|
35
|
-
"--color": "--
|
|
36
|
-
"_pattern": "
|
|
37
|
-
"--pattern": "--
|
|
38
|
-
"_hide": "
|
|
39
|
-
"_transparent": "
|
|
40
|
-
"_onClick": "
|
|
41
|
-
"__SBackground": "
|
|
42
|
-
"__SBarAnnotation": "
|
|
43
|
-
"__SBarLabel": "
|
|
44
|
-
"__SBarPercent": "
|
|
45
|
-
"__SBarValue": "
|
|
46
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
25
|
+
"__SBar": "___SBar_1j50a_gg_",
|
|
26
|
+
"--duration": "--duration_1j50a",
|
|
27
|
+
"_color": "__color_1j50a_gg_",
|
|
28
|
+
"--color": "--color_1j50a",
|
|
29
|
+
"_pattern": "__pattern_1j50a_gg_",
|
|
30
|
+
"--pattern": "--pattern_1j50a",
|
|
31
|
+
"_hide": "__hide_1j50a_gg_",
|
|
32
|
+
"_transparent": "__transparent_1j50a_gg_",
|
|
33
|
+
"_onClick": "__onClick_1j50a_gg_",
|
|
34
|
+
"__SBackground": "___SBackground_1j50a_gg_",
|
|
35
|
+
"__SBarAnnotation": "___SBarAnnotation_1j50a_gg_",
|
|
36
|
+
"__SBarLabel": "___SBarLabel_1j50a_gg_",
|
|
37
|
+
"__SBarPercent": "___SBarPercent_1j50a_gg_",
|
|
38
|
+
"__SBarValue": "___SBarValue_1j50a_gg_",
|
|
39
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1j50a_gg_"
|
|
47
40
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(0,
|
|
55
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
-
args[_key] = arguments[_key];
|
|
57
|
-
}
|
|
58
|
-
_this = (0, _callSuper2["default"])(this, CompactHorizontalBarRoot, [].concat(args));
|
|
59
|
-
(0, _defineProperty2["default"])(_this, "state", {
|
|
41
|
+
const MIN_WIDTH = exports.MIN_WIDTH = 4;
|
|
42
|
+
const barHeight = 20;
|
|
43
|
+
const hoverOffset = 6;
|
|
44
|
+
class CompactHorizontalBarRoot extends _core.Component {
|
|
45
|
+
constructor(...args) {
|
|
46
|
+
super(...args);
|
|
47
|
+
(0, _defineProperty2.default)(this, "state", {
|
|
60
48
|
indexToHover: null
|
|
61
49
|
});
|
|
62
|
-
(0, _defineProperty2
|
|
63
|
-
(0, _defineProperty2
|
|
64
|
-
(0, _defineProperty2
|
|
65
|
-
(0, _defineProperty2
|
|
66
|
-
return _this;
|
|
50
|
+
(0, _defineProperty2.default)(this, "percentFormatter", null);
|
|
51
|
+
(0, _defineProperty2.default)(this, "percentFormatterLocale", null);
|
|
52
|
+
(0, _defineProperty2.default)(this, "valueFormatter", null);
|
|
53
|
+
(0, _defineProperty2.default)(this, "valueFormatterLocale", null);
|
|
67
54
|
}
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "getPercentFormatter",
|
|
148
|
-
value: function getPercentFormatter() {
|
|
149
|
-
if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {
|
|
150
|
-
this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, {
|
|
151
|
-
style: 'percent'
|
|
152
|
-
});
|
|
153
|
-
this.percentFormatterLocale = this.asProps.locale;
|
|
154
|
-
}
|
|
155
|
-
return this.percentFormatter;
|
|
156
|
-
}
|
|
157
|
-
}, {
|
|
158
|
-
key: "getValueFormatter",
|
|
159
|
-
value: function getValueFormatter() {
|
|
160
|
-
if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
|
|
161
|
-
this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
|
|
162
|
-
this.valueFormatterLocale = this.asProps.locale;
|
|
163
|
-
}
|
|
164
|
-
return this.valueFormatter;
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "getPercentProps",
|
|
168
|
-
value: function getPercentProps(_props, index) {
|
|
169
|
-
var _this$asProps5 = this.asProps,
|
|
170
|
-
data = _this$asProps5.data,
|
|
171
|
-
x = _this$asProps5.x,
|
|
172
|
-
scale = _this$asProps5.scale;
|
|
173
|
-
var value = data[index][x];
|
|
174
|
-
var domain = scale[0].domain();
|
|
175
|
-
var percent = value / domain[1];
|
|
176
|
-
var formatter = this.getPercentFormatter();
|
|
177
|
-
var formatted = formatter.format(percent);
|
|
178
|
-
return {
|
|
179
|
-
children: formatted,
|
|
180
|
-
formatted: formatted,
|
|
181
|
-
percent: percent
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
key: "getValueProps",
|
|
186
|
-
value: function getValueProps(_props, index) {
|
|
187
|
-
var _this$asProps6 = this.asProps,
|
|
188
|
-
data = _this$asProps6.data,
|
|
189
|
-
x = _this$asProps6.x;
|
|
190
|
-
var value = data[index][x];
|
|
191
|
-
var formatter = this.getValueFormatter();
|
|
192
|
-
var formatted = formatter.format(value);
|
|
193
|
-
return {
|
|
194
|
-
children: formatted,
|
|
195
|
-
formatted: formatted,
|
|
196
|
-
value: value
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "getHoverProps",
|
|
201
|
-
value: function getHoverProps(_props, index) {
|
|
202
|
-
var _this2 = this;
|
|
203
|
-
var data = this.asProps.data;
|
|
204
|
-
return {
|
|
205
|
-
data: data,
|
|
206
|
-
getBarData: function getBarData(index) {
|
|
207
|
-
return _this2.computeBarData(data[index], index);
|
|
208
|
-
},
|
|
209
|
-
render: index === 0,
|
|
210
|
-
updateIndexToHover: function updateIndexToHover(index) {
|
|
211
|
-
return _this2.setState({
|
|
212
|
-
indexToHover: index
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
}, {
|
|
218
|
-
key: "getTooltipProps",
|
|
219
|
-
value: function getTooltipProps(_props, index) {
|
|
220
|
-
return {
|
|
221
|
-
render: index === 0,
|
|
222
|
-
index: this.state.indexToHover
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: "computeBarData",
|
|
227
|
-
value: function computeBarData(d) {
|
|
228
|
-
var _this$asProps7 = this.asProps,
|
|
229
|
-
x = _this$asProps7.x,
|
|
230
|
-
y = _this$asProps7.y,
|
|
231
|
-
scale = _this$asProps7.scale,
|
|
232
|
-
offsetProps = _this$asProps7.offset,
|
|
233
|
-
wMin = _this$asProps7.wMin,
|
|
234
|
-
heightProps = _this$asProps7.height,
|
|
235
|
-
_this$asProps7$maxBar = _this$asProps7.maxBarSize,
|
|
236
|
-
maxBarSize = _this$asProps7$maxBar === void 0 ? Number.POSITIVE_INFINITY : _this$asProps7$maxBar,
|
|
237
|
-
size = _this$asProps7.size;
|
|
238
|
-
var offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
239
|
-
var _scale = (0, _slicedToArray2["default"])(scale, 2),
|
|
240
|
-
xScale = _scale[0],
|
|
241
|
-
yScale = _scale[1];
|
|
242
|
-
var absWidth = xScale(d[x]);
|
|
243
|
-
var bandHeight = heightProps || (0, _utils.scaleToBand)(yScale).bandwidth();
|
|
244
|
-
var height = Math.min(bandHeight, maxBarSize);
|
|
245
|
-
var width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
|
|
246
|
-
var barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
247
|
-
return {
|
|
248
|
-
x: 0,
|
|
249
|
-
y: barY,
|
|
250
|
-
width: width,
|
|
251
|
-
fullWidth: size[0],
|
|
252
|
-
height: height
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
}, {
|
|
256
|
-
key: "renderBar",
|
|
257
|
-
value: function renderBar(d, i) {
|
|
258
|
-
var _ref5;
|
|
259
|
-
var SCompactHorizontalBarGroup = this.Element;
|
|
260
|
-
var _this$asProps8 = this.asProps,
|
|
261
|
-
styles = _this$asProps8.styles,
|
|
262
|
-
groupKey = _this$asProps8.groupKey;
|
|
263
|
-
var _this$computeBarData = this.computeBarData(d, i),
|
|
264
|
-
x = _this$computeBarData.x,
|
|
265
|
-
y = _this$computeBarData.y;
|
|
266
|
-
this.asProps.dataHintsHandler.describeValueEntity("".concat(i, ".").concat(x), groupKey !== null && groupKey !== void 0 ? groupKey : d[y]);
|
|
267
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
268
|
-
key: "horizontal-bar-".concat(i)
|
|
269
|
-
}, (_ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
|
|
270
|
-
"render": 'g'
|
|
271
|
-
}))));
|
|
272
|
-
}
|
|
273
|
-
}, {
|
|
274
|
-
key: "renderBars",
|
|
275
|
-
value: function renderBars() {
|
|
276
|
-
var data = this.asProps.data;
|
|
277
|
-
return data.map(this.renderBar.bind(this));
|
|
55
|
+
getBarProps(_props, index) {
|
|
56
|
+
return {
|
|
57
|
+
index
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
getBarBackgroundProps(_props, index) {
|
|
61
|
+
const {
|
|
62
|
+
data,
|
|
63
|
+
scale
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const bar = this.computeBarData(data[index], index);
|
|
66
|
+
return {
|
|
67
|
+
scale,
|
|
68
|
+
index,
|
|
69
|
+
x: bar.x,
|
|
70
|
+
y: bar.y + bar.height - barHeight - hoverOffset,
|
|
71
|
+
height: barHeight,
|
|
72
|
+
width: bar.fullWidth
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
getBarFillProps(_props, index) {
|
|
76
|
+
const {
|
|
77
|
+
data,
|
|
78
|
+
uid,
|
|
79
|
+
patterns,
|
|
80
|
+
color,
|
|
81
|
+
transparent,
|
|
82
|
+
hide,
|
|
83
|
+
scale
|
|
84
|
+
} = this.asProps;
|
|
85
|
+
const bar = this.computeBarData(data[index], index);
|
|
86
|
+
return {
|
|
87
|
+
x: bar.x,
|
|
88
|
+
y: bar.y + bar.height - barHeight - hoverOffset,
|
|
89
|
+
height: barHeight,
|
|
90
|
+
width: bar.width,
|
|
91
|
+
i: index,
|
|
92
|
+
uid,
|
|
93
|
+
resolveColor: this.asProps.resolveColor,
|
|
94
|
+
patterns,
|
|
95
|
+
color,
|
|
96
|
+
transparent,
|
|
97
|
+
hide,
|
|
98
|
+
scale,
|
|
99
|
+
index
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
getAnnotationProps(_props, index) {
|
|
103
|
+
const {
|
|
104
|
+
data,
|
|
105
|
+
size
|
|
106
|
+
} = this.asProps;
|
|
107
|
+
const bar = this.computeBarData(data[index], index);
|
|
108
|
+
return {
|
|
109
|
+
y: bar.y,
|
|
110
|
+
height: barHeight * 2,
|
|
111
|
+
width: size[0],
|
|
112
|
+
index
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
getLabelProps(_props, index) {
|
|
116
|
+
const {
|
|
117
|
+
data,
|
|
118
|
+
y
|
|
119
|
+
} = this.asProps;
|
|
120
|
+
const label = data[index][y];
|
|
121
|
+
return {
|
|
122
|
+
children: label,
|
|
123
|
+
index
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
getPercentFormatter() {
|
|
127
|
+
if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {
|
|
128
|
+
this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, {
|
|
129
|
+
style: 'percent'
|
|
130
|
+
});
|
|
131
|
+
this.percentFormatterLocale = this.asProps.locale;
|
|
278
132
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
duration = _this$asProps9.duration;
|
|
286
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderBars(), duration && /*#__PURE__*/_react["default"].createElement(_AnimatedClipPath["default"], {
|
|
287
|
-
"aria-hidden": true,
|
|
288
|
-
duration: duration,
|
|
289
|
-
id: uid,
|
|
290
|
-
x: "0",
|
|
291
|
-
y: "0",
|
|
292
|
-
width: 0,
|
|
293
|
-
height: size[1]
|
|
294
|
-
}));
|
|
133
|
+
return this.percentFormatter;
|
|
134
|
+
}
|
|
135
|
+
getValueFormatter() {
|
|
136
|
+
if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
|
|
137
|
+
this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
|
|
138
|
+
this.valueFormatterLocale = this.asProps.locale;
|
|
295
139
|
}
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
140
|
+
return this.valueFormatter;
|
|
141
|
+
}
|
|
142
|
+
getPercentProps(_props, index) {
|
|
143
|
+
const {
|
|
144
|
+
data,
|
|
145
|
+
x,
|
|
146
|
+
scale
|
|
147
|
+
} = this.asProps;
|
|
148
|
+
const value = data[index][x];
|
|
149
|
+
const domain = scale[0].domain();
|
|
150
|
+
const percent = value / domain[1];
|
|
151
|
+
const formatter = this.getPercentFormatter();
|
|
152
|
+
const formatted = formatter.format(percent);
|
|
153
|
+
return {
|
|
154
|
+
children: formatted,
|
|
155
|
+
formatted,
|
|
156
|
+
percent
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
getValueProps(_props, index) {
|
|
160
|
+
const {
|
|
161
|
+
data,
|
|
162
|
+
x
|
|
163
|
+
} = this.asProps;
|
|
164
|
+
const value = data[index][x];
|
|
165
|
+
const formatter = this.getValueFormatter();
|
|
166
|
+
const formatted = formatter.format(value);
|
|
167
|
+
return {
|
|
168
|
+
children: formatted,
|
|
169
|
+
formatted,
|
|
170
|
+
value
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
getHoverProps(_props, index) {
|
|
174
|
+
const {
|
|
175
|
+
data
|
|
176
|
+
} = this.asProps;
|
|
177
|
+
return {
|
|
178
|
+
data,
|
|
179
|
+
getBarData: index => this.computeBarData(data[index], index),
|
|
180
|
+
render: index === 0,
|
|
181
|
+
updateIndexToHover: index => this.setState({
|
|
182
|
+
indexToHover: index
|
|
183
|
+
})
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
getTooltipProps(_props, index) {
|
|
187
|
+
return {
|
|
188
|
+
render: index === 0,
|
|
189
|
+
index: this.state.indexToHover
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
computeBarData(d) {
|
|
193
|
+
const {
|
|
194
|
+
x,
|
|
195
|
+
y,
|
|
196
|
+
scale,
|
|
197
|
+
offset: offsetProps,
|
|
198
|
+
wMin,
|
|
199
|
+
height: heightProps,
|
|
200
|
+
maxBarSize = Number.POSITIVE_INFINITY,
|
|
201
|
+
size
|
|
202
|
+
} = this.asProps;
|
|
203
|
+
const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
204
|
+
const [xScale, yScale] = scale;
|
|
205
|
+
const absWidth = xScale(d[x]);
|
|
206
|
+
const bandHeight = heightProps || (0, _utils.scaleToBand)(yScale).bandwidth();
|
|
207
|
+
const height = Math.min(bandHeight, maxBarSize);
|
|
208
|
+
const width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
|
|
209
|
+
const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
210
|
+
return {
|
|
211
|
+
x: 0,
|
|
212
|
+
y: barY,
|
|
213
|
+
width,
|
|
214
|
+
fullWidth: size[0],
|
|
215
|
+
height
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
renderBar(d, i) {
|
|
219
|
+
var _ref5;
|
|
220
|
+
const SCompactHorizontalBarGroup = this.Element;
|
|
221
|
+
const {
|
|
222
|
+
styles,
|
|
223
|
+
groupKey
|
|
224
|
+
} = this.asProps;
|
|
225
|
+
const {
|
|
226
|
+
x,
|
|
227
|
+
y
|
|
228
|
+
} = this.computeBarData(d, i);
|
|
229
|
+
this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);
|
|
230
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
231
|
+
key: `horizontal-bar-${i}`
|
|
232
|
+
}, (_ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
|
|
233
|
+
"render": 'g'
|
|
234
|
+
}))));
|
|
235
|
+
}
|
|
236
|
+
renderBars() {
|
|
237
|
+
const {
|
|
238
|
+
data
|
|
239
|
+
} = this.asProps;
|
|
240
|
+
return data.map(this.renderBar.bind(this));
|
|
241
|
+
}
|
|
242
|
+
render() {
|
|
243
|
+
const {
|
|
244
|
+
uid,
|
|
245
|
+
size,
|
|
246
|
+
duration
|
|
247
|
+
} = this.asProps;
|
|
248
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderBars(), duration && /*#__PURE__*/_react.default.createElement(_AnimatedClipPath.default, {
|
|
249
|
+
"aria-hidden": true,
|
|
250
|
+
duration: duration,
|
|
251
|
+
id: uid,
|
|
252
|
+
x: "0",
|
|
253
|
+
y: "0",
|
|
254
|
+
width: 0,
|
|
255
|
+
height: size[1]
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
(0, _defineProperty2.default)(CompactHorizontalBarRoot, "displayName", 'CompactHorizontalBar');
|
|
260
|
+
(0, _defineProperty2.default)(CompactHorizontalBarRoot, "enhance", [(0, _uniqueID.default)()]);
|
|
261
|
+
(0, _defineProperty2.default)(CompactHorizontalBarRoot, "style", style);
|
|
262
|
+
(0, _defineProperty2.default)(CompactHorizontalBarRoot, "defaultProps", {
|
|
302
263
|
offset: [0, 0],
|
|
303
264
|
duration: 500,
|
|
304
265
|
wMin: MIN_WIDTH,
|
|
@@ -307,119 +268,134 @@ var CompactHorizontalBarRoot = /*#__PURE__*/function (_Component) {
|
|
|
307
268
|
});
|
|
308
269
|
function Annotation(props) {
|
|
309
270
|
var _ref6;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
271
|
+
const {
|
|
272
|
+
Children,
|
|
273
|
+
y,
|
|
274
|
+
height,
|
|
275
|
+
width,
|
|
276
|
+
styles
|
|
277
|
+
} = props;
|
|
278
|
+
const SBarAnnotation = 'div';
|
|
279
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement("foreignObject", _ref6.cn("foreignObject", {
|
|
317
280
|
"x": '0',
|
|
318
281
|
"y": y - barHeight,
|
|
319
282
|
"height": height,
|
|
320
283
|
"width": width,
|
|
321
284
|
"overflow": 'visible'
|
|
322
|
-
}), /*#__PURE__*/_react
|
|
285
|
+
}), /*#__PURE__*/_react.default.createElement(SBarAnnotation, _ref6.cn("SBarAnnotation", {}), /*#__PURE__*/_react.default.createElement(Children, _ref6.cn("Children", {}))));
|
|
323
286
|
}
|
|
324
|
-
|
|
287
|
+
const excludeProps = ['data', 'scale', 'value', 'offset'];
|
|
325
288
|
function Label(props) {
|
|
326
289
|
var _ref = arguments[0],
|
|
327
290
|
_ref7;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
291
|
+
const SBarLabel = _baseComponents.Box;
|
|
292
|
+
const {
|
|
293
|
+
styles,
|
|
294
|
+
Children
|
|
295
|
+
} = props;
|
|
296
|
+
return _ref7 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBarLabel, _ref7.cn("SBarLabel", {
|
|
297
|
+
...(0, _core.assignProps)({
|
|
298
|
+
"__excludeProps": excludeProps
|
|
299
|
+
}, _ref)
|
|
300
|
+
}), /*#__PURE__*/_react.default.createElement(Children, _ref7.cn("Children", {})));
|
|
334
301
|
}
|
|
335
302
|
function Percent(props) {
|
|
336
303
|
var _ref2 = arguments[0],
|
|
337
304
|
_ref8;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
305
|
+
const SBarPercent = _baseComponents.Box;
|
|
306
|
+
const {
|
|
307
|
+
styles,
|
|
308
|
+
Children
|
|
309
|
+
} = props;
|
|
310
|
+
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBarPercent, _ref8.cn("SBarPercent", {
|
|
311
|
+
...(0, _core.assignProps)({
|
|
312
|
+
"__excludeProps": excludeProps
|
|
313
|
+
}, _ref2)
|
|
314
|
+
}), /*#__PURE__*/_react.default.createElement(Children, _ref8.cn("Children", {})));
|
|
344
315
|
}
|
|
345
316
|
function Value(props) {
|
|
346
317
|
var _ref3 = arguments[0],
|
|
347
318
|
_ref9;
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
319
|
+
const SBarValue = _baseComponents.Box;
|
|
320
|
+
const {
|
|
321
|
+
styles,
|
|
322
|
+
Children
|
|
323
|
+
} = props;
|
|
324
|
+
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBarValue, _ref9.cn("SBarValue", {
|
|
325
|
+
...(0, _core.assignProps)({
|
|
326
|
+
"__excludeProps": excludeProps
|
|
327
|
+
}, _ref3)
|
|
328
|
+
}), /*#__PURE__*/_react.default.createElement(Children, _ref9.cn("Children", {})));
|
|
354
329
|
}
|
|
355
|
-
|
|
330
|
+
const BarContext = /*#__PURE__*/_react.default.createContext({});
|
|
356
331
|
function Bar(props) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
332
|
+
const {
|
|
333
|
+
Children,
|
|
334
|
+
index,
|
|
335
|
+
onClick,
|
|
336
|
+
transparent,
|
|
337
|
+
hide
|
|
338
|
+
} = props;
|
|
339
|
+
const onClickHandler = _react.default.useCallback(event => {
|
|
340
|
+
onClick?.(index, event);
|
|
364
341
|
}, [onClick, index]);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}, [onClickHandler, transparent, hide]);
|
|
372
|
-
return /*#__PURE__*/_react["default"].createElement(BarContext.Provider, {
|
|
342
|
+
const contextValue = _react.default.useMemo(() => ({
|
|
343
|
+
onClick: onClickHandler,
|
|
344
|
+
transparent,
|
|
345
|
+
hide
|
|
346
|
+
}), [onClickHandler, transparent, hide]);
|
|
347
|
+
return /*#__PURE__*/_react.default.createElement(BarContext.Provider, {
|
|
373
348
|
value: contextValue
|
|
374
|
-
}, /*#__PURE__*/_react
|
|
349
|
+
}, /*#__PURE__*/_react.default.createElement(Children, null));
|
|
375
350
|
}
|
|
376
351
|
function BarFill(props) {
|
|
377
352
|
var _ref0;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
353
|
+
const {
|
|
354
|
+
Element: SBar,
|
|
355
|
+
styles,
|
|
356
|
+
color,
|
|
357
|
+
x,
|
|
358
|
+
y,
|
|
359
|
+
width,
|
|
360
|
+
height,
|
|
361
|
+
uid,
|
|
362
|
+
duration,
|
|
363
|
+
resolveColor,
|
|
364
|
+
patterns,
|
|
365
|
+
i,
|
|
366
|
+
scale
|
|
367
|
+
} = props;
|
|
368
|
+
const [xScale] = scale;
|
|
369
|
+
const xRange = xScale.range();
|
|
370
|
+
const backgroundWidth = xRange[1] - xRange[0];
|
|
371
|
+
const radius = 0; // left it here in case we will change our mind and return to rounded bars
|
|
372
|
+
const pathD = _react.default.useMemo(() => {
|
|
397
373
|
if (backgroundWidth - radius > width) {
|
|
398
374
|
return (0, _utils.roundedPath)(x, y, width, height, radius);
|
|
399
375
|
}
|
|
400
376
|
return (0, _utils.roundedPath)(x, y, width, height, radius, false, true, false, true);
|
|
401
377
|
}, [x, y, height, width, radius]);
|
|
402
|
-
|
|
403
|
-
return /*#__PURE__*/_react
|
|
378
|
+
const barProps = _react.default.useContext(BarContext);
|
|
379
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_ref0 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBar, _ref0.cn("SBar", {
|
|
404
380
|
"aria-hidden": true,
|
|
405
381
|
"render": 'path',
|
|
406
382
|
"d": pathD,
|
|
407
|
-
"clipPath":
|
|
383
|
+
"clipPath": `url(#${uid})`,
|
|
408
384
|
"__excludeProps": ['data', 'scale', 'value', 'offset'],
|
|
409
385
|
"childrenPosition": 'above',
|
|
410
386
|
"index": i,
|
|
411
387
|
"color": resolveColor(color),
|
|
412
|
-
"pattern": patterns ?
|
|
388
|
+
"pattern": patterns ? `url(#${uid}-${i}-pattern)` : undefined,
|
|
413
389
|
"x": x,
|
|
414
390
|
"y": y,
|
|
415
391
|
"width": width,
|
|
416
392
|
"height": height,
|
|
417
|
-
"use:duration":
|
|
393
|
+
"use:duration": `${duration}ms`,
|
|
418
394
|
"onClick": (0, _assignProps5.callAllEventHandlers)(props.onClick, barProps.onClick),
|
|
419
395
|
"transparent": barProps.transparent || props.transparent,
|
|
420
396
|
"hide": barProps.hide || props.hide
|
|
421
|
-
}))), patterns && /*#__PURE__*/_react
|
|
422
|
-
"id":
|
|
397
|
+
}))), patterns && /*#__PURE__*/_react.default.createElement(_Pattern.PatternFill, _ref0.cn("PatternFill", {
|
|
398
|
+
"id": `${uid}-${i}-pattern`,
|
|
423
399
|
"patternKey": color,
|
|
424
400
|
"color": resolveColor(color),
|
|
425
401
|
"patterns": patterns
|
|
@@ -427,22 +403,23 @@ function BarFill(props) {
|
|
|
427
403
|
}
|
|
428
404
|
function BarBackground(props) {
|
|
429
405
|
var _ref1;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
406
|
+
const {
|
|
407
|
+
Element: SBackground,
|
|
408
|
+
styles,
|
|
409
|
+
scale,
|
|
410
|
+
y,
|
|
411
|
+
x,
|
|
412
|
+
height
|
|
413
|
+
} = props;
|
|
414
|
+
const [xScale] = scale;
|
|
415
|
+
const xRange = xScale.range();
|
|
416
|
+
const width = xRange[1] - xRange[0];
|
|
417
|
+
const radius = 0; // left it here in case we will change our mind and return to rounded bars
|
|
418
|
+
const pathD = _react.default.useMemo(() => {
|
|
442
419
|
return (0, _utils.roundedPath)(x, y, width, height, radius, false, true, false, true);
|
|
443
420
|
}, [x, y, height, width, radius]);
|
|
444
|
-
|
|
445
|
-
return _ref1 = (0, _core.sstyled)(styles), /*#__PURE__*/_react
|
|
421
|
+
const barProps = _react.default.useContext(BarContext);
|
|
422
|
+
return _ref1 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBackground, _ref1.cn("SBackground", {
|
|
446
423
|
"aria-hidden": true,
|
|
447
424
|
"render": 'path',
|
|
448
425
|
"d": pathD,
|
|
@@ -455,153 +432,142 @@ function BarBackground(props) {
|
|
|
455
432
|
"onClick": (0, _assignProps5.callAllEventHandlers)(props.onClick, barProps.onClick)
|
|
456
433
|
}));
|
|
457
434
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
(0,
|
|
462
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
463
|
-
args[_key2] = arguments[_key2];
|
|
464
|
-
}
|
|
465
|
-
_this3 = (0, _callSuper2["default"])(this, Hover, [].concat(args));
|
|
466
|
-
(0, _defineProperty2["default"])(_this3, "state", {
|
|
435
|
+
class Hover extends _core.Component {
|
|
436
|
+
constructor(...args) {
|
|
437
|
+
super(...args);
|
|
438
|
+
(0, _defineProperty2.default)(this, "state", {
|
|
467
439
|
index: null
|
|
468
440
|
});
|
|
469
|
-
(0, _defineProperty2
|
|
470
|
-
(0, _defineProperty2
|
|
471
|
-
(0, _defineProperty2
|
|
472
|
-
(0, _defineProperty2
|
|
473
|
-
|
|
474
|
-
eventEmitter
|
|
475
|
-
rootRef
|
|
476
|
-
patterns
|
|
477
|
-
updateIndexToHover
|
|
478
|
-
plotId
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
441
|
+
(0, _defineProperty2.default)(this, "virtualElement", (0, _canUseDOM.default)() ? document.createElement('div') : {});
|
|
442
|
+
(0, _defineProperty2.default)(this, "unsubscribeMouseMoveRoot", null);
|
|
443
|
+
(0, _defineProperty2.default)(this, "unsubscribeMouseLeaveRoot", null);
|
|
444
|
+
(0, _defineProperty2.default)(this, "handlerMouseMoveRoot", (0, _rafTrottle.default)(e => {
|
|
445
|
+
const {
|
|
446
|
+
eventEmitter,
|
|
447
|
+
rootRef,
|
|
448
|
+
patterns,
|
|
449
|
+
updateIndexToHover,
|
|
450
|
+
plotId
|
|
451
|
+
} = this.asProps;
|
|
452
|
+
const point = (0, _utils.eventToPoint)(e, rootRef.current);
|
|
453
|
+
const {
|
|
454
|
+
clientX,
|
|
455
|
+
clientY
|
|
456
|
+
} = e;
|
|
457
|
+
const index = this.getIndex(point);
|
|
458
|
+
this.setState({
|
|
459
|
+
index
|
|
460
|
+
}, () => {
|
|
461
|
+
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
462
|
+
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, {
|
|
463
|
+
index,
|
|
464
|
+
patterns
|
|
490
465
|
});
|
|
491
|
-
eventEmitter.emit(
|
|
466
|
+
eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);
|
|
492
467
|
updateIndexToHover(index);
|
|
493
468
|
});
|
|
494
469
|
}));
|
|
495
|
-
(0, _defineProperty2
|
|
496
|
-
|
|
497
|
-
updateIndexToHover
|
|
498
|
-
plotId
|
|
499
|
-
|
|
470
|
+
(0, _defineProperty2.default)(this, "handlerMouseLeaveRoot", (0, _rafTrottle.default)(() => {
|
|
471
|
+
const {
|
|
472
|
+
updateIndexToHover,
|
|
473
|
+
plotId
|
|
474
|
+
} = this.asProps;
|
|
475
|
+
this.setState({
|
|
500
476
|
index: null
|
|
501
|
-
},
|
|
502
|
-
|
|
477
|
+
}, () => {
|
|
478
|
+
this.asProps.eventEmitter.emit(`setTooltipVisible_${plotId}`, false);
|
|
503
479
|
updateIndexToHover(null);
|
|
504
480
|
});
|
|
505
481
|
}));
|
|
506
|
-
return _this3;
|
|
507
482
|
}
|
|
508
|
-
(0,
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
value: function getIndex(point) {
|
|
528
|
-
var _this$asProps0 = this.asProps,
|
|
529
|
-
data = _this$asProps0.data,
|
|
530
|
-
getBarData = _this$asProps0.getBarData;
|
|
531
|
-
for (var _i = 0; _i < data.length; _i++) {
|
|
532
|
-
var bar = getBarData(_i);
|
|
533
|
-
if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
|
|
534
|
-
return _i;
|
|
535
|
-
}
|
|
483
|
+
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
484
|
+
return () => ({
|
|
485
|
+
width: 0,
|
|
486
|
+
height: 0,
|
|
487
|
+
top: y,
|
|
488
|
+
right: x,
|
|
489
|
+
bottom: y,
|
|
490
|
+
left: x
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
getIndex(point) {
|
|
494
|
+
const {
|
|
495
|
+
data,
|
|
496
|
+
getBarData
|
|
497
|
+
} = this.asProps;
|
|
498
|
+
for (let i = 0; i < data.length; i++) {
|
|
499
|
+
const bar = getBarData(i);
|
|
500
|
+
if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
|
|
501
|
+
return i;
|
|
536
502
|
}
|
|
537
|
-
return null;
|
|
538
|
-
}
|
|
539
|
-
}, {
|
|
540
|
-
key: "componentDidMount",
|
|
541
|
-
value: function componentDidMount() {
|
|
542
|
-
var _this4 = this;
|
|
543
|
-
var eventEmitter = this.asProps.eventEmitter;
|
|
544
|
-
this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', function (e) {
|
|
545
|
-
e.persist();
|
|
546
|
-
_this4.handlerMouseMoveRoot(e);
|
|
547
|
-
});
|
|
548
|
-
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe('onMouseLeaveRoot', this.handlerMouseLeaveRoot);
|
|
549
503
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
componentDidMount() {
|
|
507
|
+
const {
|
|
508
|
+
eventEmitter
|
|
509
|
+
} = this.asProps;
|
|
510
|
+
this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', e => {
|
|
511
|
+
e.persist();
|
|
512
|
+
this.handlerMouseMoveRoot(e);
|
|
513
|
+
});
|
|
514
|
+
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe('onMouseLeaveRoot', this.handlerMouseLeaveRoot);
|
|
515
|
+
}
|
|
516
|
+
componentWillUnmount() {
|
|
517
|
+
if (this.unsubscribeMouseMoveRoot) {
|
|
518
|
+
this.unsubscribeMouseMoveRoot();
|
|
559
519
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
value: function render() {
|
|
563
|
-
var _ref10;
|
|
564
|
-
var _this$asProps1 = this.asProps,
|
|
565
|
-
styles = _this$asProps1.styles,
|
|
566
|
-
getBarData = _this$asProps1.getBarData,
|
|
567
|
-
render = _this$asProps1.render;
|
|
568
|
-
if (!render) return null;
|
|
569
|
-
var index = this.state.index;
|
|
570
|
-
var SCompactHorizontalBarHoverRect = this.Element;
|
|
571
|
-
if (index === null) return null;
|
|
572
|
-
var bar = getBarData(index);
|
|
573
|
-
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
|
|
574
|
-
"render": 'rect',
|
|
575
|
-
"x": bar.x,
|
|
576
|
-
"y": bar.y + bar.height - barHeight - hoverOffset * 2,
|
|
577
|
-
"width": bar.fullWidth,
|
|
578
|
-
"height": barHeight + hoverOffset * 2
|
|
579
|
-
}));
|
|
520
|
+
if (this.unsubscribeMouseLeaveRoot) {
|
|
521
|
+
this.unsubscribeMouseLeaveRoot();
|
|
580
522
|
}
|
|
581
|
-
}
|
|
582
|
-
|
|
523
|
+
}
|
|
524
|
+
render() {
|
|
525
|
+
var _ref10;
|
|
526
|
+
const {
|
|
527
|
+
styles,
|
|
528
|
+
getBarData,
|
|
529
|
+
render
|
|
530
|
+
} = this.asProps;
|
|
531
|
+
if (!render) return null;
|
|
532
|
+
const {
|
|
533
|
+
index
|
|
534
|
+
} = this.state;
|
|
535
|
+
const SCompactHorizontalBarHoverRect = this.Element;
|
|
536
|
+
if (index === null) return null;
|
|
537
|
+
const bar = getBarData(index);
|
|
538
|
+
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
|
|
539
|
+
"render": 'rect',
|
|
540
|
+
"x": bar.x,
|
|
541
|
+
"y": bar.y + bar.height - barHeight - hoverOffset * 2,
|
|
542
|
+
"width": bar.fullWidth,
|
|
543
|
+
"height": barHeight + hoverOffset * 2
|
|
544
|
+
}));
|
|
545
|
+
}
|
|
546
|
+
}
|
|
583
547
|
function CompactHorizontalBarTooltip(props) {
|
|
584
548
|
var _ref4 = arguments[0],
|
|
585
549
|
_ref11;
|
|
586
550
|
if (!props.render) return null;
|
|
587
|
-
|
|
588
|
-
return _ref11 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
551
|
+
const SCompactHorizontalBarRadarTooltip = _Tooltip.default;
|
|
552
|
+
return _ref11 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react.default.createElement(SCompactHorizontalBarRadarTooltip, _ref11.cn("SCompactHorizontalBarRadarTooltip", {
|
|
553
|
+
...(0, _core.assignProps)({
|
|
554
|
+
"tag": CompactHorizontalBar.Hover,
|
|
555
|
+
"excludeAnchorProps": true
|
|
556
|
+
}, _ref4)
|
|
557
|
+
}));
|
|
592
558
|
}
|
|
593
559
|
;
|
|
594
|
-
|
|
595
|
-
Annotation
|
|
596
|
-
Label
|
|
597
|
-
Percent
|
|
598
|
-
Value
|
|
560
|
+
const CompactHorizontalBar = (0, _createElement.default)(CompactHorizontalBarRoot, {
|
|
561
|
+
Annotation,
|
|
562
|
+
Label,
|
|
563
|
+
Percent,
|
|
564
|
+
Value,
|
|
599
565
|
Bar: [Bar, {
|
|
600
566
|
Fill: BarFill,
|
|
601
567
|
Background: BarBackground
|
|
602
568
|
}],
|
|
603
|
-
Hover
|
|
604
|
-
Tooltip: [CompactHorizontalBarTooltip, _Tooltip
|
|
569
|
+
Hover,
|
|
570
|
+
Tooltip: [CompactHorizontalBarTooltip, _Tooltip.default._______childrenComponents]
|
|
605
571
|
});
|
|
606
|
-
var _default = exports
|
|
572
|
+
var _default = exports.default = CompactHorizontalBar;
|
|
607
573
|
//# sourceMappingURL=CompactHorizontalBar.js.map
|