@semcore/d3-chart 16.0.0-prerelease.7 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/lib/cjs/Area.js +4 -2
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +4 -2
  5. package/lib/cjs/Axis.js.map +1 -1
  6. package/lib/cjs/Bar.js +4 -2
  7. package/lib/cjs/Bar.js.map +1 -1
  8. package/lib/cjs/Bubble.js +4 -2
  9. package/lib/cjs/Bubble.js.map +1 -1
  10. package/lib/cjs/CompactHorizontalBar.js +4 -2
  11. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  12. package/lib/cjs/Donut.js +4 -2
  13. package/lib/cjs/Donut.js.map +1 -1
  14. package/lib/cjs/Dots.js +4 -2
  15. package/lib/cjs/Dots.js.map +1 -1
  16. package/lib/cjs/HorizontalBar.js +4 -2
  17. package/lib/cjs/HorizontalBar.js.map +1 -1
  18. package/lib/cjs/Hover.js +4 -2
  19. package/lib/cjs/Hover.js.map +1 -1
  20. package/lib/cjs/Line.js +4 -2
  21. package/lib/cjs/Line.js.map +1 -1
  22. package/lib/cjs/Plot.js +4 -2
  23. package/lib/cjs/Plot.js.map +1 -1
  24. package/lib/cjs/Radar.js +4 -2
  25. package/lib/cjs/Radar.js.map +1 -1
  26. package/lib/cjs/RadialTree.js +4 -2
  27. package/lib/cjs/RadialTree.js.map +1 -1
  28. package/lib/cjs/Reference.js +4 -2
  29. package/lib/cjs/Reference.js.map +1 -1
  30. package/lib/cjs/ScatterPlot.js +4 -2
  31. package/lib/cjs/ScatterPlot.js.map +1 -1
  32. package/lib/cjs/Tooltip.js +4 -2
  33. package/lib/cjs/Tooltip.js.map +1 -1
  34. package/lib/cjs/Venn.js +4 -2
  35. package/lib/cjs/Venn.js.map +1 -1
  36. package/lib/cjs/a11y/PlotA11yModule.js +4 -2
  37. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  38. package/lib/cjs/a11y/PlotA11yView.js +4 -2
  39. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  40. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -2
  41. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  42. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +4 -2
  43. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  44. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +4 -2
  45. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  46. package/lib/es6/Area.js +4 -2
  47. package/lib/es6/Area.js.map +1 -1
  48. package/lib/es6/Axis.js +4 -2
  49. package/lib/es6/Axis.js.map +1 -1
  50. package/lib/es6/Bar.js +4 -2
  51. package/lib/es6/Bar.js.map +1 -1
  52. package/lib/es6/Bubble.js +4 -2
  53. package/lib/es6/Bubble.js.map +1 -1
  54. package/lib/es6/CompactHorizontalBar.js +4 -2
  55. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  56. package/lib/es6/Donut.js +4 -2
  57. package/lib/es6/Donut.js.map +1 -1
  58. package/lib/es6/Dots.js +4 -2
  59. package/lib/es6/Dots.js.map +1 -1
  60. package/lib/es6/HorizontalBar.js +4 -2
  61. package/lib/es6/HorizontalBar.js.map +1 -1
  62. package/lib/es6/Hover.js +4 -2
  63. package/lib/es6/Hover.js.map +1 -1
  64. package/lib/es6/Line.js +4 -2
  65. package/lib/es6/Line.js.map +1 -1
  66. package/lib/es6/Plot.js +4 -2
  67. package/lib/es6/Plot.js.map +1 -1
  68. package/lib/es6/Radar.js +4 -2
  69. package/lib/es6/Radar.js.map +1 -1
  70. package/lib/es6/RadialTree.js +4 -2
  71. package/lib/es6/RadialTree.js.map +1 -1
  72. package/lib/es6/Reference.js +4 -2
  73. package/lib/es6/Reference.js.map +1 -1
  74. package/lib/es6/ScatterPlot.js +4 -2
  75. package/lib/es6/ScatterPlot.js.map +1 -1
  76. package/lib/es6/Tooltip.js +4 -2
  77. package/lib/es6/Tooltip.js.map +1 -1
  78. package/lib/es6/Venn.js +4 -2
  79. package/lib/es6/Venn.js.map +1 -1
  80. package/lib/es6/a11y/PlotA11yModule.js +4 -2
  81. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  82. package/lib/es6/a11y/PlotA11yView.js +4 -2
  83. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  84. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -2
  85. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  86. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +4 -2
  87. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  88. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +4 -2
  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 +188 -0
  92. package/lib/esm/Axis.mjs +405 -0
  93. package/lib/esm/Bar.mjs +200 -0
  94. package/lib/esm/Bubble.mjs +215 -0
  95. package/lib/esm/CompactHorizontalBar.mjs +517 -0
  96. package/lib/esm/Donut.mjs +414 -0
  97. package/lib/esm/Dots.mjs +119 -0
  98. package/lib/esm/GroupBar.mjs +94 -0
  99. package/lib/esm/HorizontalBar.mjs +180 -0
  100. package/lib/esm/Hover.mjs +216 -0
  101. package/lib/esm/Line.mjs +198 -0
  102. package/lib/esm/Pattern.mjs +520 -0
  103. package/lib/esm/Plot.mjs +136 -0
  104. package/lib/esm/Radar.mjs +705 -0
  105. package/lib/esm/RadialTree.mjs +564 -0
  106. package/lib/esm/Reference.mjs +242 -0
  107. package/lib/esm/ResponsiveContainer.mjs +99 -0
  108. package/lib/esm/ScatterPlot.mjs +193 -0
  109. package/lib/esm/StackBar.mjs +177 -0
  110. package/lib/esm/StackedArea.mjs +84 -0
  111. package/lib/esm/Tooltip.mjs +254 -0
  112. package/lib/esm/Venn.mjs +233 -0
  113. package/lib/esm/a11y/DataAccessibilityTable.mjs +100 -0
  114. package/lib/esm/a11y/PlotA11yModule.mjs +116 -0
  115. package/lib/esm/a11y/PlotA11yView.mjs +145 -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 +85 -0
  170. package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
  171. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +239 -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 +89 -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 +9 -9
  214. package/vite.config.ts +2 -0
