@semcore/d3-chart 3.60.0 → 3.60.1

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.
Files changed (214) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/Area.js +14 -12
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +17 -15
  5. package/lib/cjs/Axis.js.map +1 -1
  6. package/lib/cjs/Bar.js +19 -17
  7. package/lib/cjs/Bar.js.map +1 -1
  8. package/lib/cjs/Bubble.js +15 -13
  9. package/lib/cjs/Bubble.js.map +1 -1
  10. package/lib/cjs/CompactHorizontalBar.js +19 -17
  11. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  12. package/lib/cjs/Donut.js +12 -10
  13. package/lib/cjs/Donut.js.map +1 -1
  14. package/lib/cjs/Dots.js +11 -9
  15. package/lib/cjs/Dots.js.map +1 -1
  16. package/lib/cjs/HorizontalBar.js +19 -17
  17. package/lib/cjs/HorizontalBar.js.map +1 -1
  18. package/lib/cjs/Hover.js +6 -4
  19. package/lib/cjs/Hover.js.map +1 -1
  20. package/lib/cjs/Line.js +12 -10
  21. package/lib/cjs/Line.js.map +1 -1
  22. package/lib/cjs/Plot.js +6 -4
  23. package/lib/cjs/Plot.js.map +1 -1
  24. package/lib/cjs/Radar.js +22 -20
  25. package/lib/cjs/Radar.js.map +1 -1
  26. package/lib/cjs/RadialTree.js +15 -13
  27. package/lib/cjs/RadialTree.js.map +1 -1
  28. package/lib/cjs/Reference.js +15 -13
  29. package/lib/cjs/Reference.js.map +1 -1
  30. package/lib/cjs/ScatterPlot.js +12 -10
  31. package/lib/cjs/ScatterPlot.js.map +1 -1
  32. package/lib/cjs/Tooltip.js +12 -10
  33. package/lib/cjs/Tooltip.js.map +1 -1
  34. package/lib/cjs/Venn.js +12 -10
  35. package/lib/cjs/Venn.js.map +1 -1
  36. package/lib/cjs/a11y/PlotA11yModule.js +5 -3
  37. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  38. package/lib/cjs/a11y/PlotA11yView.js +5 -3
  39. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  40. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +7 -5
  41. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  42. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +20 -18
  43. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  44. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +9 -7
  45. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  46. package/lib/es6/Area.js +14 -12
  47. package/lib/es6/Area.js.map +1 -1
  48. package/lib/es6/Axis.js +17 -15
  49. package/lib/es6/Axis.js.map +1 -1
  50. package/lib/es6/Bar.js +19 -17
  51. package/lib/es6/Bar.js.map +1 -1
  52. package/lib/es6/Bubble.js +15 -13
  53. package/lib/es6/Bubble.js.map +1 -1
  54. package/lib/es6/CompactHorizontalBar.js +19 -17
  55. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  56. package/lib/es6/Donut.js +12 -10
  57. package/lib/es6/Donut.js.map +1 -1
  58. package/lib/es6/Dots.js +11 -9
  59. package/lib/es6/Dots.js.map +1 -1
  60. package/lib/es6/HorizontalBar.js +19 -17
  61. package/lib/es6/HorizontalBar.js.map +1 -1
  62. package/lib/es6/Hover.js +6 -4
  63. package/lib/es6/Hover.js.map +1 -1
  64. package/lib/es6/Line.js +12 -10
  65. package/lib/es6/Line.js.map +1 -1
  66. package/lib/es6/Plot.js +6 -4
  67. package/lib/es6/Plot.js.map +1 -1
  68. package/lib/es6/Radar.js +22 -20
  69. package/lib/es6/Radar.js.map +1 -1
  70. package/lib/es6/RadialTree.js +15 -13
  71. package/lib/es6/RadialTree.js.map +1 -1
  72. package/lib/es6/Reference.js +15 -13
  73. package/lib/es6/Reference.js.map +1 -1
  74. package/lib/es6/ScatterPlot.js +12 -10
  75. package/lib/es6/ScatterPlot.js.map +1 -1
  76. package/lib/es6/Tooltip.js +12 -10
  77. package/lib/es6/Tooltip.js.map +1 -1
  78. package/lib/es6/Venn.js +12 -10
  79. package/lib/es6/Venn.js.map +1 -1
  80. package/lib/es6/a11y/PlotA11yModule.js +5 -3
  81. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  82. package/lib/es6/a11y/PlotA11yView.js +5 -3
  83. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  84. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +7 -5
  85. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  86. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +20 -18
  87. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  88. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +9 -7
  89. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  90. package/lib/esm/AnimatedClipPath.mjs +54 -0
  91. package/lib/esm/Area.mjs +189 -0
  92. package/lib/esm/Axis.mjs +406 -0
  93. package/lib/esm/Bar.mjs +201 -0
  94. package/lib/esm/Bubble.mjs +216 -0
  95. package/lib/esm/CompactHorizontalBar.mjs +518 -0
  96. package/lib/esm/Donut.mjs +415 -0
  97. package/lib/esm/Dots.mjs +120 -0
  98. package/lib/esm/GroupBar.mjs +94 -0
  99. package/lib/esm/HorizontalBar.mjs +181 -0
  100. package/lib/esm/Hover.mjs +217 -0
  101. package/lib/esm/Line.mjs +199 -0
  102. package/lib/esm/Pattern.mjs +520 -0
  103. package/lib/esm/Plot.mjs +137 -0
  104. package/lib/esm/Radar.mjs +706 -0
  105. package/lib/esm/RadialTree.mjs +565 -0
  106. package/lib/esm/Reference.mjs +243 -0
  107. package/lib/esm/ResponsiveContainer.mjs +99 -0
  108. package/lib/esm/ScatterPlot.mjs +194 -0
  109. package/lib/esm/StackBar.mjs +177 -0
  110. package/lib/esm/StackedArea.mjs +84 -0
  111. package/lib/esm/Tooltip.mjs +255 -0
  112. package/lib/esm/Venn.mjs +234 -0
  113. package/lib/esm/a11y/DataAccessibilityTable.mjs +100 -0
  114. package/lib/esm/a11y/PlotA11yModule.mjs +117 -0
  115. package/lib/esm/a11y/PlotA11yView.mjs +146 -0
  116. package/lib/esm/a11y/bezier.mjs +32 -0
  117. package/lib/esm/a11y/focus.mjs +44 -0
  118. package/lib/esm/a11y/hints.mjs +122 -0
  119. package/lib/esm/a11y/insights.mjs +700 -0
  120. package/lib/esm/a11y/intl.mjs +17 -0
  121. package/lib/esm/a11y/locale.mjs +39 -0
  122. package/lib/esm/a11y/serialize.mjs +363 -0
  123. package/lib/esm/a11y/summarize.mjs +14 -0
  124. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +33 -0
  125. package/lib/esm/a11y/translations/module/de.json.mjs +14 -0
  126. package/lib/esm/a11y/translations/module/en.json.mjs +14 -0
  127. package/lib/esm/a11y/translations/module/es.json.mjs +14 -0
  128. package/lib/esm/a11y/translations/module/fr.json.mjs +14 -0
  129. package/lib/esm/a11y/translations/module/it.json.mjs +14 -0
  130. package/lib/esm/a11y/translations/module/ja.json.mjs +14 -0
  131. package/lib/esm/a11y/translations/module/ko.json.mjs +14 -0
  132. package/lib/esm/a11y/translations/module/nl.json.mjs +14 -0
  133. package/lib/esm/a11y/translations/module/pl.json.mjs +14 -0
  134. package/lib/esm/a11y/translations/module/pt.json.mjs +14 -0
  135. package/lib/esm/a11y/translations/module/sv.json.mjs +14 -0
  136. package/lib/esm/a11y/translations/module/tr.json.mjs +14 -0
  137. package/lib/esm/a11y/translations/module/vi.json.mjs +14 -0
  138. package/lib/esm/a11y/translations/module/zh.json.mjs +14 -0
  139. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +33 -0
  140. package/lib/esm/a11y/translations/view/de.json.mjs +48 -0
  141. package/lib/esm/a11y/translations/view/en.json.mjs +48 -0
  142. package/lib/esm/a11y/translations/view/es.json.mjs +48 -0
  143. package/lib/esm/a11y/translations/view/fr.json.mjs +48 -0
  144. package/lib/esm/a11y/translations/view/it.json.mjs +48 -0
  145. package/lib/esm/a11y/translations/view/ja.json.mjs +48 -0
  146. package/lib/esm/a11y/translations/view/ko.json.mjs +48 -0
  147. package/lib/esm/a11y/translations/view/nl.json.mjs +48 -0
  148. package/lib/esm/a11y/translations/view/pl.json.mjs +48 -0
  149. package/lib/esm/a11y/translations/view/pt.json.mjs +48 -0
  150. package/lib/esm/a11y/translations/view/sv.json.mjs +48 -0
  151. package/lib/esm/a11y/translations/view/tr.json.mjs +48 -0
  152. package/lib/esm/a11y/translations/view/vi.json.mjs +48 -0
  153. package/lib/esm/a11y/translations/view/zh.json.mjs +48 -0
  154. package/lib/esm/color.mjs +127 -0
  155. package/lib/esm/component/Chart/AbstractChart.mjs +408 -0
  156. package/lib/esm/component/Chart/AreaChart.mjs +145 -0
  157. package/lib/esm/component/Chart/BarChart.mjs +240 -0
  158. package/lib/esm/component/Chart/BubbleChart.mjs +135 -0
  159. package/lib/esm/component/Chart/CigaretteChart.mjs +294 -0
  160. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +113 -0
  161. package/lib/esm/component/Chart/DonutChart.mjs +113 -0
  162. package/lib/esm/component/Chart/HistogramChart.mjs +166 -0
  163. package/lib/esm/component/Chart/LineChart.mjs +131 -0
  164. package/lib/esm/component/Chart/RadarChart.mjs +115 -0
  165. package/lib/esm/component/Chart/ScatterPlotChart.mjs +144 -0
  166. package/lib/esm/component/Chart/VennChart.mjs +141 -0
  167. package/lib/esm/component/Chart/index.mjs +27 -0
  168. package/lib/esm/component/ChartLegend/BaseLegend.mjs +91 -0
  169. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +86 -0
  170. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
  171. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +240 -0
  172. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +4 -0
  173. package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +129 -0
  174. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +90 -0
  175. package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +19 -0
  176. package/lib/esm/component/ChartLegend/index.mjs +5 -0
  177. package/lib/esm/component/Cigarette/Cigarette.mjs +139 -0
  178. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +141 -0
  179. package/lib/esm/createElement.mjs +104 -0
  180. package/lib/esm/index.mjs +70 -0
  181. package/lib/esm/style/area.shadow.css +50 -0
  182. package/lib/esm/style/axis.shadow.css +88 -0
  183. package/lib/esm/style/bar.shadow.css +66 -0
  184. package/lib/esm/style/bubble.shadow.css +64 -0
  185. package/lib/esm/style/donut.shadow.css +36 -0
  186. package/lib/esm/style/dot.shadow.css +27 -0
  187. package/lib/esm/style/hover.shadow.css +9 -0
  188. package/lib/esm/style/line.shadow.css +43 -0
  189. package/lib/esm/style/plot.shadow.css +19 -0
  190. package/lib/esm/style/plotA11yModule.shadow.css +12 -0
  191. package/lib/esm/style/plotA11yView.shadow.css +39 -0
  192. package/lib/esm/style/radar.shadow.css +80 -0
  193. package/lib/esm/style/radial-tree.shadow.css +54 -0
  194. package/lib/esm/style/reference.shadow.css +43 -0
  195. package/lib/esm/style/scatterplot.shadow.css +41 -0
  196. package/lib/esm/style/tooltip.shadow.css +42 -0
  197. package/lib/esm/style/venn.shadow.css +48 -0
  198. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +31 -0
  199. package/lib/esm/translations/en.json.mjs +12 -0
  200. package/lib/esm/translations/es.json.mjs +11 -0
  201. package/lib/esm/translations/fr.json.mjs +11 -0
  202. package/lib/esm/translations/it.json.mjs +11 -0
  203. package/lib/esm/translations/ja.json.mjs +11 -0
  204. package/lib/esm/translations/ko.json.mjs +11 -0
  205. package/lib/esm/translations/nl.json.mjs +11 -0
  206. package/lib/esm/translations/pl.json.mjs +11 -0
  207. package/lib/esm/translations/pt.json.mjs +11 -0
  208. package/lib/esm/translations/sv.json.mjs +11 -0
  209. package/lib/esm/translations/tr.json.mjs +11 -0
  210. package/lib/esm/translations/vi.json.mjs +11 -0
  211. package/lib/esm/translations/zh.json.mjs +11 -0
  212. package/lib/esm/utils.mjs +266 -0
  213. package/package.json +11 -11
  214. package/vite.config.ts +2 -0
