@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
package/lib/esm/Reference.mjs
CHANGED
|
@@ -1,49 +1,42 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
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 _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
2
|
import { sstyled, Component } from "@semcore/core";
|
|
9
3
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
10
4
|
import React from "react";
|
|
11
5
|
import createElement from "./createElement.mjs";
|
|
12
6
|
import { scaleOfBandwidth } from "./utils.mjs";
|
|
13
7
|
/*!__reshadow-styles__:"./style/reference.shadow.css"*/
|
|
14
|
-
|
|
8
|
+
const style = (
|
|
15
9
|
/*__reshadow_css_start__*/
|
|
16
10
|
(sstyled.insert(
|
|
17
11
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
12
|
+
".___SReferenceLine_1w6r5_gg_{fill:none;stroke:var(--intergalactic-chart-grid-y-accent-hover-line, #a9abb6)}.___STitle_1w6r5_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-chart-grid-text-label, #6c6e79);transform-origin:var(--transform-origin_1w6r5)}.___STitle_1w6r5_gg_._position_top_1w6r5_gg_{text-anchor:middle}.___STitle_1w6r5_gg_._position_bottom_1w6r5_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_1w6r5_gg_._position_left_1w6r5_gg_,.___STitle_1w6r5_gg_._position_right_1w6r5_gg_{transform:rotate(-90deg);text-anchor:middle;dominant-baseline:middle}.___SBackground_1w6r5_gg_{fill:var(--intergalactic-chart-grid-period-bg, rgba(196, 199, 207, 0.2))}.___SStripes_1w6r5_gg_{fill:var(--fill_1w6r5)}.___SStripesPatternPath_1w6r5_gg_{stroke:var(--intergalactic-chart-grid-period-pattern, rgba(25, 27, 35, 0.15));stroke-width:1px}",
|
|
19
13
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
14
|
+
"1w6r5_gg_"
|
|
21
15
|
), /*__reshadow_css_end__*/
|
|
22
16
|
{
|
|
23
|
-
"__SReferenceLine": "
|
|
24
|
-
"__STitle": "
|
|
25
|
-
"--transform-origin": "--transform-
|
|
26
|
-
"_position_top": "
|
|
27
|
-
"_position_bottom": "
|
|
28
|
-
"_position_right": "
|
|
29
|
-
"_position_left": "
|
|
30
|
-
"__SBackground": "
|
|
31
|
-
"__SStripes": "
|
|
32
|
-
"--fill": "--
|
|
33
|
-
"__SStripesPatternPath": "
|
|
17
|
+
"__SReferenceLine": "___SReferenceLine_1w6r5_gg_",
|
|
18
|
+
"__STitle": "___STitle_1w6r5_gg_",
|
|
19
|
+
"--transform-origin": "--transform-origin_1w6r5",
|
|
20
|
+
"_position_top": "_position_top_1w6r5_gg_",
|
|
21
|
+
"_position_bottom": "_position_bottom_1w6r5_gg_",
|
|
22
|
+
"_position_right": "_position_right_1w6r5_gg_",
|
|
23
|
+
"_position_left": "_position_left_1w6r5_gg_",
|
|
24
|
+
"__SBackground": "___SBackground_1w6r5_gg_",
|
|
25
|
+
"__SStripes": "___SStripes_1w6r5_gg_",
|
|
26
|
+
"--fill": "--fill_1w6r5",
|
|
27
|
+
"__SStripesPatternPath": "___SStripesPatternPath_1w6r5_gg_"
|
|
34
28
|
})
|
|
35
29
|
);
|
|
36
|
-
|
|
30
|
+
const side2direction = {
|
|
37
31
|
left: "vertical",
|
|
38
32
|
right: "vertical",
|
|
39
33
|
top: "horizontal",
|
|
40
34
|
bottom: "horizontal"
|
|
41
35
|
};
|
|
42
|
-
|
|
43
|
-
vertical:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var x = scaleOfBandwidth(xScale, value);
|
|
36
|
+
const lineDirection2props = {
|
|
37
|
+
vertical: ([xScale, yScale], value) => {
|
|
38
|
+
const yRange = yScale.range();
|
|
39
|
+
const x = scaleOfBandwidth(xScale, value);
|
|
47
40
|
return {
|
|
48
41
|
x1: x,
|
|
49
42
|
x2: x,
|
|
@@ -51,10 +44,9 @@ var lineDirection2props = {
|
|
|
51
44
|
y2: yRange[1]
|
|
52
45
|
};
|
|
53
46
|
},
|
|
54
|
-
horizontal:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var y = scaleOfBandwidth(yScale, value);
|
|
47
|
+
horizontal: ([xScale, yScale], value) => {
|
|
48
|
+
const xRange = xScale.range();
|
|
49
|
+
const y = scaleOfBandwidth(yScale, value);
|
|
58
50
|
return {
|
|
59
51
|
x1: xRange[0],
|
|
60
52
|
x2: xRange[1],
|
|
@@ -63,12 +55,11 @@ var lineDirection2props = {
|
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
57
|
};
|
|
66
|
-
|
|
67
|
-
vertical:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var width = endValue !== void 0 ? scaleOfBandwidth(xScale, endValue) - x : 100;
|
|
58
|
+
const rectDirection2props = {
|
|
59
|
+
vertical: ([xScale, yScale], value, endValue) => {
|
|
60
|
+
const yRange = yScale.range();
|
|
61
|
+
const x = scaleOfBandwidth(xScale, value);
|
|
62
|
+
const width = endValue !== void 0 ? scaleOfBandwidth(xScale, endValue) - x : 100;
|
|
72
63
|
return {
|
|
73
64
|
x,
|
|
74
65
|
y: yRange[1],
|
|
@@ -76,11 +67,10 @@ var rectDirection2props = {
|
|
|
76
67
|
height: yRange[0] - yRange[1]
|
|
77
68
|
};
|
|
78
69
|
},
|
|
79
|
-
horizontal:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var height = endValue !== void 0 ? scaleOfBandwidth(yScale, endValue) - y : 100;
|
|
70
|
+
horizontal: ([xScale, yScale], value, endValue) => {
|
|
71
|
+
const xRange = xScale.range();
|
|
72
|
+
const y = scaleOfBandwidth(yScale, value);
|
|
73
|
+
const height = endValue !== void 0 ? scaleOfBandwidth(yScale, endValue) - y : 100;
|
|
84
74
|
return {
|
|
85
75
|
x: xRange[0],
|
|
86
76
|
y,
|
|
@@ -89,84 +79,83 @@ var rectDirection2props = {
|
|
|
89
79
|
};
|
|
90
80
|
}
|
|
91
81
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
left:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var x = scaleOfBandwidth(xScale, value);
|
|
82
|
+
const titleOffset = 10;
|
|
83
|
+
const titleSideToProps = {
|
|
84
|
+
left: ([xScale, yScale], value) => {
|
|
85
|
+
const yRange = yScale.range();
|
|
86
|
+
const x = scaleOfBandwidth(xScale, value);
|
|
98
87
|
return {
|
|
99
88
|
x: x - titleOffset,
|
|
100
89
|
y: (yRange[0] + yRange[1]) / 2
|
|
101
90
|
};
|
|
102
91
|
},
|
|
103
|
-
right:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var x = scaleOfBandwidth(xScale, value);
|
|
92
|
+
right: ([xScale, yScale], value) => {
|
|
93
|
+
const yRange = yScale.range();
|
|
94
|
+
const x = scaleOfBandwidth(xScale, value);
|
|
107
95
|
return {
|
|
108
96
|
x: x + titleOffset,
|
|
109
97
|
y: (yRange[0] + yRange[1]) / 2
|
|
110
98
|
};
|
|
111
99
|
},
|
|
112
|
-
top:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var y = scaleOfBandwidth(yScale, value);
|
|
100
|
+
top: ([xScale, yScale], value) => {
|
|
101
|
+
const xRange = xScale.range();
|
|
102
|
+
const y = scaleOfBandwidth(yScale, value);
|
|
116
103
|
return {
|
|
117
104
|
x: (xRange[1] + xRange[0]) / 2,
|
|
118
105
|
y: y - titleOffset
|
|
119
106
|
};
|
|
120
107
|
},
|
|
121
|
-
bottom:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var y = scaleOfBandwidth(yScale, value);
|
|
108
|
+
bottom: ([xScale, yScale], value) => {
|
|
109
|
+
const xRange = xScale.range();
|
|
110
|
+
const y = scaleOfBandwidth(yScale, value);
|
|
125
111
|
return {
|
|
126
112
|
x: (xRange[1] + xRange[0]) / 2,
|
|
127
113
|
y: y + titleOffset
|
|
128
114
|
};
|
|
129
115
|
}
|
|
130
116
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
117
|
+
class ReferenceLineRoot extends Component {
|
|
118
|
+
getTitleProps() {
|
|
119
|
+
const {
|
|
120
|
+
position,
|
|
121
|
+
value
|
|
122
|
+
} = this.asProps;
|
|
123
|
+
return {
|
|
124
|
+
position,
|
|
125
|
+
value
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
getBackgroundProps() {
|
|
129
|
+
const {
|
|
130
|
+
position,
|
|
131
|
+
value
|
|
132
|
+
} = this.asProps;
|
|
133
|
+
return {
|
|
134
|
+
position,
|
|
135
|
+
value
|
|
136
|
+
};
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
value: function render() {
|
|
158
|
-
var _ref;
|
|
159
|
-
var SReferenceLine = this.Element;
|
|
160
|
-
var _this$asProps3 = this.asProps, title = _this$asProps3.title, scale = _this$asProps3.scale, position = _this$asProps3.position, value = _this$asProps3.value, color = _this$asProps3.color, resolveColor = _this$asProps3.resolveColor, styles = _this$asProps3.styles;
|
|
161
|
-
var positionProps = lineDirection2props[side2direction[position]];
|
|
162
|
-
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SReferenceLine, _ref.cn("SReferenceLine", _objectSpread({
|
|
163
|
-
"render": "line",
|
|
164
|
-
"__excludeProps": ["data", "scale", "format", "value", "color"],
|
|
165
|
-
"stroke": resolveColor(color)
|
|
166
|
-
}, positionProps(scale, value)))), title && /* @__PURE__ */ React.createElement(ReferenceLine.Title, null, title));
|
|
167
|
-
}
|
|
168
|
-
}]);
|
|
169
|
-
})(Component);
|
|
138
|
+
render() {
|
|
139
|
+
var _ref;
|
|
140
|
+
const SReferenceLine = this.Element;
|
|
141
|
+
const {
|
|
142
|
+
title,
|
|
143
|
+
scale,
|
|
144
|
+
position,
|
|
145
|
+
value,
|
|
146
|
+
color,
|
|
147
|
+
resolveColor,
|
|
148
|
+
styles
|
|
149
|
+
} = this.asProps;
|
|
150
|
+
const positionProps = lineDirection2props[side2direction[position]];
|
|
151
|
+
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SReferenceLine, _ref.cn("SReferenceLine", {
|
|
152
|
+
"render": "line",
|
|
153
|
+
"__excludeProps": ["data", "scale", "format", "value", "color"],
|
|
154
|
+
"stroke": resolveColor(color),
|
|
155
|
+
...positionProps(scale, value)
|
|
156
|
+
})), title && /* @__PURE__ */ React.createElement(ReferenceLine.Title, null, title));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
170
159
|
_defineProperty(ReferenceLineRoot, "displayName", "ReferenceLine");
|
|
171
160
|
_defineProperty(ReferenceLineRoot, "style", style);
|
|
172
161
|
_defineProperty(ReferenceLineRoot, "defaultProps", {
|
|
@@ -174,11 +163,20 @@ _defineProperty(ReferenceLineRoot, "defaultProps", {
|
|
|
174
163
|
});
|
|
175
164
|
function Title(props) {
|
|
176
165
|
var _ref2;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
166
|
+
const {
|
|
167
|
+
Element: STitle,
|
|
168
|
+
styles,
|
|
169
|
+
scale,
|
|
170
|
+
position,
|
|
171
|
+
value
|
|
172
|
+
} = props;
|
|
173
|
+
const {
|
|
174
|
+
x,
|
|
175
|
+
y
|
|
176
|
+
} = titleSideToProps[position](scale, value);
|
|
177
|
+
const sstyles = sstyled(styles);
|
|
178
|
+
const sTitleStyles = sstyles.cn("STitle", {
|
|
179
|
+
"transform-origin": `${x.toFixed(2)}px ${y.toFixed(2)}px`
|
|
182
180
|
});
|
|
183
181
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STitle, _ref2.cn("STitle", {
|
|
184
182
|
"render": "text",
|
|
@@ -192,30 +190,47 @@ function Title(props) {
|
|
|
192
190
|
}
|
|
193
191
|
function Background(props) {
|
|
194
192
|
var _ref3;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
const {
|
|
194
|
+
Element: SBackground,
|
|
195
|
+
styles,
|
|
196
|
+
scale,
|
|
197
|
+
position = "left",
|
|
198
|
+
value,
|
|
199
|
+
endValue
|
|
200
|
+
} = props;
|
|
201
|
+
const positionProps = rectDirection2props[side2direction[position]];
|
|
202
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SBackground, _ref3.cn("SBackground", {
|
|
198
203
|
"render": "rect",
|
|
199
|
-
"childrenPosition": "inside"
|
|
200
|
-
|
|
204
|
+
"childrenPosition": "inside",
|
|
205
|
+
...positionProps(scale, value, endValue)
|
|
206
|
+
}));
|
|
201
207
|
}
|
|
202
208
|
Background.style = style;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
const diagonalGap = 8;
|
|
210
|
+
const gap = Math.sqrt(diagonalGap ** 2 + diagonalGap ** 2);
|
|
211
|
+
const gap12 = gap * (1 / 2);
|
|
212
|
+
const gap32 = gap * (3 / 2);
|
|
213
|
+
const path = `M-${gap},-${gap12} L${gap},${gap32} M-${gap12},-${gap} L${gap32},${gap}`;
|
|
208
214
|
function Stripes(props) {
|
|
209
215
|
var _ref4;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
const {
|
|
217
|
+
Element: SStripes,
|
|
218
|
+
styles,
|
|
219
|
+
scale,
|
|
220
|
+
position = "left",
|
|
221
|
+
value,
|
|
222
|
+
endValue,
|
|
223
|
+
uid
|
|
224
|
+
} = props;
|
|
225
|
+
const SStripesPatternPath = "path";
|
|
226
|
+
const positionProps = rectDirection2props[side2direction[position]];
|
|
227
|
+
const patternId = `${uid}-pattern`;
|
|
228
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement("g", _ref4.cn("g", {}), /* @__PURE__ */ React.createElement(SStripes, _ref4.cn("SStripes", {
|
|
215
229
|
"render": "rect",
|
|
216
230
|
"childrenPosition": "inside",
|
|
217
|
-
"fill":
|
|
218
|
-
|
|
231
|
+
"fill": `url(#${patternId})`,
|
|
232
|
+
...positionProps(scale, value, endValue)
|
|
233
|
+
})), /* @__PURE__ */ React.createElement("pattern", _ref4.cn("pattern", {
|
|
219
234
|
"id": patternId,
|
|
220
235
|
"patternUnits": "userSpaceOnUse",
|
|
221
236
|
"width": gap,
|
|
@@ -226,13 +241,13 @@ function Stripes(props) {
|
|
|
226
241
|
}
|
|
227
242
|
Stripes.style = style;
|
|
228
243
|
Stripes.enhance = [uniqueIDEnhancement()];
|
|
229
|
-
|
|
244
|
+
const ReferenceLine = createElement(ReferenceLineRoot, {
|
|
230
245
|
Title,
|
|
231
246
|
Background,
|
|
232
247
|
Stripes
|
|
233
248
|
});
|
|
234
|
-
|
|
235
|
-
|
|
249
|
+
const ReferenceBackground = createElement(Background);
|
|
250
|
+
const ReferenceStripes = createElement(Stripes);
|
|
236
251
|
export {
|
|
237
252
|
ReferenceBackground,
|
|
238
253
|
ReferenceLine,
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
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 _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { createComponent, sstyled, assignProps
|
|
2
|
+
import { createComponent, Component, sstyled, assignProps } from "@semcore/core";
|
|
3
|
+
import { Box } from "@semcore/base-components";
|
|
9
4
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
10
5
|
import fire from "@semcore/core/lib/utils/fire";
|
|
11
6
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
12
7
|
import trottle from "@semcore/core/lib/utils/rafTrottle";
|
|
13
|
-
import { Box } from "@semcore/flex-box";
|
|
14
8
|
import React from "react";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_defineProperty(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
class ResponsiveContainerRoot extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
_defineProperty(this, "containerRef", /* @__PURE__ */ React.createRef());
|
|
13
|
+
_defineProperty(this, "size", [0, 0]);
|
|
14
|
+
_defineProperty(this, "handleResize", trottle((entries) => {
|
|
15
|
+
const {
|
|
16
|
+
Children,
|
|
17
|
+
aspect
|
|
18
|
+
} = this.asProps;
|
|
19
|
+
if (!this.$container) return;
|
|
20
|
+
let {
|
|
21
|
+
clientWidth: width,
|
|
22
|
+
clientHeight: height
|
|
23
|
+
} = this.$container;
|
|
26
24
|
if (aspect) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const style = window.getComputedStyle(this.$container);
|
|
26
|
+
const minHeight = Number.parseInt(style.getPropertyValue("min-height"));
|
|
27
|
+
const maxHeight = Number.parseInt(style.getPropertyValue("max-height"));
|
|
30
28
|
height = width * aspect;
|
|
31
29
|
if (height < minHeight) {
|
|
32
30
|
height = minHeight;
|
|
@@ -35,62 +33,53 @@ var ResponsiveContainerRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
35
33
|
height = maxHeight;
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
fire(
|
|
36
|
+
if (this.size[0] === width && this.size[1] === height) return;
|
|
37
|
+
this.size = [width, height];
|
|
38
|
+
fire(this, "onResize", this.size, entries);
|
|
41
39
|
if (typeof getOriginChildren(Children) === "function") {
|
|
42
|
-
|
|
40
|
+
this.forceUpdate();
|
|
43
41
|
}
|
|
44
42
|
}));
|
|
45
43
|
if (canUseDOM()) {
|
|
46
|
-
|
|
44
|
+
this.observer = new ResizeObserver(this.handleResize);
|
|
47
45
|
}
|
|
48
|
-
return _this;
|
|
49
46
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "componentDidMount",
|
|
67
|
-
value: function componentDidMount() {
|
|
68
|
-
if (this.$container) {
|
|
69
|
-
var _this$observer;
|
|
70
|
-
(_this$observer = this.observer) === null || _this$observer === void 0 || _this$observer.observe(this.$container);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// TODO component did update ref?
|
|
74
|
-
}, {
|
|
75
|
-
key: "componentWillUnmount",
|
|
76
|
-
value: function componentWillUnmount() {
|
|
77
|
-
var _this$observer2;
|
|
78
|
-
(_this$observer2 = this.observer) === null || _this$observer2 === void 0 || _this$observer2.disconnect();
|
|
47
|
+
get $container() {
|
|
48
|
+
return this.containerRef.current;
|
|
49
|
+
}
|
|
50
|
+
setContext() {
|
|
51
|
+
const [width, height] = this.size;
|
|
52
|
+
return {
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
componentDidMount() {
|
|
58
|
+
var _a;
|
|
59
|
+
if (this.$container) {
|
|
60
|
+
(_a = this.observer) == null ? void 0 : _a.observe(this.$container);
|
|
79
61
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
}
|
|
63
|
+
// TODO component did update ref?
|
|
64
|
+
componentWillUnmount() {
|
|
65
|
+
var _a;
|
|
66
|
+
(_a = this.observer) == null ? void 0 : _a.disconnect();
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
var _ref = this.asProps, _ref2;
|
|
70
|
+
const SResponsiveContainer = Box;
|
|
71
|
+
const {
|
|
72
|
+
styles
|
|
73
|
+
} = this.asProps;
|
|
74
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SResponsiveContainer, _ref2.cn("SResponsiveContainer", {
|
|
75
|
+
...assignProps({
|
|
87
76
|
"ref": this.containerRef
|
|
88
|
-
}, _ref)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
77
|
+
}, _ref)
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
92
81
|
_defineProperty(ResponsiveContainerRoot, "displayName", "ResponsiveContainer");
|
|
93
|
-
|
|
82
|
+
const ResponsiveContainer = createComponent(ResponsiveContainerRoot);
|
|
94
83
|
export {
|
|
95
84
|
ResponsiveContainer as default
|
|
96
85
|
};
|