@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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -8,36 +8,35 @@ exports.RadarChart = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
12
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
15
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _core = require("@semcore/core");
|
|
18
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
18
19
|
var _d3Scale = require("d3-scale");
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
21
|
var _AbstractChart2 = require("./AbstractChart");
|
|
20
22
|
var _ = require("../..");
|
|
21
23
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
22
|
-
|
|
23
|
-
// @ts-ignore
|
|
24
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
25
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } // @ts-ignore
|
|
24
26
|
var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
25
|
-
(0, _inherits2["default"])(RadarChartComponent, _AbstractChart);
|
|
26
|
-
var _super = (0, _createSuper2["default"])(RadarChartComponent);
|
|
27
27
|
function RadarChartComponent() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, RadarChartComponent);
|
|
29
|
-
return
|
|
29
|
+
return _callSuper(this, RadarChartComponent, arguments);
|
|
30
30
|
}
|
|
31
|
-
(0,
|
|
31
|
+
(0, _inherits2["default"])(RadarChartComponent, _AbstractChart);
|
|
32
|
+
return (0, _createClass2["default"])(RadarChartComponent, [{
|
|
32
33
|
key: "renderChart",
|
|
33
34
|
value: function renderChart() {
|
|
34
35
|
var _this$asProps = this.asProps,
|
|
35
36
|
groupKey = _this$asProps.groupKey,
|
|
36
37
|
showDots = _this$asProps.showDots,
|
|
37
38
|
circle = _this$asProps.circle;
|
|
38
|
-
var
|
|
39
|
-
dataDefinitions = _this$state.dataDefinitions,
|
|
40
|
-
highlightedLine = _this$state.highlightedLine;
|
|
39
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
41
40
|
return /*#__PURE__*/_react["default"].createElement(_.Radar, {
|
|
42
41
|
scale: this.xScale,
|
|
43
42
|
type: circle ? 'circle' : undefined
|
|
@@ -121,12 +120,10 @@ var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
121
120
|
}, {
|
|
122
121
|
key: "domain",
|
|
123
122
|
get: function get() {
|
|
124
|
-
return [Math.min.apply(Math, (0, _toConsumableArray2["default"])((
|
|
123
|
+
return [Math.min.apply(Math, (0, _toConsumableArray2["default"])(_superPropGet(RadarChartComponent, "flatValues", this, 1))), Math.max.apply(Math, (0, _toConsumableArray2["default"])(_superPropGet(RadarChartComponent, "flatValues", this, 1)))];
|
|
125
124
|
}
|
|
126
125
|
}]);
|
|
127
|
-
return RadarChartComponent;
|
|
128
126
|
}(_AbstractChart2.AbstractChart);
|
|
129
127
|
(0, _defineProperty2["default"])(RadarChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
|
|
130
|
-
var RadarChart = (0, _core.createComponent)(RadarChartComponent);
|
|
131
|
-
exports.RadarChart = RadarChart;
|
|
128
|
+
var RadarChart = exports.RadarChart = (0, _core.createComponent)(RadarChartComponent);
|
|
132
129
|
//# sourceMappingURL=RadarChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.js","names":["
|
|
1
|
+
{"version":3,"file":"RadarChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_d3Scale","_react","_AbstractChart2","_","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","_superPropGet","r","p","_get2","prototype","RadarChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","dataDefinitions","state","createElement","Radar","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","scaleLinear","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","_toConsumableArray2","max","AbstractChart","_defineProperty2","i18nEnhance","localizedMessages","RadarChart","exports","createComponent"],"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),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AC3E;EAAC;IAAA1D,GAAA;IAAA6C,GAAA,EAED,SAAAA,IAAA,EAAuC;MACrC,OAAO,CAACc,IAAI,CAACC,GAAG,CAAAxE,KAAA,CAARuE,IAAI,MAAAE,mBAAA,aAAAxE,aAAA,CAAAK,mBAAA,yBAAwB,CAAC,EAAEiE,IAAI,CAACG,GAAG,CAAA1E,KAAA,CAARuE,IAAI,MAAAE,mBAAA,aAAAxE,aAAA,CAAAK,mBAAA,yBAAwB,CAAC,CAAC;IACvE;EAAC;AAAA,EA/F+BqE,6BAAa;AAAA,IAAAC,gBAAA,aAAzCtE,mBAAmB,aAKN,CAAC,IAAAuE,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AA6F5C,IAAMC,UAA0B,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,qBAAe,EAAC3E,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":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,26 +9,27 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
14
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react = _interopRequireDefault(require("react"));
|
|
16
17
|
var _core = require("@semcore/core");
|
|
18
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
19
|
+
var _typography = require("@semcore/typography");
|
|
17
20
|
var _d3Scale = require("d3-scale");
|
|
21
|
+
var _react = _interopRequireDefault(require("react"));
|
|
18
22
|
var _ = require("../..");
|
|
19
23
|
var _AbstractChart2 = require("./AbstractChart");
|
|
20
|
-
var _typography = require("@semcore/typography");
|
|
21
|
-
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
22
24
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
23
|
-
// @ts-ignore
|
|
25
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } // @ts-ignore
|
|
24
26
|
var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
25
|
-
(0, _inherits2["default"])(ScatterPlotChartComponent, _AbstractChart);
|
|
26
|
-
var _super = (0, _createSuper2["default"])(ScatterPlotChartComponent);
|
|
27
27
|
function ScatterPlotChartComponent() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ScatterPlotChartComponent);
|
|
29
|
-
return
|
|
29
|
+
return _callSuper(this, ScatterPlotChartComponent, arguments);
|
|
30
30
|
}
|
|
31
|
-
(0,
|
|
31
|
+
(0, _inherits2["default"])(ScatterPlotChartComponent, _AbstractChart);
|
|
32
|
+
return (0, _createClass2["default"])(ScatterPlotChartComponent, [{
|
|
32
33
|
key: "dataKeys",
|
|
33
34
|
get: function get() {
|
|
34
35
|
var _this$props = this.props,
|
|
@@ -146,9 +147,9 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
146
147
|
color: item.color
|
|
147
148
|
}, "Data"), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
148
149
|
tag: "div"
|
|
149
|
-
}, "X axis
|
|
150
|
+
}, "X axis", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
150
151
|
tag: "div"
|
|
151
|
-
}, "Y axis
|
|
152
|
+
}, "Y axis", _this.tooltipValueFormatter(data[index][y])))
|
|
152
153
|
};
|
|
153
154
|
});
|
|
154
155
|
});
|
|
@@ -161,7 +162,6 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
164
|
}]);
|
|
164
|
-
return ScatterPlotChartComponent;
|
|
165
165
|
}(_AbstractChart2.AbstractChart);
|
|
166
166
|
(0, _defineProperty2["default"])(ScatterPlotChartComponent, "displayName", 'Chart.ScatterPlot');
|
|
167
167
|
(0, _defineProperty2["default"])(ScatterPlotChartComponent, "defaultProps", {
|
|
@@ -172,6 +172,5 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
172
172
|
showLegend: false
|
|
173
173
|
});
|
|
174
174
|
(0, _defineProperty2["default"])(ScatterPlotChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
|
|
175
|
-
var ScatterPlotChart = (0, _core.createComponent)(ScatterPlotChartComponent);
|
|
176
|
-
exports.ScatterPlotChart = ScatterPlotChart;
|
|
175
|
+
var ScatterPlotChart = exports.ScatterPlotChart = (0, _core.createComponent)(ScatterPlotChartComponent);
|
|
177
176
|
//# sourceMappingURL=ScatterPlotChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_","_AbstractChart2","_typography","_i18nEnhance","_intergalacticDynamicLocales","ScatterPlotChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","ScatterPlot","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","createComponent","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAMA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAXA;AAAA,IAaMQ,yBAAyB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,yBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,yBAAA;EAAA,SAAAA,0BAAA;IAAA,IAAAK,gBAAA,mBAAAL,yBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,aAAAR,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,KAAKK,QAAQ,IAAIL,GAAG,KAAKM,QAAQ;MAAA,EAAC;IACnF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qBAAqB,CAACzE,IAAI,CAACmE,KAAK,CAAC,CAACV,CAAC,CAAC,CAAC,CAAQ;UAGhF,CAAC;QACH,CAAC,CACmB;MAE1B,CAAC,CAAC;IACN;EAAC;IAAA7D,GAAA;IAAAiD,KAAA,EAED,SAAA6B,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAACnE,OAAO,CAACoE,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;IACjF;EAAC;EAAA,OAAAzF,yBAAA;AAAA,EAvHqC0F,6BAAa;AAAA,IAAAC,gBAAA,aAA/C3F,yBAAyB,iBAKR,mBAAmB;AAAA,IAAA2F,gBAAA,aALpC3F,yBAAyB,kBAMmC;EAC9D4F,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACflB,WAAW,EAAE,IAAI;EACjBmB,UAAU,EAAE;AACd,CAAC;AAAA,IAAAJ,gBAAA,aAZG3F,yBAAyB,aAcZ,CAAC,IAAAgG,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AA4G5C,IAAMC,gBAAsC,GAAG,IAAAC,qBAAe,EAACnG,yBAAyB,CAAC;AAACoG,OAAA,CAAAF,gBAAA,GAAAA,gBAAA"}
|
|
1
|
+
{"version":3,"file":"ScatterPlotChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","ScatterPlotChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","ScatterPlot","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","exports","createComponent"],"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,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAOA,IAAAQ,4BAAA,GAAAR,OAAA;AAAuF,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA,MATvF;AAAA,IAWMQ,yBAAyB,0BAAAC,cAAA;EAAA,SAAAD,0BAAA;IAAA,IAAAE,gBAAA,mBAAAF,yBAAA;IAAA,OAAAX,UAAA,OAAAW,yBAAA,EAAAG,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAJ,yBAAA,EAAAC,cAAA;EAAA,WAAAI,aAAA,aAAAL,yBAAA;IAAAM,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,GA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WAAA,CAAAkG,IAAI;cAACC,GAAG,EAAC;YAAK,GAAC,QAEd,EAACX,KAAI,CAACY,qBAAqB,CAACzE,IAAI,CAACmE,KAAK,CAAC,CAACX,CAAC,CAAC,CACtC,CAAC,eACPjF,MAAA,YAAA+E,aAAA,CAACjF,WAAA,CAAAkG,IAAI;cAACC,GAAG,EAAC;YAAK,GAAC,QAEd,EAACX,KAAI,CAACY,qBAAqB,CAACzE,IAAI,CAACmE,KAAK,CAAC,CAACV,CAAC,CAAC,CACtC,CACN;UAEN,CAAC;QACH,CACmB,CAAC;MAE1B,CAAC,CAAC;IACN;EAAC;IAAA7D,GAAA;IAAAiD,KAAA,EAED,SAAU6B,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAACnE,OAAO,CAACoE,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;IACjF;EAAC;AAAA,EA7HqCC,6BAAa;AAAA,IAAAC,gBAAA,aAA/CxF,yBAAyB,iBAKR,mBAAmB;AAAA,IAAAwF,gBAAA,aALpCxF,yBAAyB,kBAMmC;EAC9DyF,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACflB,WAAW,EAAE,IAAI;EACjBmB,UAAU,EAAE;AACd,CAAC;AAAA,IAAAJ,gBAAA,aAZGxF,yBAAyB,aAcZ,CAAC,IAAA6F,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAkH5C,IAAMC,gBAAsC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,qBAAe,EAACjG,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,32 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.VennChart = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
10
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
12
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
15
|
var _core = require("@semcore/core");
|
|
16
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
17
|
+
var _typography = require("@semcore/typography");
|
|
15
18
|
var _d3Scale = require("d3-scale");
|
|
19
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
20
|
var _ = require("../..");
|
|
17
21
|
var _AbstractChart2 = require("./AbstractChart");
|
|
18
|
-
var _typography = require("@semcore/typography");
|
|
19
|
-
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
20
22
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
21
|
-
// @ts-ignore
|
|
23
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } // @ts-ignore
|
|
22
24
|
var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
23
|
-
(0, _inherits2["default"])(VennChartComponent, _AbstractChart);
|
|
24
|
-
var _super = (0, _createSuper2["default"])(VennChartComponent);
|
|
25
25
|
function VennChartComponent() {
|
|
26
26
|
(0, _classCallCheck2["default"])(this, VennChartComponent);
|
|
27
|
-
return
|
|
27
|
+
return _callSuper(this, VennChartComponent, arguments);
|
|
28
28
|
}
|
|
29
|
-
(0,
|
|
29
|
+
(0, _inherits2["default"])(VennChartComponent, _AbstractChart);
|
|
30
|
+
return (0, _createClass2["default"])(VennChartComponent, [{
|
|
30
31
|
key: "xScale",
|
|
31
32
|
get: function get() {
|
|
32
33
|
var xScale = this.asProps.xScale;
|
|
@@ -137,7 +138,6 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
140
|
}]);
|
|
140
|
-
return VennChartComponent;
|
|
141
141
|
}(_AbstractChart2.AbstractChart);
|
|
142
142
|
(0, _defineProperty2["default"])(VennChartComponent, "displayName", 'Chart.Venn');
|
|
143
143
|
(0, _defineProperty2["default"])(VennChartComponent, "defaultProps", {
|
|
@@ -147,6 +147,5 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
147
147
|
marginX: 0
|
|
148
148
|
});
|
|
149
149
|
(0, _defineProperty2["default"])(VennChartComponent, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
|
|
150
|
-
var VennChart = (0, _core.createComponent)(VennChartComponent);
|
|
151
|
-
exports.VennChart = VennChart;
|
|
150
|
+
var VennChart = exports.VennChart = (0, _core.createComponent)(VennChartComponent);
|
|
152
151
|
//# sourceMappingURL=VennChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_","_AbstractChart2","_typography","_i18nEnhance","_intergalacticDynamicLocales","VennChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","xScale","asProps","scaleLinear","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","Venn","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","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","createComponent","exports"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent } from '@semcore/core';\nimport { BaseChartProps } from './AbstractChart.type';\nimport { scaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { Text } from '@semcore/typography';\nimport { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAGA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAPA;AAAA,IASMQ,kBAAkB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,kBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAA,IAAAK,gBAAA,mBAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,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WAAA,CAAAuE,IAAI;YAACC,IAAI;UAAA,GAAEtD,IAAI,CAACwB,OAAO,CAAC,CAAQ;QAGvC,CAAC;MACH,CAAC,CACY;IAEnB;EAAC;IAAA9B,GAAA;IAAAe,KAAA,EAED,SAAA8C,mBAAA,EAAuC;MACrC,OAAO,IAAI,CAAC1D,OAAO,CAAC2D,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;EAAA,OAAAxE,kBAAA;AAAA,EA5I8ByE,6BAAa;AAAA,IAAAC,gBAAA,aAAxC1E,kBAAkB,iBAKD,YAAY;AAAA,IAAA0E,gBAAA,aAL7B1E,kBAAkB,kBAOwC;EAC5D2E,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,aAZG1E,kBAAkB,aAcL,CAAC,IAAA+E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAiI5C,IAAMC,SAAwB,GAAG,IAAAC,qBAAe,EAAClF,kBAAkB,CAAC;AAACmF,OAAA,CAAAF,SAAA,GAAAA,SAAA"}
|
|
1
|
+
{"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","VennChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","xScale","asProps","scaleLinear","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","Venn","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","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"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,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAEA,IAAAQ,4B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B,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":[]}
|
|
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _AreaChart = require("./AreaChart");
|
|
8
8
|
var _BarChart = require("./BarChart");
|
|
9
|
+
var _BubbleChart = require("./BubbleChart");
|
|
10
|
+
var _CigaretteChart = require("./CigaretteChart");
|
|
9
11
|
var _CompactHorizontalBarChart = require("./CompactHorizontalBarChart");
|
|
12
|
+
var _DonutChart = require("./DonutChart");
|
|
10
13
|
var _HistogramChart = require("./HistogramChart");
|
|
14
|
+
var _LineChart = require("./LineChart");
|
|
15
|
+
var _RadarChart = require("./RadarChart");
|
|
11
16
|
var _ScatterPlotChart = require("./ScatterPlotChart");
|
|
12
|
-
var _AreaChart = require("./AreaChart");
|
|
13
|
-
var _BubbleChart = require("./BubbleChart");
|
|
14
|
-
var _DonutChart = require("./DonutChart");
|
|
15
17
|
var _VennChart = require("./VennChart");
|
|
16
|
-
var
|
|
17
|
-
var _CigaretteChart = require("./CigaretteChart");
|
|
18
|
-
var _default = {
|
|
18
|
+
var _default = exports["default"] = {
|
|
19
19
|
Line: _LineChart.LineChart,
|
|
20
20
|
Bar: _BarChart.BarChart,
|
|
21
21
|
Histogram: _HistogramChart.HistogramChart,
|
|
@@ -28,5 +28,4 @@ var _default = {
|
|
|
28
28
|
Cigarette: _CigaretteChart.CigaretteChart,
|
|
29
29
|
CompactHorizontalBar: _CompactHorizontalBarChart.CompactHorizontalBarChart
|
|
30
30
|
};
|
|
31
|
-
exports["default"] = _default;
|
|
32
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"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,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,cAEzB;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -8,41 +8,63 @@ exports.BaseLegend = void 0;
|
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
16
|
var _core = require("@semcore/core");
|
|
16
17
|
var _hints = require("../../a11y/hints");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _super = (0, _createSuper2["default"])(BaseLegend);
|
|
18
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
var BaseLegend = exports.BaseLegend = /*#__PURE__*/function (_Component) {
|
|
20
20
|
function BaseLegend() {
|
|
21
21
|
var _this;
|
|
22
22
|
(0, _classCallCheck2["default"])(this, BaseLegend);
|
|
23
23
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
24
|
args[_key] = arguments[_key];
|
|
25
25
|
}
|
|
26
|
-
_this =
|
|
27
|
-
(0, _defineProperty2["default"])(
|
|
26
|
+
_this = _callSuper(this, BaseLegend, [].concat(args));
|
|
27
|
+
(0, _defineProperty2["default"])(_this, "onChangeLegendItem", function (id, checked) {
|
|
28
28
|
var _this$props$onChangeV, _this$props;
|
|
29
|
-
(_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0
|
|
29
|
+
(_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 || _this$props$onChangeV.call(_this$props, id, checked);
|
|
30
|
+
if (checked) {
|
|
31
|
+
var _this$props$onMouseEn, _this$props2;
|
|
32
|
+
(_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props2, id);
|
|
33
|
+
} else {
|
|
34
|
+
var _this$props$onMouseLe, _this$props3;
|
|
35
|
+
(_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props3, id);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
(0, _defineProperty2["default"])(_this, "onFocusLegendItem", function (checked) {
|
|
39
|
+
return function (id) {
|
|
40
|
+
var _this$props$onMouseEn2, _this$props5;
|
|
41
|
+
if (!checked) {
|
|
42
|
+
var _this$props$onMouseLe2, _this$props4;
|
|
43
|
+
return (_this$props$onMouseLe2 = (_this$props4 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe2 === void 0 ? void 0 : _this$props$onMouseLe2.call(_this$props4, id);
|
|
44
|
+
}
|
|
45
|
+
(_this$props$onMouseEn2 = (_this$props5 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn2 === void 0 || _this$props$onMouseEn2.call(_this$props5, id);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
(0, _defineProperty2["default"])(_this, "onBlurLegendItem", function (id) {
|
|
49
|
+
var _this$props$onMouseLe3, _this$props6;
|
|
50
|
+
(_this$props$onMouseLe3 = (_this$props6 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe3 === void 0 || _this$props$onMouseLe3.call(_this$props6, id);
|
|
30
51
|
});
|
|
31
|
-
(0, _defineProperty2["default"])(
|
|
52
|
+
(0, _defineProperty2["default"])(_this, "bindOnMouseEnterItem", function (id) {
|
|
32
53
|
return function (e) {
|
|
33
|
-
var _this$props$
|
|
34
|
-
(_this$props$
|
|
54
|
+
var _this$props$onMouseEn3, _this$props7;
|
|
55
|
+
(_this$props$onMouseEn3 = (_this$props7 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn3 === void 0 || _this$props$onMouseEn3.call(_this$props7, id, e);
|
|
35
56
|
};
|
|
36
57
|
});
|
|
37
|
-
(0, _defineProperty2["default"])(
|
|
58
|
+
(0, _defineProperty2["default"])(_this, "bindOnMouseLeaveItem", function (id) {
|
|
38
59
|
return function (e) {
|
|
39
|
-
var _this$props$
|
|
40
|
-
(_this$props$
|
|
60
|
+
var _this$props$onMouseLe4, _this$props8;
|
|
61
|
+
(_this$props$onMouseLe4 = (_this$props8 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe4 === void 0 || _this$props$onMouseLe4.call(_this$props8, id, e);
|
|
41
62
|
};
|
|
42
63
|
});
|
|
43
64
|
return _this;
|
|
44
65
|
}
|
|
45
|
-
(0,
|
|
66
|
+
(0, _inherits2["default"])(BaseLegend, _Component);
|
|
67
|
+
return (0, _createClass2["default"])(BaseLegend, [{
|
|
46
68
|
key: "componentDidMount",
|
|
47
69
|
value: function componentDidMount() {
|
|
48
70
|
this.setHints();
|
|
@@ -62,7 +84,7 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
62
84
|
dataHints = _this$asProps.dataHints;
|
|
63
85
|
var dataHintsHandler = dataHints ? (0, _hints.makeDataHintsHandlers)(dataHints) : undefined;
|
|
64
86
|
items.forEach(function (legendItem) {
|
|
65
|
-
dataHintsHandler === null || dataHintsHandler === void 0
|
|
87
|
+
dataHintsHandler === null || dataHintsHandler === void 0 || dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
|
|
66
88
|
});
|
|
67
89
|
}
|
|
68
90
|
}, {
|
|
@@ -87,8 +109,10 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
87
109
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, line), {}, {
|
|
88
110
|
shape: shape,
|
|
89
111
|
size: size,
|
|
112
|
+
onFocusLegendItem: this.onFocusLegendItem(line.checked),
|
|
113
|
+
onBlurLegendItem: this.onBlurLegendItem,
|
|
90
114
|
onChangeLegendItem: this.onChangeLegendItem,
|
|
91
|
-
onMouseEnter: this.bindOnMouseEnterItem(line.id),
|
|
115
|
+
onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
|
|
92
116
|
onMouseLeave: this.bindOnMouseLeaveItem(line.id),
|
|
93
117
|
style: {
|
|
94
118
|
gridRowStart: "".concat(index + 1),
|
|
@@ -98,7 +122,5 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
|
98
122
|
});
|
|
99
123
|
}
|
|
100
124
|
}]);
|
|
101
|
-
return BaseLegend;
|
|
102
125
|
}(_core.Component);
|
|
103
|
-
exports.BaseLegend = BaseLegend;
|
|
104
126
|
//# sourceMappingURL=BaseLegend.js.map
|