@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/Line.mjs
CHANGED
|
@@ -1,160 +1,180 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
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
2
|
import { sstyled, Component } from "@semcore/core";
|
|
8
3
|
import uniqueIDEnhancement, { useUID } from "@semcore/core/lib/utils/uniqueID";
|
|
9
4
|
import { bisector } from "d3-array";
|
|
10
|
-
import {
|
|
5
|
+
import { curveCardinal, area, line, curveLinear } from "d3-shape";
|
|
11
6
|
import React from "react";
|
|
12
7
|
import AnimatedClipPath from "./AnimatedClipPath.mjs";
|
|
13
8
|
import createElement from "./createElement.mjs";
|
|
14
9
|
import Dots from "./Dots.mjs";
|
|
15
10
|
import { resolvePatternDasharray } from "./Pattern.mjs";
|
|
16
|
-
import { interpolateValue, getNullData, eventToPoint, invert,
|
|
11
|
+
import { interpolateValue, definedData, getNullData, eventToPoint, invert, getChartDefaultColorName, definedNullData, scaleOfBandwidth } from "./utils.mjs";
|
|
17
12
|
/*!__reshadow-styles__:"./style/line.shadow.css"*/
|
|
18
|
-
|
|
13
|
+
const style = (
|
|
19
14
|
/*__reshadow_css_start__*/
|
|
20
15
|
(sstyled.insert(
|
|
21
16
|
/*__inner_css_start__*/
|
|
22
|
-
".
|
|
17
|
+
".___SLine_7eofj_gg_{fill:transparent;stroke-width:3;stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:d;transition-duration:var(--duration_7eofj);transition-timing-function:ease-in-out}.___SLine_7eofj_gg_.__color_7eofj_gg_{stroke:var(--color_7eofj)}.___SLine_7eofj_gg_.__hide_7eofj_gg_{display:none}.___SLine_7eofj_gg_.__transparent_7eofj_gg_{opacity:.3}.___SNull_7eofj_gg_{fill:transparent;stroke:var(--intergalactic-border-primary, #c4c7cf);stroke-dasharray:4}.___SNull_7eofj_gg_.__hide_7eofj_gg_{display:none}.___SLineArea_7eofj_gg_{transition-property:d;transition-duration:var(--duration_7eofj);transition-timing-function:ease-in-out;opacity:.3;fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLineArea_7eofj_gg_.__color_7eofj_gg_{fill:var(--color_7eofj)}",
|
|
23
18
|
/*__inner_css_end__*/
|
|
24
|
-
"
|
|
19
|
+
"7eofj_gg_"
|
|
25
20
|
), /*__reshadow_css_end__*/
|
|
26
21
|
{
|
|
27
|
-
"__SLine": "
|
|
28
|
-
"--duration": "--
|
|
29
|
-
"_color": "
|
|
30
|
-
"--color": "--
|
|
31
|
-
"_hide": "
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"__SNull": "
|
|
34
|
-
"__SLineArea": "
|
|
22
|
+
"__SLine": "___SLine_7eofj_gg_",
|
|
23
|
+
"--duration": "--duration_7eofj",
|
|
24
|
+
"_color": "__color_7eofj_gg_",
|
|
25
|
+
"--color": "--color_7eofj",
|
|
26
|
+
"_hide": "__hide_7eofj_gg_",
|
|
27
|
+
"_transparent": "__transparent_7eofj_gg_",
|
|
28
|
+
"__SNull": "___SNull_7eofj_gg_",
|
|
29
|
+
"__SLineArea": "___SLineArea_7eofj_gg_"
|
|
35
30
|
})
|
|
36
31
|
);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
class LineRoot extends Component {
|
|
33
|
+
getDotsProps() {
|
|
34
|
+
const {
|
|
35
|
+
x,
|
|
36
|
+
y,
|
|
37
|
+
d3,
|
|
38
|
+
color,
|
|
39
|
+
resolveColor,
|
|
40
|
+
duration,
|
|
41
|
+
transparent,
|
|
42
|
+
patterns,
|
|
43
|
+
onClick
|
|
44
|
+
} = this.asProps;
|
|
45
|
+
return {
|
|
46
|
+
x,
|
|
47
|
+
y,
|
|
48
|
+
d3,
|
|
49
|
+
color,
|
|
50
|
+
resolveColor,
|
|
51
|
+
duration,
|
|
52
|
+
transparent,
|
|
53
|
+
patterns,
|
|
54
|
+
onClick
|
|
55
|
+
};
|
|
41
56
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
})(Component);
|
|
57
|
+
getNullProps() {
|
|
58
|
+
const {
|
|
59
|
+
x,
|
|
60
|
+
y,
|
|
61
|
+
d3,
|
|
62
|
+
color,
|
|
63
|
+
resolveColor
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const data = this.asProps.data.filter((item) => item[y] !== interpolateValue);
|
|
66
|
+
return {
|
|
67
|
+
d3,
|
|
68
|
+
// TODO: vertical
|
|
69
|
+
data: getNullData(data, definedNullData(x, y), y),
|
|
70
|
+
color,
|
|
71
|
+
resolveColor
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
getAreaProps() {
|
|
75
|
+
const {
|
|
76
|
+
x,
|
|
77
|
+
y,
|
|
78
|
+
color,
|
|
79
|
+
hide,
|
|
80
|
+
duration,
|
|
81
|
+
scale
|
|
82
|
+
} = this.asProps;
|
|
83
|
+
const data = this.asProps.data.filter((item) => item[y] !== interpolateValue);
|
|
84
|
+
return {
|
|
85
|
+
x,
|
|
86
|
+
y,
|
|
87
|
+
data,
|
|
88
|
+
color,
|
|
89
|
+
hide,
|
|
90
|
+
duration,
|
|
91
|
+
scale
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
handlerOnClick(e) {
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
const {
|
|
97
|
+
rootRef,
|
|
98
|
+
scale: [xScale],
|
|
99
|
+
data,
|
|
100
|
+
x,
|
|
101
|
+
onClick
|
|
102
|
+
} = this.asProps;
|
|
103
|
+
if (!onClick) return;
|
|
104
|
+
const [pX] = eventToPoint(e, rootRef.current);
|
|
105
|
+
const vX = invert(xScale, pX);
|
|
106
|
+
const index = bisector((d) => d[x]).center(data, vX);
|
|
107
|
+
onClick(index, e);
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
var _ref;
|
|
111
|
+
const SLine = this.Element;
|
|
112
|
+
const {
|
|
113
|
+
styles,
|
|
114
|
+
hide,
|
|
115
|
+
color,
|
|
116
|
+
resolveColor,
|
|
117
|
+
uid,
|
|
118
|
+
size,
|
|
119
|
+
d3,
|
|
120
|
+
duration,
|
|
121
|
+
x,
|
|
122
|
+
y,
|
|
123
|
+
transparent,
|
|
124
|
+
patterns
|
|
125
|
+
} = this.asProps;
|
|
126
|
+
const data = this.asProps.data.filter((item) => item[y] !== interpolateValue);
|
|
127
|
+
this.asProps.dataHintsHandler.specifyDataRowFields(x, y);
|
|
128
|
+
this.asProps.dataHintsHandler.establishDataType("time-series");
|
|
129
|
+
const patternKey = color || getChartDefaultColorName(0);
|
|
130
|
+
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SLine, _ref.cn("SLine", {
|
|
131
|
+
"aria-hidden": true,
|
|
132
|
+
"clipPath": `url(#${uid})`,
|
|
133
|
+
"render": "path",
|
|
134
|
+
"hide": hide,
|
|
135
|
+
"color": resolveColor(color),
|
|
136
|
+
"transparent": transparent,
|
|
137
|
+
"d": d3(data),
|
|
138
|
+
"use:duration": `${duration}ms`,
|
|
139
|
+
"strokeDasharray": patterns ? resolvePatternDasharray(patternKey, patterns) : void 0,
|
|
140
|
+
"onClickCapture": this.handlerOnClick.bind(this),
|
|
141
|
+
"pointerEvents": "stroke"
|
|
142
|
+
})), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref.cn("AnimatedClipPath", {
|
|
143
|
+
"aria-hidden": true,
|
|
144
|
+
"duration": duration,
|
|
145
|
+
"id": uid,
|
|
146
|
+
"x": "0",
|
|
147
|
+
"y": "0",
|
|
148
|
+
"width": 0,
|
|
149
|
+
"height": size[1]
|
|
150
|
+
})));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
140
153
|
_defineProperty(LineRoot, "displayName", "Line");
|
|
141
154
|
_defineProperty(LineRoot, "style", style);
|
|
142
155
|
_defineProperty(LineRoot, "enhance", [uniqueIDEnhancement()]);
|
|
143
|
-
_defineProperty(LineRoot, "defaultProps",
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
_defineProperty(LineRoot, "defaultProps", ({
|
|
157
|
+
x,
|
|
158
|
+
y,
|
|
159
|
+
$rootProps,
|
|
160
|
+
curve = curveLinear,
|
|
161
|
+
scale
|
|
162
|
+
}) => {
|
|
163
|
+
const [xScale, yScale] = scale || $rootProps.scale;
|
|
146
164
|
return {
|
|
147
|
-
d3: line().defined(definedData(x, y)).curve(curve).x(
|
|
148
|
-
return scaleOfBandwidth(xScale, p[x]);
|
|
149
|
-
}).y(function(p) {
|
|
150
|
-
return scaleOfBandwidth(yScale, p[y]);
|
|
151
|
-
}),
|
|
165
|
+
d3: line().defined(definedData(x, y)).curve(curve).x((p) => scaleOfBandwidth(xScale, p[x])).y((p) => scaleOfBandwidth(yScale, p[y])),
|
|
152
166
|
duration: 500
|
|
153
167
|
};
|
|
154
168
|
});
|
|
155
169
|
function Null(props) {
|
|
156
170
|
var _ref2;
|
|
157
|
-
|
|
171
|
+
const {
|
|
172
|
+
Element: SNull,
|
|
173
|
+
styles,
|
|
174
|
+
d3,
|
|
175
|
+
data,
|
|
176
|
+
hide
|
|
177
|
+
} = props;
|
|
158
178
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SNull, _ref2.cn("SNull", {
|
|
159
179
|
"render": "path",
|
|
160
180
|
"d": d3(data),
|
|
@@ -162,12 +182,27 @@ function Null(props) {
|
|
|
162
182
|
}));
|
|
163
183
|
}
|
|
164
184
|
function Area(props) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
185
|
+
const uid = useUID();
|
|
186
|
+
const {
|
|
187
|
+
Element: SLineArea,
|
|
188
|
+
styles,
|
|
189
|
+
data,
|
|
190
|
+
hide,
|
|
191
|
+
duration,
|
|
192
|
+
color,
|
|
193
|
+
scale,
|
|
194
|
+
x,
|
|
195
|
+
y0,
|
|
196
|
+
y1,
|
|
197
|
+
curve = curveCardinal,
|
|
198
|
+
area: area$1,
|
|
199
|
+
patterns,
|
|
200
|
+
autoInterpolate = true
|
|
201
|
+
} = props;
|
|
202
|
+
const [xScale, yScale] = scale;
|
|
203
|
+
const dataToArea = React.useMemo(() => {
|
|
169
204
|
if (area$1) return area$1;
|
|
170
|
-
|
|
205
|
+
const chunked = data.reduce((acc, d) => {
|
|
171
206
|
if (d[y0] === interpolateValue || d[y1] === interpolateValue) return acc;
|
|
172
207
|
if (definedData(y0, y1)(d)) {
|
|
173
208
|
acc[acc.length - 1].push(d);
|
|
@@ -181,24 +216,18 @@ function Area(props) {
|
|
|
181
216
|
}
|
|
182
217
|
return chunked;
|
|
183
218
|
}, [data, y0, y1, area$1, autoInterpolate]);
|
|
184
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, dataToArea.map(
|
|
219
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, dataToArea.map((chunk, index) => {
|
|
185
220
|
var _ref3;
|
|
186
|
-
|
|
187
|
-
return xScale(data2[x]);
|
|
188
|
-
}).y0(function(data2) {
|
|
189
|
-
return yScale(data2[y0]);
|
|
190
|
-
}).y1(function(data2) {
|
|
191
|
-
return yScale(data2[y1]);
|
|
192
|
-
});
|
|
221
|
+
const d3 = area().curve(curve).x((data2) => xScale(data2[x])).y0((data2) => yScale(data2[y0])).y1((data2) => yScale(data2[y1]));
|
|
193
222
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineArea, _ref3.cn("SLineArea", {
|
|
194
|
-
"key":
|
|
223
|
+
"key": `${chunk.length}-${index}`,
|
|
195
224
|
"aria-hidden": true,
|
|
196
|
-
"clipPath":
|
|
225
|
+
"clipPath": `url(#${uid})`,
|
|
197
226
|
"render": "path",
|
|
198
227
|
"hide": hide,
|
|
199
228
|
"color": color,
|
|
200
229
|
"d": d3(chunk),
|
|
201
|
-
"use:duration":
|
|
230
|
+
"use:duration": `${duration}ms`,
|
|
202
231
|
"patterns": patterns
|
|
203
232
|
}));
|
|
204
233
|
}));
|
package/lib/esm/Pattern.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
2
|
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
5
3
|
import React from "react";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var defaultPatterns = {
|
|
4
|
+
const defaultDasharrays = ["4 4", "8 8", "2 4", "4 8", "8 2", "8 4", "12 4", "2 2"];
|
|
5
|
+
const defaultPatterns = {
|
|
9
6
|
starSmall: {
|
|
10
7
|
fill: {
|
|
11
8
|
viewBox: "0 0 20 20",
|
|
@@ -429,90 +426,97 @@ var defaultPatterns = {
|
|
|
429
426
|
dasharray: defaultDasharrays[7]
|
|
430
427
|
}
|
|
431
428
|
};
|
|
432
|
-
|
|
433
|
-
|
|
429
|
+
const defaultPatternsList = Object.values(defaultPatterns);
|
|
430
|
+
const patternsKeysOrderCache = /* @__PURE__ */ new WeakMap();
|
|
434
431
|
patternsKeysOrderCache.set(defaultPatternsList, []);
|
|
435
|
-
|
|
436
|
-
if (
|
|
432
|
+
const resolvePatternIndex = (patternKey, patterns) => {
|
|
433
|
+
if (typeof patterns !== "object") return 0;
|
|
437
434
|
if (!patternsKeysOrderCache.has(patterns)) {
|
|
438
435
|
patternsKeysOrderCache.set(patterns, []);
|
|
439
436
|
}
|
|
440
|
-
|
|
441
|
-
|
|
437
|
+
const patternsKeysCachedList = patternsKeysOrderCache.get(patterns);
|
|
438
|
+
let index = patternsKeysCachedList.indexOf(patternKey);
|
|
442
439
|
if (index === -1) {
|
|
443
440
|
index = patternsKeysCachedList.length;
|
|
444
441
|
patternsKeysCachedList.push(patternKey);
|
|
445
442
|
}
|
|
446
443
|
return index;
|
|
447
444
|
};
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
if (_typeof(patternsConfig) === "object" && patternsConfig && !Array.isArray(patternsConfig)) return patternsConfig;
|
|
445
|
+
const resolvePattern = (patternKey, patternsConfig = true) => {
|
|
446
|
+
if (typeof patternsConfig === "object" && patternsConfig && !Array.isArray(patternsConfig)) return patternsConfig;
|
|
451
447
|
if (typeof patternsConfig === "string") {
|
|
452
448
|
if (!defaultPatterns[patternsConfig]) {
|
|
453
|
-
|
|
454
|
-
throw new Error(
|
|
449
|
+
const available = Object.keys(defaultPatterns).join(", ");
|
|
450
|
+
throw new Error(`No default pattern ${patternsConfig} found. Options ${available} are available. If you want to use cusom pattern, pass it as object.`);
|
|
455
451
|
}
|
|
456
452
|
return defaultPatterns[patternsConfig];
|
|
457
453
|
}
|
|
458
|
-
|
|
459
|
-
|
|
454
|
+
const patterns = patternsConfig === true ? defaultPatternsList : patternsConfig;
|
|
455
|
+
let patternIndex = resolvePatternIndex(patternKey, patterns);
|
|
460
456
|
patternIndex = patternIndex % patterns.length;
|
|
461
457
|
return patterns[patternIndex];
|
|
462
458
|
};
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
459
|
+
const PatternFill = ({
|
|
460
|
+
id,
|
|
461
|
+
color,
|
|
462
|
+
patternKey,
|
|
463
|
+
patterns = defaultPatternsList
|
|
464
|
+
}) => {
|
|
465
|
+
const DefaultPattern = React.useMemo(() => {
|
|
466
|
+
const {
|
|
467
|
+
fill
|
|
468
|
+
} = resolvePattern(patternKey, patterns);
|
|
469
|
+
return () => /* @__PURE__ */ React.createElement("pattern", {
|
|
470
|
+
id,
|
|
471
|
+
fill: color,
|
|
472
|
+
x: "0",
|
|
473
|
+
y: "0",
|
|
474
|
+
width: "12",
|
|
475
|
+
height: "12",
|
|
476
|
+
viewBox: fill.viewBox,
|
|
477
|
+
patternUnits: "userSpaceOnUse"
|
|
478
|
+
}, fill.children);
|
|
479
479
|
}, [patternKey, id, color, patterns]);
|
|
480
480
|
return /* @__PURE__ */ React.createElement(DefaultPattern, null);
|
|
481
481
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
482
|
+
const getPatternSymbolSize = ({
|
|
483
|
+
patternKey,
|
|
484
|
+
patterns
|
|
485
|
+
}) => {
|
|
486
|
+
var _a;
|
|
487
|
+
const patternData = resolvePattern(patternKey, patterns);
|
|
488
|
+
if (!((_a = patternData == null ? void 0 : patternData.symbol) == null ? void 0 : _a.size)) return [10, 10];
|
|
487
489
|
return patternData.symbol.size;
|
|
488
490
|
};
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}
|
|
491
|
+
const PatternSymbol = ({
|
|
492
|
+
color,
|
|
493
|
+
patternKey,
|
|
494
|
+
patterns,
|
|
495
|
+
...props
|
|
496
|
+
}) => {
|
|
497
|
+
const DefaultSymbol = React.useMemo(() => {
|
|
498
|
+
const patternData = resolvePattern(patternKey, patterns);
|
|
499
|
+
const children = patternData == null ? void 0 : patternData.symbol.children;
|
|
500
|
+
const viewBox = patternData == null ? void 0 : patternData.symbol.viewBox;
|
|
501
|
+
const width = patternData == null ? void 0 : patternData.symbol.size[0];
|
|
502
|
+
const height = patternData == null ? void 0 : patternData.symbol.size[1];
|
|
503
|
+
return (props2) => /* @__PURE__ */ React.createElement("svg", _extends({
|
|
504
|
+
fill: color,
|
|
505
|
+
x: "0",
|
|
506
|
+
y: "0",
|
|
507
|
+
width,
|
|
508
|
+
height,
|
|
509
|
+
viewBox,
|
|
510
|
+
strokeWidth: "1"
|
|
511
|
+
}, propsForElement(props2, "svg"), {
|
|
512
|
+
"aria-hidden": true
|
|
513
|
+
}), children);
|
|
510
514
|
}, [patternKey, color, patterns]);
|
|
511
515
|
return /* @__PURE__ */ React.createElement(DefaultSymbol, props);
|
|
512
516
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
return pattern
|
|
517
|
+
const resolvePatternDasharray = (patternKey, patterns) => {
|
|
518
|
+
const pattern = resolvePattern(patternKey, patterns);
|
|
519
|
+
return pattern == null ? void 0 : pattern.dasharray;
|
|
516
520
|
};
|
|
517
521
|
export {
|
|
518
522
|
PatternFill,
|