@@ -0,0 +1,233 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
7
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
+ import { sstyled, Component, assignProps } from "@semcore/core";
11
+ import React from "react";
12
+ import { scaleSolution, normalizeSolution, venn, intersectionAreaPath } from "@upsetjs/venn.js";
13
+ import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
14
+ import { FadeInOut } from "@semcore/animation";
15
+ import createElement from "./createElement.mjs";
16
+ import { getChartDefaultColorName } from "./utils.mjs";
17
+ import Tooltip from "./Tooltip.mjs";
18
+ import { PatternFill } from "./Pattern.mjs";
19
+ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
20
+ /*!__reshadow-styles__:"./style/venn.shadow.css"*/
21
+ var style = (
22
+ /*__reshadow_css_start__*/
23
+ (sstyled.insert(
24
+ /*__inner_css_start__*/
25
+ ".___SCircle_wmt8p_gg_,.___SIntersection_wmt8p_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px}.___SCircle_wmt8p_gg_{fill:var(--intergalactic-chart-palette-order-2, #59ddaa);fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_wmt8p);transition-timing-function:ease-in-out}@media (hover:hover){.___SCircle_wmt8p_gg_:hover{fill-opacity:.7}}.___SCircle_wmt8p_gg_.__color_wmt8p_gg_{fill:var(--color_wmt8p)}.___SCircle_wmt8p_gg_.__pattern_wmt8p_gg_.__color_wmt8p_gg_{fill:var(--pattern_wmt8p);fill-opacity:.7;stroke:var(--color_wmt8p);stroke-width:1px}@media (hover:hover){.___SCircle_wmt8p_gg_.__pattern_wmt8p_gg_.__color_wmt8p_gg_:hover{fill-opacity:.85}}.___SCircle_wmt8p_gg_.__transparent_wmt8p_gg_{opacity:.3}.___SIntersection_wmt8p_gg_{fill-opacity:0}@media (hover:hover){.___SIntersection_wmt8p_gg_:hover{fill-opacity:.1}}.___SIntersection_wmt8p_gg_.__transparent_wmt8p_gg_{opacity:.3}",
26
+ /*__inner_css_end__*/
27
+ "wmt8p_gg_"
28
+ ), /*__reshadow_css_end__*/
29
+ {
30
+ "__SCircle": "___SCircle_wmt8p_gg_",
31
+ "_color": "__color_wmt8p_gg_",
32
+ "--color": "--color_wmt8p",
33
+ "_transparent": "__transparent_wmt8p_gg_",
34
+ "__SIntersection": "___SIntersection_wmt8p_gg_",
35
+ "--duration": "--duration_wmt8p",
36
+ "_pattern": "__pattern_wmt8p_gg_",
37
+ "--pattern": "--pattern_wmt8p"
38
+ })
39
+ );
40
+ var VennRoot = /* @__PURE__ */ function(_Component) {
41
+ _inherits(VennRoot2, _Component);
42
+ var _super = _createSuper(VennRoot2);
43
+ function VennRoot2() {
44
+ var _this;
45
+ _classCallCheck(this, VennRoot2);
46
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
+ args[_key] = arguments[_key];
48
+ }
49
+ _this = _super.call.apply(_super, [this].concat(args));
50
+ _defineProperty(_assertThisInitialized(_this), "virtualElement", canUseDOM() ? document.createElement("div") : {});
51
+ _defineProperty(_assertThisInitialized(_this), "bindHandlerTooltip", function(visible, props, tooltipProps) {
52
+ return function(_ref5) {
53
+ var clientX = _ref5.clientX, clientY = _ref5.clientY;
54
+ var eventEmitter = _this.asProps.eventEmitter;
55
+ eventEmitter.emit("setTooltipPosition", clientX, clientY);
56
+ eventEmitter.emit("setTooltipRenderingProps", props, tooltipProps);
57
+ eventEmitter.emit("setTooltipVisible", visible);
58
+ };
59
+ });
60
+ _defineProperty(_assertThisInitialized(_this), "renderElement", /* @__PURE__ */ React.forwardRef(function(props, ref) {
61
+ return /* @__PURE__ */ React.createElement(FadeInOut, _extends({
62
+ "aria-hidden": true,
63
+ ref,
64
+ tag: "g",
65
+ visible: true
66
+ }, props));
67
+ }));
68
+ return _this;
69
+ }
70
+ _createClass(VennRoot2, [{
71
+ key: "generateGetBoundingClientRect",
72
+ value: function generateGetBoundingClientRect() {
73
+ var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
74
+ var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
75
+ return function() {
76
+ return {
77
+ width: 0,
78
+ height: 0,
79
+ top: y,
80
+ right: x,
81
+ bottom: y,
82
+ left: x
83
+ };
84
+ };
85
+ }
86
+ }, {
87
+ key: "getVennData",
88
+ value: function getVennData() {
89
+ var _this$asProps = this.asProps, data = _this$asProps.data, orientation = _this$asProps.orientation, orientationOrder2 = _this$asProps.orientationOrder, size = _this$asProps.size;
90
+ var _size = _slicedToArray(size, 2), width = _size[0], height = _size[1];
91
+ var vennData = Object.entries(data).map(function(_ref6) {
92
+ var _ref7 = _slicedToArray(_ref6, 2), dataKey = _ref7[0], size2 = _ref7[1];
93
+ return {
94
+ sets: dataKey.split("/"),
95
+ size: size2
96
+ };
97
+ });
98
+ return scaleSolution(normalizeSolution(venn(vennData), orientation, orientationOrder2), width, height, 10);
99
+ }
100
+ }, {
101
+ key: "getCircleProps",
102
+ value: function getCircleProps(props, index) {
103
+ var colorBackwardCapabilityOffset = 1;
104
+ var color = props.color || getChartDefaultColorName(index + colorBackwardCapabilityOffset);
105
+ var tooltipProps = {
106
+ dataKey: props.dataKey,
107
+ name: props.name,
108
+ color,
109
+ patterns: this.asProps.patterns
110
+ };
111
+ return {
112
+ duration: this.asProps.duration,
113
+ data: this.vennData[props.dataKey],
114
+ originalData: this.asProps.data[props.dataKey],
115
+ onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
116
+ onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
117
+ transparent: this.asProps.transparent,
118
+ resolveColor: this.asProps.resolveColor,
119
+ color,
120
+ uid: "".concat(this.asProps.uid, "-").concat(index),
121
+ patterns: this.asProps.patterns,
122
+ minRadius: this.asProps.minRadius
123
+ };
124
+ }
125
+ }, {
126
+ key: "getIntersectionProps",
127
+ value: function getIntersectionProps(props) {
128
+ var _this$asProps2 = this.asProps, duration = _this$asProps2.duration, transparent = _this$asProps2.transparent;
129
+ var dataKeys = props.dataKey.split("/");
130
+ var tooltipProps = {
131
+ dataKey: props.dataKey,
132
+ name: props.name,
133
+ color: props.color,
134
+ duration: props.duration,
135
+ transparent: props.transparent
136
+ };
137
+ return {
138
+ duration,
139
+ delay: duration,
140
+ data: Object.values(this.vennData).filter(function(d) {
141
+ return dataKeys.includes(d.setid);
142
+ }),
143
+ originalData: this.asProps.data[props.dataKey],
144
+ onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
145
+ onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
146
+ transparent,
147
+ resolveColor: this.asProps.resolveColor
148
+ };
149
+ }
150
+ }, {
151
+ key: "render",
152
+ value: function render() {
153
+ var Element = this.Element;
154
+ this.asProps.dataHintsHandler.establishDataType("values-set");
155
+ this.vennData = this.getVennData();
156
+ return /* @__PURE__ */ React.createElement(Element, {
157
+ "aria-hidden": true,
158
+ render: this.renderElement,
159
+ childrenPosition: "inside",
160
+ vennData: this.vennData
161
+ });
162
+ }
163
+ }]);
164
+ return VennRoot2;
165
+ }(Component);
166
+ _defineProperty(VennRoot, "displayName", "Venn");
167
+ _defineProperty(VennRoot, "style", style);
168
+ _defineProperty(VennRoot, "defaultProps", {
169
+ orientation: Math.PI / 2,
170
+ orientationOrder: function orientationOrder(c1, c2) {
171
+ return c2.radius - c1.radius;
172
+ },
173
+ duration: 500,
174
+ minRadius: 6
175
+ });
176
+ _defineProperty(VennRoot, "enhance", [uniqueIDEnhancement()]);
177
+ function Circle(_ref8) {
178
+ var _ref2;
179
+ var SCircle = _ref8.Element, styles = _ref8.styles, color = _ref8.color, resolveColor = _ref8.resolveColor, data = _ref8.data, duration = _ref8.duration, name = _ref8.name, dataKey = _ref8.dataKey, dataHintsHandler = _ref8.dataHintsHandler, transparent = _ref8.transparent, uid = _ref8.uid, patterns = _ref8.patterns, minRadius = _ref8.minRadius;
180
+ dataHintsHandler.describeValueEntity(dataKey, name);
181
+ var radius = data.radius < minRadius ? minRadius : data.radius;
182
+ if (data.radius === 0) return null;
183
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SCircle, _ref2.cn("SCircle", {
184
+ "aria-hidden": true,
185
+ "render": "circle",
186
+ "color": resolveColor(color),
187
+ "pattern": patterns ? "url(#".concat(uid, "-pattern)") : void 0,
188
+ "cx": data.x,
189
+ "cy": data.y,
190
+ "r": radius,
191
+ "transparent": transparent,
192
+ "use:duration": "".concat(duration, "ms")
193
+ }))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
194
+ "id": "".concat(uid, "-pattern"),
195
+ "patternKey": color,
196
+ "color": resolveColor(color),
197
+ "patterns": patterns
198
+ })));
199
+ }
200
+ function Intersection(props) {
201
+ var _ref3;
202
+ var SIntersection = props.Element, styles = props.styles, data = props.data, name = props.name, dataKey = props.dataKey, dataHintsHandler = props.dataHintsHandler, transparent = props.transparent;
203
+ dataHintsHandler.describeValueEntity(dataKey, name);
204
+ var renderIntersection = React.useCallback(/* @__PURE__ */ React.forwardRef(function(props2, ref) {
205
+ return /* @__PURE__ */ React.createElement(FadeInOut, _extends({
206
+ "aria-hidden": true,
207
+ ref,
208
+ tag: "path",
209
+ visible: true
210
+ }, props2));
211
+ }), [props]);
212
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SIntersection, _ref3.cn("SIntersection", {
213
+ "aria-hidden": true,
214
+ "render": renderIntersection,
215
+ "d": intersectionAreaPath(data),
216
+ "transparent": transparent
217
+ }));
218
+ }
219
+ var VennTooltip = function VennTooltip2(props) {
220
+ var _ref = arguments[0], _ref4;
221
+ var SVennTooltip = Tooltip;
222
+ return _ref4 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SVennTooltip, _ref4.cn("SVennTooltip", _objectSpread({}, assignProps({
223
+ "excludeAnchorProps": true
224
+ }, _ref))));
225
+ };
226
+ var Venn = createElement(VennRoot, {
227
+ Circle,
228
+ Intersection,
229
+ Tooltip: [VennTooltip, Tooltip._______childrenComponents]
230
+ });
231
+ export {
232
+ Venn as default
233
+ };
@@ -0,0 +1,100 @@
1
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
4
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
+ import React from "react";
6
+ import { defaultValueFormatter } from "./serialize.mjs";
7
+ var DataAccessibilityTable = function DataAccessibilityTable2(_ref) {
8
+ var id = _ref.id, dataTableRef = _ref.dataTableRef, data = _ref.data, hints = _ref.hints, config = _ref.config, intl = _ref.intl;
9
+ var keys = React.useMemo(function() {
10
+ var _fromHints, _fromHints2, _fromHints3, _fromHints4, _fromHints5;
11
+ var fromHints = [];
12
+ (_fromHints = fromHints).push.apply(_fromHints, _toConsumableArray(hints.fields.verticalAxes));
13
+ (_fromHints2 = fromHints).push.apply(_fromHints2, _toConsumableArray(hints.fields.horizontalAxes));
14
+ (_fromHints3 = fromHints).push.apply(_fromHints3, _toConsumableArray(hints.fields.valueAxes));
15
+ (_fromHints4 = fromHints).push.apply(_fromHints4, _toConsumableArray(config.additionalFields));
16
+ (_fromHints5 = fromHints).push.apply(_fromHints5, _toConsumableArray(Object.keys(hints.fields.values)));
17
+ fromHints = _toConsumableArray(new Set(fromHints)).filter(function(key) {
18
+ return key in data[0];
19
+ });
20
+ if (fromHints.length === 0) {
21
+ data.forEach(function(row) {
22
+ var _fromHints6;
23
+ return (_fromHints6 = fromHints).push.apply(_fromHints6, _toConsumableArray(Object.keys(row)));
24
+ });
25
+ }
26
+ return _toConsumableArray(new Set(fromHints));
27
+ }, [data, hints]);
28
+ var duplicatedBaseKeys = React.useMemo(function() {
29
+ var baseKeys = keys.filter(function(key2) {
30
+ return !hints.titles.valuesAxes[key2];
31
+ }).map(function(key2) {
32
+ if (hints.fields.verticalAxes.has(key2) && hints.axesTitle.vertical) return [key2, hints.axesTitle.vertical];
33
+ if (hints.fields.horizontalAxes.has(key2) && hints.axesTitle.horizontal) return [key2, hints.axesTitle.horizontal];
34
+ }).filter(function(entry) {
35
+ return entry !== void 0;
36
+ }).map(function(entry) {
37
+ return entry;
38
+ });
39
+ var doublicated = {};
40
+ var handled = {};
41
+ var _iterator = _createForOfIteratorHelper(baseKeys), _step;
42
+ try {
43
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
44
+ var _step$value = _slicedToArray(_step.value, 2), key = _step$value[0], label = _step$value[1];
45
+ if (handled[label]) {
46
+ doublicated[key] = true;
47
+ doublicated[handled[label]] = true;
48
+ }
49
+ handled[label] = key;
50
+ }
51
+ } catch (err) {
52
+ _iterator.e(err);
53
+ } finally {
54
+ _iterator.f();
55
+ }
56
+ return doublicated;
57
+ }, [keys, hints]);
58
+ var renderTitle = React.useCallback(function(dataKey) {
59
+ var _config$titlesFormatt;
60
+ var formatted = (_config$titlesFormatt = config.titlesFormatter) === null || _config$titlesFormatt === void 0 ? void 0 : _config$titlesFormatt.call(config, dataKey);
61
+ if (formatted !== void 0) return formatted;
62
+ if (hints.titles.valuesAxes[dataKey]) return hints.titles.valuesAxes[dataKey];
63
+ if (!duplicatedBaseKeys[dataKey]) {
64
+ if (hints.fields.verticalAxes.has(dataKey) && hints.axesTitle.vertical) return hints.axesTitle.vertical;
65
+ if (hints.fields.horizontalAxes.has(dataKey) && hints.axesTitle.horizontal) return hints.axesTitle.horizontal;
66
+ }
67
+ return dataKey;
68
+ }, [data, hints, duplicatedBaseKeys, config]);
69
+ var formatValue = React.useCallback(function(value, row) {
70
+ var _config$valuesFormatt, _config$valuesFormatt2;
71
+ return (_config$valuesFormatt = (_config$valuesFormatt2 = config.valuesFormatter) === null || _config$valuesFormatt2 === void 0 ? void 0 : _config$valuesFormatt2.call(config, value, row)) !== null && _config$valuesFormatt !== void 0 ? _config$valuesFormatt : defaultValueFormatter(intl, value);
72
+ }, [intl, config]);
73
+ return /* @__PURE__ */ React.createElement("table", {
74
+ id: "".concat(id, "-data-table"),
75
+ tabIndex: 0,
76
+ ref: dataTableRef
77
+ }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, keys.map(function(key, index) {
78
+ return /* @__PURE__ */ React.createElement("th", {
79
+ key: "".concat(key, "-").concat(index)
80
+ }, renderTitle(key));
81
+ }))), /* @__PURE__ */ React.createElement("tbody", null, data.map(function(row, index) {
82
+ var key = "".concat(Object.values(row).filter(function(item) {
83
+ return _typeof(item) !== "symbol";
84
+ }).join("-"), "-").concat(index);
85
+ var cells = keys.map(function(key2) {
86
+ return _typeof(row[key2]) !== "symbol" ? [key2, row[key2]] : [key2, ""];
87
+ });
88
+ return /* @__PURE__ */ React.createElement("tr", {
89
+ key
90
+ }, cells.map(function(_ref2, index2) {
91
+ var _ref3 = _slicedToArray(_ref2, 2), key2 = _ref3[0], value = _ref3[1];
92
+ return /* @__PURE__ */ React.createElement("td", {
93
+ key: "".concat(key2, "-").concat(index2)
94
+ }, formatValue(value, keys[index2]));
95
+ }));
96
+ })));
97
+ };
98
+ export {
99
+ DataAccessibilityTable
100
+ };
@@ -0,0 +1,116 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import { sstyled, assignProps } from "@semcore/core";
5
+ import React from "react";
6
+ import { normalizeLocale } from "./locale.mjs";
7
+ import { localizedMessages } from "./translations/module/__intergalactic-dynamic-locales.mjs";
8
+ import { Context, useI18n } from "@semcore/core/lib/utils/enhances/WithI18n";
9
+ import { Box } from "@semcore/flex-box";
10
+ /*!__reshadow-styles__:"../style/plotA11yModule.shadow.css"*/
11
+ var styles = (
12
+ /*__reshadow_css_start__*/
13
+ (sstyled.insert(
14
+ /*__inner_css_start__*/
15
+ ".___SPlotA11yModule_i0svk_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}.___SPlotA11yModule_i0svk_gg_:focus{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1}",
16
+ /*__inner_css_end__*/
17
+ "i0svk_gg_"
18
+ ), /*__reshadow_css_end__*/
19
+ {
20
+ "__SPlotA11yModule": "___SPlotA11yModule_i0svk_gg_"
21
+ })
22
+ );
23
+ var globalWasFocused = false;
24
+ var globalNavWithKeyboard = false;
25
+ var PlotA11yModule = function PlotA11yModule2(props) {
26
+ var _ref = arguments[0], _ref5;
27
+ var SPlotA11yModule = Box;
28
+ var _React$useState = React.useState(globalWasFocused), _React$useState2 = _slicedToArray(_React$useState, 2), wasFocused = _React$useState2[0], setWasFocused = _React$useState2[1];
29
+ var _React$useState3 = React.useState(globalNavWithKeyboard), _React$useState4 = _slicedToArray(_React$useState3, 2), navWithKeyboard = _React$useState4[0], setNavWithKeyboard = _React$useState4[1];
30
+ var _React$useState5 = React.useState(null), _React$useState6 = _slicedToArray(_React$useState5, 2), plotA11yView = _React$useState6[0], setPlotA11yView = _React$useState6[1];
31
+ var hadnleHiddenElementsFocus = React.useCallback(function() {
32
+ setWasFocused(true);
33
+ setNavWithKeyboard(true);
34
+ }, []);
35
+ var _React$useState7 = React.useState(false), _React$useState8 = _slicedToArray(_React$useState7, 2), loading = _React$useState8[0], setLoading = _React$useState8[1];
36
+ var _React$useState9 = React.useState(null), _React$useState10 = _slicedToArray(_React$useState9, 2), error = _React$useState10[0], setError = _React$useState10[1];
37
+ var contextLocale = React.useContext(Context);
38
+ var locale = React.useMemo(function() {
39
+ var _props$locale;
40
+ return normalizeLocale((_props$locale = props.locale) !== null && _props$locale !== void 0 ? _props$locale : contextLocale, localizedMessages);
41
+ }, [props.locale]);
42
+ var t = useI18n(localizedMessages, locale);
43
+ React.useEffect(function() {
44
+ var _props$plotRef$curren;
45
+ if (wasFocused) return;
46
+ var focusListener = function focusListener2() {
47
+ globalWasFocused = true;
48
+ setWasFocused(true);
49
+ };
50
+ (_props$plotRef$curren = props.plotRef.current) === null || _props$plotRef$curren === void 0 ? void 0 : _props$plotRef$curren.addEventListener("focus", focusListener);
51
+ return function() {
52
+ var _props$plotRef$curren2;
53
+ return (_props$plotRef$curren2 = props.plotRef.current) === null || _props$plotRef$curren2 === void 0 ? void 0 : _props$plotRef$curren2.removeEventListener("focus", focusListener);
54
+ };
55
+ }, [wasFocused, props.plotRef]);
56
+ React.useEffect(function() {
57
+ var _document$body;
58
+ if (navWithKeyboard) return;
59
+ var keyboardListener = function keyboardListener2(event) {
60
+ var navigationKeys = ["Tab", "ArrowUp", "ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"];
61
+ if ("key" in event && navigationKeys.includes(event.key)) {
62
+ setNavWithKeyboard(true);
63
+ globalNavWithKeyboard = true;
64
+ }
65
+ };
66
+ (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.addEventListener("keydown", keyboardListener);
67
+ return function() {
68
+ var _document$body2;
69
+ return (_document$body2 = document.body) === null || _document$body2 === void 0 ? void 0 : _document$body2.removeEventListener("keydown", keyboardListener);
70
+ };
71
+ }, [navWithKeyboard]);
72
+ var shouldDisplayView = wasFocused && navWithKeyboard;
73
+ React.useEffect(function() {
74
+ if (!shouldDisplayView) return;
75
+ if (plotA11yView) return;
76
+ if (loading) return;
77
+ setLoading(true);
78
+ import("./PlotA11yView.mjs").then(function(_ref6) {
79
+ var PlotA11yView = _ref6.PlotA11yView;
80
+ setPlotA11yView({
81
+ Component: PlotA11yView
82
+ });
83
+ setLoading(false);
84
+ setError(null);
85
+ })["catch"](function(error2) {
86
+ console.error(error2);
87
+ setError(error2);
88
+ });
89
+ }, [plotA11yView, shouldDisplayView, loading, setLoading]);
90
+ if (plotA11yView) {
91
+ return sstyled(styles), /* @__PURE__ */ React.createElement(plotA11yView.Component, _extends({}, props, {
92
+ locale
93
+ }));
94
+ }
95
+ if (error) {
96
+ var _ref3;
97
+ return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SPlotA11yModule, _ref3.cn("SPlotA11yModule", _objectSpread({}, assignProps({
98
+ "tabIndex": 0,
99
+ "aria-live": "assertive"
100
+ }, _ref))), t("failed"));
101
+ }
102
+ if (loading) {
103
+ var _ref4;
104
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SPlotA11yModule, _ref4.cn("SPlotA11yModule", _objectSpread({}, assignProps({
105
+ "tabIndex": 0,
106
+ "aria-live": "polite"
107
+ }, _ref))), t("loading"));
108
+ }
109
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SPlotA11yModule, _ref5.cn("SPlotA11yModule", _objectSpread({}, assignProps({
110
+ "tabIndex": 0,
111
+ "onFocus": hadnleHiddenElementsFocus
112
+ }, _ref))), t("disabled"));
113
+ };
114
+ export {
115
+ PlotA11yModule
116
+ };
@@ -0,0 +1,145 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import { sstyled, assignProps } from "@semcore/core";
4
+ import React from "react";
5
+ import { heavyFindNextFocusableElement } from "./focus.mjs";
6
+ import { makeDataSummarizationConfig } from "./hints.mjs";
7
+ import { getIntl } from "./intl.mjs";
8
+ import { summarize } from "./summarize.mjs";
9
+ import { Box } from "@semcore/flex-box";
10
+ import { useAsyncI18nMessages } from "@semcore/core/lib/utils/enhances/i18nEnhance";
11
+ import { localizedMessages } from "./translations/view/__intergalactic-dynamic-locales.mjs";
12
+ import { DataAccessibilityTable } from "./DataAccessibilityTable.mjs";
13
+ /*!__reshadow-styles__:"../style/plotA11yView.shadow.css"*/
14
+ var styles = (
15
+ /*__reshadow_css_start__*/
16
+ (sstyled.insert(
17
+ /*__inner_css_start__*/
18
+ ".___SPlotA11yView_1anfm_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);color:var(--intergalactic-text-primary, #191b23);border:3px solid var(--intergalactic-border-primary, #c4c7cf);font-size:var(--intergalactic-fs-50, 10px);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}.___SPlotA11yView_1anfm_gg_:focus,.___SPlotA11yView_1anfm_gg_:focus-within{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay, 500);position:relative;display:block}.___SPlotA11yView_1anfm_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x, 8px);display:block}.___SPlotA11yView_1anfm_gg_ table,.___SPlotA11yView_1anfm_gg_ td,.___SPlotA11yView_1anfm_gg_ th{border:1px solid var(--intergalactic-border-primary, #c4c7cf)}",
19
+ /*__inner_css_end__*/
20
+ "1anfm_gg_"
21
+ ), /*__reshadow_css_end__*/
22
+ {
23
+ "__SPlotA11yView": "___SPlotA11yView_1anfm_gg_"
24
+ })
25
+ );
26
+ var PlotA11yView = function PlotA11yView2(_ref3) {
27
+ var _ref = arguments[0], _ref2;
28
+ var id = _ref3.id, providedData = _ref3.data, hints = _ref3.hints, plotLabel = _ref3.plotLabel, plotRef = _ref3.plotRef, providedConfig = _ref3.config, locale = _ref3.locale;
29
+ var SPlotA11yView = Box;
30
+ var translations = useAsyncI18nMessages(localizedMessages, locale);
31
+ var intl = React.useMemo(function() {
32
+ return getIntl(locale, translations, localizedMessages);
33
+ }, [locale, translations, localizedMessages]);
34
+ var config = React.useMemo(function() {
35
+ return makeDataSummarizationConfig(providedConfig);
36
+ }, [providedConfig]);
37
+ var data = React.useMemo(function() {
38
+ return Array.isArray(providedData) ? providedData : [providedData];
39
+ }, [providedData]);
40
+ var _React$useState = React.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), summary = _React$useState2[0], setSummary = _React$useState2[1];
41
+ var _React$useState3 = React.useState(true), _React$useState4 = _slicedToArray(_React$useState3, 2), generatingSummary = _React$useState4[0], setGeneratingSummary = _React$useState4[1];
42
+ React.useEffect(function() {
43
+ if (config.disable) {
44
+ setSummary("");
45
+ setGeneratingSummary(false);
46
+ return;
47
+ }
48
+ if (config.override) {
49
+ setSummary(config.override);
50
+ setGeneratingSummary(false);
51
+ return;
52
+ }
53
+ setTimeout(function() {
54
+ setSummary(summarize(providedData, hints, config, locale, translations, localizedMessages));
55
+ setGeneratingSummary(false);
56
+ }, 0);
57
+ }, [providedData, hints, config, locale, translations, localizedMessages]);
58
+ var handleClose = React.useCallback(function() {
59
+ var _plotRef$current;
60
+ (_plotRef$current = plotRef.current) === null || _plotRef$current === void 0 ? void 0 : _plotRef$current.focus();
61
+ }, []);
62
+ var handleSkip = React.useCallback(function(event) {
63
+ var _heavyFindNextFocusab;
64
+ event.preventDefault();
65
+ if (!plotRef.current) return;
66
+ (_heavyFindNextFocusab = heavyFindNextFocusableElement(plotRef.current)) === null || _heavyFindNextFocusab === void 0 ? void 0 : _heavyFindNextFocusab.focus();
67
+ }, []);
68
+ var handleSkipKeyboard = React.useCallback(function(event) {
69
+ if (!(event.key === "Enter" || event.key === " ")) return;
70
+ handleSkip(event);
71
+ }, [handleSkip]);
72
+ var handleGoToTable = React.useCallback(function(event) {
73
+ var _dataTableRef$current;
74
+ event.preventDefault();
75
+ (_dataTableRef$current = dataTableRef.current) === null || _dataTableRef$current === void 0 ? void 0 : _dataTableRef$current.focus();
76
+ }, []);
77
+ var handleGoToTableKeyboard = React.useCallback(function(event) {
78
+ if (!(event.key === "Enter" || event.key === " ")) return;
79
+ handleGoToTable(event);
80
+ }, [handleGoToTable]);
81
+ var texts = React.useMemo(function() {
82
+ return {
83
+ label: intl.formatMessage({
84
+ id: "view-label"
85
+ }, {
86
+ plotLabel: plotLabel !== null && plotLabel !== void 0 ? plotLabel : intl.formatMessage({
87
+ id: "view-default-plot-label"
88
+ })
89
+ }),
90
+ close: intl.formatMessage({
91
+ id: "view-close"
92
+ }),
93
+ skipPlot: intl.formatMessage({
94
+ id: "view-skip-plot"
95
+ }),
96
+ goToTable: intl.formatMessage({
97
+ id: "view-go-to-table"
98
+ }),
99
+ summary: intl.formatMessage({
100
+ id: "view-data-summary"
101
+ }),
102
+ summaryPlaceholder: intl.formatMessage({
103
+ id: "view-summary-placeholder"
104
+ }),
105
+ table: intl.formatMessage({
106
+ id: "view-table"
107
+ })
108
+ };
109
+ }, [intl, plotLabel]);
110
+ var dataTableRef = React.useRef(null);
111
+ return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SPlotA11yView, _ref2.cn("SPlotA11yView", _objectSpread({}, assignProps({
112
+ "tabIndex": 0,
113
+ "aria-label": texts.label,
114
+ "role": "dialog",
115
+ "__excludeProps": ["data"]
116
+ }, _ref))), /* @__PURE__ */ React.createElement("button", _ref2.cn("button", {
117
+ "type": "button",
118
+ "onClick": handleClose
119
+ }), texts.close), /* @__PURE__ */ React.createElement("a", _ref2.cn("a", {
120
+ "href": "#",
121
+ "onKeyDown": handleSkipKeyboard,
122
+ "onClick": handleSkip
123
+ }), texts.skipPlot), /* @__PURE__ */ React.createElement("a", _ref2.cn("a", {
124
+ "href": "#".concat(id, "-data-table"),
125
+ "onKeyDown": handleGoToTableKeyboard,
126
+ "onClick": handleGoToTable
127
+ }), texts.goToTable), /* @__PURE__ */ React.createElement("strong", _ref2.cn("strong", {}), /* @__PURE__ */ React.createElement("label", _ref2.cn("label", {
128
+ "htmlFor": "".concat(id, "-data-summary")
129
+ }), texts.summary)), /* @__PURE__ */ React.createElement("div", _ref2.cn("div", {
130
+ "id": "".concat(id, "-data-summary"),
131
+ "aria-busy": generatingSummary
132
+ }), generatingSummary ? texts.summaryPlaceholder : summary), /* @__PURE__ */ React.createElement("strong", _ref2.cn("strong", {}), /* @__PURE__ */ React.createElement("label", _ref2.cn("label", {
133
+ "htmlFor": "".concat(id, "-data-table")
134
+ }), texts.table)), /* @__PURE__ */ React.createElement(DataAccessibilityTable, _ref2.cn("DataAccessibilityTable", {
135
+ "id": id,
136
+ "dataTableRef": dataTableRef,
137
+ "data": data,
138
+ "hints": hints,
139
+ "config": config,
140
+ "intl": intl
141
+ })));
142
+ };
143
+ export {
144
+ PlotA11yView
145
+ };
@@ -0,0 +1,32 @@
1
+ var makeBezier = function makeBezier2(points, bounds) {
2
+ var yPoints = points.map(function(point) {
3
+ return point.y;
4
+ });
5
+ var noPoints = points.map(function() {
6
+ return 1;
7
+ });
8
+ var weightPoints = points.map(function(point) {
9
+ var _point$weight;
10
+ return (_point$weight = point.weight) !== null && _point$weight !== void 0 ? _point$weight : 1;
11
+ });
12
+ var process = function process2(t, points2) {
13
+ var result = 0;
14
+ for (var i = 0; i < points2.length; i++) {
15
+ var tPower = i;
16
+ var reversedTPower = points2.length - 1 - i;
17
+ var edge = i === 0 || i === points2.length - 1;
18
+ var factor = edge ? 1 : points2.length - 1;
19
+ var point = points2[i];
20
+ var weight = weightPoints[i];
21
+ result += factor * Math.pow(t, tPower) * Math.pow(1 - t, reversedTPower) * point * weight;
22
+ }
23
+ return result;
24
+ };
25
+ return function(x) {
26
+ var t = x / bounds.width;
27
+ return process(t, yPoints) / process(t, noPoints);
28
+ };
29
+ };
30
+ export {
31
+ makeBezier
32
+ };
@@ -0,0 +1,44 @@
1
+ import { isFocusable } from "@semcore/core/lib/utils/focus-lock/isFocusable";
2
+ var findNextFocusableElementInChildren = function findNextFocusableElementInChildren2(element) {
3
+ if (element && isFocusable(element)) {
4
+ return element;
5
+ }
6
+ var children = element === null || element === void 0 ? void 0 : element.children;
7
+ if (children) {
8
+ for (var i = 0; i < children.length; i++) {
9
+ var childChild = children.item(i);
10
+ if (!childChild) continue;
11
+ var result = findNextFocusableElementInChildren2(childChild);
12
+ if (result) return result;
13
+ }
14
+ }
15
+ return null;
16
+ };
17
+ var makeParentsChain = function makeParentsChain2(element) {
18
+ var parents = [];
19
+ var parent = element.parentElement;
20
+ while (parent) {
21
+ parents.push(parent);
22
+ parent = parent.parentElement;
23
+ }
24
+ return parents;
25
+ };
26
+ var heavyFindNextFocusableElement = function heavyFindNextFocusableElement2(base) {
27
+ var parents = makeParentsChain(base);
28
+ for (var i = 0; i < parents.length; i++) {
29
+ var _parent$children;
30
+ var parent = parents[i];
31
+ var siblings = Array.from((_parent$children = parent === null || parent === void 0 ? void 0 : parent.children) !== null && _parent$children !== void 0 ? _parent$children : []);
32
+ if (siblings.indexOf(parents[i - 1] || base) !== -1) {
33
+ siblings = siblings.slice(siblings.indexOf(parents[i - 1] || base) + 1);
34
+ }
35
+ for (var _i = 0; _i < siblings.length; _i++) {
36
+ var focusable = findNextFocusableElementInChildren(siblings[_i]);
37
+ if (focusable) return focusable;
38
+ }
39
+ }
40
+ return null;
41
+ };
42
+ export {
43
+ heavyFindNextFocusableElement
44
+ };