@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","names":["React","createComponent","scaleLinear","scaleTime","Line","minMax","HoverLine","AbstractChart","Box","Flex","Text","localizedMessages","i18nEnhance","LineChartComponent","_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","flatValues","_get","_getPrototypeOf","prototype","max","Math","_toConsumableArray","min","value","renderChart","_this$asProps3","curve","showDots","area","areaCurve","_this$state","state","dataDefinitions","highlightedLine","map","item","index","checked","createElement","x","toString","y","id","color","transparent","Dots","display","Area","y0","y1","renderTooltip","_this","_this$asProps4","showTotalInTooltip","showTooltip","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","dataItem","total","totalValue","children","Fragment","Title","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_defineProperty","LineChart"],"sources":["../../../../src/component/Chart/LineChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { LineChartData, LineChartProps, LineChartType } from './LineChart.type';\nimport { ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\n// @ts-ignore\nimport { Line, minMax, HoverLine } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { Box, Flex } 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 LineChartComponent extends AbstractChart<\n LineChartData,\n LineChartProps,\n typeof LineChartComponent.enhance\n> {\n static displayName = 'Chart.Line';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get xScale() {\n const { xScale, marginY = 30, 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 protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n\n const max = Math.max(...flatValues);\n const min = Math.min(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected renderChart() {\n const { groupKey, curve, showDots, area, areaCurve } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Line\n x={groupKey.toString()}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <Line.Dots display />}\n {area?.[item.id] && (\n <Line.Area area={area[item.id]} y0={'y0'} y1={'y1'} curve={areaCurve} />\n )}\n </Line>\n )\n );\n });\n }\n\n protected 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: 'Line' });\n }\n}\n\nexport const LineChart: LineChartType = createComponent(LineChartComponent);\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,eAAe;AAE/C,SAAsBC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAC9D;AACA,SAASC,IAAI,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SA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AE,GAAC,OAAK,CAAM,eACvBlG,KAAA,CAAAoE,aAAA,CAAC1D,IAAI;YAAC0F,IAAI;UAAA,GAAET,KAAK,CAAQ,CAE5B;QAGP,CAAC;MACH,CAAC,CACiB;IAExB;EAAC;IAAArE,GAAA;IAAA+B,KAAA,EAED,SAAAkD,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAAC9E,OAAO,CAAC+E,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;EAAA,OAAA5F,kBAAA;AAAA,EArH8BN,aAAa;AAAAmG,eAAA,CAAxC7F,kBAAkB,iBAKD,YAAY;AAAA6F,eAAA,CAL7B7F,kBAAkB,aAOL,CAACD,WAAW,CAACD,iBAAiB,CAAC,CAAC;AAiHnD,OAAO,IAAMgG,SAAwB,GAAG1G,eAAe,CAACY,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":["createComponent","i18nEnhance","Box","Flex","Text","scaleLinear","scaleTime","React","Line","minMax","HoverLine","AbstractChart","localizedMessages","LineChartComponent","_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","flatValues","_superPropGet","max","Math","apply","_toConsumableArray","min","value","renderChart","_this$asProps3","curve","showDots","area","areaCurve","_this$state","state","dataDefinitions","highlightedLine","map","item","index","checked","createElement","x","toString","y","id","color","transparent","Dots","display","Area","y0","y1","renderTooltip","_this","_this$asProps4","showTotalInTooltip","showTooltip","Tooltip","wMin","_ref","_dataItem$groupKey","xIndex","dataItem","total","totalValue","children","Fragment","Title","justifyContent","Dot","mr","label","bold","tooltipValueFormatter","mt","getLegendAriaLabel","getI18nText","chartType","_defineProperty","LineChart"],"sources":["../../../../src/component/Chart/LineChart.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 { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\nimport type { LineChartData, LineChartProps, LineChartType } from './LineChart.type';\n// @ts-ignore\nimport { Line, minMax, HoverLine } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass LineChartComponent extends AbstractChart<\n LineChartData,\n LineChartProps,\n typeof LineChartComponent.enhance\n> {\n static displayName = 'Chart.Line';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get xScale() {\n const { xScale, marginY = 30, 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 protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n\n const max = Math.max(...flatValues);\n const min = Math.min(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected renderChart() {\n const { groupKey, curve, showDots, area, areaCurve } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Line\n x={groupKey.toString()}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n >\n {showDots && <Line.Dots display />}\n {area?.[item.id] && (\n <Line.Area area={area[item.id]} y0='y0' y1='y1' curve={areaCurve} />\n )}\n </Line>\n )\n );\n });\n }\n\n protected 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: 'Line' });\n }\n}\n\nexport const LineChart: LineChartType = createComponent(LineChartComponent);\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,SAA2BC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AACnE,OAAOC,KAAK,MAAM,OAAO;AAGzB;AACA,SAASC,IAAI,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAEjFC,kBAAkB,0BAAAC,cAAA;EAAA,SAAAD,mBAAA;IAAAE,eAAA,OAAAF,kBAAA;IAAA,OAAAG,UAAA,OAAAH,kB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W;MACrC,OAAO,IAAI,CAAC7E,OAAO,CAAC8E,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;AAAA,EArH8B3F,aAAa;AAAA4F,eAAA,CAAxC1F,kBAAkB,iBAKD,YAAY;AAAA0F,eAAA,CAL7B1F,kBAAkB,aAOL,CAACZ,WAAW,CAACW,iBAAiB,CAAC,CAAC;AAiHnD,OAAO,IAAM4F,SAAwB,GAAGxG,eAAe,CAACa,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport
|
|
1
|
+
{"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.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';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n groupKey: string;\n area?: Record<LegendItemKey, AreaItem[]>;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n showDots?: boolean;\n curve?: CurveFactory;\n areaCurve?: CurveFactory;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,36 +1,36 @@
|
|
|
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';
|
|
11
14
|
import { scaleLinear } from 'd3-scale';
|
|
15
|
+
import React from 'react';
|
|
12
16
|
import { AbstractChart } from './AbstractChart';
|
|
13
17
|
// @ts-ignore
|
|
14
18
|
import { Radar } from '../..';
|
|
15
19
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
16
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
17
20
|
var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
18
|
-
_inherits(RadarChartComponent, _AbstractChart);
|
|
19
|
-
var _super = _createSuper(RadarChartComponent);
|
|
20
21
|
function RadarChartComponent() {
|
|
21
22
|
_classCallCheck(this, RadarChartComponent);
|
|
22
|
-
return
|
|
23
|
+
return _callSuper(this, RadarChartComponent, arguments);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
_inherits(RadarChartComponent, _AbstractChart);
|
|
26
|
+
return _createClass(RadarChartComponent, [{
|
|
25
27
|
key: "renderChart",
|
|
26
28
|
value: function renderChart() {
|
|
27
29
|
var _this$asProps = this.asProps,
|
|
28
30
|
groupKey = _this$asProps.groupKey,
|
|
29
31
|
showDots = _this$asProps.showDots,
|
|
30
32
|
circle = _this$asProps.circle;
|
|
31
|
-
var
|
|
32
|
-
dataDefinitions = _this$state.dataDefinitions,
|
|
33
|
-
highlightedLine = _this$state.highlightedLine;
|
|
33
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
34
34
|
return /*#__PURE__*/React.createElement(Radar, {
|
|
35
35
|
scale: this.xScale,
|
|
36
36
|
type: circle ? 'circle' : undefined
|
|
@@ -114,10 +114,9 @@ var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
114
114
|
}, {
|
|
115
115
|
key: "domain",
|
|
116
116
|
get: function get() {
|
|
117
|
-
return [Math.min.apply(Math, _toConsumableArray(
|
|
117
|
+
return [Math.min.apply(Math, _toConsumableArray(_superPropGet(RadarChartComponent, "flatValues", this, 1))), Math.max.apply(Math, _toConsumableArray(_superPropGet(RadarChartComponent, "flatValues", this, 1)))];
|
|
118
118
|
}
|
|
119
119
|
}]);
|
|
120
|
-
return RadarChartComponent;
|
|
121
120
|
}(AbstractChart);
|
|
122
121
|
_defineProperty(RadarChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
123
122
|
export var RadarChart = createComponent(RadarChartComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.js","names":["
|
|
1
|
+
{"version":3,"file":"RadarChart.js","names":["createComponent","i18nEnhance","scaleLinear","React","AbstractChart","Radar","localizedMessages","RadarChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","dataDefinitions","state","createElement","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","color","Line","Dots","_this","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","_data$groupKey","index","children","Fragment","Title","_data$item$id","Dot","tooltipValueFormatter","renderTooltip","get","_this$props","props","legendKeys","Object","keys","filter","_this$asProps$scale","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","apply","_toConsumableArray","_superPropGet","max","_defineProperty","RadarChart"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport { AbstractChart } from './AbstractChart';\nimport type { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";;;;;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,WAAW,QAA0B,UAAU;AACxD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,iBAAiB;AAE/C;AACA,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAEjFC,mBAAmB,0BAAAC,cAAA;EAAA,SAAAD,oBAAA;IAAAE,eAAA,OAAAF,mBAAA;IAAA,OAAAG,UAAA,OAAAH,mBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,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AA,EAED,SAAAA,IAAA,EAAuC;MACrC,OAAO,CAACa,IAAI,CAACC,GAAG,CAAAC,KAAA,CAARF,IAAI,EAAAG,kBAAA,CAAAC,aAAA,CAAApE,mBAAA,yBAAwB,CAAC,EAAEgE,IAAI,CAACK,GAAG,CAAAH,KAAA,CAARF,IAAI,EAAAG,kBAAA,CAAAC,aAAA,CAAApE,mBAAA,yBAAwB,CAAC,CAAC;IACvE;EAAC;AAAA,EA/F+BH,aAAa;AAAAyE,eAAA,CAAzCtE,mBAAmB,aAKN,CAACN,WAAW,CAACK,iBAAiB,CAAC,CAAC;AA6FnD,OAAO,IAAMwE,UAA0B,GAAG9E,eAAe,CAACO,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.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 RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.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 RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,26 +2,29 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
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 _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
8
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
11
|
import { createComponent } from '@semcore/core';
|
|
12
|
+
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
13
|
+
import { Text } from '@semcore/typography';
|
|
10
14
|
import { scaleLinear, scaleTime } from 'd3-scale';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
|
|
11
17
|
// @ts-ignore
|
|
12
18
|
import { minMax, ScatterPlot, getScatterPlotRadius } from '../..';
|
|
13
19
|
import { AbstractChart } from './AbstractChart';
|
|
14
|
-
import { Text } from '@semcore/typography';
|
|
15
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
16
20
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
17
21
|
var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
18
|
-
_inherits(ScatterPlotChartComponent, _AbstractChart);
|
|
19
|
-
var _super = _createSuper(ScatterPlotChartComponent);
|
|
20
22
|
function ScatterPlotChartComponent() {
|
|
21
23
|
_classCallCheck(this, ScatterPlotChartComponent);
|
|
22
|
-
return
|
|
24
|
+
return _callSuper(this, ScatterPlotChartComponent, arguments);
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
_inherits(ScatterPlotChartComponent, _AbstractChart);
|
|
27
|
+
return _createClass(ScatterPlotChartComponent, [{
|
|
25
28
|
key: "dataKeys",
|
|
26
29
|
get: function get() {
|
|
27
30
|
var _this$props = this.props,
|
|
@@ -139,9 +142,9 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
139
142
|
color: item.color
|
|
140
143
|
}, "Data"), /*#__PURE__*/React.createElement(Text, {
|
|
141
144
|
tag: "div"
|
|
142
|
-
}, "X axis
|
|
145
|
+
}, "X axis", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/React.createElement(Text, {
|
|
143
146
|
tag: "div"
|
|
144
|
-
}, "Y axis
|
|
147
|
+
}, "Y axis", _this.tooltipValueFormatter(data[index][y])))
|
|
145
148
|
};
|
|
146
149
|
});
|
|
147
150
|
});
|
|
@@ -154,7 +157,6 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
154
157
|
});
|
|
155
158
|
}
|
|
156
159
|
}]);
|
|
157
|
-
return ScatterPlotChartComponent;
|
|
158
160
|
}(AbstractChart);
|
|
159
161
|
_defineProperty(ScatterPlotChartComponent, "displayName", 'Chart.ScatterPlot');
|
|
160
162
|
_defineProperty(ScatterPlotChartComponent, "defaultProps", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotChart.js","names":["React","createComponent","scaleLinear","scaleTime","minMax","ScatterPlot","getScatterPlotRadius","AbstractChart","Text","i18nEnhance","localizedMessages","ScatterPlotChartComponent","_AbstractChart","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getValueScale","_toConsumableArray","flatValues","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","_defineProperty","direction","showXAxis","showYAxis","showLegend","ScatterPlotChart"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { Text } from '@semcore/typography';\nimport { BaseChartProps, ListData } from './AbstractChart.type';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\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[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>X axis {this.tooltipValueFormatter(data[index][x])}</Text>\n <Text tag='div'>Y axis {this.tooltipValueFormatter(data[index][y])}</Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAAsBC,WAAW,EAAEC,SAAS,QAAQ,UAAU;AAC9D;AACA,SAASC,MAAM,EAAEC,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AACjE,SAASC,aAAa,QAAQ,iBAAiB;AAM/C,SAASC,IAAI,QAAQ,qBAAqB;AAE1C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAEjFC,yBAAyB,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAAK,eAAA,OAAAL,yBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,yBAAA;IAAAS,GAAA;IAAAC,GAAA,EAgB7B,SAAAA,IAAA,EAAmC;MACjC,IAAAC,WAAA,GAAqC,IAAI,CAACC,KAAK;QAAvCC,IAAI,GAAAF,WAAA,CAAJE,IAAI;QAAEC,QAAQ,GAAAH,WAAA,CAARG,QAAQ;QAAEC,QAAQ,GAAAJ,WAAA,CAARI,QAAQ;MAEhC,OAAOC,MAAM,CAACC,IAAI,CAACJ,IAAI,CAAC,CAAC,CAAC,CAAC,CAACK,MAAM,CAAC,UAACT,GAAG;QAAA,OAAKA,GAAG,KAAK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,CAAC,CAAC,CAAC,CAAQ;UAGhF,CAAC;QACH,CAAC,CACmB;MAE1B,CAAC,CAAC;IACN;EAAC;IAAAxD,GAAA;IAAA6C,KAAA,EAED,SAAA2B,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAAC7D,OAAO,CAAC8D,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;IACjF;EAAC;EAAA,OAAAnF,yBAAA;AAAA,EAvHqCJ,aAAa;AAAAwF,eAAA,CAA/CpF,yBAAyB,iBAKR,mBAAmB;AAAAoF,eAAA,CALpCpF,yBAAyB,kBAMmC;EAC9DqF,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACfhB,WAAW,EAAE,IAAI;EACjBiB,UAAU,EAAE;AACd,CAAC;AAAAJ,eAAA,CAZGpF,yBAAyB,aAcZ,CAACF,WAAW,CAACC,iBAAiB,CAAC,CAAC;AA4GnD,OAAO,IAAM0F,gBAAsC,GAAGnG,eAAe,CAACU,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ScatterPlotChart.js","names":["createComponent","i18nEnhance","Text","scaleLinear","scaleTime","React","minMax","ScatterPlot","getScatterPlotRadius","AbstractChart","localizedMessages","ScatterPlotChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getValueScale","_toConsumableArray","flatValues","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","apply","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","_defineProperty","direction","showXAxis","showYAxis","showLegend","ScatterPlotChart"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { BaseChartProps, ListData } from './AbstractChart.type';\nimport type {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\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[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>\n X axis\n {this.tooltipValueFormatter(data[index][x])}\n </Text>\n <Text tag='div'>\n Y axis\n {this.tooltipValueFormatter(data[index][y])}\n </Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW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yB,kBAMmC;EAC9DoF,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACfhB,WAAW,EAAE,IAAI;EACjBiB,UAAU,EAAE;AACd,CAAC;AAAAJ,eAAA,CAZGnF,yBAAyB,aAcZ,CAACV,WAAW,CAACS,iBAAiB,CAAC,CAAC;AAkHnD,OAAO,IAAMyF,gBAAsC,GAAGnG,eAAe,CAACW,yBAAyB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport
|
|
1
|
+
{"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n valueKey?: string;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,25 +1,27 @@
|
|
|
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';
|
|
9
14
|
// @ts-ignore
|
|
10
15
|
import { Venn } from '../..';
|
|
11
16
|
import { AbstractChart } from './AbstractChart';
|
|
12
|
-
import { Text } from '@semcore/typography';
|
|
13
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
14
17
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
15
18
|
var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
16
|
-
_inherits(VennChartComponent, _AbstractChart);
|
|
17
|
-
var _super = _createSuper(VennChartComponent);
|
|
18
19
|
function VennChartComponent() {
|
|
19
20
|
_classCallCheck(this, VennChartComponent);
|
|
20
|
-
return
|
|
21
|
+
return _callSuper(this, VennChartComponent, arguments);
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
_inherits(VennChartComponent, _AbstractChart);
|
|
24
|
+
return _createClass(VennChartComponent, [{
|
|
23
25
|
key: "xScale",
|
|
24
26
|
get: function get() {
|
|
25
27
|
var xScale = this.asProps.xScale;
|
|
@@ -130,7 +132,6 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
130
132
|
});
|
|
131
133
|
}
|
|
132
134
|
}]);
|
|
133
|
-
return VennChartComponent;
|
|
134
135
|
}(AbstractChart);
|
|
135
136
|
_defineProperty(VennChartComponent, "displayName", 'Chart.Venn');
|
|
136
137
|
_defineProperty(VennChartComponent, "defaultProps", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.js","names":["
|
|
1
|
+
{"version":3,"file":"VennChart.js","names":["createComponent","i18nEnhance","Text","scaleLinear","React","Venn","AbstractChart","localizedMessages","VennChartComponent","_AbstractChart","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","get","xScale","asProps","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","bold","getLegendAriaLabel","getI18nText","chartType","_defineProperty","direction","alignItems","marginY","marginX","VennChart"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,WAAW,QAAQ,UAAU;AACtC,OAAOC,KAAK,MAAM,OAAO;AAGzB;AACA,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,SAASC,iBAAiB,QAAQ,oDAAoD;AAAC,IAGjFC,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,GAAA;IAAAC,GAAA,EAgBtB,SAAAA,IAAA,EAAa;MACX,IAAQC,MAAM,GAAK,IAAI,CAACC,OAAO,CAAvBD,MAAM;MAEd,IAAIA,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,OAAOd,WAAW,CAAC,CAAC;IACtB;EAAC;IAAAY,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAa;MACX,IAAQG,MAAM,GAAK,IAAI,CAACD,OAAO,CAAvBC,MAAM;MAEd,IAAIA,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,OAAOhB,WAAW,CAAC,CAAC;IACtB;EAAC;IAAAY,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAmC;MACjC,IAAQI,IAAI,GAAK,IAAI,CAACC,KAAK,C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AM0E,SAAwB,GAAGjF,eAAe,CAACQ,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.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 VennChartData = Record<string, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.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 VennChartData = Record<string, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AreaChart } from './AreaChart';
|
|
2
2
|
import { BarChart } from './BarChart';
|
|
3
|
+
import { BubbleChart } from './BubbleChart';
|
|
4
|
+
import { CigaretteChart } from './CigaretteChart';
|
|
3
5
|
import { CompactHorizontalBarChart } from './CompactHorizontalBarChart';
|
|
6
|
+
import { DonutChart } from './DonutChart';
|
|
4
7
|
import { HistogramChart } from './HistogramChart';
|
|
8
|
+
import { LineChart } from './LineChart';
|
|
9
|
+
import { RadarChart } from './RadarChart';
|
|
5
10
|
import { ScatterPlotChart } from './ScatterPlotChart';
|
|
6
|
-
import { AreaChart } from './AreaChart';
|
|
7
|
-
import { BubbleChart } from './BubbleChart';
|
|
8
|
-
import { DonutChart } from './DonutChart';
|
|
9
11
|
import { VennChart } from './VennChart';
|
|
10
|
-
import { RadarChart } from './RadarChart';
|
|
11
|
-
import { CigaretteChart } from './CigaretteChart';
|
|
12
12
|
export default {
|
|
13
13
|
Line: LineChart,
|
|
14
14
|
Bar: BarChart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["AreaChart","BarChart","BubbleChart","CigaretteChart","CompactHorizontalBarChart","DonutChart","HistogramChart","LineChart","RadarChart","ScatterPlotChart","VennChart","Line","Bar","Histogram","ScatterPlot","Area","Bubble","Donut","Venn","Radar","Cigarette","CompactHorizontalBar"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,aAAa;AAEvC,eAAe;EACbC,IAAI,EAAEJ,SAAS;EACfK,GAAG,EAAEX,QAAQ;EACbY,SAAS,EAAEP,cAAc;EACzBQ,WAAW,EAAEL,gBAAgB;EAC7BM,IAAI,EAAEf,SAAS;EACfgB,MAAM,EAAEd,WAAW;EACnBe,KAAK,EAAEZ,UAAU;EACjBa,IAAI,EAAER,SAAS;EACfS,KAAK,EAAEX,UAAU;EACjBY,SAAS,EAAEjB,cAAc;EACzBkB,oBAAoB,EAAEjB;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
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";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
10
|
import { Component } from '@semcore/core';
|
|
9
11
|
import { makeDataHintsHandlers } from '../../a11y/hints';
|
|
10
12
|
export var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
11
|
-
_inherits(BaseLegend, _Component);
|
|
12
|
-
var _super = _createSuper(BaseLegend);
|
|
13
13
|
function BaseLegend() {
|
|
14
14
|
var _this;
|
|
15
15
|
_classCallCheck(this, BaseLegend);
|
|
16
16
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
17
17
|
args[_key] = arguments[_key];
|
|
18
18
|
}
|
|
19
|
-
_this =
|
|
20
|
-
_defineProperty(
|
|
19
|
+
_this = _callSuper(this, BaseLegend, [].concat(args));
|
|
20
|
+
_defineProperty(_this, "onChangeLegendItem", function (id, checked) {
|
|
21
21
|
var _this$props$onChangeV, _this$props;
|
|
22
|
-
(_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0
|
|
22
|
+
(_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 || _this$props$onChangeV.call(_this$props, id, checked);
|
|
23
|
+
if (checked) {
|
|
24
|
+
var _this$props$onMouseEn, _this$props2;
|
|
25
|
+
(_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props2, id);
|
|
26
|
+
} else {
|
|
27
|
+
var _this$props$onMouseLe, _this$props3;
|
|
28
|
+
(_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props3, id);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
_defineProperty(_this, "onFocusLegendItem", function (checked) {
|
|
32
|
+
return function (id) {
|
|
33
|
+
var _this$props$onMouseEn2, _this$props5;
|
|
34
|
+
if (!checked) {
|
|
35
|
+
var _this$props$onMouseLe2, _this$props4;
|
|
36
|
+
return (_this$props$onMouseLe2 = (_this$props4 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe2 === void 0 ? void 0 : _this$props$onMouseLe2.call(_this$props4, id);
|
|
37
|
+
}
|
|
38
|
+
(_this$props$onMouseEn2 = (_this$props5 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn2 === void 0 || _this$props$onMouseEn2.call(_this$props5, id);
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(_this, "onBlurLegendItem", function (id) {
|
|
42
|
+
var _this$props$onMouseLe3, _this$props6;
|
|
43
|
+
(_this$props$onMouseLe3 = (_this$props6 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe3 === void 0 || _this$props$onMouseLe3.call(_this$props6, id);
|
|
23
44
|
});
|
|
24
|
-
_defineProperty(
|
|
45
|
+
_defineProperty(_this, "bindOnMouseEnterItem", function (id) {
|
|
25
46
|
return function (e) {
|
|
26
|
-
var _this$props$
|
|
27
|
-
(_this$props$
|
|
47
|
+
var _this$props$onMouseEn3, _this$props7;
|
|
48
|
+
(_this$props$onMouseEn3 = (_this$props7 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn3 === void 0 || _this$props$onMouseEn3.call(_this$props7, id, e);
|
|
28
49
|
};
|
|
29
50
|
});
|
|
30
|
-
_defineProperty(
|
|
51
|
+
_defineProperty(_this, "bindOnMouseLeaveItem", function (id) {
|
|
31
52
|
return function (e) {
|
|
32
|
-
var _this$props$
|
|
33
|
-
(_this$props$
|
|
53
|
+
var _this$props$onMouseLe4, _this$props8;
|
|
54
|
+
(_this$props$onMouseLe4 = (_this$props8 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe4 === void 0 || _this$props$onMouseLe4.call(_this$props8, id, e);
|
|
34
55
|
};
|
|
35
56
|
});
|
|
36
57
|
return _this;
|
|
37
58
|
}
|
|
38
|
-
|
|
59
|
+
_inherits(BaseLegend, _Component);
|
|
60
|
+
return _createClass(BaseLegend, [{
|
|
39
61
|
key: "componentDidMount",
|
|
40
62
|
value: function componentDidMount() {
|
|
41
63
|
this.setHints();
|
|
@@ -55,7 +77,7 @@ export var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
55
77
|
dataHints = _this$asProps.dataHints;
|
|
56
78
|
var dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;
|
|
57
79
|
items.forEach(function (legendItem) {
|
|
58
|
-
dataHintsHandler === null || dataHintsHandler === void 0
|
|
80
|
+
dataHintsHandler === null || dataHintsHandler === void 0 || dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
|
|
59
81
|
});
|
|
60
82
|
}
|
|
61
83
|
}, {
|
|
@@ -80,8 +102,10 @@ export var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
80
102
|
return _objectSpread(_objectSpread({}, line), {}, {
|
|
81
103
|
shape: shape,
|
|
82
104
|
size: size,
|
|
105
|
+
onFocusLegendItem: this.onFocusLegendItem(line.checked),
|
|
106
|
+
onBlurLegendItem: this.onBlurLegendItem,
|
|
83
107
|
onChangeLegendItem: this.onChangeLegendItem,
|
|
84
|
-
onMouseEnter: this.bindOnMouseEnterItem(line.id),
|
|
108
|
+
onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
|
|
85
109
|
onMouseLeave: this.bindOnMouseLeaveItem(line.id),
|
|
86
110
|
style: {
|
|
87
111
|
gridRowStart: "".concat(index + 1),
|
|
@@ -91,6 +115,5 @@ export var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
91
115
|
});
|
|
92
116
|
}
|
|
93
117
|
}]);
|
|
94
|
-
return BaseLegend;
|
|
95
118
|
}(Component);
|
|
96
119
|
//# sourceMappingURL=BaseLegend.js.map
|