@semcore/d3-chart 16.4.2 → 16.5.0-prerelease.2
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 +12 -0
- package/README.md +4 -4
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +15 -15
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +15 -15
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +21 -19
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +12 -11
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +7 -7
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +21 -21
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +24 -24
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +12 -11
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +12 -11
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +5 -5
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +119 -35
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +5 -29
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +5 -29
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +0 -4
- 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 +96 -59
- 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.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +1 -6
- 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 +4 -28
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +5 -29
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +1 -5
- 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 +0 -4
- 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/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/style/abstract-chart.shadow.css +12 -0
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +15 -15
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +15 -15
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +21 -19
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +12 -11
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +7 -7
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +21 -21
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +24 -24
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +12 -11
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +12 -11
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +4 -4
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +119 -31
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +5 -29
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +5 -29
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +0 -4
- 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 +100 -61
- 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.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +1 -6
- 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 +4 -28
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +5 -29
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +1 -5
- 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 +0 -4
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/style/abstract-chart.shadow.css +12 -0
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +16 -16
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +16 -16
- package/lib/esm/CompactHorizontalBar.mjs +21 -20
- package/lib/esm/Donut.mjs +12 -12
- package/lib/esm/Dots.mjs +9 -9
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +8 -8
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +4 -4
- package/lib/esm/Radar.mjs +22 -22
- package/lib/esm/RadialTree.mjs +27 -27
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +12 -12
- package/lib/esm/Tooltip.mjs +10 -10
- package/lib/esm/Venn.mjs +12 -12
- package/lib/esm/a11y/PlotA11yModule.mjs +5 -5
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +103 -19
- package/lib/esm/component/Chart/AreaChart.mjs +5 -27
- package/lib/esm/component/Chart/BarChart.mjs +6 -28
- package/lib/esm/component/Chart/BubbleChart.mjs +0 -4
- package/lib/esm/component/Chart/CigaretteChart.mjs +78 -45
- package/lib/esm/component/Chart/DonutChart.mjs +1 -4
- package/lib/esm/component/Chart/HistogramChart.mjs +5 -27
- package/lib/esm/component/Chart/LineChart.mjs +5 -27
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +1 -4
- package/lib/esm/component/Chart/VennChart.mjs +0 -4
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +18 -18
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +7 -7
- package/lib/esm/style/abstract-chart.shadow.css +12 -0
- package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +11 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/package.json +5 -5
package/lib/esm/Tooltip.mjs
CHANGED
|
@@ -20,19 +20,19 @@ var style = (
|
|
|
20
20
|
/*__reshadow_css_start__*/
|
|
21
21
|
(sstyled.insert(
|
|
22
22
|
/*__inner_css_start__*/
|
|
23
|
-
".
|
|
23
|
+
".___STooltip_gj0h7_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%);position:relative;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-radius:var(--intergalactic-popper-rounded, 6px);border:1px solid var(--intergalactic-border-secondary, #e0e1e9);box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));padding:var(--intergalactic-spacing-3x, 12px)}.___STitle_gj0h7_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SDotGroup_gj0h7_gg_{display:flex;align-items:center}.___SDot_gj0h7_gg_{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SDotCircle_gj0h7_gg_.__color_gj0h7_gg_{background-color:var(--color_gj0h7);width:8px;height:8px;border-radius:50%}.___SFooter_gj0h7_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9);padding:var(--intergalactic-spacing-1x, 4px) var(--intergalactic-spacing-3x, 12px);border-radius:0 0 var(--intergalactic-rounded-medium, 6px) var(--intergalactic-rounded-medium, 6px);margin:var(--intergalactic-spacing-3x, 12px) calc(-1*var(--intergalactic-spacing-3x, 12px)) calc(-1*var(--intergalactic-spacing-3x, 12px))}",
|
|
24
24
|
/*__inner_css_end__*/
|
|
25
|
-
"
|
|
25
|
+
"gj0h7_gg_"
|
|
26
26
|
), /*__reshadow_css_end__*/
|
|
27
27
|
{
|
|
28
|
-
"__STooltip": "
|
|
29
|
-
"__STitle": "
|
|
30
|
-
"__SDotGroup": "
|
|
31
|
-
"__SDot": "
|
|
32
|
-
"__SDotCircle": "
|
|
33
|
-
"_color": "
|
|
34
|
-
"--color": "--
|
|
35
|
-
"__SFooter": "
|
|
28
|
+
"__STooltip": "___STooltip_gj0h7_gg_",
|
|
29
|
+
"__STitle": "___STitle_gj0h7_gg_",
|
|
30
|
+
"__SDotGroup": "___SDotGroup_gj0h7_gg_",
|
|
31
|
+
"__SDot": "___SDot_gj0h7_gg_",
|
|
32
|
+
"__SDotCircle": "___SDotCircle_gj0h7_gg_",
|
|
33
|
+
"_color": "__color_gj0h7_gg_",
|
|
34
|
+
"--color": "--color_gj0h7",
|
|
35
|
+
"__SFooter": "___SFooter_gj0h7_gg_"
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
38
|
var TooltipDotRenderContext = /* @__PURE__ */ React.createContext({
|
package/lib/esm/Venn.mjs
CHANGED
|
@@ -22,19 +22,19 @@ var style = (
|
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
23
|
(sstyled.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
|
-
".
|
|
25
|
+
".___SCircle_fyipu_gg_,.___SIntersection_fyipu_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px}.___SCircle_fyipu_gg_{fill:var(--intergalactic-chart-palette-order-2, #59ddaa);fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_fyipu);transition-timing-function:ease-in-out}@media (hover:hover){.___SCircle_fyipu_gg_:hover{fill-opacity:.7}}.___SCircle_fyipu_gg_.__color_fyipu_gg_{fill:var(--color_fyipu)}.___SCircle_fyipu_gg_.__pattern_fyipu_gg_.__color_fyipu_gg_{fill:var(--pattern_fyipu);fill-opacity:.7;stroke:var(--color_fyipu);stroke-width:1px}@media (hover:hover){.___SCircle_fyipu_gg_.__pattern_fyipu_gg_.__color_fyipu_gg_:hover{fill-opacity:.85}}.___SCircle_fyipu_gg_.__transparent_fyipu_gg_{opacity:.3}.___SIntersection_fyipu_gg_{fill-opacity:0}@media (hover:hover){.___SIntersection_fyipu_gg_:hover{fill-opacity:.1}}.___SIntersection_fyipu_gg_.__transparent_fyipu_gg_{opacity:.3}",
|
|
26
26
|
/*__inner_css_end__*/
|
|
27
|
-
"
|
|
27
|
+
"fyipu_gg_"
|
|
28
28
|
), /*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SCircle": "
|
|
31
|
-
"_color": "
|
|
32
|
-
"--color": "--
|
|
33
|
-
"_transparent": "
|
|
34
|
-
"__SIntersection": "
|
|
35
|
-
"--duration": "--
|
|
36
|
-
"_pattern": "
|
|
37
|
-
"--pattern": "--
|
|
30
|
+
"__SCircle": "___SCircle_fyipu_gg_",
|
|
31
|
+
"_color": "__color_fyipu_gg_",
|
|
32
|
+
"--color": "--color_fyipu",
|
|
33
|
+
"_transparent": "__transparent_fyipu_gg_",
|
|
34
|
+
"__SIntersection": "___SIntersection_fyipu_gg_",
|
|
35
|
+
"--duration": "--duration_fyipu",
|
|
36
|
+
"_pattern": "__pattern_fyipu_gg_",
|
|
37
|
+
"--pattern": "--pattern_fyipu"
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
var VennRoot = /* @__PURE__ */ (function(_Component) {
|
|
@@ -236,13 +236,13 @@ function Intersection(props) {
|
|
|
236
236
|
"onClickCapture": callAllEventHandlers(onClickIntersectionRoot, onClick)
|
|
237
237
|
}));
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
function VennTooltip(props) {
|
|
240
240
|
var _ref = arguments[0], _ref4;
|
|
241
241
|
var SVennTooltip = Tooltip;
|
|
242
242
|
return _ref4 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SVennTooltip, _ref4.cn("SVennTooltip", _objectSpread({}, assignProps({
|
|
243
243
|
"excludeAnchorProps": true
|
|
244
244
|
}, _ref))));
|
|
245
|
-
}
|
|
245
|
+
}
|
|
246
246
|
var Venn = createElement(VennRoot, {
|
|
247
247
|
Circle,
|
|
248
248
|
Intersection,
|
|
@@ -12,17 +12,17 @@ var styles = (
|
|
|
12
12
|
/*__reshadow_css_start__*/
|
|
13
13
|
(sstyled.insert(
|
|
14
14
|
/*__inner_css_start__*/
|
|
15
|
-
".
|
|
15
|
+
".___SPlotA11yModule_1jy6a_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}.___SPlotA11yModule_1jy6a_gg_:focus{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1}",
|
|
16
16
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
17
|
+
"1jy6a_gg_"
|
|
18
18
|
), /*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SPlotA11yModule": "
|
|
20
|
+
"__SPlotA11yModule": "___SPlotA11yModule_1jy6a_gg_"
|
|
21
21
|
})
|
|
22
22
|
);
|
|
23
23
|
var globalWasFocused = false;
|
|
24
24
|
var globalNavWithKeyboard = false;
|
|
25
|
-
|
|
25
|
+
function PlotA11yModule(props) {
|
|
26
26
|
var _ref = arguments[0], _ref5;
|
|
27
27
|
var SPlotA11yModule = Box;
|
|
28
28
|
var _React$useState = React.useState(globalWasFocused), _React$useState2 = _slicedToArray(_React$useState, 2), wasFocused = _React$useState2[0], setWasFocused = _React$useState2[1];
|
|
@@ -110,7 +110,7 @@ var PlotA11yModule = function PlotA11yModule2(props) {
|
|
|
110
110
|
"tabIndex": 0,
|
|
111
111
|
"onFocus": hadnleHiddenElementsFocus
|
|
112
112
|
}, _ref))), t("disabled"));
|
|
113
|
-
}
|
|
113
|
+
}
|
|
114
114
|
export {
|
|
115
115
|
PlotA11yModule
|
|
116
116
|
};
|
|
@@ -15,12 +15,12 @@ var styles = (
|
|
|
15
15
|
/*__reshadow_css_start__*/
|
|
16
16
|
(sstyled.insert(
|
|
17
17
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
18
|
+
".___SPlotA11yView_5y734_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);color:var(--intergalactic-text-primary, #191b23);border:3px solid var(--intergalactic-border-primary, #c4c7cf);font-size:var(--intergalactic-fs-50, 10px);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}.___SPlotA11yView_5y734_gg_:focus,.___SPlotA11yView_5y734_gg_:focus-within{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay, 500);position:relative;display:block}.___SPlotA11yView_5y734_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x, 8px);display:block}.___SPlotA11yView_5y734_gg_ table,.___SPlotA11yView_5y734_gg_ td,.___SPlotA11yView_5y734_gg_ th{border:1px solid var(--intergalactic-border-primary, #c4c7cf)}",
|
|
19
19
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
20
|
+
"5y734_gg_"
|
|
21
21
|
), /*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SPlotA11yView": "
|
|
23
|
+
"__SPlotA11yView": "___SPlotA11yView_5y734_gg_"
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
26
|
var PlotA11yView = function PlotA11yView2(_ref3) {
|
|
@@ -9,15 +9,31 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
9
9
|
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
10
10
|
import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
|
|
11
11
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
12
|
-
import { Flex } from "@semcore/flex-box";
|
|
12
|
+
import { Flex, Box } from "@semcore/flex-box";
|
|
13
13
|
import { Text } from "@semcore/typography";
|
|
14
|
-
import React from "react";
|
|
14
|
+
import React, { Fragment } from "react";
|
|
15
15
|
import Plot from "../../Plot.mjs";
|
|
16
16
|
import { LegendFlex } from "../ChartLegend/LegendFlex/LegendFlex.mjs";
|
|
17
17
|
import { LegendTable } from "../ChartLegend/LegendTable/LegendTable.mjs";
|
|
18
18
|
import { YAxis, XAxis } from "../../Axis.mjs";
|
|
19
19
|
import { interpolateValue } from "../../utils.mjs";
|
|
20
20
|
import { makeDataHintsContainer } from "../../a11y/hints.mjs";
|
|
21
|
+
/*!__reshadow-styles__:"../../style/abstract-chart.shadow.css"*/
|
|
22
|
+
var style = (
|
|
23
|
+
/*__reshadow_css_start__*/
|
|
24
|
+
(sstyled.insert(
|
|
25
|
+
/*__inner_css_start__*/
|
|
26
|
+
".___STooltipChildrenWrapper_1xuth_gg_{display:grid;grid-column-gap:var(--intergalactic-spacing-2x, 8px);-moz-column-gap:var(--intergalactic-spacing-2x, 8px);column-gap:var(--intergalactic-spacing-2x, 8px)}.___STooltipChildrenWrapper_1xuth_gg_._columnsCount_2_1xuth_gg_{grid-template-columns:auto minmax(28px,max-content)}.___STooltipChildrenWrapper_1xuth_gg_._columnsCount_3_1xuth_gg_{grid-template-columns:auto minmax(28px,max-content) minmax(28px,max-content)}",
|
|
27
|
+
/*__inner_css_end__*/
|
|
28
|
+
"1xuth_gg_"
|
|
29
|
+
), /*__reshadow_css_end__*/
|
|
30
|
+
{
|
|
31
|
+
"__STooltipChildrenWrapper": "___STooltipChildrenWrapper_1xuth_gg_",
|
|
32
|
+
"_columnsCount_2": "_columnsCount_2_1xuth_gg_",
|
|
33
|
+
"_columnsCount_3": "_columnsCount_3_1xuth_gg_"
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
var NOT_A_VALUE = "n/a";
|
|
21
37
|
var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
22
38
|
function AbstractChart2(props) {
|
|
23
39
|
var _this;
|
|
@@ -96,7 +112,7 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
96
112
|
}, percent !== void 0 ? "".concat(percent, "%") : ""), /* @__PURE__ */ React.createElement(Text, {
|
|
97
113
|
key: "".concat(key, "_value"),
|
|
98
114
|
use: value ? "primary" : "secondary"
|
|
99
|
-
}, value !== null && value !== void 0 ? value :
|
|
115
|
+
}, value !== null && value !== void 0 ? value : NOT_A_VALUE)];
|
|
100
116
|
}
|
|
101
117
|
return dataDefinition;
|
|
102
118
|
});
|
|
@@ -154,8 +170,8 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
154
170
|
if (!groupKey && typeof item === "number") {
|
|
155
171
|
result.add(item);
|
|
156
172
|
} else {
|
|
157
|
-
Object.entries(item).forEach(function(
|
|
158
|
-
var
|
|
173
|
+
Object.entries(item).forEach(function(_ref5) {
|
|
174
|
+
var _ref6 = _slicedToArray(_ref5, 2), key = _ref6[0], value = _ref6[1];
|
|
159
175
|
if (key !== groupKey && typeof value === "number") {
|
|
160
176
|
result.add(value);
|
|
161
177
|
}
|
|
@@ -179,8 +195,8 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
179
195
|
return _max;
|
|
180
196
|
}
|
|
181
197
|
var max = data.reduce(function(max2, item) {
|
|
182
|
-
var barSum = Object.entries(item).reduce(function(sum,
|
|
183
|
-
var
|
|
198
|
+
var barSum = Object.entries(item).reduce(function(sum, _ref7) {
|
|
199
|
+
var _ref8 = _slicedToArray(_ref7, 2), key = _ref8[0], val = _ref8[1];
|
|
184
200
|
if (key === groupKey) {
|
|
185
201
|
return sum;
|
|
186
202
|
}
|
|
@@ -203,18 +219,42 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
203
219
|
key: "totalValue",
|
|
204
220
|
value: function totalValue(data) {
|
|
205
221
|
var dataDefinitions = this.state.dataDefinitions;
|
|
222
|
+
var allNotAValue = true;
|
|
206
223
|
var total = dataDefinitions.reduce(function(sum, legendItem) {
|
|
207
224
|
var item = data[legendItem.id];
|
|
225
|
+
if (item === null) {
|
|
226
|
+
allNotAValue = false;
|
|
227
|
+
return sum;
|
|
228
|
+
}
|
|
208
229
|
if (typeof item === "number") {
|
|
230
|
+
allNotAValue = false;
|
|
209
231
|
return sum + item;
|
|
210
232
|
}
|
|
211
233
|
if (item instanceof Date && !Number.isNaN(item.getMilliseconds())) {
|
|
234
|
+
allNotAValue = false;
|
|
212
235
|
return sum + item.getMilliseconds();
|
|
213
236
|
}
|
|
214
237
|
return sum;
|
|
215
238
|
}, 0);
|
|
239
|
+
if (allNotAValue) {
|
|
240
|
+
return Number.NaN;
|
|
241
|
+
}
|
|
216
242
|
return total;
|
|
217
243
|
}
|
|
244
|
+
}, {
|
|
245
|
+
key: "percentValue",
|
|
246
|
+
value: function percentValue(data, key) {
|
|
247
|
+
var total = this.totalValue(data);
|
|
248
|
+
var value = data[key];
|
|
249
|
+
if (typeof value === "number" && total !== 0) {
|
|
250
|
+
var percent = Math.round(100 * value / total);
|
|
251
|
+
return "".concat(percent, "%");
|
|
252
|
+
}
|
|
253
|
+
if (value === null) {
|
|
254
|
+
return "0%";
|
|
255
|
+
}
|
|
256
|
+
return NOT_A_VALUE;
|
|
257
|
+
}
|
|
218
258
|
}, {
|
|
219
259
|
key: "getValueScale",
|
|
220
260
|
value: function getValueScale(values) {
|
|
@@ -280,7 +320,7 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
280
320
|
return tooltipValueFormatter2(value);
|
|
281
321
|
}
|
|
282
322
|
if (value === void 0 || value === interpolateValue) {
|
|
283
|
-
return
|
|
323
|
+
return NOT_A_VALUE;
|
|
284
324
|
}
|
|
285
325
|
if (value === null) {
|
|
286
326
|
return "0";
|
|
@@ -347,14 +387,14 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
347
387
|
}
|
|
348
388
|
var xTicks = this.xTicks;
|
|
349
389
|
var yTicks = this.yTicks;
|
|
350
|
-
var childrenX = axisXValueFormatter ? function(
|
|
351
|
-
var value =
|
|
390
|
+
var childrenX = axisXValueFormatter ? function(_ref9) {
|
|
391
|
+
var value = _ref9.value;
|
|
352
392
|
return {
|
|
353
393
|
children: axisXValueFormatter(value)
|
|
354
394
|
};
|
|
355
395
|
} : void 0;
|
|
356
|
-
var childrenY = axisYValueFormatter ? function(
|
|
357
|
-
var value =
|
|
396
|
+
var childrenY = axisYValueFormatter ? function(_ref0) {
|
|
397
|
+
var value = _ref0.value;
|
|
358
398
|
return {
|
|
359
399
|
children: axisYValueFormatter(value)
|
|
360
400
|
};
|
|
@@ -375,18 +415,61 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
375
415
|
ticks: xTicks
|
|
376
416
|
}) : /* @__PURE__ */ React.createElement(XAxis.Grid, null))));
|
|
377
417
|
}
|
|
418
|
+
}, {
|
|
419
|
+
key: "getTooltipChildren",
|
|
420
|
+
value: function getTooltipChildren(options) {
|
|
421
|
+
var _ref = this.asProps, _ref3, _dataItem, _this3 = this;
|
|
422
|
+
var STooltipChildrenWrapper = Box;
|
|
423
|
+
var Tooltip = options.Tooltip, dataItem = options.dataItem;
|
|
424
|
+
var _this$asProps7 = this.asProps, styles = _this$asProps7.styles, groupKey = _this$asProps7.groupKey;
|
|
425
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
426
|
+
var title = (_dataItem = dataItem[groupKey]) === null || _dataItem === void 0 ? void 0 : _dataItem.toString();
|
|
427
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(Flex, _ref3.cn("Flex", {
|
|
428
|
+
"direction": "column"
|
|
429
|
+
}), title && /* @__PURE__ */ React.createElement(Tooltip.Title, null, title), /* @__PURE__ */ React.createElement(STooltipChildrenWrapper, _ref3.cn("STooltipChildrenWrapper", _objectSpread({}, assignProps({
|
|
430
|
+
"columnsCount": "2",
|
|
431
|
+
"__excludeProps": ["data"]
|
|
432
|
+
}, _ref))), dataDefinitions.map(function(item) {
|
|
433
|
+
return item.checked && /* @__PURE__ */ React.createElement(Fragment, {
|
|
434
|
+
key: item.id
|
|
435
|
+
}, /* @__PURE__ */ React.createElement(Tooltip.Dot, {
|
|
436
|
+
mr: 2,
|
|
437
|
+
color: item.color
|
|
438
|
+
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
439
|
+
textAlign: "end",
|
|
440
|
+
bold: true
|
|
441
|
+
}, _this3.tooltipValueFormatter(dataItem[item.id])));
|
|
442
|
+
}), this.renderTooltipTotalLine(dataItem)));
|
|
443
|
+
}
|
|
444
|
+
}, {
|
|
445
|
+
key: "renderTooltipTotalLine",
|
|
446
|
+
value: function renderTooltipTotalLine(dataItem) {
|
|
447
|
+
var showTotalInTooltip = this.asProps.showTotalInTooltip;
|
|
448
|
+
if (!showTotalInTooltip) {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
var total = this.totalValue(dataItem);
|
|
452
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, {
|
|
453
|
+
mt: 2,
|
|
454
|
+
mr: 2
|
|
455
|
+
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
456
|
+
mt: 2,
|
|
457
|
+
textAlign: "end",
|
|
458
|
+
bold: true
|
|
459
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : total));
|
|
460
|
+
}
|
|
378
461
|
}, {
|
|
379
462
|
key: "render",
|
|
380
463
|
value: function render() {
|
|
381
|
-
var
|
|
464
|
+
var _ref2 = this.asProps, _ref4;
|
|
382
465
|
var SChart = Flex;
|
|
383
|
-
var _this$
|
|
466
|
+
var _this$asProps8 = this.asProps, styles = _this$asProps8.styles, plotWidth = _this$asProps8.plotWidth, plotHeight = _this$asProps8.plotHeight, data = _this$asProps8.data, patterns = _this$asProps8.patterns, a11yAltTextConfig = _this$asProps8.a11yAltTextConfig, duration = _this$asProps8.duration, eventEmitter = _this$asProps8.eventEmitter, showTooltip = _this$asProps8.showTooltip;
|
|
384
467
|
var _extractAriaProps = extractAriaProps(this.asProps), extractedAriaProps = _extractAriaProps.extractedAriaProps;
|
|
385
|
-
return
|
|
468
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SChart, _ref4.cn("SChart", _objectSpread({}, assignProps({
|
|
386
469
|
"gap": 5,
|
|
387
470
|
"__excludeProps": ["data", "eventEmitter"],
|
|
388
471
|
"role": "group"
|
|
389
|
-
},
|
|
472
|
+
}, _ref2))), this.renderLegend(), /* @__PURE__ */ React.createElement(Plot, _ref4.cn("Plot", _objectSpread({
|
|
390
473
|
"data": data,
|
|
391
474
|
"scale": [this.xScale, this.yScale],
|
|
392
475
|
"width": plotWidth,
|
|
@@ -396,11 +479,11 @@ var AbstractChart = /* @__PURE__ */ (function(_Component) {
|
|
|
396
479
|
"patterns": patterns,
|
|
397
480
|
"duration": duration,
|
|
398
481
|
"eventEmitter": eventEmitter
|
|
399
|
-
}, extractedAriaProps)), this.renderAxis(), this.renderTooltip(), this.renderChart()));
|
|
482
|
+
}, extractedAriaProps)), this.renderAxis(), !showTooltip ? null : this.renderTooltip(), this.renderChart()));
|
|
400
483
|
}
|
|
401
484
|
}]);
|
|
402
485
|
})(Component);
|
|
403
|
-
_defineProperty(AbstractChart, "style",
|
|
486
|
+
_defineProperty(AbstractChart, "style", style);
|
|
404
487
|
_defineProperty(AbstractChart, "defaultProps", {
|
|
405
488
|
direction: "column",
|
|
406
489
|
showXAxis: true,
|
|
@@ -408,5 +491,6 @@ _defineProperty(AbstractChart, "defaultProps", {
|
|
|
408
491
|
showTooltip: true
|
|
409
492
|
});
|
|
410
493
|
export {
|
|
411
|
-
AbstractChart
|
|
494
|
+
AbstractChart,
|
|
495
|
+
NOT_A_VALUE
|
|
412
496
|
};
|
|
@@ -7,8 +7,6 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
8
|
import { createComponent } from "@semcore/core";
|
|
9
9
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
10
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
11
|
-
import { Text } from "@semcore/typography";
|
|
12
10
|
import { scaleTime, scaleLinear } from "d3-scale";
|
|
13
11
|
import React from "react";
|
|
14
12
|
import Area from "../../Area.mjs";
|
|
@@ -90,38 +88,18 @@ var AreaChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
90
88
|
key: "renderTooltip",
|
|
91
89
|
value: function renderTooltip() {
|
|
92
90
|
var _this = this;
|
|
93
|
-
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey
|
|
94
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
95
|
-
if (!showTooltip) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
91
|
+
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey;
|
|
98
92
|
return /* @__PURE__ */ React.createElement(HoverLine.Tooltip, {
|
|
99
93
|
x: groupKey,
|
|
100
94
|
wMin: 100
|
|
101
95
|
}, function(_ref) {
|
|
102
|
-
var _dataItem$groupKey;
|
|
103
96
|
var xIndex = _ref.xIndex;
|
|
104
97
|
var dataItem = data[xIndex];
|
|
105
|
-
var total = _this.totalValue(dataItem);
|
|
106
98
|
return {
|
|
107
|
-
children:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, /* @__PURE__ */ React.createElement(HoverLine.Tooltip.Dot, {
|
|
112
|
-
mr: 4,
|
|
113
|
-
color: item.color
|
|
114
|
-
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
115
|
-
bold: true
|
|
116
|
-
}, _this.tooltipValueFormatter(dataItem[item.id])));
|
|
117
|
-
}), showTotalInTooltip === true && /* @__PURE__ */ React.createElement(Flex, {
|
|
118
|
-
mt: 2,
|
|
119
|
-
justifyContent: "space-between"
|
|
120
|
-
}, /* @__PURE__ */ React.createElement(Box, {
|
|
121
|
-
mr: 4
|
|
122
|
-
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
123
|
-
bold: true
|
|
124
|
-
}, total)))
|
|
99
|
+
children: _this.getTooltipChildren({
|
|
100
|
+
Tooltip: HoverLine.Tooltip,
|
|
101
|
+
dataItem
|
|
102
|
+
})
|
|
125
103
|
};
|
|
126
104
|
});
|
|
127
105
|
}
|
|
@@ -8,16 +8,14 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import { createComponent } from "@semcore/core";
|
|
10
10
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
12
|
-
import { Text } from "@semcore/typography";
|
|
13
11
|
import { scaleTime, scaleBand, scaleLinear } from "d3-scale";
|
|
14
12
|
import React from "react";
|
|
13
|
+
import { AbstractChart } from "./AbstractChart.mjs";
|
|
15
14
|
import Line from "../../Line.mjs";
|
|
16
15
|
import GroupBar from "../../GroupBar.mjs";
|
|
17
16
|
import StackBar from "../../StackBar.mjs";
|
|
18
17
|
import { HoverRect } from "../../Hover.mjs";
|
|
19
18
|
import { minMax } from "../../utils.mjs";
|
|
20
|
-
import { AbstractChart } from "./AbstractChart.mjs";
|
|
21
19
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
22
20
|
var BarChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
23
21
|
function BarChartComponent2() {
|
|
@@ -157,41 +155,21 @@ var BarChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
157
155
|
key: "renderTooltip",
|
|
158
156
|
value: function renderTooltip() {
|
|
159
157
|
var _this3 = this;
|
|
160
|
-
var _this$asProps5 = this.asProps, data = _this$asProps5.data, groupKey = _this$asProps5.groupKey,
|
|
161
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
162
|
-
if (!showTooltip) {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
158
|
+
var _this$asProps5 = this.asProps, data = _this$asProps5.data, groupKey = _this$asProps5.groupKey, invertAxis = _this$asProps5.invertAxis, onClickHoverRect = _this$asProps5.onClickHoverRect;
|
|
165
159
|
return /* @__PURE__ */ React.createElement(HoverRect.Tooltip, {
|
|
166
160
|
x: invertAxis ? void 0 : groupKey,
|
|
167
161
|
y: invertAxis ? groupKey : void 0,
|
|
168
162
|
wMin: 100,
|
|
169
163
|
onClick: onClickHoverRect
|
|
170
164
|
}, function(_ref) {
|
|
171
|
-
var _dataItem$groupKey;
|
|
172
165
|
var xIndex = _ref.xIndex, yIndex = _ref.yIndex;
|
|
173
166
|
var index = invertAxis ? yIndex : xIndex;
|
|
174
167
|
var dataItem = data[index];
|
|
175
|
-
var total = _this3.totalValue(dataItem);
|
|
176
168
|
return {
|
|
177
|
-
children:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}, /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Dot, {
|
|
182
|
-
mr: 4,
|
|
183
|
-
color: item.color
|
|
184
|
-
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
185
|
-
bold: true
|
|
186
|
-
}, _this3.tooltipValueFormatter(dataItem[item.id])));
|
|
187
|
-
}), showTotalInTooltip === true && /* @__PURE__ */ React.createElement(Flex, {
|
|
188
|
-
mt: 2,
|
|
189
|
-
justifyContent: "space-between"
|
|
190
|
-
}, /* @__PURE__ */ React.createElement(Box, {
|
|
191
|
-
mr: 4
|
|
192
|
-
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
193
|
-
bold: true
|
|
194
|
-
}, total)))
|
|
169
|
+
children: _this3.getTooltipChildren({
|
|
170
|
+
Tooltip: HoverRect.Tooltip,
|
|
171
|
+
dataItem
|
|
172
|
+
})
|
|
195
173
|
};
|
|
196
174
|
});
|
|
197
175
|
}
|
|
@@ -109,10 +109,6 @@ var BubbleChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
109
109
|
}, {
|
|
110
110
|
key: "renderTooltip",
|
|
111
111
|
value: function renderTooltip() {
|
|
112
|
-
var showTooltip = this.asProps.showTooltip;
|
|
113
|
-
if (!showTooltip) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
112
|
return /* @__PURE__ */ React.createElement(Bubble.Tooltip, null, function(_ref3) {
|
|
117
113
|
var index = _ref3.index, data = _ref3.data;
|
|
118
114
|
return {
|