@semcore/d3-chart 18.0.0-prerelease.2 → 18.0.0-prerelease.6
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 +43 -5
- package/README.md +0 -1
- package/lib/cjs/Area.js +12 -12
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/CompactHorizontalBar.js +17 -17
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +12 -12
- package/lib/cjs/GroupBar.js +5 -2
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +12 -12
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/component/Chart/AbstractChart.js +19 -16
- 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 +1 -1
- 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 +12 -6
- 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/CigaretteChart.js +5 -1
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +1 -1
- 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 +1 -1
- 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/ChartLegend/BaseLegend.js +0 -4
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +3 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +28 -21
- 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/LegendTable/legend-table.shadow.css +30 -14
- package/lib/cjs/component/Cigarette/Cigarette.js +0 -1
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/Metric/Metric.js +78 -0
- package/lib/cjs/component/Metric/Metric.js.map +1 -0
- package/lib/cjs/component/Metric/Metric.type.js +2 -0
- package/lib/cjs/component/Metric/Metric.type.js.map +1 -0
- package/lib/cjs/index.js +8 -8
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/abstract-chart.shadow.css +1 -1
- package/lib/cjs/style/area.shadow.css +0 -2
- package/lib/cjs/style/bar.shadow.css +1 -3
- package/lib/cjs/style/bubble.shadow.css +1 -3
- package/lib/cjs/style/donut.shadow.css +1 -3
- package/lib/cjs/style/dot.shadow.css +1 -3
- package/lib/cjs/style/line.shadow.css +0 -2
- package/lib/cjs/style/radial-tree.shadow.css +1 -3
- package/lib/cjs/style/reference.shadow.css +1 -1
- package/lib/cjs/style/scatterplot.shadow.css +1 -3
- package/lib/cjs/style/tooltip.shadow.css +0 -2
- package/lib/cjs/style/venn.shadow.css +0 -2
- package/lib/cjs/types/index.d.js +20 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/es6/Area.js +12 -12
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/CompactHorizontalBar.js +17 -17
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +12 -12
- package/lib/es6/GroupBar.js +5 -2
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Line.js +9 -9
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +12 -12
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/component/Chart/AbstractChart.js +19 -16
- 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 +1 -1
- 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 +12 -6
- 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/CigaretteChart.js +5 -1
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +1 -1
- 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 +1 -1
- 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/ChartLegend/BaseLegend.js +0 -4
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +3 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +28 -21
- 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/LegendTable/legend-table.shadow.css +30 -14
- package/lib/es6/component/Cigarette/Cigarette.js +0 -1
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/Metric/Metric.js +72 -0
- package/lib/es6/component/Metric/Metric.js.map +1 -0
- package/lib/es6/component/Metric/Metric.type.js +2 -0
- package/lib/es6/component/Metric/Metric.type.js.map +1 -0
- package/lib/es6/index.js +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/abstract-chart.shadow.css +1 -1
- package/lib/es6/style/area.shadow.css +0 -2
- package/lib/es6/style/bar.shadow.css +1 -3
- package/lib/es6/style/bubble.shadow.css +1 -3
- package/lib/es6/style/donut.shadow.css +1 -3
- package/lib/es6/style/dot.shadow.css +1 -3
- package/lib/es6/style/line.shadow.css +0 -2
- package/lib/es6/style/radial-tree.shadow.css +1 -3
- package/lib/es6/style/reference.shadow.css +1 -1
- package/lib/es6/style/scatterplot.shadow.css +1 -3
- package/lib/es6/style/tooltip.shadow.css +0 -2
- package/lib/es6/style/venn.shadow.css +0 -2
- package/lib/es6/types/index.d.js +5 -7
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/esm/Area.mjs +13 -13
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/CompactHorizontalBar.mjs +18 -18
- package/lib/esm/Donut.mjs +10 -10
- package/lib/esm/Dots.mjs +13 -13
- package/lib/esm/GroupBar.mjs +5 -2
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +13 -13
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/component/Chart/AbstractChart.mjs +18 -17
- package/lib/esm/component/Chart/AreaChart.mjs +1 -1
- package/lib/esm/component/Chart/BarChart.mjs +12 -6
- package/lib/esm/component/Chart/CigaretteChart.mjs +5 -1
- package/lib/esm/component/Chart/HistogramChart.mjs +1 -1
- package/lib/esm/component/Chart/LineChart.mjs +1 -1
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +0 -4
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +3 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +29 -22
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +30 -14
- package/lib/esm/component/Cigarette/Cigarette.mjs +0 -1
- package/lib/esm/component/Metric/Metric.mjs +62 -0
- package/lib/esm/index.mjs +34 -34
- package/lib/esm/style/abstract-chart.shadow.css +1 -1
- package/lib/esm/style/area.shadow.css +0 -2
- package/lib/esm/style/bar.shadow.css +1 -3
- package/lib/esm/style/bubble.shadow.css +1 -3
- package/lib/esm/style/donut.shadow.css +1 -3
- package/lib/esm/style/dot.shadow.css +1 -3
- package/lib/esm/style/line.shadow.css +0 -2
- package/lib/esm/style/radial-tree.shadow.css +1 -3
- package/lib/esm/style/reference.shadow.css +1 -1
- package/lib/esm/style/scatterplot.shadow.css +1 -3
- package/lib/esm/style/tooltip.shadow.css +0 -2
- package/lib/esm/style/venn.shadow.css +0 -2
- package/lib/types/component/Chart/AbstractChart.d.ts +8 -4
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +9 -7
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +3 -1
- package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -3
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
- package/lib/types/component/Metric/Metric.d.ts +9 -0
- package/lib/types/component/Metric/Metric.d.ts.map +1 -0
- package/lib/types/component/Metric/Metric.type.d.ts +33 -0
- package/lib/types/component/Metric/Metric.type.d.ts.map +1 -0
- package/lib/types/index.d.ts +5 -7
- package/package.json +16 -15
- package/lib/cjs/color.js +0 -132
- package/lib/cjs/color.js.map +0 -1
- package/lib/cjs/style/var.css +0 -125
- package/lib/es6/color.js +0 -127
- package/lib/es6/color.js.map +0 -1
- package/lib/es6/style/var.css +0 -125
- package/lib/esm/color.mjs +0 -127
package/CHANGELOG.md
CHANGED
|
@@ -2,20 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [18.0.0] - 2026-10-
|
|
5
|
+
## [18.0.0] - 2026-10-08
|
|
6
6
|
|
|
7
7
|
### BREAK
|
|
8
8
|
|
|
9
|
+
- Removed the deprecated `colors` export. Use chart palette tokens or an
|
|
10
|
+
explicit `colorMap`.
|
|
11
|
+
- Changed `Chart.Area` to stacked mode by default. Set `stacked={false}`
|
|
12
|
+
explicitly for the previous unstacked behavior; the `stacked` prop is
|
|
13
|
+
deprecated.
|
|
14
|
+
- Removed `Line` and `Square` legend shapes. Use `Checkbox`, `Circle`,
|
|
15
|
+
`Pattern`, or a custom shape renderer.
|
|
16
|
+
- Made `multilineXTicks`, `multilineYTicks`, and axis ticks' `multiline`
|
|
17
|
+
ineffective; these props are deprecated.
|
|
18
|
+
- Narrowed `ObjectData` values from `unknown` to supported chart value
|
|
19
|
+
types. Update data typings that contain arbitrary objects or other
|
|
20
|
+
unsupported values.
|
|
9
21
|
- New theme applied.
|
|
10
22
|
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Added forecast and potential segments for line and area charts,
|
|
26
|
+
configured with `DATA_TYPE`, `FORECAST`, and `POTENTIAL`.
|
|
27
|
+
- Added highlighted data points configured with `HIGHLIGHT_DOT`, `GOOD`,
|
|
28
|
+
`BAD`, and `INSIGHTFUL`.
|
|
29
|
+
- Added percentage changes to supported chart tooltips with
|
|
30
|
+
`showDeltaPercentInTooltip`, custom `getPercentDelta`, and
|
|
31
|
+
`deltaPercentGrowthColor`.
|
|
32
|
+
- Added `locale` and `tooltipTitleFormatter`; axis value formatters now
|
|
33
|
+
accept React nodes, including links.
|
|
34
|
+
- Added `maxBarSize` to `Chart.Bar` to limit bar thickness.
|
|
35
|
+
- Added row-based layout in table legends for displaying legend with metrics.
|
|
36
|
+
- Added `hideTickHover` to hover components and tooltips.
|
|
37
|
+
- `maxBarSize` prop for `Chart.Bar`.
|
|
38
|
+
- `deltaPercentGrowthColor` prop to define color for delta growth.
|
|
39
|
+
|
|
11
40
|
### Changed
|
|
12
41
|
|
|
13
|
-
-
|
|
14
|
-
|
|
42
|
+
- Redesigned chart grids, axes, hover indicators, tooltips, and legends;
|
|
43
|
+
added end caps to reference lines and gradient fills to area charts.
|
|
44
|
+
- Changed the default donut thickness to 12px. Set `innerRadius` explicitly when a specific
|
|
45
|
+
thickness is required.
|
|
46
|
+
- Changed default tooltip formatting to localized dates and numbers,
|
|
47
|
+
with non-integer numbers rounded to one decimal place. Use custom
|
|
48
|
+
formatters to retain application-specific formatting.
|
|
49
|
+
- Limited `Chart.Bar` thickness to 12px by default; histogram bars
|
|
50
|
+
retain their independent sizing.
|
|
15
51
|
|
|
16
|
-
###
|
|
52
|
+
### Fixed
|
|
17
53
|
|
|
18
|
-
-
|
|
54
|
+
- Preserved highlighted dots during hover and rendered hovered dots when
|
|
55
|
+
`showDots` is disabled.
|
|
56
|
+
- Kept tooltips visible when hovering the axis area below the plot.
|
|
19
57
|
|
|
20
58
|
## [17.3.1] - 2026-09-10
|
|
21
59
|
|
package/README.md
CHANGED
package/lib/cjs/Area.js
CHANGED
|
@@ -20,20 +20,20 @@ var _Dots = _interopRequireDefault(require("./Dots"));
|
|
|
20
20
|
var _Pattern = require("./Pattern");
|
|
21
21
|
var _utils = require("./utils");
|
|
22
22
|
/*!__reshadow-styles__:"./style/area.shadow.css"*/
|
|
23
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
23
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SArea_mf3t1_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));fill-opacity:.1}.___SArea_mf3t1_gg_.__withGradient_mf3t1_gg_{-webkit-mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000);mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000)}.___SArea_mf3t1_gg_.__color_mf3t1_gg_{fill:var(--color_mf3t1)}.___SArea_mf3t1_gg_.__pattern_mf3t1_gg_{fill:var(--pattern_mf3t1);fill-opacity:.5}.___SArea_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke-width:2;fill:#0000}.___SAreaLine_mf3t1_gg_.__color_mf3t1_gg_{stroke:var(--color_mf3t1)}.___SAreaLine_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_,.___SArea_mf3t1_gg_{transition-property:d;transition-duration:var(--duration_mf3t1);transition-timing-function:ease-in-out}.___SNull_mf3t1_gg_{fill:#0000;stroke:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_mf3t1_gg_.__hide_mf3t1_gg_{display:none}", /*__inner_css_end__*/"mf3t1_gg_"),
|
|
24
24
|
/*__reshadow_css_end__*/
|
|
25
25
|
{
|
|
26
|
-
"__SArea": "
|
|
27
|
-
"_withGradient": "
|
|
28
|
-
"_color": "
|
|
29
|
-
"--color": "--
|
|
30
|
-
"_pattern": "
|
|
31
|
-
"--pattern": "--
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"__SAreaLine": "
|
|
34
|
-
"--duration": "--
|
|
35
|
-
"__SNull": "
|
|
36
|
-
"_hide": "
|
|
26
|
+
"__SArea": "___SArea_mf3t1_gg_",
|
|
27
|
+
"_withGradient": "__withGradient_mf3t1_gg_",
|
|
28
|
+
"_color": "__color_mf3t1_gg_",
|
|
29
|
+
"--color": "--color_mf3t1",
|
|
30
|
+
"_pattern": "__pattern_mf3t1_gg_",
|
|
31
|
+
"--pattern": "--pattern_mf3t1",
|
|
32
|
+
"_transparent": "__transparent_mf3t1_gg_",
|
|
33
|
+
"__SAreaLine": "___SAreaLine_mf3t1_gg_",
|
|
34
|
+
"--duration": "--duration_mf3t1",
|
|
35
|
+
"__SNull": "___SNull_mf3t1_gg_",
|
|
36
|
+
"_hide": "__hide_mf3t1_gg_"
|
|
37
37
|
});
|
|
38
38
|
class AreaRoot extends _core.Component {
|
|
39
39
|
getDotsProps() {
|
package/lib/cjs/Bar.js
CHANGED
|
@@ -15,24 +15,24 @@ var _createElement = _interopRequireDefault(require("./createElement"));
|
|
|
15
15
|
var _Pattern = require("./Pattern");
|
|
16
16
|
var _utils = require("./utils");
|
|
17
17
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
18
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
18
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBar_1d6up_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_1d6up);transition-timing-function:ease-in-out}.___SBar_1d6up_gg_.__color_1d6up_gg_{fill:var(--color_1d6up)}.___SBar_1d6up_gg_.__pattern_1d6up_gg_.__color_1d6up_gg_{fill:var(--pattern_1d6up);stroke:var(--color_1d6up);stroke-width:1px}.___SBar_1d6up_gg_.__hide_1d6up_gg_{display:none}.___SBar_1d6up_gg_.__transparent_1d6up_gg_{opacity:.3}.___SBar_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBackground_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBarAnnotation_1d6up_gg_{display:flex;justify-content:space-between}.___SBarLabel_1d6up_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_1d6up_gg_,.___SBarPercent_1d6up_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1d6up_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1d6up_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}", /*__inner_css_end__*/"1d6up_gg_"),
|
|
19
19
|
/*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SBar": "
|
|
22
|
-
"--duration": "--
|
|
23
|
-
"_color": "
|
|
24
|
-
"--color": "--
|
|
25
|
-
"_pattern": "
|
|
26
|
-
"--pattern": "--
|
|
27
|
-
"_hide": "
|
|
28
|
-
"_transparent": "
|
|
29
|
-
"_onClick": "
|
|
30
|
-
"__SBackground": "
|
|
31
|
-
"__SBarAnnotation": "
|
|
32
|
-
"__SBarLabel": "
|
|
33
|
-
"__SBarPercent": "
|
|
34
|
-
"__SBarValue": "
|
|
35
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
21
|
+
"__SBar": "___SBar_1d6up_gg_",
|
|
22
|
+
"--duration": "--duration_1d6up",
|
|
23
|
+
"_color": "__color_1d6up_gg_",
|
|
24
|
+
"--color": "--color_1d6up",
|
|
25
|
+
"_pattern": "__pattern_1d6up_gg_",
|
|
26
|
+
"--pattern": "--pattern_1d6up",
|
|
27
|
+
"_hide": "__hide_1d6up_gg_",
|
|
28
|
+
"_transparent": "__transparent_1d6up_gg_",
|
|
29
|
+
"_onClick": "__onClick_1d6up_gg_",
|
|
30
|
+
"__SBackground": "___SBackground_1d6up_gg_",
|
|
31
|
+
"__SBarAnnotation": "___SBarAnnotation_1d6up_gg_",
|
|
32
|
+
"__SBarLabel": "___SBarLabel_1d6up_gg_",
|
|
33
|
+
"__SBarPercent": "___SBarPercent_1d6up_gg_",
|
|
34
|
+
"__SBarValue": "___SBarValue_1d6up_gg_",
|
|
35
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1d6up_gg_"
|
|
36
36
|
});
|
|
37
37
|
const MIN_HEIGHT = exports.MIN_HEIGHT = 2;
|
|
38
38
|
const calcPartBarY = (y, minHeight, height) => {
|
package/lib/cjs/Bubble.js
CHANGED
|
@@ -18,22 +18,22 @@ var _Pattern = require("./Pattern");
|
|
|
18
18
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
19
19
|
var _utils = require("./utils");
|
|
20
20
|
/*!__reshadow-styles__:"./style/bubble.shadow.css"*/
|
|
21
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
21
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBubble_1fxbq_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1fxbq);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1fxbq_gg_:hover{opacity:.8}}g._visible_false_1fxbq_gg_{display:none}.___SBubble_1fxbq_gg_.__clickable_1fxbq_gg_{cursor:pointer}.___SBubble_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SBubble_1fxbq_gg_.__pattern_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--pattern_1fxbq);stroke:var(--color_1fxbq);stroke-width:1px}.___SBubble_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SCenter_1fxbq_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SCenter_1fxbq_gg_.__color_1fxbq_gg_{stroke:var(--color_1fxbq)}.___SCenter_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SLabel_1fxbq_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_1fxbq_gg_._position_right_1fxbq_gg_{text-anchor:end}.___SLabel_1fxbq_gg_._position_left_1fxbq_gg_{text-anchor:start}.___SLabel_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SLabel_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}", /*__inner_css_end__*/"1fxbq_gg_"),
|
|
22
22
|
/*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"_visible_false": "
|
|
25
|
-
"__SBubble": "
|
|
26
|
-
"_clickable": "
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"--pattern": "--
|
|
31
|
-
"_transparent": "
|
|
32
|
-
"__SCenter": "
|
|
33
|
-
"__SLabel": "
|
|
34
|
-
"_position_right": "
|
|
35
|
-
"_position_left": "
|
|
36
|
-
"--duration": "--
|
|
24
|
+
"_visible_false": "_visible_false_1fxbq_gg_",
|
|
25
|
+
"__SBubble": "___SBubble_1fxbq_gg_",
|
|
26
|
+
"_clickable": "__clickable_1fxbq_gg_",
|
|
27
|
+
"_color": "__color_1fxbq_gg_",
|
|
28
|
+
"--color": "--color_1fxbq",
|
|
29
|
+
"_pattern": "__pattern_1fxbq_gg_",
|
|
30
|
+
"--pattern": "--pattern_1fxbq",
|
|
31
|
+
"_transparent": "__transparent_1fxbq_gg_",
|
|
32
|
+
"__SCenter": "___SCenter_1fxbq_gg_",
|
|
33
|
+
"__SLabel": "___SLabel_1fxbq_gg_",
|
|
34
|
+
"_position_right": "_position_right_1fxbq_gg_",
|
|
35
|
+
"_position_left": "_position_left_1fxbq_gg_",
|
|
36
|
+
"--duration": "--duration_1fxbq"
|
|
37
37
|
});
|
|
38
38
|
class BubbleRoot extends _core.Component {
|
|
39
39
|
constructor(...args) {
|
|
@@ -19,27 +19,27 @@ var _Pattern = require("./Pattern");
|
|
|
19
19
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
20
20
|
var _utils = require("./utils");
|
|
21
21
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
22
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
22
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBar_1d6up_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_1d6up);transition-timing-function:ease-in-out}.___SBar_1d6up_gg_.__color_1d6up_gg_{fill:var(--color_1d6up)}.___SBar_1d6up_gg_.__pattern_1d6up_gg_.__color_1d6up_gg_{fill:var(--pattern_1d6up);stroke:var(--color_1d6up);stroke-width:1px}.___SBar_1d6up_gg_.__hide_1d6up_gg_{display:none}.___SBar_1d6up_gg_.__transparent_1d6up_gg_{opacity:.3}.___SBar_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBackground_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBarAnnotation_1d6up_gg_{display:flex;justify-content:space-between}.___SBarLabel_1d6up_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_1d6up_gg_,.___SBarPercent_1d6up_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1d6up_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1d6up_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}", /*__inner_css_end__*/"1d6up_gg_"),
|
|
23
23
|
/*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SBar": "
|
|
26
|
-
"--duration": "--
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"--pattern": "--
|
|
31
|
-
"_hide": "
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"_onClick": "
|
|
34
|
-
"__SBackground": "
|
|
35
|
-
"__SBarAnnotation": "
|
|
36
|
-
"__SBarLabel": "
|
|
37
|
-
"__SBarPercent": "
|
|
38
|
-
"__SBarValue": "
|
|
39
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
25
|
+
"__SBar": "___SBar_1d6up_gg_",
|
|
26
|
+
"--duration": "--duration_1d6up",
|
|
27
|
+
"_color": "__color_1d6up_gg_",
|
|
28
|
+
"--color": "--color_1d6up",
|
|
29
|
+
"_pattern": "__pattern_1d6up_gg_",
|
|
30
|
+
"--pattern": "--pattern_1d6up",
|
|
31
|
+
"_hide": "__hide_1d6up_gg_",
|
|
32
|
+
"_transparent": "__transparent_1d6up_gg_",
|
|
33
|
+
"_onClick": "__onClick_1d6up_gg_",
|
|
34
|
+
"__SBackground": "___SBackground_1d6up_gg_",
|
|
35
|
+
"__SBarAnnotation": "___SBarAnnotation_1d6up_gg_",
|
|
36
|
+
"__SBarLabel": "___SBarLabel_1d6up_gg_",
|
|
37
|
+
"__SBarPercent": "___SBarPercent_1d6up_gg_",
|
|
38
|
+
"__SBarValue": "___SBarValue_1d6up_gg_",
|
|
39
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1d6up_gg_"
|
|
40
40
|
});
|
|
41
41
|
const MIN_WIDTH = exports.MIN_WIDTH = 4;
|
|
42
|
-
const barHeight =
|
|
42
|
+
const barHeight = 12;
|
|
43
43
|
const hoverOffset = 6;
|
|
44
44
|
class CompactHorizontalBarRoot extends _core.Component {
|
|
45
45
|
constructor(...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactHorizontalBar.js","names":["_core","require","_baseComponents","_assignProps5","_canUseDOM","_interopRequireDefault","_rafTrottle","_uniqueID","_react","_AnimatedClipPath","_createElement","_Pattern","_Tooltip","_utils","style","sstyled","insert","MIN_WIDTH","exports","barHeight","hoverOffset","CompactHorizontalBarRoot","Component","constructor","args","_defineProperty2","default","indexToHover","getBarProps","_props","index","getBarBackgroundProps","data","scale","asProps","bar","computeBarData","x","y","height","width","fullWidth","getBarFillProps","uid","patterns","color","transparent","hide","i","resolveColor","getAnnotationProps","size","getLabelProps","label","children","getPercentFormatter","percentFormatter","percentFormatterLocale","locale","Intl","NumberFormat","getValueFormatter","valueFormatter","valueFormatterLocale","getPercentProps","value","domain","percent","formatter","formatted","format","getValueProps","getHoverProps","getBarData","render","updateIndexToHover","setState","getTooltipProps","state","d","offset","offsetProps","wMin","heightProps","maxBarSize","Number","POSITIVE_INFINITY","xScale","yScale","absWidth","bandHeight","scaleToBand","bandwidth","Math","min","max","barY","renderBar","_ref5","SCompactHorizontalBarGroup","Element","styles","groupKey","dataHintsHandler","describeValueEntity","createElement","Fragment","key","cn","renderBars","map","bind","duration","id","uniqueIDEnhancement","Annotation","props","_ref6","Children","SBarAnnotation","excludeProps","Label","_ref","arguments[0]","_ref7","SBarLabel","Box","assignProps","Percent","_ref2","_ref8","SBarPercent","Value","_ref3","_ref9","SBarValue","BarContext","React","createContext","Bar","onClick","onClickHandler","useCallback","event","contextValue","useMemo","Provider","BarFill","_ref0","SBar","xRange","range","backgroundWidth","radius","pathD","roundedPath","barProps","useContext","undefined","callAllEventHandlers","PatternFill","BarBackground","_ref1","SBackground","Hover","canUseDOM","document","trottle","e","eventEmitter","rootRef","plotId","point","eventToPoint","current","clientX","clientY","getIndex","emit","generateGetBoundingClientRect","top","right","bottom","left","length","componentDidMount","unsubscribeMouseMoveRoot","subscribe","persist","handlerMouseMoveRoot","unsubscribeMouseLeaveRoot","handlerMouseLeaveRoot","componentWillUnmount","_ref10","SCompactHorizontalBarHoverRect","CompactHorizontalBarTooltip","_ref4","_ref11","SCompactHorizontalBarRadarTooltip","Tooltip","CompactHorizontalBar","Fill","Background","_______childrenComponents","_default"],"sources":["../../src/CompactHorizontalBar.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport AnimatedClipPath from './AnimatedClipPath';\nimport createElement from './createElement';\nimport { PatternFill } from './Pattern';\nimport style from './style/bar.shadow.css';\nimport Tooltip from './Tooltip';\nimport { roundedPath, scaleToBand, eventToPoint } from './utils';\n\nexport const MIN_WIDTH = 4;\n\nconst barHeight = 20;\nconst hoverOffset = 6;\n\nclass CompactHorizontalBarRoot extends Component {\n static displayName = 'CompactHorizontalBar';\n static enhance = [uniqueIDEnhancement()];\n static style = style;\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n wMin: MIN_WIDTH,\n locale: 'en',\n color: 'chart-palette-order-1',\n };\n\n state = {\n indexToHover: null,\n };\n\n getBarProps(_props, index) {\n return {\n index,\n };\n }\n\n getBarBackgroundProps(_props, index) {\n const { data, scale } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n\n return {\n scale,\n index,\n x: bar.x,\n y: bar.y + bar.height - barHeight - hoverOffset,\n height: barHeight,\n width: bar.fullWidth,\n };\n }\n\n getBarFillProps(_props, index) {\n const { data, uid, patterns, color, transparent, hide, scale } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n return {\n x: bar.x,\n y: bar.y + bar.height - barHeight - hoverOffset,\n height: barHeight,\n width: bar.width,\n i: index,\n uid,\n resolveColor: this.asProps.resolveColor,\n patterns,\n color,\n transparent,\n hide,\n scale,\n index,\n };\n }\n\n getAnnotationProps(_props, index) {\n const { data, size } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n return {\n y: bar.y,\n height: barHeight * 2,\n width: size[0],\n index,\n };\n }\n\n getLabelProps(_props, index) {\n const { data, y } = this.asProps;\n const label = data[index][y];\n\n return {\n children: label,\n index,\n };\n }\n\n percentFormatter = null;\n percentFormatterLocale = null;\n getPercentFormatter() {\n if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {\n this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'percent' });\n this.percentFormatterLocale = this.asProps.locale;\n }\n return this.percentFormatter;\n }\n\n valueFormatter = null;\n valueFormatterLocale = null;\n getValueFormatter() {\n if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {\n this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);\n this.valueFormatterLocale = this.asProps.locale;\n }\n return this.valueFormatter;\n }\n\n getPercentProps(_props, index) {\n const { data, x, scale } = this.asProps;\n const value = data[index][x];\n const domain = scale[0].domain();\n const percent = value / domain[1];\n const formatter = this.getPercentFormatter();\n const formatted = formatter.format(percent);\n\n return { children: formatted, formatted, percent };\n }\n\n getValueProps(_props, index) {\n const { data, x } = this.asProps;\n const value = data[index][x];\n const formatter = this.getValueFormatter();\n const formatted = formatter.format(value);\n\n return { children: formatted, formatted, value };\n }\n\n getHoverProps(_props, index) {\n const { data } = this.asProps;\n\n return {\n data,\n getBarData: (index) => this.computeBarData(data[index], index),\n render: index === 0,\n updateIndexToHover: (index) => this.setState({ indexToHover: index }),\n };\n }\n\n getTooltipProps(_props, index) {\n return {\n render: index === 0,\n index: this.state.indexToHover,\n };\n }\n\n computeBarData(d) {\n const {\n x,\n y,\n scale,\n offset: offsetProps,\n wMin,\n height: heightProps,\n maxBarSize = Number.POSITIVE_INFINITY,\n size,\n } = this.asProps;\n\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absWidth = xScale(d[x]);\n const bandHeight = heightProps || scaleToBand(yScale).bandwidth();\n const height = Math.min(bandHeight, maxBarSize);\n const width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);\n const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];\n\n return {\n x: 0,\n y: barY,\n width,\n fullWidth: size[0],\n height,\n };\n }\n\n renderBar(d, i) {\n const SCompactHorizontalBarGroup = this.Element;\n const { styles, groupKey } = this.asProps;\n const { x, y } = this.computeBarData(d, i);\n\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);\n\n return (\n <React.Fragment key={`horizontal-bar-${i}`}>\n {sstyled(styles)(<SCompactHorizontalBarGroup render='g' />)}\n </React.Fragment>\n );\n }\n\n renderBars() {\n const { data } = this.asProps;\n\n return data.map(this.renderBar.bind(this));\n }\n\n render() {\n const { uid, size, duration } = this.asProps;\n\n return (\n <>\n {this.renderBars()}\n {duration && (\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n />\n )}\n </>\n );\n }\n}\n\nfunction Annotation(props) {\n const { Children, y, height, width, styles } = props;\n const SBarAnnotation = 'div';\n return sstyled(styles)(\n <foreignObject x='0' y={y - barHeight} height={height} width={width} overflow='visible'>\n <SBarAnnotation>\n <Children />\n </SBarAnnotation>\n </foreignObject>,\n );\n}\nconst excludeProps = ['data', 'scale', 'value', 'offset'];\nfunction Label(props) {\n const SBarLabel = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarLabel render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarLabel>,\n );\n}\nfunction Percent(props) {\n const SBarPercent = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarPercent render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarPercent>,\n );\n}\nfunction Value(props) {\n const SBarValue = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarValue render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarValue>,\n );\n}\n\nconst BarContext = React.createContext({});\nfunction Bar(props) {\n const { Children, index, onClick, transparent, hide } = props;\n const onClickHandler = React.useCallback(\n (event) => {\n onClick?.(index, event);\n },\n [onClick, index],\n );\n const contextValue = React.useMemo(\n () => ({ onClick: onClickHandler, transparent, hide }),\n [onClickHandler, transparent, hide],\n );\n return (\n <BarContext.Provider value={contextValue}>\n <Children />\n </BarContext.Provider>\n );\n}\nfunction BarFill(props) {\n const {\n Element: SBar,\n styles,\n color,\n x,\n y,\n width,\n height,\n uid,\n duration,\n resolveColor,\n patterns,\n i,\n scale,\n } = props;\n const [xScale] = scale;\n const xRange = xScale.range();\n const backgroundWidth = xRange[1] - xRange[0];\n const radius = 0; // left it here in case we will change our mind and return to rounded bars\n const pathD = React.useMemo(() => {\n if (backgroundWidth - radius > width) {\n return roundedPath(x, y, width, height, radius);\n }\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n }, [x, y, height, width, radius]);\n\n const barProps = React.useContext(BarContext);\n\n return (\n <>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n d={pathD}\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n index={i}\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n x={x}\n y={y}\n width={width}\n height={height}\n use:duration={`${duration}ms`}\n onClick={callAllEventHandlers(props.onClick, barProps.onClick)}\n transparent={barProps.transparent || props.transparent}\n hide={barProps.hide || props.hide}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </>\n );\n}\nfunction BarBackground(props) {\n const { Element: SBackground, styles, scale, y, x, height } = props;\n const [xScale] = scale;\n const xRange = xScale.range();\n const width = xRange[1] - xRange[0];\n const radius = 0; // left it here in case we will change our mind and return to rounded bars\n const pathD = React.useMemo(() => {\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n }, [x, y, height, width, radius]);\n const barProps = React.useContext(BarContext);\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='path'\n d={pathD}\n childrenPosition='above'\n width={xRange[1] - xRange[0]}\n height={height}\n x={x}\n y={y}\n transparent={barProps.transparent}\n onClick={callAllEventHandlers(props.onClick, barProps.onClick)}\n />,\n );\n}\n\nclass Hover extends Component {\n state = {\n index: null,\n };\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n unsubscribeMouseMoveRoot = null;\n unsubscribeMouseLeaveRoot = null;\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n getIndex(point) {\n const { data, getBarData } = this.asProps;\n for (let i = 0; i < data.length; i++) {\n const bar = getBarData(i);\n if (\n point[0] >= bar.x &&\n point[0] <= bar.x + bar.fullWidth &&\n point[1] >= bar.y &&\n point[1] <= bar.y + bar.height\n ) {\n return i;\n }\n }\n return null;\n }\n\n handlerMouseMoveRoot = trottle((e) => {\n const { eventEmitter, rootRef, patterns, updateIndexToHover, plotId } = this.asProps;\n const point = eventToPoint(e, rootRef.current);\n const { clientX, clientY } = e;\n\n const index = this.getIndex(point);\n\n this.setState({ index }, () => {\n eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, { index, patterns });\n eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);\n updateIndexToHover(index);\n });\n });\n\n handlerMouseLeaveRoot = trottle(() => {\n const { updateIndexToHover, plotId } = this.asProps;\n\n this.setState({ index: null }, () => {\n this.asProps.eventEmitter.emit(`setTooltipVisible_${plotId}`, false);\n updateIndexToHover(null);\n });\n });\n\n componentDidMount() {\n const { eventEmitter } = this.asProps;\n this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', (e) => {\n e.persist();\n this.handlerMouseMoveRoot(e);\n });\n this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe(\n 'onMouseLeaveRoot',\n this.handlerMouseLeaveRoot,\n );\n }\n\n componentWillUnmount() {\n if (this.unsubscribeMouseMoveRoot) {\n this.unsubscribeMouseMoveRoot();\n }\n if (this.unsubscribeMouseLeaveRoot) {\n this.unsubscribeMouseLeaveRoot();\n }\n }\n\n render() {\n const { styles, getBarData, render } = this.asProps;\n if (!render) return null;\n const { index } = this.state;\n const SCompactHorizontalBarHoverRect = this.Element;\n\n if (index === null) return null;\n const bar = getBarData(index);\n return sstyled(styles)(\n <SCompactHorizontalBarHoverRect\n render='rect'\n x={bar.x}\n y={bar.y + bar.height - barHeight - hoverOffset * 2}\n width={bar.fullWidth}\n height={barHeight + hoverOffset * 2}\n />,\n );\n }\n}\n\nfunction CompactHorizontalBarTooltip(props) {\n if (!props.render) return null;\n const SCompactHorizontalBarRadarTooltip = Root;\n return sstyled(props.styles)(\n <SCompactHorizontalBarRadarTooltip\n render={Tooltip}\n tag={CompactHorizontalBar.Hover}\n excludeAnchorProps\n />,\n );\n};\n\n/**\n * CompactHorizontalBar\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/bar-horizontal-compact/bar-horizontal-compact-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/bar-horizontal-compact/bar-horizontal-compact-code/|Examples}\n */\nconst CompactHorizontalBar = createElement(CompactHorizontalBarRoot, {\n Annotation,\n Label,\n Percent,\n Value,\n Bar: [\n Bar,\n {\n Fill: BarFill,\n Background: BarBackground,\n },\n ],\n Hover,\n Tooltip: [CompactHorizontalBarTooltip, Tooltip._______childrenComponents],\n});\n\nexport default CompactHorizontalBar;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,SAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,MAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAEA,IAAAQ,iBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,cAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAEA,IAAAW,QAAA,GAAAP,sBAAA,CAAAJ,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAAiE;AAAA,MAAAa,KAAA,8BAAAd,KAAA,CAAAe,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE1D,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,CAAC;AAE1B,MAAME,SAAS,GAAG,EAAE;AACpB,MAAMC,WAAW,GAAG,CA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ACJ,2BAA2B,EAAEI,gBAAO,CAACI,yBAAyB;AAC1E,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAA1L,OAAA,CAAAQ,OAAA,GAEY8K,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBar.js","names":["_core","require","_baseComponents","_assignProps5","_canUseDOM","_interopRequireDefault","_rafTrottle","_uniqueID","_react","_AnimatedClipPath","_createElement","_Pattern","_Tooltip","_utils","style","sstyled","insert","MIN_WIDTH","exports","barHeight","hoverOffset","CompactHorizontalBarRoot","Component","constructor","args","_defineProperty2","default","indexToHover","getBarProps","_props","index","getBarBackgroundProps","data","scale","asProps","bar","computeBarData","x","y","height","width","fullWidth","getBarFillProps","uid","patterns","color","transparent","hide","i","resolveColor","getAnnotationProps","size","getLabelProps","label","children","getPercentFormatter","percentFormatter","percentFormatterLocale","locale","Intl","NumberFormat","getValueFormatter","valueFormatter","valueFormatterLocale","getPercentProps","value","domain","percent","formatter","formatted","format","getValueProps","getHoverProps","getBarData","render","updateIndexToHover","setState","getTooltipProps","state","d","offset","offsetProps","wMin","heightProps","maxBarSize","Number","POSITIVE_INFINITY","xScale","yScale","absWidth","bandHeight","scaleToBand","bandwidth","Math","min","max","barY","renderBar","_ref5","SCompactHorizontalBarGroup","Element","styles","groupKey","dataHintsHandler","describeValueEntity","createElement","Fragment","key","cn","renderBars","map","bind","duration","id","uniqueIDEnhancement","Annotation","props","_ref6","Children","SBarAnnotation","excludeProps","Label","_ref","arguments[0]","_ref7","SBarLabel","Box","assignProps","Percent","_ref2","_ref8","SBarPercent","Value","_ref3","_ref9","SBarValue","BarContext","React","createContext","Bar","onClick","onClickHandler","useCallback","event","contextValue","useMemo","Provider","BarFill","_ref0","SBar","xRange","range","backgroundWidth","radius","pathD","roundedPath","barProps","useContext","undefined","callAllEventHandlers","PatternFill","BarBackground","_ref1","SBackground","Hover","canUseDOM","document","trottle","e","eventEmitter","rootRef","plotId","point","eventToPoint","current","clientX","clientY","getIndex","emit","generateGetBoundingClientRect","top","right","bottom","left","length","componentDidMount","unsubscribeMouseMoveRoot","subscribe","persist","handlerMouseMoveRoot","unsubscribeMouseLeaveRoot","handlerMouseLeaveRoot","componentWillUnmount","_ref10","SCompactHorizontalBarHoverRect","CompactHorizontalBarTooltip","_ref4","_ref11","SCompactHorizontalBarRadarTooltip","Tooltip","CompactHorizontalBar","Fill","Background","_______childrenComponents","_default"],"sources":["../../src/CompactHorizontalBar.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport AnimatedClipPath from './AnimatedClipPath';\nimport createElement from './createElement';\nimport { PatternFill } from './Pattern';\nimport style from './style/bar.shadow.css';\nimport Tooltip from './Tooltip';\nimport { roundedPath, scaleToBand, eventToPoint } from './utils';\n\nexport const MIN_WIDTH = 4;\n\nconst barHeight = 12;\nconst hoverOffset = 6;\n\nclass CompactHorizontalBarRoot extends Component {\n static displayName = 'CompactHorizontalBar';\n static enhance = [uniqueIDEnhancement()];\n static style = style;\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n wMin: MIN_WIDTH,\n locale: 'en',\n color: 'chart-palette-order-1',\n };\n\n state = {\n indexToHover: null,\n };\n\n getBarProps(_props, index) {\n return {\n index,\n };\n }\n\n getBarBackgroundProps(_props, index) {\n const { data, scale } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n\n return {\n scale,\n index,\n x: bar.x,\n y: bar.y + bar.height - barHeight - hoverOffset,\n height: barHeight,\n width: bar.fullWidth,\n };\n }\n\n getBarFillProps(_props, index) {\n const { data, uid, patterns, color, transparent, hide, scale } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n return {\n x: bar.x,\n y: bar.y + bar.height - barHeight - hoverOffset,\n height: barHeight,\n width: bar.width,\n i: index,\n uid,\n resolveColor: this.asProps.resolveColor,\n patterns,\n color,\n transparent,\n hide,\n scale,\n index,\n };\n }\n\n getAnnotationProps(_props, index) {\n const { data, size } = this.asProps;\n const bar = this.computeBarData(data[index], index);\n return {\n y: bar.y,\n height: barHeight * 2,\n width: size[0],\n index,\n };\n }\n\n getLabelProps(_props, index) {\n const { data, y } = this.asProps;\n const label = data[index][y];\n\n return {\n children: label,\n index,\n };\n }\n\n percentFormatter = null;\n percentFormatterLocale = null;\n getPercentFormatter() {\n if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {\n this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'percent' });\n this.percentFormatterLocale = this.asProps.locale;\n }\n return this.percentFormatter;\n }\n\n valueFormatter = null;\n valueFormatterLocale = null;\n getValueFormatter() {\n if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {\n this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);\n this.valueFormatterLocale = this.asProps.locale;\n }\n return this.valueFormatter;\n }\n\n getPercentProps(_props, index) {\n const { data, x, scale } = this.asProps;\n const value = data[index][x];\n const domain = scale[0].domain();\n const percent = value / domain[1];\n const formatter = this.getPercentFormatter();\n const formatted = formatter.format(percent);\n\n return { children: formatted, formatted, percent };\n }\n\n getValueProps(_props, index) {\n const { data, x } = this.asProps;\n const value = data[index][x];\n const formatter = this.getValueFormatter();\n const formatted = formatter.format(value);\n\n return { children: formatted, formatted, value };\n }\n\n getHoverProps(_props, index) {\n const { data } = this.asProps;\n\n return {\n data,\n getBarData: (index) => this.computeBarData(data[index], index),\n render: index === 0,\n updateIndexToHover: (index) => this.setState({ indexToHover: index }),\n };\n }\n\n getTooltipProps(_props, index) {\n return {\n render: index === 0,\n index: this.state.indexToHover,\n };\n }\n\n computeBarData(d) {\n const {\n x,\n y,\n scale,\n offset: offsetProps,\n wMin,\n height: heightProps,\n maxBarSize = Number.POSITIVE_INFINITY,\n size,\n } = this.asProps;\n\n const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;\n const [xScale, yScale] = scale;\n const absWidth = xScale(d[x]);\n const bandHeight = heightProps || scaleToBand(yScale).bandwidth();\n const height = Math.min(bandHeight, maxBarSize);\n const width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);\n const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];\n\n return {\n x: 0,\n y: barY,\n width,\n fullWidth: size[0],\n height,\n };\n }\n\n renderBar(d, i) {\n const SCompactHorizontalBarGroup = this.Element;\n const { styles, groupKey } = this.asProps;\n const { x, y } = this.computeBarData(d, i);\n\n this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);\n\n return (\n <React.Fragment key={`horizontal-bar-${i}`}>\n {sstyled(styles)(<SCompactHorizontalBarGroup render='g' />)}\n </React.Fragment>\n );\n }\n\n renderBars() {\n const { data } = this.asProps;\n\n return data.map(this.renderBar.bind(this));\n }\n\n render() {\n const { uid, size, duration } = this.asProps;\n\n return (\n <>\n {this.renderBars()}\n {duration && (\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={0}\n height={size[1]}\n />\n )}\n </>\n );\n }\n}\n\nfunction Annotation(props) {\n const { Children, y, height, width, styles } = props;\n const SBarAnnotation = 'div';\n return sstyled(styles)(\n <foreignObject x='0' y={y - barHeight} height={height} width={width} overflow='visible'>\n <SBarAnnotation>\n <Children />\n </SBarAnnotation>\n </foreignObject>,\n );\n}\nconst excludeProps = ['data', 'scale', 'value', 'offset'];\nfunction Label(props) {\n const SBarLabel = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarLabel render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarLabel>,\n );\n}\nfunction Percent(props) {\n const SBarPercent = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarPercent render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarPercent>,\n );\n}\nfunction Value(props) {\n const SBarValue = Root;\n const { styles, Children } = props;\n return sstyled(styles)(\n <SBarValue render={Box} __excludeProps={excludeProps}>\n <Children />\n </SBarValue>,\n );\n}\n\nconst BarContext = React.createContext({});\nfunction Bar(props) {\n const { Children, index, onClick, transparent, hide } = props;\n const onClickHandler = React.useCallback(\n (event) => {\n onClick?.(index, event);\n },\n [onClick, index],\n );\n const contextValue = React.useMemo(\n () => ({ onClick: onClickHandler, transparent, hide }),\n [onClickHandler, transparent, hide],\n );\n return (\n <BarContext.Provider value={contextValue}>\n <Children />\n </BarContext.Provider>\n );\n}\nfunction BarFill(props) {\n const {\n Element: SBar,\n styles,\n color,\n x,\n y,\n width,\n height,\n uid,\n duration,\n resolveColor,\n patterns,\n i,\n scale,\n } = props;\n const [xScale] = scale;\n const xRange = xScale.range();\n const backgroundWidth = xRange[1] - xRange[0];\n const radius = 0; // left it here in case we will change our mind and return to rounded bars\n const pathD = React.useMemo(() => {\n if (backgroundWidth - radius > width) {\n return roundedPath(x, y, width, height, radius);\n }\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n }, [x, y, height, width, radius]);\n\n const barProps = React.useContext(BarContext);\n\n return (\n <>\n {sstyled(styles)(\n <SBar\n aria-hidden\n render='path'\n d={pathD}\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n index={i}\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${i}-pattern)` : undefined}\n x={x}\n y={y}\n width={width}\n height={height}\n use:duration={`${duration}ms`}\n onClick={callAllEventHandlers(props.onClick, barProps.onClick)}\n transparent={barProps.transparent || props.transparent}\n hide={barProps.hide || props.hide}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${i}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </>\n );\n}\nfunction BarBackground(props) {\n const { Element: SBackground, styles, scale, y, x, height } = props;\n const [xScale] = scale;\n const xRange = xScale.range();\n const width = xRange[1] - xRange[0];\n const radius = 0; // left it here in case we will change our mind and return to rounded bars\n const pathD = React.useMemo(() => {\n return roundedPath(x, y, width, height, radius, false, true, false, true);\n }, [x, y, height, width, radius]);\n const barProps = React.useContext(BarContext);\n\n return sstyled(styles)(\n <SBackground\n aria-hidden\n render='path'\n d={pathD}\n childrenPosition='above'\n width={xRange[1] - xRange[0]}\n height={height}\n x={x}\n y={y}\n transparent={barProps.transparent}\n onClick={callAllEventHandlers(props.onClick, barProps.onClick)}\n />,\n );\n}\n\nclass Hover extends Component {\n state = {\n index: null,\n };\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n unsubscribeMouseMoveRoot = null;\n unsubscribeMouseLeaveRoot = null;\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n getIndex(point) {\n const { data, getBarData } = this.asProps;\n for (let i = 0; i < data.length; i++) {\n const bar = getBarData(i);\n if (\n point[0] >= bar.x &&\n point[0] <= bar.x + bar.fullWidth &&\n point[1] >= bar.y &&\n point[1] <= bar.y + bar.height\n ) {\n return i;\n }\n }\n return null;\n }\n\n handlerMouseMoveRoot = trottle((e) => {\n const { eventEmitter, rootRef, patterns, updateIndexToHover, plotId } = this.asProps;\n const point = eventToPoint(e, rootRef.current);\n const { clientX, clientY } = e;\n\n const index = this.getIndex(point);\n\n this.setState({ index }, () => {\n eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, { index, patterns });\n eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);\n updateIndexToHover(index);\n });\n });\n\n handlerMouseLeaveRoot = trottle(() => {\n const { updateIndexToHover, plotId } = this.asProps;\n\n this.setState({ index: null }, () => {\n this.asProps.eventEmitter.emit(`setTooltipVisible_${plotId}`, false);\n updateIndexToHover(null);\n });\n });\n\n componentDidMount() {\n const { eventEmitter } = this.asProps;\n this.unsubscribeMouseMoveRoot = eventEmitter.subscribe('onMouseMoveRoot', (e) => {\n e.persist();\n this.handlerMouseMoveRoot(e);\n });\n this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe(\n 'onMouseLeaveRoot',\n this.handlerMouseLeaveRoot,\n );\n }\n\n componentWillUnmount() {\n if (this.unsubscribeMouseMoveRoot) {\n this.unsubscribeMouseMoveRoot();\n }\n if (this.unsubscribeMouseLeaveRoot) {\n this.unsubscribeMouseLeaveRoot();\n }\n }\n\n render() {\n const { styles, getBarData, render } = this.asProps;\n if (!render) return null;\n const { index } = this.state;\n const SCompactHorizontalBarHoverRect = this.Element;\n\n if (index === null) return null;\n const bar = getBarData(index);\n return sstyled(styles)(\n <SCompactHorizontalBarHoverRect\n render='rect'\n x={bar.x}\n y={bar.y + bar.height - barHeight - hoverOffset * 2}\n width={bar.fullWidth}\n height={barHeight + hoverOffset * 2}\n />,\n );\n }\n}\n\nfunction CompactHorizontalBarTooltip(props) {\n if (!props.render) return null;\n const SCompactHorizontalBarRadarTooltip = Root;\n return sstyled(props.styles)(\n <SCompactHorizontalBarRadarTooltip\n render={Tooltip}\n tag={CompactHorizontalBar.Hover}\n excludeAnchorProps\n />,\n );\n};\n\n/**\n * CompactHorizontalBar\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/bar-horizontal-compact/bar-horizontal-compact-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/bar-horizontal-compact/bar-horizontal-compact-code/|Examples}\n */\nconst CompactHorizontalBar = createElement(CompactHorizontalBarRoot, {\n Annotation,\n Label,\n Percent,\n Value,\n Bar: [\n Bar,\n {\n Fill: BarFill,\n Background: BarBackground,\n },\n ],\n Hover,\n Tooltip: [CompactHorizontalBarTooltip, Tooltip._______childrenComponents],\n});\n\nexport default CompactHorizontalBar;\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,G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AAgF,KAAA,GAAAzE,YAAA;IAAA0E,MAAA;EAC1C,IAAI,CAACjF,KAAK,CAAC1C,MAAM,EAAE,OAAO,IAAI;EAC9B,MAAM4H,iCAAiC,GAG3BC,gBAAO;EAFnB,OAAAF,MAAA,GAAO,IAAAtL,aAAO,EAACqG,KAAK,CAACf,MAAM,CAAC,eAC1B7F,MAAA,CAAAkB,OAAA,CAAA+E,aAAA,CAAC6F,iCAAiC,EAAAD,MAAA,CAAAzF,EAAA;IAAA,OAAA5G,KAAA,CAAA+H,WAAA;MAAA,OAE3ByE,oBAAoB,CAACpC,KAAK;MAAA;IAAA,GAAAgC,KAAA;EAAA,EAEhC,CAAC;AAEN;AAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,oBAAoB,GAAG,IAAA/F,sBAAa,EAACpF,wBAAwB,EAAE;EACnE8F,UAAU;EACVM,KAAK;EACLO,OAAO;EACPI,KAAK;EACLO,GAAG,EAAE,CACHA,GAAG,EACH;IACE8D,IAAI,EAAEtD,OAAO;IACbuD,UAAU,EAAEzC;EACd,CAAC,CACF;EACDG,KAAK;EACLmC,OAAO,EAAE,CAACJ,2BAA2B,EAAEI,gBAAO,CAACI,yBAAyB;AAC1E,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAA1L,OAAA,CAAAQ,OAAA,GAEY8K,oBAAoB","ignoreList":[]}
|
package/lib/cjs/Donut.js
CHANGED
|
@@ -20,17 +20,17 @@ var _Pattern = require("./Pattern");
|
|
|
20
20
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
21
21
|
var _utils = require("./utils");
|
|
22
22
|
/*!__reshadow-styles__:"./style/donut.shadow.css"*/
|
|
23
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
23
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPie_1oosh_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SPie_1oosh_gg_.__color_1oosh_gg_{fill:var(--color_1oosh)}.___SPie_1oosh_gg_.__pattern_1oosh_gg_.__color_1oosh_gg_{fill:var(--pattern_1oosh);stroke:var(--color_1oosh);stroke-width:1px}.___SPie_1oosh_gg_.__transparent_1oosh_gg_{opacity:.3}.___SEmptyData_1oosh_gg_{fill:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234))}.___SEmptyData_1oosh_gg_.__color_1oosh_gg_{fill:var(--color_1oosh)}.___SLabel_1oosh_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}", /*__inner_css_end__*/"1oosh_gg_"),
|
|
24
24
|
/*__reshadow_css_end__*/
|
|
25
25
|
{
|
|
26
|
-
"__SPie": "
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"--pattern": "--
|
|
31
|
-
"_transparent": "
|
|
32
|
-
"__SEmptyData": "
|
|
33
|
-
"__SLabel": "
|
|
26
|
+
"__SPie": "___SPie_1oosh_gg_",
|
|
27
|
+
"_color": "__color_1oosh_gg_",
|
|
28
|
+
"--color": "--color_1oosh",
|
|
29
|
+
"_pattern": "__pattern_1oosh_gg_",
|
|
30
|
+
"--pattern": "--pattern_1oosh",
|
|
31
|
+
"_transparent": "__transparent_1oosh_gg_",
|
|
32
|
+
"__SEmptyData": "___SEmptyData_1oosh_gg_",
|
|
33
|
+
"__SLabel": "___SLabel_1oosh_gg_"
|
|
34
34
|
});
|
|
35
35
|
const DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
|
|
36
36
|
function transitionAnglePie({
|
package/lib/cjs/Dots.js
CHANGED
|
@@ -15,20 +15,20 @@ var _createElement = _interopRequireDefault(require("./createElement"));
|
|
|
15
15
|
var _Pattern = require("./Pattern");
|
|
16
16
|
var _utils = require("./utils");
|
|
17
17
|
/*!__reshadow-styles__:"./style/dot.shadow.css"*/
|
|
18
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
18
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SDots_1bl4y_gg_ .___SDot_1bl4y_gg_{transition-duration:var(--duration_1bl4y)}.___SDot_1bl4y_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:cx,cy,x,y,filter;transition-timing-function:ease-in-out}.___SDot_1bl4y_gg_.__active_1bl4y_gg_{filter:drop-shadow(0 0 1px rgba(0,12,8,.161)) drop-shadow(0 1px 1px rgba(0,12,8,.161))}@media (color-gamut:p3){.___SDot_1bl4y_gg_.__active_1bl4y_gg_{filter:drop-shadow(0 0 1px oklch(.137 .026 175.7/.161)) drop-shadow(0 1px 1px oklch(.137 .026 175.7/.161))}}.___SDot_1bl4y_gg_.__hide_1bl4y_gg_{display:none}.___SDot_1bl4y_gg_.__color_1bl4y_gg_{fill:var(--color_1bl4y)}.___SDotHighlight_1bl4y_gg_.__color_1bl4y_gg_{opacity:.4;fill:var(--color_1bl4y)}.___SDotHighlight_1bl4y_gg_.__transparent_1bl4y_gg_{opacity:.12}.___SDotBorder_1bl4y_gg_{fill:none;stroke-width:1px;stroke:var(--intergalactic-chart-grid-dot-outer-border,#191d211a);stroke-dasharray:2}.___SDotBorder_1bl4y_gg_.__transparent_1bl4y_gg_{opacity:.03}.___SDot_1bl4y_gg_.__transparent_1bl4y_gg_{opacity:.3}.___SDotBackdrop_1bl4y_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-grid-border,#fff);transition-property:cx,cy;transition-duration:var(--duration_1bl4y);transition-timing-function:ease-in-out}.___SDotBackdrop_1bl4y_gg_.__hide_1bl4y_gg_{display:none}", /*__inner_css_end__*/"1bl4y_gg_"),
|
|
19
19
|
/*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SDot": "
|
|
22
|
-
"_active": "
|
|
23
|
-
"_hide": "
|
|
24
|
-
"_color": "
|
|
25
|
-
"--color": "--
|
|
26
|
-
"_transparent": "
|
|
27
|
-
"__SDots": "
|
|
28
|
-
"--duration": "--
|
|
29
|
-
"__SDotHighlight": "
|
|
30
|
-
"__SDotBorder": "
|
|
31
|
-
"__SDotBackdrop": "
|
|
21
|
+
"__SDot": "___SDot_1bl4y_gg_",
|
|
22
|
+
"_active": "__active_1bl4y_gg_",
|
|
23
|
+
"_hide": "__hide_1bl4y_gg_",
|
|
24
|
+
"_color": "__color_1bl4y_gg_",
|
|
25
|
+
"--color": "--color_1bl4y",
|
|
26
|
+
"_transparent": "__transparent_1bl4y_gg_",
|
|
27
|
+
"__SDots": "___SDots_1bl4y_gg_",
|
|
28
|
+
"--duration": "--duration_1bl4y",
|
|
29
|
+
"__SDotHighlight": "___SDotHighlight_1bl4y_gg_",
|
|
30
|
+
"__SDotBorder": "___SDotBorder_1bl4y_gg_",
|
|
31
|
+
"__SDotBackdrop": "___SDotBackdrop_1bl4y_gg_"
|
|
32
32
|
});
|
|
33
33
|
const BASE_RADIUS = 3.5;
|
|
34
34
|
const ACTIVE_RADIUS = 4.5;
|
package/lib/cjs/GroupBar.js
CHANGED
|
@@ -20,7 +20,8 @@ class GroupBarRoot extends _core.Component {
|
|
|
20
20
|
Children,
|
|
21
21
|
scale,
|
|
22
22
|
scaleGroup,
|
|
23
|
-
x
|
|
23
|
+
x,
|
|
24
|
+
maxBarSize
|
|
24
25
|
} = this.asProps;
|
|
25
26
|
// TODO: love that hack (by lsroman) ❤�
|
|
26
27
|
const xyScale = x ? scale[0] : scale[1];
|
|
@@ -34,7 +35,9 @@ class GroupBarRoot extends _core.Component {
|
|
|
34
35
|
}
|
|
35
36
|
return acc;
|
|
36
37
|
}, []);
|
|
37
|
-
|
|
38
|
+
const groupWidth = (0, _utils.scaleToBand)(xyScale).bandwidth();
|
|
39
|
+
const paddingOuter = maxBarSize !== undefined && maxBarSize < groupWidth ? 1 - maxBarSize / groupWidth : 0.1;
|
|
40
|
+
return (0, _d3Scale.scaleBand)().range([0, (0, _utils.scaleToBand)(xyScale).bandwidth()]).domain(domain).paddingInner(0.1).paddingOuter(paddingOuter);
|
|
38
41
|
}
|
|
39
42
|
getBarProps({
|
|
40
43
|
y
|
package/lib/cjs/GroupBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupBar.js","names":["_core","require","_getOriginChildren","_interopRequireDefault","_d3Scale","_react","_Bar","_createElement","_HorizontalBar","_utils","GroupBarRoot","Component","getScaleGroup","Children","scale","scaleGroup","x","asProps","xyScale","domain","React","toArray","getOriginChildren","reduce","acc","child","isValidElement","type","GroupBar","Bar","props","hide","push","y","HorizontalBar","
|
|
1
|
+
{"version":3,"file":"GroupBar.js","names":["_core","require","_getOriginChildren","_interopRequireDefault","_d3Scale","_react","_Bar","_createElement","_HorizontalBar","_utils","GroupBarRoot","Component","getScaleGroup","Children","scale","scaleGroup","x","maxBarSize","asProps","xyScale","domain","React","toArray","getOriginChildren","reduce","acc","child","isValidElement","type","GroupBar","Bar","props","hide","push","y","HorizontalBar","groupWidth","scaleToBand","bandwidth","paddingOuter","undefined","scaleBand","range","paddingInner","getBarProps","index","Number","POSITIVE_INFINITY","patterns","bandWidth","width","Math","min","offsetX","offset","color","getChartDefaultColorName","groupKey","getHorizontalBarProps","height","offsetY","render","Element","dataHintsHandler","establishDataType","default","createElement","childrenPosition","_defineProperty2","_default","exports"],"sources":["../../src/GroupBar.jsx"],"sourcesContent":["import { Component } from '@semcore/core';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport { scaleBand } from 'd3-scale';\nimport React from 'react';\n\nimport Bar from './Bar';\nimport createElement from './createElement';\nimport HorizontalBar from './HorizontalBar';\nimport { getChartDefaultColorName, scaleToBand } from './utils';\n\nclass GroupBarRoot extends Component {\n static displayName = 'GroupBar';\n\n getScaleGroup() {\n const { Children, scale, scaleGroup, x, maxBarSize } = this.asProps;\n // TODO: love that hack (by lsroman) ❤�\n const xyScale = x ? scale[0] : scale[1];\n\n if (scaleGroup) return scaleGroup;\n\n const domain = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {\n if (React.isValidElement(child) && child.type === GroupBar.Bar && !child.props.hide) {\n acc.push(child.props.y);\n }\n if (\n React.isValidElement(child) &&\n child.type === GroupBar.HorizontalBar &&\n !child.props.hide\n ) {\n acc.push(child.props.x);\n }\n return acc;\n }, []);\n\n const groupWidth = scaleToBand(xyScale).bandwidth();\n const paddingOuter = maxBarSize !== undefined && maxBarSize < groupWidth\n ? 1 - (maxBarSize / groupWidth)\n : 0.1;\n\n return scaleBand()\n .range([0, scaleToBand(xyScale).bandwidth()])\n .domain(domain)\n .paddingInner(0.1)\n .paddingOuter(paddingOuter);\n }\n\n getBarProps({ y }, index) {\n const { x, maxBarSize = Number.POSITIVE_INFINITY, patterns } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const width = Math.min(bandWidth, maxBarSize);\n const offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;\n\n return {\n offset: [offsetX, 0],\n width,\n color: getChartDefaultColorName(index),\n x,\n groupKey: x,\n patterns,\n };\n }\n\n getHorizontalBarProps({ x }, index) {\n const { y, maxBarSize = Number.POSITIVE_INFINITY } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const height = Math.min(bandWidth, maxBarSize);\n const offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;\n\n return {\n offset: [0, offsetY],\n height,\n color: getChartDefaultColorName(index),\n y,\n groupKey: y,\n };\n }\n\n render() {\n const Element = this.Element;\n this.scaleGroup = this.getScaleGroup();\n\n this.asProps.dataHintsHandler.establishDataType('grouped-values');\n\n return (\n <Element aria-hidden render='g' childrenPosition='inside' scaleGroup={this.scaleGroup} />\n );\n }\n}\n\n/**\n * GroupBar\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/bar-chart/bar-chart-code#grouped-bars|Examples}\n */\nconst GroupBar = createElement(GroupBarRoot, {\n Bar,\n HorizontalBar,\n});\n\nexport default GroupBar;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,IAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,cAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,cAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAEA,MAAMS,YAAY,SAASC,eAAS,CAAC;EAGnCC,aAAaA,CAAA,EAAG;IACd,MAAM;MAAEC,QAAQ;MAAEC,KAAK;MAAEC,UAAU;MAAEC,CAAC;MAAEC;IAAW,CAAC,GAAG,IAAI,CAACC,OAAO;IACnE;IACA,MAAMC,OAAO,GAAGH,CAAC,GAAGF,KAAK,CAAC,CAAC,CAAC,GAAGA,KAAK,CAAC,CAAC,CAAC;IAEvC,IAAIC,UAAU,EAAE,OAAOA,UAAU;IAEjC,MAAMK,MAAM,GAAGC,cAAK,CAACR,QAAQ,CAACS,OAAO,CAAC,IAAAC,0BAAiB,EAACV,QAAQ,CAAC,CAAC,CAACW,MAAM,CAAC,CAACC,GAAG,EAAEC,KAAK,KAAK;MACxF,IAAI,aAAAL,cAAK,CAACM,cAAc,CAACD,KAAK,CAAC,IAAIA,KAAK,CAACE,IAAI,KAAKC,QAAQ,CAACC,GAAG,IAAI,CAACJ,KAAK,CAACK,KAAK,CAACC,IAAI,EAAE;QACnFP,GAAG,CAACQ,IAAI,CAACP,KAAK,CAACK,KAAK,CAACG,CAAC,CAAC;MACzB;MACA,IACE,aAAAb,cAAK,CAACM,cAAc,CAACD,KAAK,CAAC,IAC3BA,KAAK,C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