@semcore/d3-chart 16.0.2-prerelease.4 → 16.0.3-prerelease.0
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 +8 -0
- package/README.md +1 -50
- package/lib/cjs/AnimatedClipPath.js +13 -13
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +29 -27
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +97 -101
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +31 -32
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +26 -27
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +65 -68
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +94 -95
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +36 -34
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +16 -16
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +30 -31
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +27 -33
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +23 -23
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +13 -11
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +26 -27
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +125 -132
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +164 -145
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +47 -49
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +19 -20
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +24 -25
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +20 -23
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +14 -15
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +34 -35
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +28 -29
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +2 -3
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +11 -12
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +10 -11
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +1 -2
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +4 -5
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +5 -8
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +63 -64
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +1 -2
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +4 -5
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +15 -17
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +1 -2
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +2 -3
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +43 -46
- 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 +17 -20
- 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 +17 -21
- 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 +18 -19
- 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 +19 -23
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +13 -14
- 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 +13 -14
- 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 +15 -16
- 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 +17 -18
- 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 +14 -17
- 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 +14 -15
- 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 +12 -13
- 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 +7 -8
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +42 -20
- 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 +20 -20
- 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 +79 -67
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +18 -18
- 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 +1 -2
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +18 -19
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +22 -26
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +21 -0
- package/lib/cjs/component/SvgElement.js.map +1 -0
- package/lib/cjs/createElement.d.js.map +1 -1
- package/lib/cjs/createElement.js +7 -8
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +9 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Area.d.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/Bar.d.js.map +1 -1
- package/lib/cjs/types/Bubble.d.js.map +1 -1
- package/lib/cjs/types/ClipPath.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/GroupBar.d.js.map +1 -1
- package/lib/cjs/types/HorizontalBar.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/Reference.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
- package/lib/cjs/types/StackBar.d.js.map +1 -1
- package/lib/cjs/types/StackedArea.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/context.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +2 -2
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +31 -52
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +11 -10
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +27 -24
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +96 -98
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +28 -27
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +24 -24
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +63 -65
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +92 -92
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +36 -33
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +14 -13
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +27 -26
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +24 -28
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +20 -19
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +4 -2
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +25 -25
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +122 -128
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +162 -142
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +44 -43
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +17 -17
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +22 -22
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +17 -19
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +12 -12
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +33 -33
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +26 -26
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +11 -11
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +9 -9
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +3 -3
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +1 -1
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +61 -61
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +2 -2
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +14 -13
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +2 -2
- 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 +40 -41
- 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 +16 -16
- 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 +15 -17
- 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 +17 -15
- 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 +17 -17
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +11 -10
- 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 +12 -10
- 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 +14 -12
- 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 +15 -14
- 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 +12 -13
- 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 +13 -11
- 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 +10 -9
- 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/Chart/index.js +6 -6
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +40 -17
- 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 +18 -17
- 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 +77 -64
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +16 -15
- 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/ChartLegend/index.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +16 -16
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +20 -21
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
- package/lib/es6/component/SvgElement.js +14 -0
- package/lib/es6/component/SvgElement.js.map +1 -0
- package/lib/es6/createElement.d.js.map +1 -1
- package/lib/es6/createElement.js +5 -5
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Area.d.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/Bar.d.js.map +1 -1
- package/lib/es6/types/Bubble.d.js.map +1 -1
- package/lib/es6/types/ClipPath.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/GroupBar.d.js.map +1 -1
- package/lib/es6/types/HorizontalBar.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/Reference.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/ScatterPlot.d.js.map +1 -1
- package/lib/es6/types/StackBar.d.js.map +1 -1
- package/lib/es6/types/StackedArea.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/types/context.d.js.map +1 -1
- package/lib/es6/types/index.d.js +1 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +11 -13
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +10 -7
- package/lib/esm/Area.mjs +30 -25
- package/lib/esm/Axis.mjs +67 -67
- package/lib/esm/Bar.mjs +31 -28
- package/lib/esm/Bubble.mjs +28 -26
- package/lib/esm/CompactHorizontalBar.mjs +61 -60
- package/lib/esm/Donut.mjs +50 -49
- package/lib/esm/Dots.mjs +32 -27
- package/lib/esm/GroupBar.mjs +14 -11
- package/lib/esm/HorizontalBar.mjs +30 -27
- package/lib/esm/Hover.mjs +28 -30
- package/lib/esm/Line.mjs +23 -20
- package/lib/esm/Pattern.mjs +1 -1
- package/lib/esm/Plot.mjs +27 -25
- package/lib/esm/Radar.mjs +90 -94
- package/lib/esm/RadialTree.mjs +86 -86
- package/lib/esm/Reference.mjs +34 -31
- package/lib/esm/ResponsiveContainer.mjs +19 -17
- package/lib/esm/ScatterPlot.mjs +26 -24
- package/lib/esm/StackBar.mjs +17 -17
- package/lib/esm/StackedArea.mjs +13 -11
- package/lib/esm/Tooltip.mjs +35 -33
- package/lib/esm/Venn.mjs +29 -27
- package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -2
- package/lib/esm/a11y/PlotA11yModule.mjs +8 -8
- package/lib/esm/a11y/PlotA11yView.mjs +9 -9
- package/lib/esm/a11y/focus.mjs +3 -3
- package/lib/esm/a11y/hints.mjs +1 -1
- package/lib/esm/a11y/insights.mjs +77 -78
- package/lib/esm/a11y/intl.mjs +1 -1
- package/lib/esm/a11y/locale.mjs +2 -2
- package/lib/esm/a11y/serialize.mjs +12 -12
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/component/Chart/AbstractChart.mjs +38 -37
- package/lib/esm/component/Chart/AreaChart.mjs +19 -15
- package/lib/esm/component/Chart/BarChart.mjs +20 -17
- package/lib/esm/component/Chart/BubbleChart.mjs +16 -13
- package/lib/esm/component/Chart/CigaretteChart.mjs +24 -17
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +18 -10
- package/lib/esm/component/Chart/DonutChart.mjs +13 -10
- package/lib/esm/component/Chart/HistogramChart.mjs +18 -12
- package/lib/esm/component/Chart/LineChart.mjs +18 -12
- package/lib/esm/component/Chart/RadarChart.mjs +19 -12
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +14 -11
- package/lib/esm/component/Chart/VennChart.mjs +12 -9
- package/lib/esm/component/Chart/index.mjs +6 -6
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +42 -17
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +21 -18
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +67 -56
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +23 -20
- package/lib/esm/component/Cigarette/Cigarette.mjs +18 -16
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +20 -19
- package/lib/esm/component/SvgElement.mjs +14 -0
- package/lib/esm/createElement.mjs +5 -5
- package/lib/esm/index.mjs +2 -0
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/utils.mjs +8 -8
- package/lib/types/Area.d.ts +7 -6
- package/lib/types/Axis.d.ts +4 -3
- package/lib/types/Bar.d.ts +7 -6
- package/lib/types/Bubble.d.ts +6 -5
- package/lib/types/ClipPath.d.ts +4 -3
- package/lib/types/CompactHorizontalBar.d.ts +7 -8
- package/lib/types/Donut.d.ts +6 -5
- package/lib/types/GroupBar.d.ts +6 -6
- package/lib/types/HorizontalBar.d.ts +7 -6
- package/lib/types/Hover.d.ts +8 -8
- package/lib/types/Line.d.ts +7 -6
- package/lib/types/Pattern.d.ts +51 -51
- package/lib/types/Plot.d.ts +10 -9
- package/lib/types/Radar.d.ts +8 -7
- package/lib/types/RadialTree.d.ts +9 -54
- package/lib/types/Reference.d.ts +5 -4
- package/lib/types/ResponsiveContainer.d.ts +5 -4
- package/lib/types/ScatterPlot.d.ts +6 -5
- package/lib/types/StackBar.d.ts +7 -6
- package/lib/types/StackedArea.d.ts +6 -5
- package/lib/types/Tooltip.d.ts +14 -12
- package/lib/types/Venn.d.ts +7 -6
- package/lib/types/a11y/DataAccessibilityTable.d.ts +2 -2
- package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
- package/lib/types/a11y/hints.d.ts +5 -5
- package/lib/types/a11y/insights.d.ts +1 -1
- package/lib/types/a11y/intl.d.ts +1 -1
- package/lib/types/a11y/serialize.d.ts +7 -7
- package/lib/types/a11y/summarize.d.ts +2 -2
- package/lib/types/component/Chart/AbstractChart.d.ts +6 -6
- package/lib/types/component/Chart/AbstractChart.type.d.ts +27 -27
- package/lib/types/component/Chart/AreaChart.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +6 -6
- package/lib/types/component/Chart/BarChart.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +6 -6
- package/lib/types/component/Chart/BubbleChart.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +4 -4
- package/lib/types/component/Chart/CigaretteChart.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +4 -4
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +5 -5
- package/lib/types/component/Chart/DonutChart.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +5 -5
- package/lib/types/component/Chart/HistogramChart.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +4 -4
- package/lib/types/component/Chart/LineChart.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +7 -7
- package/lib/types/component/Chart/RadarChart.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +4 -4
- package/lib/types/component/Chart/ScatterPlotChart.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +5 -5
- package/lib/types/component/Chart/VennChart.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +4 -4
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +6 -4
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +4 -5
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +4 -5
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +17 -10
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -5
- package/lib/types/component/StackGroupBar/StackGroupBar.d.ts +1 -1
- package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts +3 -4
- package/lib/types/component/SvgElement.d.ts +10 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/utils.d.ts +6 -6
- package/package.json +22 -23
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
5
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _get from "@babel/runtime/helpers/get";
|
|
6
8
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
12
|
import { createComponent } from '@semcore/core';
|
|
13
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
14
|
+
import { Flex, Box } from '@semcore/flex-box';
|
|
15
|
+
import { Text } from '@semcore/typography';
|
|
11
16
|
import { scaleLinear, scaleTime } from 'd3-scale';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
|
|
12
19
|
// @ts-ignore
|
|
13
20
|
import { Area, minMax, HoverLine, StackedArea } from '../..';
|
|
14
21
|
import { AbstractChart } from './AbstractChart';
|
|
15
|
-
import { Flex, Box } from '@semcore/flex-box';
|
|
16
|
-
import { Text } from '@semcore/typography';
|
|
17
22
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
18
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
19
23
|
var AreaChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
20
|
-
_inherits(AreaChartComponent, _AbstractChart);
|
|
21
|
-
var _super = _createSuper(AreaChartComponent);
|
|
22
24
|
function AreaChartComponent() {
|
|
23
25
|
_classCallCheck(this, AreaChartComponent);
|
|
24
|
-
return
|
|
26
|
+
return _callSuper(this, AreaChartComponent, arguments);
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
_inherits(AreaChartComponent, _AbstractChart);
|
|
29
|
+
return _createClass(AreaChartComponent, [{
|
|
27
30
|
key: "xScale",
|
|
28
31
|
get: function get() {
|
|
29
32
|
var _this$asProps = this.asProps,
|
|
@@ -52,15 +55,13 @@ var AreaChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
52
55
|
_this$asProps2$margin = _this$asProps2.marginX,
|
|
53
56
|
marginX = _this$asProps2$margin === void 0 ? 24 : _this$asProps2$margin,
|
|
54
57
|
plotHeight = _this$asProps2.plotHeight,
|
|
55
|
-
stacked = _this$asProps2.stacked
|
|
56
|
-
data = _this$asProps2.data,
|
|
57
|
-
groupKey = _this$asProps2.groupKey;
|
|
58
|
+
stacked = _this$asProps2.stacked;
|
|
58
59
|
if (yScale) {
|
|
59
60
|
return yScale;
|
|
60
61
|
}
|
|
61
|
-
var flatValues =
|
|
62
|
+
var flatValues = _superPropGet(AreaChartComponent, "flatValues", this, 1);
|
|
62
63
|
var min = Math.min.apply(Math, _toConsumableArray(flatValues));
|
|
63
|
-
var max = stacked ?
|
|
64
|
+
var max = stacked ? _superPropGet(AreaChartComponent, "maxStackedValue", this, 1) : Math.max.apply(Math, _toConsumableArray(flatValues));
|
|
64
65
|
return scaleLinear().range([plotHeight - marginX, this.plotPadding]).domain([min, max]);
|
|
65
66
|
}
|
|
66
67
|
}, {
|
|
@@ -154,7 +155,6 @@ var AreaChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
154
155
|
});
|
|
155
156
|
}
|
|
156
157
|
}]);
|
|
157
|
-
return AreaChartComponent;
|
|
158
158
|
}(AbstractChart);
|
|
159
159
|
_defineProperty(AreaChartComponent, "displayName", 'Chart.Area');
|
|
160
160
|
_defineProperty(AreaChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","names":["React","createComponent","scaleLinear","scaleTime","Area","minMax","HoverLine","StackedArea","AbstractChart","Flex","Box","Text","localizedMessages","i18nEnhance","AreaChartComponent","_AbstractChart","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","data","groupKey","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","stacked","flatValues","_get","_getPrototypeOf","prototype","min","Math","_toConsumableArray","max","value","renderChart","_this$asProps3","curve","showDots","_this$state","state","dataDefinitions","highlightedLine","createElement","x","map","item","index","checked","y","id","color","transparent","Dots","display","renderTooltip","_this","_this$asProps4","showTotalInTooltip","showTooltip","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","dataItem","total","totalValue","children","Fragment","Title","toString","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_defineProperty","AreaChart"],"sources":["../../../../src/component/Chart/AreaChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\n// @ts-ignore\nimport { Area, minMax, HoverLine, StackedArea } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { AreaChartData, AreaChartProps, AreaChartType } from './AreaChart.type';\nimport { Flex, Box } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\n\nclass AreaChartComponent extends AbstractChart<\n AreaChartData,\n AreaChartProps,\n typeof AreaChartComponent.enhance\n> {\n static displayName = 'Chart.Area';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale, marginY = 40, plotWidth, data, groupKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime(domain, range);\n }\n\n return scaleLinear(domain, range);\n }\n\n get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 24, plotHeight, stacked, data, groupKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n const min = Math.min(...flatValues);\n const max = stacked ? super.maxStackedValue : Math.max(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n renderChart() {\n const { groupKey, curve, showDots, stacked } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n if (stacked) {\n return (\n <StackedArea x={groupKey}>\n {dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <StackedArea.Area\n x={groupKey}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <StackedArea.Area.Dots display />}\n </StackedArea.Area>\n )\n );\n })}\n </StackedArea>\n );\n }\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Area\n x={groupKey}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <Area.Dots display />}\n </Area>\n )\n );\n });\n }\n\n renderTooltip() {\n const { data, groupKey, showTotalInTooltip, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <HoverLine.Tooltip x={groupKey} wMin={100}>\n {({ xIndex }: any) => {\n const dataItem = data[xIndex];\n const total = this.totalValue(dataItem);\n\n return {\n children: (\n <>\n <HoverLine.Tooltip.Title>{dataItem[groupKey]?.toString()}</HoverLine.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Flex justifyContent='space-between' key={item.id}>\n <HoverLine.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverLine.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(dataItem[item.id])}</Text>\n </Flex>\n )\n );\n })}\n\n {showTotalInTooltip === true && (\n <Flex mt={2} justifyContent='space-between'>\n <Box mr={4}>Total</Box>\n <Text bold>{total}</Text>\n </Flex>\n )}\n </>\n ),\n };\n }}\n </HoverLine.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Area' });\n }\n}\n\nexport const AreaChart: AreaChartType = createComponent(AreaChartComponent);\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAAsBC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAC9D;AACA,SAASC,IAAI,EAAEC,MAAM,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC5D,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,iBAAiB,QAAQ,oDAAoD;AACtF,OAAOC,WAAW,MAAM,8CAA8C;AAAC,IAEjEC,kBAAkB,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,kBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAAK,eAAA,OAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,kBAAA;IAAAS,GAAA;IAAAC,GAAA,EAStB,SAAAA,IAAA,EAAa;MACX,IAAAC,aAAA,GAA4D,IAAI,CAACC,OAAO;QAAhEC,MAAM,GAAAF,aAAA,CAANE,MAAM;QAAAC,qBAAA,GAAAH,aAAA,CAAEI,OAAO;QAAPA,OAAO,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;QAAEE,SAAS,GAAAL,aAAA,CAATK,SAAS;QAAEC,IAAI,GAAAN,aAAA,CAAJM,IAAI;QAAEC,QAAQ,GAAAP,aAAA,CAARO,QAAQ;MAEvD,IAAIL,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,IAAMM,QAAQ,GAAGF,IAAI,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC;MAClC,IAAME,KAA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E;EAAC;EAAA,OAAAxF,kBAAA;AAAA,EAxI8BN,aAAa;AAAA+F,eAAA,CAAxCzF,kBAAkB,iBAKD,YAAY;AAAAyF,eAAA,CAL7BzF,kBAAkB,aAOL,CAACD,WAAW,CAACD,iBAAiB,CAAC,CAAC;AAoInD,OAAO,IAAM4F,SAAwB,GAAGvG,eAAe,CAACa,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"AreaChart.js","names":["createComponent","i18nEnhance","Flex","Box","Text","scaleLinear","scaleTime","React","Area","minMax","HoverLine","StackedArea","AbstractChart","localizedMessages","AreaChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","get","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","data","groupKey","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","stacked","flatValues","_superPropGet","min","Math","apply","_toConsumableArray","max","value","renderChart","_this$asProps3","curve","showDots","_this$state","state","dataDefinitions","highlightedLine","createElement","x","map","item","index","checked","y","id","color","transparent","Dots","display","renderTooltip","_this","_this$asProps4","showTotalInTooltip","showTooltip","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","dataItem","total","totalValue","children","Fragment","Title","toString","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_defineProperty","AreaChart"],"sources":["../../../../src/component/Chart/AreaChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Flex, Box } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { Area, minMax, HoverLine, StackedArea } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { AreaChartData, AreaChartProps, AreaChartType } from './AreaChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass AreaChartComponent extends AbstractChart<\n AreaChartData,\n AreaChartProps,\n typeof AreaChartComponent.enhance\n> {\n static displayName = 'Chart.Area';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale, marginY = 40, plotWidth, data, groupKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime(domain, range);\n }\n\n return scaleLinear(domain, range);\n }\n\n get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 24, plotHeight, stacked } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n const min = Math.min(...flatValues);\n const max = stacked ? super.maxStackedValue : Math.max(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n renderChart() {\n const { groupKey, curve, showDots, stacked } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n if (stacked) {\n return (\n <StackedArea x={groupKey}>\n {dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <StackedArea.Area\n x={groupKey}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <StackedArea.Area.Dots display />}\n </StackedArea.Area>\n )\n );\n })}\n </StackedArea>\n );\n }\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Area\n x={groupKey}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <Area.Dots display />}\n </Area>\n )\n );\n });\n }\n\n renderTooltip() {\n const { data, groupKey, showTotalInTooltip, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <HoverLine.Tooltip x={groupKey} wMin={100}>\n {({ xIndex }: any) => {\n const dataItem = data[xIndex];\n const total = this.totalValue(dataItem);\n\n return {\n children: (\n <>\n <HoverLine.Tooltip.Title>{dataItem[groupKey]?.toString()}</HoverLine.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Flex justifyContent='space-between' key={item.id}>\n <HoverLine.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverLine.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(dataItem[item.id])}</Text>\n </Flex>\n )\n );\n })}\n\n {showTotalInTooltip === true && (\n <Flex mt={2} justifyContent='space-between'>\n <Box mr={4}>Total</Box>\n <Text bold>{total}</Text>\n </Flex>\n )}\n </>\n ),\n };\n }}\n </HoverLine.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Area' });\n }\n}\n\nexport const AreaChart: AreaChartType = createComponent(AreaChartComponent);\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AACnE,OAAOC,KAAK,MAAM,OAAO;;AAEzB;AACA,SAASC,IAAI,EAAEC,MAAM,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC5D,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAEjFC,kBAAkB,0BAAAC,cAAA;EAAA,SAAAD,mBAAA;IAAAE,eAAA,OAAAF,kBAAA;IAAA,OAAAG,UAAA,OAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,kBAAA,EAAAC,cAAA;EAAA,OAAAK,YAAA,CAAAN,kBAAA;IAAAO,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BACzCnF,KAAA,CAAAsD,aAAA,CAAC1D,GAAG;YAACyF,EAAE,EAAE;UAAE,GAAC,OAAU,CAAC,eACvBrF,KAAA,CAAAsD,aAAA,CAACzD,IAAI;YAAC0F,IAAI;UAAA,GAAEV,KAAY,CACpB,CAER;QAEN,CAAC;MACH,CACiB,CAAC;IAExB;EAAC;IAAA/D,GAAA;IAAA+B,KAAA,EAED,SAAU6C,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAACzE,OAAO,CAAC0E,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;AAAA,EAxI8BvF,aAAa;AAAAwF,eAAA,CAAxCtF,kBAAkB,iBAKD,YAAY;AAAAsF,eAAA,CAL7BtF,kBAAkB,aAOL,CAACb,WAAW,CAACY,iBAAiB,CAAC,CAAC;AAoInD,OAAO,IAAMwF,SAAwB,GAAGrG,eAAe,CAACc,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.type.js","names":[],"sources":["../../../../src/component/Chart/AreaChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport
|
|
1
|
+
{"version":3,"file":"AreaChart.type.js","names":[],"sources":["../../../../src/component/Chart/AreaChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type AreaChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type AreaChartProps = BaseChartProps<AreaChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n showDots?: boolean;\n curve?: CurveFactory;\n stacked?: boolean;\n};\n\nexport type AreaChartType = Intergalactic.Component<typeof Flex, AreaChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,33 +2,33 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _get from "@babel/runtime/helpers/get";
|
|
8
9
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
12
13
|
import { createComponent } from '@semcore/core';
|
|
14
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
15
|
+
import { Box, Flex } from '@semcore/flex-box';
|
|
16
|
+
import { Text } from '@semcore/typography';
|
|
13
17
|
import { scaleBand, scaleLinear, scaleTime } from 'd3-scale';
|
|
18
|
+
import React from 'react';
|
|
14
19
|
// @ts-ignore
|
|
15
20
|
import { minMax, GroupBar, HoverRect, StackBar, Line } from '../..';
|
|
16
21
|
import { AbstractChart } from './AbstractChart';
|
|
17
|
-
import { Box, Flex } from '@semcore/flex-box';
|
|
18
|
-
import { Text } from '@semcore/typography';
|
|
19
22
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
20
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
21
23
|
var BarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
22
|
-
_inherits(BarChartComponent, _AbstractChart);
|
|
23
|
-
var _super = _createSuper(BarChartComponent);
|
|
24
24
|
function BarChartComponent() {
|
|
25
25
|
var _this;
|
|
26
26
|
_classCallCheck(this, BarChartComponent);
|
|
27
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
28
|
args[_key] = arguments[_key];
|
|
29
29
|
}
|
|
30
|
-
_this =
|
|
31
|
-
_defineProperty(
|
|
30
|
+
_this = _callSuper(this, BarChartComponent, [].concat(args));
|
|
31
|
+
_defineProperty(_this, "handleClickBar", function (_data, e, barIndex, barKey) {
|
|
32
32
|
var onClickBar = _this.asProps.onClickBar;
|
|
33
33
|
if (onClickBar) {
|
|
34
34
|
onClickBar(barIndex, barKey, e);
|
|
@@ -36,7 +36,8 @@ var BarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
36
36
|
});
|
|
37
37
|
return _this;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
_inherits(BarChartComponent, _AbstractChart);
|
|
40
|
+
return _createClass(BarChartComponent, [{
|
|
40
41
|
key: "xScale",
|
|
41
42
|
get: function get() {
|
|
42
43
|
var _this$asProps = this.asProps,
|
|
@@ -73,8 +74,6 @@ var BarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
73
74
|
value: function renderTrend(key) {
|
|
74
75
|
var _this$asProps3 = this.asProps,
|
|
75
76
|
groupKey = _this$asProps3.groupKey,
|
|
76
|
-
_this$asProps3$type = _this$asProps3.type,
|
|
77
|
-
type = _this$asProps3$type === void 0 ? 'group' : _this$asProps3$type,
|
|
78
77
|
invertAxis = _this$asProps3.invertAxis,
|
|
79
78
|
trend = _this$asProps3.trend;
|
|
80
79
|
var withTrend = this.state.withTrend;
|
|
@@ -85,7 +84,7 @@ var BarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
85
84
|
key: "".concat(key, "_").concat(groupKey),
|
|
86
85
|
x: invertAxis ? 'y' : 'x',
|
|
87
86
|
y: invertAxis ? 'x' : 'y',
|
|
88
|
-
color:
|
|
87
|
+
color: "wall",
|
|
89
88
|
style: {
|
|
90
89
|
strokeWidth: 3,
|
|
91
90
|
strokeDasharray: 5
|
|
@@ -260,11 +259,10 @@ var BarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
260
259
|
plotHeight = _this$asProps7.plotHeight,
|
|
261
260
|
invertAxis = _this$asProps7.invertAxis,
|
|
262
261
|
type = _this$asProps7.type;
|
|
263
|
-
var max = type === 'stack' ?
|
|
262
|
+
var max = type === 'stack' ? _superPropGet(BarChartComponent, "maxStackedValue", this, 1) : Math.max.apply(Math, _toConsumableArray(_superPropGet(BarChartComponent, "flatValues", this, 1)));
|
|
264
263
|
return scaleLinear().range(invertAxis ? [marginY, plotWidth - this.plotPadding] : [plotHeight - marginX, this.plotPadding]).domain([0, max]);
|
|
265
264
|
}
|
|
266
265
|
}]);
|
|
267
|
-
return BarChartComponent;
|
|
268
266
|
}(AbstractChart);
|
|
269
267
|
_defineProperty(BarChartComponent, "displayName", 'Chart.Bar');
|
|
270
268
|
_defineProperty(BarChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","names":["React","createComponent","scaleBand","scaleLinear","scaleTime","minMax","GroupBar","HoverRect","StackBar","Line","AbstractChart","Box","Flex","Text","localizedMessages","i18nEnhance","BarChartComponent","_AbstractChart","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","_data","e","barIndex","barKey","onClickBar","asProps","_createClass","key","get","_this$asProps","xScale","invertAxis","valueScale","categoryScale","_this$asProps2","yScale","value","defaultLegendProps","props","trend","undefined","withTrend","renderTrend","_this$asProps3","groupKey","_this$asProps3$type","type","state","trendItem","createElement","data","x","y","color","style","strokeWidth","strokeDasharray","Dots","display","renderChart","_this2","_this$asProps4","_this$asProps4$type","_this$state","dataDefinitions","highlightedLine","item","BarComponent","HorizontalBar","Bar","Fragment","id","onClick","handleClickBar","map","index","commonBarComponentProps","transparent","checked","_extends","renderTooltip","_this3","_this$asProps5","showTotalInTooltip","showTooltip","onClickHoverRect","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","yIndex","dataItem","total","totalValue","children","Title","toString","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_this$asProps6","_this$asProps6$margin","marginY","_this$asProps6$margin2","marginX","plotWidth","plotHeight","testItem","range","plotPadding","Date","Number","isNaN","getMilliseconds","domain","paddingInner","paddingOuter","_this$asProps7","_this$asProps7$margin","_this$asProps7$margin2","max","_get","_getPrototypeOf","prototype","Math","_toConsumableArray","BarChart"],"sources":["../../../../src/component/Chart/BarChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { BaseLegendProps } from './AbstractChart.type';\nimport { BarChartData, BarChartProps, BarChartType } from './BarChart.type';\nimport { scaleBand, scaleLinear, scaleTime } from 'd3-scale';\n// @ts-ignore\nimport { minMax, GroupBar, HoverRect, StackBar, Line } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { BarProps } from '../../types';\nimport { Box, Flex } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\n\nclass BarChartComponent extends AbstractChart<\n BarChartData,\n BarChartProps,\n typeof BarChartComponent.enhance\n> {\n static displayName = 'Chart.Bar';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale, invertAxis } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return invertAxis ? this.valueScale : this.categoryScale;\n }\n\n get yScale() {\n const { yScale, invertAxis } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return invertAxis ? this.categoryScale : this.valueScale;\n }\n\n protected defaultLegendProps(): Partial<BaseLegendProps> {\n if (this.props.trend !== undefined) {\n return { withTrend: true };\n }\n\n return {};\n }\n\n renderTrend(key: LegendItemKey) {\n const { groupKey, type = 'group', invertAxis, trend } = this.asProps;\n const { withTrend } = this.state;\n const trendItem = trend?.[key];\n\n if (withTrend && trendItem) {\n return (\n <Line\n data={trendItem}\n key={`${key}_${groupKey}`}\n x={invertAxis ? 'y' : 'x'}\n y={invertAxis ? 'x' : 'y'}\n color={'wall'}\n style={{ strokeWidth: 3, strokeDasharray: 5 }}\n >\n <Line.Dots data={trendItem} display />\n </Line>\n );\n }\n\n return null;\n }\n\n renderChart() {\n const { groupKey, type = 'group', invertAxis } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n if (dataDefinitions.length === 1) {\n const item = dataDefinitions[0];\n const BarComponent = invertAxis ? GroupBar.HorizontalBar : GroupBar.Bar;\n\n return (\n <>\n <BarComponent\n x={invertAxis ? item.id : groupKey}\n y={invertAxis ? groupKey : item.id}\n key={item.id}\n color={item.color}\n onClick={this.handleClickBar}\n />\n {this.renderTrend(item.id)}\n </>\n );\n }\n\n if (type === 'group') {\n return (\n <>\n <GroupBar x={invertAxis ? undefined : groupKey} y={invertAxis ? groupKey : undefined}>\n {dataDefinitions.map((item, index) => {\n const BarComponent = invertAxis ? GroupBar.HorizontalBar : GroupBar.Bar;\n\n const commonBarComponentProps: BarProps = {\n color: item.color,\n transparent: highlightedLine !== -1 && highlightedLine !== index,\n onClick: this.handleClickBar,\n };\n\n if (invertAxis) {\n commonBarComponentProps.x = item.id;\n } else {\n commonBarComponentProps.y = item.id;\n }\n\n return item.checked && <BarComponent key={item.id} {...commonBarComponentProps} />;\n })}\n </GroupBar>\n {dataDefinitions.map((item) => item.checked && this.renderTrend(item.id))}\n </>\n );\n }\n\n if (type === 'stack') {\n return (\n <>\n <StackBar x={invertAxis ? undefined : groupKey} y={invertAxis ? groupKey : undefined}>\n {dataDefinitions.map((item, index) => {\n const BarComponent = invertAxis ? StackBar.HorizontalBar : StackBar.Bar;\n\n const commonBarComponentProps: BarProps = {\n color: item.color,\n transparent: highlightedLine !== -1 && highlightedLine !== index,\n onClick: this.handleClickBar,\n };\n\n if (invertAxis) {\n commonBarComponentProps.x = item.id;\n } else {\n commonBarComponentProps.y = item.id;\n }\n\n return item.checked && <BarComponent key={item.id} {...commonBarComponentProps} />;\n })}\n </StackBar>\n {dataDefinitions.map((item) => item.checked && this.renderTrend(item.id))}\n </>\n );\n }\n\n return null;\n }\n\n renderTooltip(): React.ReactNode {\n const { data, groupKey, showTotalInTooltip, showTooltip, invertAxis, onClickHoverRect } =\n this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <HoverRect.Tooltip\n x={invertAxis ? undefined : groupKey}\n y={invertAxis ? groupKey : undefined}\n wMin={100}\n onClick={onClickHoverRect}\n >\n {({ xIndex, yIndex }: any) => {\n const index = invertAxis ? yIndex : xIndex;\n const dataItem = data[index];\n const total = this.totalValue(dataItem);\n\n return {\n children: (\n <>\n <HoverRect.Tooltip.Title>{dataItem[groupKey]?.toString()}</HoverRect.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Flex justifyContent='space-between' key={item.id}>\n <HoverRect.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(dataItem[item.id])}</Text>\n </Flex>\n )\n );\n })}\n\n {showTotalInTooltip === true && (\n <Flex mt={2} justifyContent='space-between'>\n <Box mr={4}>Total</Box>\n <Text bold>{total}</Text>\n </Flex>\n )}\n </>\n ),\n };\n }}\n </HoverRect.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Bar' });\n }\n\n private handleClickBar = (\n _data: BarChartData[0],\n e: React.SyntheticEvent,\n barIndex: number,\n barKey: string,\n ) => {\n const { onClickBar } = this.asProps;\n\n if (onClickBar) {\n onClickBar(barIndex, barKey, e);\n }\n };\n\n private get categoryScale() {\n const {\n marginY = 40,\n marginX = 24,\n plotWidth,\n plotHeight,\n invertAxis,\n data,\n groupKey,\n } = this.asProps;\n\n const testItem = data[0][groupKey];\n const range = invertAxis\n ? [plotHeight - marginX, this.plotPadding]\n : [marginY, plotWidth - this.plotPadding];\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n const domain = minMax(data, groupKey);\n\n return scaleTime(domain, range);\n }\n\n const domain = data.map((item) => item[groupKey]);\n\n return scaleBand(domain, range).paddingInner(0.4).paddingOuter(0.2);\n }\n\n private get valueScale() {\n const { marginY = 40, marginX = 24, plotWidth, plotHeight, invertAxis, type } = this.asProps;\n\n const max = type === 'stack' ? super.maxStackedValue : Math.max(...super.flatValues);\n\n return scaleLinear()\n .range(\n invertAxis\n ? [marginY, plotWidth - this.plotPadding]\n : [plotHeight - marginX, this.plotPadding],\n )\n .domain([0, max]);\n }\n}\n\nexport const BarChart: BarChartType = createComponent(BarChartComponent);\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,eAAe;AAG/C,SAASC,SAAS,EAAEC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAC5D;AACA,SAASC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,OAAO;AACnE,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB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AAS,GAAAY,cAAA,CAATZ,SAAS;QAAEC,UAAU,GAAAW,cAAA,CAAVX,UAAU;QAAEnF,UAAU,GAAA8F,cAAA,CAAV9F,UAAU;QAAEe,IAAI,GAAA+E,cAAA,CAAJ/E,IAAI;MAE3E,IAAMkF,GAAG,GAAGlF,IAAI,KAAK,OAAO,GAAAmF,IAAA,CAAAC,eAAA,CAAAhI,iBAAA,CAAAiI,SAAA,8BAA2BC,IAAI,CAACJ,GAAG,CAAAhH,KAAA,CAARoH,IAAI,EAAAC,kBAAA,CAAAJ,IAAA,CAAAC,eAAA,CAAAhI,iBAAA,CAAAiI,SAAA,wBAAyB;MAEpF,OAAO9I,WAAW,EAAE,CACjB+H,KAAK,CACJrF,UAAU,GACN,CAAC+E,OAAO,EAAEG,SAAS,GAAG,IAAI,CAACI,WAAW,CAAC,GACvC,CAACH,UAAU,GAAGF,OAAO,EAAE,IAAI,CAACK,WAAW,CAAC,CAC7C,CACAK,MAAM,CAAC,CAAC,CAAC,EAAEM,GAAG,CAAC,CAAC;IACrB;EAAC;EAAA,OAAA9H,iBAAA;AAAA,EAxP6BN,aAAa;AAAAsB,eAAA,CAAvChB,iBAAiB,iBAKA,WAAW;AAAAgB,eAAA,CAL5BhB,iBAAiB,aAOJ,CAACD,WAAW,CAACD,iBAAiB,CAAC,CAAC;AAoPnD,OAAO,IAAMsI,QAAsB,GAAGnJ,eAAe,CAACe,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"BarChart.js","names":["createComponent","i18nEnhance","Box","Flex","Text","scaleBand","scaleLinear","scaleTime","React","minMax","GroupBar","HoverRect","StackBar","Line","AbstractChart","localizedMessages","BarChartComponent","_AbstractChart","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","_data","e","barIndex","barKey","onClickBar","asProps","_inherits","_createClass","key","get","_this$asProps","xScale","invertAxis","valueScale","categoryScale","_this$asProps2","yScale","value","defaultLegendProps","props","trend","undefined","withTrend","renderTrend","_this$asProps3","groupKey","state","trendItem","createElement","data","x","y","color","style","strokeWidth","strokeDasharray","Dots","display","renderChart","_this2","_this$asProps4","_this$asProps4$type","type","_this$state","dataDefinitions","highlightedLine","item","BarComponent","HorizontalBar","Bar","Fragment","id","onClick","handleClickBar","map","index","commonBarComponentProps","transparent","checked","_extends","renderTooltip","_this3","_this$asProps5","showTotalInTooltip","showTooltip","onClickHoverRect","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","yIndex","dataItem","total","totalValue","children","Title","toString","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_this$asProps6","_this$asProps6$margin","marginY","_this$asProps6$margin2","marginX","plotWidth","plotHeight","testItem","range","plotPadding","Date","Number","isNaN","getMilliseconds","domain","paddingInner","paddingOuter","_this$asProps7","_this$asProps7$margin","_this$asProps7$margin2","max","_superPropGet","Math","apply","_toConsumableArray","BarChart"],"sources":["../../../../src/component/Chart/BarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Box, Flex } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport { scaleBand, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseLegendProps } from './AbstractChart.type';\nimport type { BarChartData, BarChartProps, BarChartType } from './BarChart.type';\n// @ts-ignore\nimport { minMax, GroupBar, HoverRect, StackBar, Line } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { BarProps } from '../../types';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass BarChartComponent extends AbstractChart<\n BarChartData,\n BarChartProps,\n typeof BarChartComponent.enhance\n> {\n static displayName = 'Chart.Bar';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale, invertAxis } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return invertAxis ? this.valueScale : this.categoryScale;\n }\n\n get yScale() {\n const { yScale, invertAxis } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return invertAxis ? this.categoryScale : this.valueScale;\n }\n\n protected defaultLegendProps(): Partial<BaseLegendProps> {\n if (this.props.trend !== undefined) {\n return { withTrend: true };\n }\n\n return {};\n }\n\n renderTrend(key: LegendItemKey) {\n const { groupKey, invertAxis, trend } = this.asProps;\n const { withTrend } = this.state;\n const trendItem = trend?.[key];\n\n if (withTrend && trendItem) {\n return (\n <Line\n data={trendItem}\n key={`${key}_${groupKey}`}\n x={invertAxis ? 'y' : 'x'}\n y={invertAxis ? 'x' : 'y'}\n color='wall'\n style={{ strokeWidth: 3, strokeDasharray: 5 }}\n >\n <Line.Dots data={trendItem} display />\n </Line>\n );\n }\n\n return null;\n }\n\n renderChart() {\n const { groupKey, type = 'group', invertAxis } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n if (dataDefinitions.length === 1) {\n const item = dataDefinitions[0];\n const BarComponent = invertAxis ? GroupBar.HorizontalBar : GroupBar.Bar;\n\n return (\n <>\n <BarComponent\n x={invertAxis ? item.id : groupKey}\n y={invertAxis ? groupKey : item.id}\n key={item.id}\n color={item.color}\n onClick={this.handleClickBar}\n />\n {this.renderTrend(item.id)}\n </>\n );\n }\n\n if (type === 'group') {\n return (\n <>\n <GroupBar x={invertAxis ? undefined : groupKey} y={invertAxis ? groupKey : undefined}>\n {dataDefinitions.map((item, index) => {\n const BarComponent = invertAxis ? GroupBar.HorizontalBar : GroupBar.Bar;\n\n const commonBarComponentProps: BarProps = {\n color: item.color,\n transparent: highlightedLine !== -1 && highlightedLine !== index,\n onClick: this.handleClickBar,\n };\n\n if (invertAxis) {\n commonBarComponentProps.x = item.id;\n } else {\n commonBarComponentProps.y = item.id;\n }\n\n return item.checked && <BarComponent key={item.id} {...commonBarComponentProps} />;\n })}\n </GroupBar>\n {dataDefinitions.map((item) => item.checked && this.renderTrend(item.id))}\n </>\n );\n }\n\n if (type === 'stack') {\n return (\n <>\n <StackBar x={invertAxis ? undefined : groupKey} y={invertAxis ? groupKey : undefined}>\n {dataDefinitions.map((item, index) => {\n const BarComponent = invertAxis ? StackBar.HorizontalBar : StackBar.Bar;\n\n const commonBarComponentProps: BarProps = {\n color: item.color,\n transparent: highlightedLine !== -1 && highlightedLine !== index,\n onClick: this.handleClickBar,\n };\n\n if (invertAxis) {\n commonBarComponentProps.x = item.id;\n } else {\n commonBarComponentProps.y = item.id;\n }\n\n return item.checked && <BarComponent key={item.id} {...commonBarComponentProps} />;\n })}\n </StackBar>\n {dataDefinitions.map((item) => item.checked && this.renderTrend(item.id))}\n </>\n );\n }\n\n return null;\n }\n\n renderTooltip(): React.ReactNode {\n const { data, groupKey, showTotalInTooltip, showTooltip, invertAxis, onClickHoverRect } =\n this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <HoverRect.Tooltip\n x={invertAxis ? undefined : groupKey}\n y={invertAxis ? groupKey : undefined}\n wMin={100}\n onClick={onClickHoverRect}\n >\n {({ xIndex, yIndex }: any) => {\n const index = invertAxis ? yIndex : xIndex;\n const dataItem = data[index];\n const total = this.totalValue(dataItem);\n\n return {\n children: (\n <>\n <HoverRect.Tooltip.Title>{dataItem[groupKey]?.toString()}</HoverRect.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Flex justifyContent='space-between' key={item.id}>\n <HoverRect.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(dataItem[item.id])}</Text>\n </Flex>\n )\n );\n })}\n\n {showTotalInTooltip === true && (\n <Flex mt={2} justifyContent='space-between'>\n <Box mr={4}>Total</Box>\n <Text bold>{total}</Text>\n </Flex>\n )}\n </>\n ),\n };\n }}\n </HoverRect.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Bar' });\n }\n\n private handleClickBar = (\n _data: BarChartData[0],\n e: React.SyntheticEvent,\n barIndex: number,\n barKey: string,\n ) => {\n const { onClickBar } = this.asProps;\n\n if (onClickBar) {\n onClickBar(barIndex, barKey, e);\n }\n };\n\n private get categoryScale() {\n const {\n marginY = 40,\n marginX = 24,\n plotWidth,\n plotHeight,\n invertAxis,\n data,\n groupKey,\n } = this.asProps;\n\n const testItem = data[0][groupKey];\n const range = invertAxis\n ? [plotHeight - marginX, this.plotPadding]\n : [marginY, plotWidth - this.plotPadding];\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n const domain = minMax(data, groupKey);\n\n return scaleTime(domain, range);\n }\n\n const domain = data.map((item) => item[groupKey]);\n\n return scaleBand(domain, range).paddingInner(0.4).paddingOuter(0.2);\n }\n\n private get valueScale() {\n const { marginY = 40, marginX = 24, plotWidth, plotHeight, invertAxis, type } = this.asProps;\n\n const max = type === 'stack' ? super.maxStackedValue : Math.max(...super.flatValues);\n\n return scaleLinear()\n .range(\n invertAxis\n ? [marginY, plotWidth - this.plotPadding]\n : [plotHeight - marginX, this.plotPadding],\n )\n .domain([0, max]);\n }\n}\n\nexport const BarChart: BarChartType = createComponent(BarChartComponent);\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,SAAS,EAAEC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAC5D,OAAOC,KAAK,MAAM,OAAO;AAIzB;AACA,SAASC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,OAAO;AACnE,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAIjFC,iBAAiB,0BAAAC,cA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I,CAACF,GAAG,CAAAG,KAAA,CAARD,IAAI,EAAAE,kBAAA,CAAAH,aAAA,CAAA1H,iBAAA,yBAAwB,CAAC;MAEpF,OAAOV,WAAW,CAAC,CAAC,CACjBuH,KAAK,CACJpF,UAAU,GACN,CAAC8E,OAAO,EAAEG,SAAS,GAAG,IAAI,CAACI,WAAW,CAAC,GACvC,CAACH,UAAU,GAAGF,OAAO,EAAE,IAAI,CAACK,WAAW,CAC7C,CAAC,CACAK,MAAM,CAAC,CAAC,CAAC,EAAEM,GAAG,CAAC,CAAC;IACrB;EAAC;AAAA,EAxP6B3H,aAAa;AAAAc,eAAA,CAAvCZ,iBAAiB,iBAKA,WAAW;AAAAY,eAAA,CAL5BZ,iBAAiB,aAOJ,CAACf,WAAW,CAACc,iBAAiB,CAAC,CAAC;AAoPnD,OAAO,IAAM+H,QAAsB,GAAG9I,eAAe,CAACgB,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.type.js","names":[],"sources":["../../../../src/component/Chart/BarChart.type.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"BarChart.type.js","names":[],"sources":["../../../../src/component/Chart/BarChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';\nimport type React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype TrendItem = {\n x: number;\n y: number;\n};\n\ntype BarKey = string;\n\nexport type BarChartData = Array<Record<BarKey, string | number | Date>>;\n\nexport type BarChartProps = BaseChartProps<BarChartData> & {\n groupKey: string;\n xScale?: ScaleBand<any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n type?: 'stack' | 'group';\n trend?: Record<LegendItemKey, TrendItem[]>;\n\n /** Handle click by `HoverRect`. `index` is an index of the data array. */\n onClickHoverRect?: (index: number, e: React.SyntheticEvent) => void;\n\n /** Handle click by Bar. */\n onClickBar?: (barItem: number, barKey: BarKey, e: React.SyntheticEvent) => void;\n};\n\nexport type BarChartType = Intergalactic.Component<typeof Flex, BarChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
3
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
9
|
import { createComponent } from '@semcore/core';
|
|
10
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
11
|
+
import { Text } from '@semcore/typography';
|
|
8
12
|
import { scaleLinear } from 'd3-scale';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
|
|
9
15
|
// @ts-ignore
|
|
10
16
|
import { Bubble, calculateBubbleDomain } from '../..';
|
|
11
17
|
import { AbstractChart } from './AbstractChart';
|
|
12
|
-
import { Text } from '@semcore/typography';
|
|
13
18
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
14
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
15
19
|
var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
16
|
-
_inherits(BubbleChartComponent, _AbstractChart);
|
|
17
|
-
var _super = _createSuper(BubbleChartComponent);
|
|
18
20
|
function BubbleChartComponent() {
|
|
19
21
|
_classCallCheck(this, BubbleChartComponent);
|
|
20
|
-
return
|
|
22
|
+
return _callSuper(this, BubbleChartComponent, arguments);
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
_inherits(BubbleChartComponent, _AbstractChart);
|
|
25
|
+
return _createClass(BubbleChartComponent, [{
|
|
23
26
|
key: "dataKeys",
|
|
24
27
|
get: function get() {
|
|
25
28
|
var data = this.props.data;
|
|
@@ -37,7 +40,7 @@ var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
37
40
|
return data.map(function (item, index) {
|
|
38
41
|
var _legendProps$legendMa, _ref, _legendData$label, _legendData$icon, _legendData$defaultCh;
|
|
39
42
|
var key = index.toString();
|
|
40
|
-
var legendData = legendProps === null || legendProps === void 0
|
|
43
|
+
var legendData = legendProps === null || legendProps === void 0 || (_legendProps$legendMa = legendProps.legendMap) === null || _legendProps$legendMa === void 0 ? void 0 : _legendProps$legendMa[key];
|
|
41
44
|
if (item.color === undefined) {
|
|
42
45
|
item.color = _this.resolveColor(key, index);
|
|
43
46
|
}
|
|
@@ -105,8 +108,8 @@ var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
105
108
|
x: "x",
|
|
106
109
|
y: "y",
|
|
107
110
|
value: "value",
|
|
108
|
-
color:
|
|
109
|
-
label:
|
|
111
|
+
color: "color",
|
|
112
|
+
label: "label"
|
|
110
113
|
});
|
|
111
114
|
}
|
|
112
115
|
}, {
|
|
@@ -122,11 +125,11 @@ var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
122
125
|
return {
|
|
123
126
|
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Bubble.Tooltip.Title, null, "Data"), /*#__PURE__*/React.createElement(Text, {
|
|
124
127
|
tag: "div"
|
|
125
|
-
}, "X axis
|
|
128
|
+
}, "X axis", ' ', data[index].x), /*#__PURE__*/React.createElement(Text, {
|
|
126
129
|
tag: "div"
|
|
127
|
-
}, "Y axis
|
|
130
|
+
}, "Y axis", ' ', data[index].y), /*#__PURE__*/React.createElement(Text, {
|
|
128
131
|
tag: "div"
|
|
129
|
-
}, "Value
|
|
132
|
+
}, "Value", ' ', data[index].value))
|
|
130
133
|
};
|
|
131
134
|
});
|
|
132
135
|
}
|
|
@@ -138,7 +141,6 @@ var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
143
|
}]);
|
|
141
|
-
return BubbleChartComponent;
|
|
142
144
|
}(AbstractChart);
|
|
143
145
|
_defineProperty(BubbleChartComponent, "displayName", 'Chart.Bubble');
|
|
144
146
|
_defineProperty(BubbleChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleChart.js","names":["
|
|
1
|
+
{"version":3,"file":"BubbleChart.js","names":["createComponent","i18nEnhance","Text","scaleLinear","React","Bubble","calculateBubbleDomain","AbstractChart","localizedMessages","BubbleChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","get","data","props","map","_","index","toString","value","getDefaultDataDefinitions","_this","_this$props","legendProps","item","_legendProps$legendMa","_ref","_legendData$label","_legendData$icon","_legendData$defaultCh","legendData","legendMap","color","undefined","resolveColor","dataDefinition","id","label","icon","checked","defaultChecked","columns","additionalInfo","count","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","range","plotPadding","domain","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","defaultLegendProps","shape","renderChart","createElement","x","y","renderTooltip","showTooltip","Tooltip","_ref2","children","Fragment","Title","tag","getLegendAriaLabel","getI18nText","chartType","_defineProperty","BubbleChart"],"sources":["../../../../src/component/Chart/BubbleChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { Bubble, calculateBubbleDomain } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { BubbleChartData, BubbleChartProps, BubbleChartType } from './BubbleChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass BubbleChartComponent extends AbstractChart<\n BubbleChartData,\n BubbleChartProps,\n typeof BubbleChartComponent.enhance\n> {\n static displayName = 'Chart.Bubble';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n return data.map((_, index) => index.toString());\n }\n\n protected override getDefaultDataDefinitions(): Array<\n LegendItem & { columns: React.ReactNode[] }\n > {\n const { legendProps, data } = this.props;\n\n return data.map((item, index) => {\n const key = index.toString();\n const legendData = legendProps?.legendMap?.[key];\n\n if (item.color === undefined) {\n item.color = this.resolveColor(key, index);\n }\n\n const dataDefinition: LegendItem & { columns: React.ReactNode[] } = {\n id: key,\n label: legendData?.label ?? item.label ?? key,\n icon: legendData?.icon ?? undefined,\n checked: legendData?.defaultChecked ?? true,\n color: item.color,\n columns: [],\n };\n\n if (legendData?.additionalInfo || legendData?.count) {\n dataDefinition.additionalInfo = legendData.additionalInfo\n ? { label: legendData.additionalInfo }\n : legendData.count\n ? { count: legendData.count }\n : undefined;\n }\n\n return dataDefinition;\n });\n }\n\n get xScale() {\n const { xScale, marginY = 30, plotWidth, data } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = calculateBubbleDomain(data, 'x', range);\n\n return scaleLinear().domain(domain).range(range);\n }\n\n get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, data } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const range = [plotHeight - marginX, this.plotPadding];\n const domain = calculateBubbleDomain(data, 'y', range);\n\n return scaleLinear().domain(domain).range(range);\n }\n\n defaultLegendProps() {\n return {\n shape: 'Circle' as const,\n };\n }\n\n renderChart() {\n return <Bubble x='x' y='y' value='value' color='color' label='label' />;\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Bubble.Tooltip>\n {({ index, data }: any) => {\n return {\n children: (\n <>\n <Bubble.Tooltip.Title>Data</Bubble.Tooltip.Title>\n <Text tag='div'>\n X axis\n {' '}\n {data[index].x}\n </Text>\n <Text tag='div'>\n Y axis\n {' '}\n {data[index].y}\n </Text>\n <Text tag='div'>\n Value\n {' '}\n {data[index].value}\n </Text>\n </>\n ),\n };\n }}\n </Bubble.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Bubble' });\n }\n}\n\nexport const BubbleChart: BubbleChartType = createComponent(BubbleChartComponent);\n"],"mappings":";;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,WAAW,QAA0B,UAAU;AACxD,OAAOC,KAAK,MAAM,OAAO;;AAEzB;AACA,SAASC,MAAM,EAAEC,qBAAqB,QAAQ,OAAO;AACrD,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAGjFC,oBAAoB,0BAAAC,cAAA;EAAA,SAAAD,qBAAA;IAAAE,eAAA,OAAAF,oBAAA;IAAA,OAAAG,UAAA,OAAAH,oBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,oBAAA,EAAAC,cAAA;EAAA,OAAAK,YAAA,CAAAN,oBAAA;IAAAO,GAAA;IAAAC,GAAA,EASxB,SAAAA,IAAA,EAAmC;MACj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../../../src/component/Chart/BubbleChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { ScaleLinear } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\nexport type ScaledValues = {\n x: number[];\n y: number[];\n};\n\nexport type BubbleChartData = Array<{\n x: number;\n y: number;\n value: number;\n label?: string;\n color?: string;\n}>;\n\nexport type BubbleChartProps = BaseChartProps<BubbleChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type BubbleChartType = Intergalactic.Component<typeof Flex, BubbleChartProps>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"BubbleChart.type.js","names":[],"sources":["../../../../src/component/Chart/BubbleChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type ScaledValues = {\n x: number[];\n y: number[];\n};\n\nexport type BubbleChartData = Array<{\n x: number;\n y: number;\n value: number;\n label?: string;\n color?: string;\n}>;\n\nexport type BubbleChartProps = BaseChartProps<BubbleChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type BubbleChartType = Intergalactic.Component<typeof Flex, BubbleChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,47 +2,48 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _get from "@babel/runtime/helpers/get";
|
|
8
9
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
11
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
12
12
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
13
|
-
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
14
15
|
import { createComponent, Root, sstyled } from '@semcore/core';
|
|
16
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
17
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
18
|
+
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
15
19
|
import Divider from '@semcore/divider';
|
|
16
20
|
import { Box, Flex } from '@semcore/flex-box';
|
|
17
21
|
import { Text } from '@semcore/typography';
|
|
18
|
-
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
19
|
-
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
20
22
|
import { scaleBand, scaleLinear } from 'd3-scale';
|
|
23
|
+
import React from 'react';
|
|
21
24
|
// @ts-ignore
|
|
22
25
|
import { HoverRect, Plot } from '../..';
|
|
26
|
+
import { AbstractChart } from './AbstractChart';
|
|
23
27
|
// @ts-ignore
|
|
24
28
|
import AnimatedClipPath from '../../AnimatedClipPath';
|
|
25
|
-
import {
|
|
29
|
+
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
26
30
|
import { interpolateValue, scaleToBand } from '../../utils';
|
|
27
31
|
import Cigarette from '../Cigarette/Cigarette';
|
|
28
|
-
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
29
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
30
32
|
var wMin = 2;
|
|
31
33
|
var CigaretteChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
32
|
-
_inherits(CigaretteChartComponent, _AbstractChart);
|
|
33
|
-
var _super = _createSuper(CigaretteChartComponent);
|
|
34
34
|
function CigaretteChartComponent() {
|
|
35
35
|
var _this;
|
|
36
36
|
_classCallCheck(this, CigaretteChartComponent);
|
|
37
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
38
|
args[_key] = arguments[_key];
|
|
39
39
|
}
|
|
40
|
-
_this =
|
|
41
|
-
_defineProperty(
|
|
42
|
-
_defineProperty(
|
|
40
|
+
_this = _callSuper(this, CigaretteChartComponent, [].concat(args));
|
|
41
|
+
_defineProperty(_this, "plotPadding", 0);
|
|
42
|
+
_defineProperty(_this, "offset", 0);
|
|
43
43
|
return _this;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
_inherits(CigaretteChartComponent, _AbstractChart);
|
|
46
|
+
return _createClass(CigaretteChartComponent, [{
|
|
46
47
|
key: "resolveColor",
|
|
47
48
|
value: function resolveColor(id, index) {
|
|
48
49
|
var _this$props$colorMap$, _this$props$colorMap;
|
|
@@ -51,7 +52,7 @@ var CigaretteChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
51
52
|
}, {
|
|
52
53
|
key: "getDefaultDataDefinitions",
|
|
53
54
|
value: function getDefaultDataDefinitions() {
|
|
54
|
-
var dataDefinitions =
|
|
55
|
+
var dataDefinitions = _superPropGet(CigaretteChartComponent, "getDefaultDataDefinitions", this, 3)([]);
|
|
55
56
|
return dataDefinitions.map(function (dataDef) {
|
|
56
57
|
dataDef.columns = dataDef.columns.slice(1);
|
|
57
58
|
return dataDef;
|
|
@@ -301,7 +302,6 @@ var CigaretteChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
301
302
|
return scaleLinear().range(invertAxis ? [0, plotWidth] : [plotHeight, 0]).domain([0, max]);
|
|
302
303
|
}
|
|
303
304
|
}]);
|
|
304
|
-
return CigaretteChartComponent;
|
|
305
305
|
}(AbstractChart);
|
|
306
306
|
_defineProperty(CigaretteChartComponent, "displayName", 'Cigarette.Bar');
|
|
307
307
|
_defineProperty(CigaretteChartComponent, "defaultProps", function (props) {
|