@@ -0,0 +1,406 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
+ import { sstyled } from "@semcore/utils/lib/core/index";
9
+ import React from "react";
10
+ import { sstyled as sstyled$1, Component } from "@semcore/core";
11
+ import createElement from "./createElement.mjs";
12
+ import { scaleOfBandwidth } from "./utils.mjs";
13
+ var _MAP_POSITION_AXIS, _MAP_POSITION_TICK;
14
+ /*!__reshadow-styles__:"./style/axis.shadow.css"*/
15
+ var style = (
16
+ /*__reshadow_css_start__*/
17
+ (sstyled.insert(
18
+ /*__inner_css_start__*/
19
+ ".___SAxis_dp39u_gg_{stroke:var(--intergalactic-chart-grid-x-axis, #c4c7cf)}.___SAxis_dp39u_gg_.__hide_dp39u_gg_,.___STick_dp39u_gg_.__hide_dp39u_gg_{display:none}.___STick_dp39u_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-chart-grid-text-label, #6c6e79)}.___SGrid_dp39u_gg_{fill:transparent;stroke:var(--intergalactic-border-secondary, #e0e1e9)}.___STitle_dp39u_gg_{font-size:var(--intergalactic-fs-100, 12px);fill:var(--intergalactic-text-hint, #6c6e79);transform-origin:var(--transform-origin_dp39u)}.___STitle_dp39u_gg_._position_top_dp39u_gg_{text-anchor:middle}.___STitle_dp39u_gg_._position_bottom_dp39u_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_dp39u_gg_._position_left_dp39u_gg_,.___STitle_dp39u_gg_._position_right_dp39u_gg_{transform:rotate(-90deg);text-anchor:middle;dominant-baseline:middle}.___STitle_dp39u_gg_._position_left_dp39u_gg_.__verticalWritingMode_dp39u_gg_,.___STitle_dp39u_gg_._position_right_dp39u_gg_.__verticalWritingMode_dp39u_gg_{writing-mode:vertical-rl;transform:none}.___STick_dp39u_gg_._position_top_dp39u_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_dp39u_gg_._position_bottom_dp39u_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_dp39u_gg_._position_right_dp39u_gg_{transform:translateX(16px);text-anchor:start;dominant-baseline:middle}.___STick_dp39u_gg_._position_left_dp39u_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_dp39u_gg_._position_custom_0_dp39u_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_dp39u_gg_._position_custom_1_dp39u_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}",
20
+ /*__inner_css_end__*/
21
+ "dp39u_gg_"
22
+ ), /*__reshadow_css_end__*/
23
+ {
24
+ "__SAxis": "___SAxis_dp39u_gg_",
25
+ "_hide": "__hide_dp39u_gg_",
26
+ "__STick": "___STick_dp39u_gg_",
27
+ "__SGrid": "___SGrid_dp39u_gg_",
28
+ "__STitle": "___STitle_dp39u_gg_",
29
+ "--transform-origin": "--transform-origin_dp39u",
30
+ "_position_top": "_position_top_dp39u_gg_",
31
+ "_position_bottom": "_position_bottom_dp39u_gg_",
32
+ "_position_right": "_position_right_dp39u_gg_",
33
+ "_position_left": "_position_left_dp39u_gg_",
34
+ "_verticalWritingMode": "__verticalWritingMode_dp39u_gg_",
35
+ "_position_custom_0": "_position_custom_0_dp39u_gg_",
36
+ "_position_custom_1": "_position_custom_1_dp39u_gg_"
37
+ })
38
+ );
39
+ var CUSTOM_0 = Symbol("custom_0");
40
+ var CUSTOM_1 = Symbol("custom_1");
41
+ var MAP_INDEX_SCALE_SYMBOL = {
42
+ 0: CUSTOM_0,
43
+ 1: CUSTOM_1
44
+ };
45
+ var MAP_POSITION_REVERT = {
46
+ top: "bottom",
47
+ right: "left",
48
+ bottom: "top",
49
+ left: "right"
50
+ };
51
+ var MAP_POSITION_AXIS = (_MAP_POSITION_AXIS = {
52
+ top: function top(_ref5) {
53
+ var _ref6 = _slicedToArray(_ref5, 2), xScale = _ref6[0], yScale = _ref6[1];
54
+ var xRange = xScale.range();
55
+ var yRange = yScale.range();
56
+ return {
57
+ x1: xRange[0],
58
+ y1: yRange[1],
59
+ x2: xRange[1],
60
+ y2: yRange[1]
61
+ };
62
+ },
63
+ bottom: function bottom(_ref7) {
64
+ var _ref8 = _slicedToArray(_ref7, 2), xScale = _ref8[0], yScale = _ref8[1];
65
+ var xRange = xScale.range();
66
+ var yRange = yScale.range();
67
+ return {
68
+ x1: xRange[0],
69
+ y1: yRange[0],
70
+ x2: xRange[1],
71
+ y2: yRange[0]
72
+ };
73
+ },
74
+ right: function right(_ref9) {
75
+ var _ref10 = _slicedToArray(_ref9, 2), xScale = _ref10[0], yScale = _ref10[1];
76
+ var xRange = xScale.range();
77
+ var yRange = yScale.range();
78
+ return {
79
+ x1: xRange[1],
80
+ y1: yRange[0],
81
+ x2: xRange[1],
82
+ y2: yRange[1]
83
+ };
84
+ },
85
+ left: function left(_ref11) {
86
+ var _ref12 = _slicedToArray(_ref11, 2), xScale = _ref12[0], yScale = _ref12[1];
87
+ var xRange = xScale.range();
88
+ var yRange = yScale.range();
89
+ return {
90
+ x1: xRange[0],
91
+ y1: yRange[0],
92
+ x2: xRange[0],
93
+ y2: yRange[1]
94
+ };
95
+ }
96
+ }, _defineProperty(_MAP_POSITION_AXIS, CUSTOM_0, function(_ref13, pos) {
97
+ var _ref14 = _slicedToArray(_ref13, 2), xScale = _ref14[0], yScale = _ref14[1];
98
+ var xRange = xScale.range();
99
+ return {
100
+ x1: xRange[0],
101
+ y1: scaleOfBandwidth(yScale, pos),
102
+ x2: xRange[1],
103
+ y2: scaleOfBandwidth(yScale, pos)
104
+ };
105
+ }), _defineProperty(_MAP_POSITION_AXIS, CUSTOM_1, function(_ref15, pos) {
106
+ var _ref16 = _slicedToArray(_ref15, 2), xScale = _ref16[0], yScale = _ref16[1];
107
+ var yRange = yScale.range();
108
+ return {
109
+ x1: scaleOfBandwidth(xScale, pos),
110
+ y1: yRange[0],
111
+ x2: scaleOfBandwidth(xScale, pos),
112
+ y2: yRange[1]
113
+ };
114
+ }), _MAP_POSITION_AXIS);
115
+ var MAP_POSITION_TICK = (_MAP_POSITION_TICK = {
116
+ top: function top2(_ref17, value) {
117
+ var _ref18 = _slicedToArray(_ref17, 2), xScale = _ref18[0], yScale = _ref18[1];
118
+ var yRange = yScale.range();
119
+ return {
120
+ x: scaleOfBandwidth(xScale, value),
121
+ y: yRange[1]
122
+ };
123
+ },
124
+ bottom: function bottom2(_ref19, value) {
125
+ var _ref20 = _slicedToArray(_ref19, 2), xScale = _ref20[0], yScale = _ref20[1];
126
+ var yRange = yScale.range();
127
+ return {
128
+ x: scaleOfBandwidth(xScale, value),
129
+ y: yRange[0]
130
+ };
131
+ },
132
+ right: function right2(_ref21, value) {
133
+ var _ref22 = _slicedToArray(_ref21, 2), xScale = _ref22[0], yScale = _ref22[1];
134
+ var xRange = xScale.range();
135
+ return {
136
+ x: xRange[1],
137
+ y: scaleOfBandwidth(yScale, value)
138
+ };
139
+ },
140
+ left: function left2(_ref23, value) {
141
+ var _ref24 = _slicedToArray(_ref23, 2), xScale = _ref24[0], yScale = _ref24[1];
142
+ var xRange = xScale.range();
143
+ return {
144
+ x: xRange[0],
145
+ y: scaleOfBandwidth(yScale, value)
146
+ };
147
+ }
148
+ }, _defineProperty(_MAP_POSITION_TICK, CUSTOM_0, function(_ref25, value, pos) {
149
+ var _ref26 = _slicedToArray(_ref25, 2), xScale = _ref26[0], yScale = _ref26[1];
150
+ return {
151
+ x: scaleOfBandwidth(xScale, value),
152
+ y: scaleOfBandwidth(yScale, pos)
153
+ };
154
+ }), _defineProperty(_MAP_POSITION_TICK, CUSTOM_1, function(_ref27, value, pos) {
155
+ var _ref28 = _slicedToArray(_ref27, 2), xScale = _ref28[0], yScale = _ref28[1];
156
+ return {
157
+ x: scaleOfBandwidth(xScale, pos),
158
+ y: scaleOfBandwidth(yScale, value)
159
+ };
160
+ }), _MAP_POSITION_TICK);
161
+ var MAP_POSITION_GRID = {
162
+ 0: function _(_ref29, value) {
163
+ var _ref30 = _slicedToArray(_ref29, 2), xScale = _ref30[0], yScale = _ref30[1];
164
+ var yRange = yScale.range();
165
+ var x = scaleOfBandwidth(xScale, value);
166
+ return {
167
+ x1: x,
168
+ y1: yRange[0],
169
+ x2: x,
170
+ y2: yRange[1]
171
+ };
172
+ },
173
+ 1: function _2(_ref31, value) {
174
+ var _ref32 = _slicedToArray(_ref31, 2), xScale = _ref32[0], yScale = _ref32[1];
175
+ var xRange = xScale.range();
176
+ var y = scaleOfBandwidth(yScale, value);
177
+ return {
178
+ x1: xRange[0],
179
+ y1: y,
180
+ x2: xRange[1],
181
+ y2: y
182
+ };
183
+ }
184
+ };
185
+ var OFFSET_TITLE = 10;
186
+ var MAP_POSITION_TITlE = {
187
+ top: function top3(_ref33) {
188
+ var _ref34 = _slicedToArray(_ref33, 1), xScale = _ref34[0];
189
+ var xRange = xScale.range();
190
+ return {
191
+ x: (xRange[1] + xRange[0]) / 2,
192
+ y: OFFSET_TITLE
193
+ };
194
+ },
195
+ bottom: function bottom3(_ref35, _ref36) {
196
+ var _ref37 = _slicedToArray(_ref35, 1), xScale = _ref37[0];
197
+ var _ref38 = _slicedToArray(_ref36, 2), height = _ref38[1];
198
+ var xRange = xScale.range();
199
+ return {
200
+ x: (xRange[1] + xRange[0]) / 2,
201
+ y: height - OFFSET_TITLE
202
+ };
203
+ },
204
+ right: function right3(_ref39, _ref40) {
205
+ var _ref41 = _slicedToArray(_ref39, 2), yScale = _ref41[1];
206
+ var _ref42 = _slicedToArray(_ref40, 1), width = _ref42[0];
207
+ var yRange = yScale.range();
208
+ return {
209
+ x: width - OFFSET_TITLE,
210
+ y: (yRange[0] + yRange[1]) / 2
211
+ };
212
+ },
213
+ left: function left3(_ref43) {
214
+ var _ref44 = _slicedToArray(_ref43, 2), yScale = _ref44[1];
215
+ var yRange = yScale.range();
216
+ return {
217
+ x: OFFSET_TITLE,
218
+ y: (yRange[0] + yRange[1]) / 2
219
+ };
220
+ }
221
+ };
222
+ function renderValue(value) {
223
+ if (value instanceof Date) {
224
+ return value.toLocaleDateString();
225
+ }
226
+ return value;
227
+ }
228
+ var AxisRoot = /* @__PURE__ */ function(_Component) {
229
+ _inherits(AxisRoot2, _Component);
230
+ var _super = _createSuper(AxisRoot2);
231
+ function AxisRoot2() {
232
+ _classCallCheck(this, AxisRoot2);
233
+ return _super.apply(this, arguments);
234
+ }
235
+ _createClass(AxisRoot2, [{
236
+ key: "ticks",
237
+ get: function get() {
238
+ var _scl$ticks, _scl$domain;
239
+ var _this$asProps = this.asProps, ticks = _this$asProps.ticks, indexScale = _this$asProps.indexScale, scale = _this$asProps.scale;
240
+ var scl = scale[indexScale];
241
+ return ticks || ((_scl$ticks = scl.ticks) === null || _scl$ticks === void 0 ? void 0 : _scl$ticks.call(scl)) || ((_scl$domain = scl.domain) === null || _scl$domain === void 0 ? void 0 : _scl$domain.call(scl)) || [];
242
+ }
243
+ }, {
244
+ key: "getTitleProps",
245
+ value: function getTitleProps() {
246
+ var _this$asProps2 = this.asProps, position = _this$asProps2.position, locale = _this$asProps2.locale;
247
+ return {
248
+ position: MAP_POSITION_REVERT[position],
249
+ verticalWritingMode: ["zh", "ja"].includes(locale)
250
+ };
251
+ }
252
+ }, {
253
+ key: "getTicksProps",
254
+ value: function getTicksProps() {
255
+ var _this$asProps3 = this.asProps, position = _this$asProps3.position, indexScale = _this$asProps3.indexScale;
256
+ return {
257
+ ticks: this.ticks,
258
+ indexScale,
259
+ position
260
+ };
261
+ }
262
+ }, {
263
+ key: "getGridProps",
264
+ value: function getGridProps() {
265
+ var indexScale = this.asProps.indexScale;
266
+ return {
267
+ ticks: this.ticks,
268
+ indexScale
269
+ };
270
+ }
271
+ }, {
272
+ key: "render",
273
+ value: function render() {
274
+ var _ref, _MAP_POSITION_AXIS$po;
275
+ var SAxis = this.Element;
276
+ var _this$asProps4 = this.asProps, styles = _this$asProps4.styles, position = _this$asProps4.position, scale = _this$asProps4.scale, hide = _this$asProps4.hide, indexScale = _this$asProps4.indexScale;
277
+ var pos = (_MAP_POSITION_AXIS$po = MAP_POSITION_AXIS[position]) !== null && _MAP_POSITION_AXIS$po !== void 0 ? _MAP_POSITION_AXIS$po : MAP_POSITION_AXIS[MAP_INDEX_SCALE_SYMBOL[indexScale]];
278
+ return _ref = sstyled$1(styles), /* @__PURE__ */ React.createElement(SAxis, _ref.cn("SAxis", _objectSpread({
279
+ "render": "line",
280
+ "hide": hide
281
+ }, pos(scale, position))));
282
+ }
283
+ }]);
284
+ return AxisRoot2;
285
+ }(Component);
286
+ _defineProperty(AxisRoot, "displayName", "Axis");
287
+ _defineProperty(AxisRoot, "style", style);
288
+ _defineProperty(AxisRoot, "defaultProps", {});
289
+ function Ticks(props) {
290
+ var _MAP_POSITION_TICK$po;
291
+ var STick = props.Element, styles = props.styles, scale = props.scale, ticks = props.ticks, position = props.position, hide = props.hide, indexScale = props.indexScale, dataHintsHandler = props.dataHintsHandler, children = props.children, _props$childrenPositi = props.childrenPosition, childrenPosition = _props$childrenPositi === void 0 ? "inside" : _props$childrenPositi;
292
+ var pos = (_MAP_POSITION_TICK$po = MAP_POSITION_TICK[position]) !== null && _MAP_POSITION_TICK$po !== void 0 ? _MAP_POSITION_TICK$po : MAP_POSITION_TICK[MAP_INDEX_SCALE_SYMBOL[indexScale]];
293
+ var positionClass = MAP_POSITION_TICK[position] ? position : "custom_".concat(indexScale);
294
+ if (typeof children === "function") {
295
+ var labelGetter = function labelGetter2(value) {
296
+ var _result$value;
297
+ var result = children({
298
+ value
299
+ });
300
+ return (_result$value = result.value) !== null && _result$value !== void 0 ? _result$value : result.children;
301
+ };
302
+ if (position === "left" || position === "right") {
303
+ dataHintsHandler.addKeyLabelGetter("vertical", labelGetter);
304
+ } else if (position === "top" || position === "bottom") {
305
+ dataHintsHandler.addKeyLabelGetter("horizontal", labelGetter);
306
+ }
307
+ }
308
+ return ticks.map(function(value, i) {
309
+ var _ref2;
310
+ var displayValue = typeof children === "function" ? void 0 : renderValue(value);
311
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(STick, _ref2.cn("STick", _objectSpread({
312
+ "aria-hidden": true,
313
+ "key": i,
314
+ "render": "text",
315
+ "childrenPosition": childrenPosition,
316
+ "__excludeProps": ["data", "scale", "format", "value"],
317
+ "value": value,
318
+ "index": i,
319
+ "position": positionClass,
320
+ "hide": hide
321
+ }, pos(scale, value, position))), displayValue);
322
+ });
323
+ }
324
+ function Grid(props) {
325
+ var SGrid = props.Element, styles = props.styles, scale = props.scale, ticks = props.ticks, indexScale = props.indexScale;
326
+ if (ticks.length >= 2) {
327
+ if (indexScale === 1) {
328
+ props.dataHintsHandler.setupGrid("vertical", Math.abs(ticks[1] - ticks[0]));
329
+ } else if (indexScale === 0) {
330
+ props.dataHintsHandler.setupGrid("horizontal", Math.abs(ticks[1] - ticks[0]));
331
+ }
332
+ }
333
+ return ticks.map(function(value, i) {
334
+ var _ref3;
335
+ return _ref3 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SGrid, _ref3.cn("SGrid", _objectSpread({
336
+ "key": i,
337
+ "render": "line"
338
+ }, MAP_POSITION_GRID[indexScale](scale, value))));
339
+ });
340
+ }
341
+ function Title(props) {
342
+ var _ref4;
343
+ var STitle = props.Element, styles = props.styles, scale = props.scale, position = props.position, size = props.size, children = props.children, verticalWritingMode = props.verticalWritingMode;
344
+ var _MAP_POSITION_TITlE$p = MAP_POSITION_TITlE[position](scale, size), x = _MAP_POSITION_TITlE$p.x, y = _MAP_POSITION_TITlE$p.y;
345
+ if (position === "left" || position === "right") {
346
+ props.dataHintsHandler.setTitle("vertical", children);
347
+ } else if (position === "top" || position === "bottom") {
348
+ props.dataHintsHandler.setTitle("horizontal", children);
349
+ }
350
+ var sstyles = sstyled$1(styles);
351
+ var sTitleStyles = sstyles.cn("STitle", {
352
+ "transform-origin": "".concat(x.toFixed(2), "px ").concat(y.toFixed(2), "px")
353
+ });
354
+ return _ref4 = sstyled$1(styles), /* @__PURE__ */ React.createElement(STitle, _ref4.cn("STitle", {
355
+ "aria-hidden": true,
356
+ "render": "text",
357
+ "childrenPosition": "inside",
358
+ "position": position,
359
+ "className": sTitleStyles.className,
360
+ "style": sTitleStyles.style,
361
+ "verticalWritingMode": verticalWritingMode,
362
+ "x": x,
363
+ "y": y
364
+ }));
365
+ }
366
+ var XAxisRoot = /* @__PURE__ */ function(_AxisRoot) {
367
+ _inherits(XAxisRoot2, _AxisRoot);
368
+ var _super2 = _createSuper(XAxisRoot2);
369
+ function XAxisRoot2() {
370
+ _classCallCheck(this, XAxisRoot2);
371
+ return _super2.apply(this, arguments);
372
+ }
373
+ return _createClass(XAxisRoot2);
374
+ }(AxisRoot);
375
+ _defineProperty(XAxisRoot, "defaultProps", _objectSpread(_objectSpread({}, AxisRoot.defaultProps), {}, {
376
+ indexScale: 0,
377
+ position: "bottom"
378
+ }));
379
+ var XAxis = createElement(XAxisRoot, {
380
+ Ticks,
381
+ Grid,
382
+ Title
383
+ });
384
+ var YAxisRoot = /* @__PURE__ */ function(_AxisRoot2) {
385
+ _inherits(YAxisRoot2, _AxisRoot2);
386
+ var _super3 = _createSuper(YAxisRoot2);
387
+ function YAxisRoot2() {
388
+ _classCallCheck(this, YAxisRoot2);
389
+ return _super3.apply(this, arguments);
390
+ }
391
+ return _createClass(YAxisRoot2);
392
+ }(AxisRoot);
393
+ _defineProperty(YAxisRoot, "defaultProps", _objectSpread(_objectSpread({}, AxisRoot.defaultProps), {}, {
394
+ indexScale: 1,
395
+ position: "left",
396
+ hide: true
397
+ }));
398
+ var YAxis = createElement(YAxisRoot, {
399
+ Ticks,
400
+ Grid,
401
+ Title
402
+ });
403
+ export {
404
+ XAxis,
405
+ YAxis
406
+ };
@@ -0,0 +1,201 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { sstyled } from "@semcore/utils/lib/core/index";
8
+ import React from "react";
9
+ import { transition } from "d3-transition";
10
+ import { sstyled as sstyled$1, Component } from "@semcore/core";
11
+ import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
12
+ import createElement from "./createElement.mjs";
13
+ import AnimatedClipPath from "./AnimatedClipPath.mjs";
14
+ import { scaleToBand, roundedPath } from "./utils.mjs";
15
+ import { PatternFill } from "./Pattern.mjs";
16
+ /*!__reshadow-styles__:"./style/bar.shadow.css"*/
17
+ var style = (
18
+ /*__reshadow_css_start__*/
19
+ (sstyled.insert(
20
+ /*__inner_css_start__*/
21
+ ".___SBar_1rv7u_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1rv7u);transition-timing-function:ease-in-out}.___SBar_1rv7u_gg_.__color_1rv7u_gg_{fill:var(--color_1rv7u)}.___SBar_1rv7u_gg_.__pattern_1rv7u_gg_.__color_1rv7u_gg_{fill:var(--pattern_1rv7u);stroke:var(--color_1rv7u);stroke-width:1px}.___SBar_1rv7u_gg_.__hide_1rv7u_gg_{display:none}.___SBar_1rv7u_gg_.__transparent_1rv7u_gg_{opacity:.3}.___SBackground_1rv7u_gg_.__onClick_1rv7u_gg_,.___SBar_1rv7u_gg_.__onClick_1rv7u_gg_{cursor:pointer}.___SBackground_1rv7u_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1rv7u_gg_{display:flex;justify-content:space-between}.___SBarLabel_1rv7u_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1rv7u_gg_,.___SBarPercent_1rv7u_gg_,.___SBarValue_1rv7u_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1rv7u_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1rv7u_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1rv7u_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
22
+ /*__inner_css_end__*/
23
+ "1rv7u_gg_"
24
+ ), /*__reshadow_css_end__*/
25
+ {
26
+ "__SBar": "___SBar_1rv7u_gg_",
27
+ "--duration": "--duration_1rv7u",
28
+ "_color": "__color_1rv7u_gg_",
29
+ "--color": "--color_1rv7u",
30
+ "_pattern": "__pattern_1rv7u_gg_",
31
+ "--pattern": "--pattern_1rv7u",
32
+ "_hide": "__hide_1rv7u_gg_",
33
+ "_transparent": "__transparent_1rv7u_gg_",
34
+ "_onClick": "__onClick_1rv7u_gg_",
35
+ "__SBackground": "___SBackground_1rv7u_gg_",
36
+ "__SBarAnnotation": "___SBarAnnotation_1rv7u_gg_",
37
+ "__SBarLabel": "___SBarLabel_1rv7u_gg_",
38
+ "__SBarPercent": "___SBarPercent_1rv7u_gg_",
39
+ "__SBarValue": "___SBarValue_1rv7u_gg_",
40
+ "__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1rv7u_gg_"
41
+ })
42
+ );
43
+ var MIN_HEIGHT = 2;
44
+ var calcPartBarY = function calcPartBarY2(y, minHeight, height) {
45
+ if (y <= 0) {
46
+ return Object.is(y, 0) ? minHeight : 0;
47
+ }
48
+ return height <= minHeight ? minHeight : 0;
49
+ };
50
+ var BarRoot = /* @__PURE__ */ function(_Component) {
51
+ _inherits(BarRoot2, _Component);
52
+ var _super = _createSuper(BarRoot2);
53
+ function BarRoot2() {
54
+ _classCallCheck(this, BarRoot2);
55
+ return _super.apply(this, arguments);
56
+ }
57
+ _createClass(BarRoot2, [{
58
+ key: "getBackgroundProps",
59
+ value: function getBackgroundProps(_props, index) {
60
+ var _this$asProps = this.asProps, x = _this$asProps.x, data = _this$asProps.data;
61
+ return {
62
+ value: data[index][x],
63
+ index
64
+ };
65
+ }
66
+ }, {
67
+ key: "animationBar",
68
+ value: function animationBar() {
69
+ var _this$asProps2 = this.asProps, duration = _this$asProps2.duration, uid = _this$asProps2.uid;
70
+ var selectRect = transition().selection().selectAll("#".concat(uid, " rect"));
71
+ var selectRectNode = selectRect.node();
72
+ if (duration > 0 && selectRectNode && selectRectNode.getAttribute("y") !== "0") {
73
+ selectRect.transition().duration(duration).attr("y", 0);
74
+ }
75
+ }
76
+ }, {
77
+ key: "componentDidUpdate",
78
+ value: function componentDidUpdate() {
79
+ this.animationBar();
80
+ }
81
+ }, {
82
+ key: "componentDidMount",
83
+ value: function componentDidMount() {
84
+ this.animationBar();
85
+ }
86
+ }, {
87
+ key: "renderBar",
88
+ value: function renderBar(d, i) {
89
+ var _ref, _d$y, _d$y2, _d$y3;
90
+ var SBar = this.Element;
91
+ var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, color = _this$asProps3.color, resolveColor = _this$asProps3.resolveColor, x = _this$asProps3.x, y = _this$asProps3.y, y0 = _this$asProps3.y0, scale = _this$asProps3.scale, hide = _this$asProps3.hide, offsetProps = _this$asProps3.offset, duration = _this$asProps3.duration, uid = _this$asProps3.uid, r = _this$asProps3.r, hMin = _this$asProps3.hMin, widthProps = _this$asProps3.width, groupKey = _this$asProps3.groupKey, onClick = _this$asProps3.onClick, transparent = _this$asProps3.transparent, _this$asProps3$maxBar = _this$asProps3.maxBarSize, maxBarSize = _this$asProps3$maxBar === void 0 ? Infinity : _this$asProps3$maxBar, patterns = _this$asProps3.patterns, dataHintsHandler = _this$asProps3.dataHintsHandler;
92
+ var offset = typeof offsetProps === "function" ? offsetProps(i) : offsetProps;
93
+ var _scale = _slicedToArray(scale, 2), xScale = _scale[0], yScale = _scale[1];
94
+ var absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale((_d$y = d[y0]) !== null && _d$y !== void 0 ? _d$y : 0)));
95
+ var height = Number(d[y] - ((_d$y2 = d[y0]) !== null && _d$y2 !== void 0 ? _d$y2 : 0)) === 0 ? 0 : Math.max(absHeight, hMin);
96
+ var bandWidth = widthProps || scaleToBand(xScale).bandwidth();
97
+ var width = Math.min(bandWidth, maxBarSize);
98
+ var barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];
99
+ var barY = yScale(Math.max((_d$y3 = d[y0]) !== null && _d$y3 !== void 0 ? _d$y3 : 0, height <= hMin && d[y] > 0 ? 0 : d[y])) + offset[1] - calcPartBarY(d[y], hMin, height);
100
+ var handleClick = function handleClick2(event) {
101
+ return onClick === null || onClick === void 0 ? void 0 : onClick(d, event, i, y);
102
+ };
103
+ var dSvg = getRect({
104
+ x: barX,
105
+ y: barY,
106
+ width,
107
+ height,
108
+ radius: Array.isArray(r) ? r[i] : r,
109
+ position: d[y] > 0 || Object.is(d[y], 0) ? "top" : "bottom"
110
+ });
111
+ if (groupKey) {
112
+ dataHintsHandler.describeGroupedValues(groupKey, y);
113
+ } else {
114
+ dataHintsHandler.describeValueEntity("".concat(i, ".").concat(y), groupKey !== null && groupKey !== void 0 ? groupKey : d[x]);
115
+ dataHintsHandler.specifyDataRowFields(x, y);
116
+ }
117
+ return /* @__PURE__ */ React.createElement(React.Fragment, {
118
+ key: "bar-".concat(i)
119
+ }, (_ref = sstyled$1(styles), /* @__PURE__ */ React.createElement(SBar, _ref.cn("SBar", {
120
+ "aria-hidden": true,
121
+ "render": "path",
122
+ "clipPath": "url(#".concat(uid, ")"),
123
+ "__excludeProps": ["data", "scale", "value", "onClick", "offset"],
124
+ "childrenPosition": "above",
125
+ "value": d,
126
+ "index": i,
127
+ "hide": hide,
128
+ "pattern": patterns ? "url(#".concat(uid, "-").concat(i, "-pattern)") : void 0,
129
+ "color": resolveColor(color),
130
+ "x": barX,
131
+ "y": barY,
132
+ "width": width,
133
+ "height": height,
134
+ "d": dSvg,
135
+ "onClickCapture": handleClick,
136
+ "use:duration": "".concat(duration, "ms"),
137
+ "transparent": transparent
138
+ }))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
139
+ "id": "".concat(uid, "-").concat(i, "-pattern"),
140
+ "patternKey": color,
141
+ "color": resolveColor(color),
142
+ "patterns": patterns
143
+ })));
144
+ }
145
+ }, {
146
+ key: "render",
147
+ value: function render() {
148
+ var _this$asProps4 = this.asProps, data = _this$asProps4.data, uid = _this$asProps4.uid, size = _this$asProps4.size, duration = _this$asProps4.duration;
149
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map(this.renderBar.bind(this)), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, {
150
+ duration,
151
+ key: "".concat(uid, "-animation"),
152
+ attributeName: "y",
153
+ values: "100%;0",
154
+ id: uid,
155
+ width: size[0],
156
+ height: "".concat(size[1], "px")
157
+ }));
158
+ }
159
+ }]);
160
+ return BarRoot2;
161
+ }(Component);
162
+ _defineProperty(BarRoot, "displayName", "Bar");
163
+ _defineProperty(BarRoot, "style", style);
164
+ _defineProperty(BarRoot, "enhance", [uniqueIDEnhancement()]);
165
+ _defineProperty(BarRoot, "defaultProps", {
166
+ offset: [0, 0],
167
+ duration: 500,
168
+ r: 2,
169
+ hMin: MIN_HEIGHT
170
+ });
171
+ function Background(props) {
172
+ var _ref2;
173
+ var SBackground = props.Element, styles = props.styles, scale = props.scale, value = props.value;
174
+ var _scale2 = _slicedToArray(scale, 2), xScale = _scale2[0], yScale = _scale2[1];
175
+ var yRange = yScale.range();
176
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SBackground, _ref2.cn("SBackground", {
177
+ "aria-hidden": true,
178
+ "render": "rect",
179
+ "childrenPosition": "above",
180
+ "width": scaleToBand(xScale).bandwidth(),
181
+ "height": yRange[0] - yRange[1],
182
+ "x": xScale(value),
183
+ "y": yRange[1]
184
+ }));
185
+ }
186
+ function getRect(_ref3) {
187
+ var x = _ref3.x, y = _ref3.y, width = _ref3.width, height = _ref3.height, radius = _ref3.radius, position = _ref3.position;
188
+ if (height < radius) radius = height;
189
+ if (radius) {
190
+ if (position === "top") return roundedPath(x, y, width, height, radius, true, true, false, false);
191
+ return roundedPath(x, y, width, height, radius, false, false, true, true);
192
+ }
193
+ return roundedPath(x, y, width, height, radius);
194
+ }
195
+ const Bar = createElement(BarRoot, {
196
+ Background
197
+ });
198
+ export {
199
+ MIN_HEIGHT,
200
+ Bar as default
201
+ };