@extend-ai/react-xlsx 0.18.1 → 0.20.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 (72) hide show
  1. package/README.md +154 -6
  2. package/dist/chart-renderer-AAVZ34BF.cjs +5048 -0
  3. package/dist/chart-renderer-AAVZ34BF.cjs.map +1 -0
  4. package/dist/{chart-renderer-HQSQHDCB.js → chart-renderer-KGLAI4DN.js} +25 -20
  5. package/dist/chart-renderer-KGLAI4DN.js.map +1 -0
  6. package/dist/{chart-renderer-ZUWRNNZT.cjs → chart-renderer-NM5UVCTO.cjs} +44 -39
  7. package/dist/chart-renderer-NM5UVCTO.cjs.map +1 -0
  8. package/dist/chart-renderer-RXO7WP4Q.js +5047 -0
  9. package/dist/chart-renderer-RXO7WP4Q.js.map +1 -0
  10. package/dist/chunk-2YBG7XQ3.cjs +26981 -0
  11. package/dist/chunk-2YBG7XQ3.cjs.map +1 -0
  12. package/dist/chunk-3JTCYAUX.js +50 -0
  13. package/dist/{chunk-OZLJPZUX.js.map → chunk-3JTCYAUX.js.map} +1 -1
  14. package/dist/chunk-6K3NSKDJ.cjs +50 -0
  15. package/dist/chunk-6K3NSKDJ.cjs.map +1 -0
  16. package/dist/chunk-CJBI5F6V.cjs +816 -0
  17. package/dist/chunk-CJBI5F6V.cjs.map +1 -0
  18. package/dist/{chunk-WFQGZI2Z.cjs → chunk-MCFUTO4J.cjs} +12 -8
  19. package/dist/chunk-MCFUTO4J.cjs.map +1 -0
  20. package/dist/chunk-NBH72POD.js +816 -0
  21. package/dist/chunk-NBH72POD.js.map +1 -0
  22. package/dist/{chunk-E2VSYCP2.cjs → chunk-O3V2MCOC.cjs} +18 -2
  23. package/dist/chunk-O3V2MCOC.cjs.map +1 -0
  24. package/dist/chunk-QN3D3JS2.js +26978 -0
  25. package/dist/chunk-QN3D3JS2.js.map +1 -0
  26. package/dist/{chunk-FO6MIHX4.cjs → chunk-T5WZHPIN.cjs} +2 -2
  27. package/dist/{chunk-FO6MIHX4.cjs.map → chunk-T5WZHPIN.cjs.map} +1 -1
  28. package/dist/{chunk-BAAMDEDS.js → chunk-VXBNYHW5.js} +18 -2
  29. package/dist/{chunk-BAAMDEDS.js.map → chunk-VXBNYHW5.js.map} +1 -1
  30. package/dist/{chunk-OZLJPZUX.js → chunk-WSQDFXDW.js} +10 -6
  31. package/dist/chunk-WSQDFXDW.js.map +1 -0
  32. package/dist/index.cjs +600 -11270
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +5 -14
  35. package/dist/index.d.ts +5 -14
  36. package/dist/index.js +479 -11149
  37. package/dist/index.js.map +1 -1
  38. package/dist/internal-DrXSHYJZ.d.cts +1498 -0
  39. package/dist/internal-DrXSHYJZ.d.ts +1498 -0
  40. package/dist/internal.cjs +24 -0
  41. package/dist/internal.cjs.map +1 -0
  42. package/dist/internal.d.cts +3 -0
  43. package/dist/internal.d.ts +3 -0
  44. package/dist/internal.js +23 -0
  45. package/dist/internal.js.map +1 -0
  46. package/dist/{region-map-geography-5E5SVPGS.cjs → region-map-geography-6TGXBY3V.cjs} +2 -2
  47. package/dist/{region-map-geography-5E5SVPGS.cjs.map → region-map-geography-6TGXBY3V.cjs.map} +1 -1
  48. package/dist/{spreadsheet-font-assets-7QMV43XD.cjs → spreadsheet-font-assets-4AHYDTAQ.cjs} +2 -2
  49. package/dist/{spreadsheet-font-assets-7QMV43XD.cjs.map → spreadsheet-font-assets-4AHYDTAQ.cjs.map} +1 -1
  50. package/dist/{surface-regl-WVLW3SEA.cjs → surface-regl-5Z6IVOID.cjs} +18 -15
  51. package/dist/surface-regl-5Z6IVOID.cjs.map +1 -0
  52. package/dist/{surface-regl-NWR5ZZ5D.js → surface-regl-7CDGGVDG.js} +10 -7
  53. package/dist/surface-regl-7CDGGVDG.js.map +1 -0
  54. package/dist/surface-regl-AY7JZVYY.cjs +727 -0
  55. package/dist/surface-regl-AY7JZVYY.cjs.map +1 -0
  56. package/dist/surface-regl-TJUWTLAZ.js +726 -0
  57. package/dist/surface-regl-TJUWTLAZ.js.map +1 -0
  58. package/dist/vanilla.cjs +20 -0
  59. package/dist/vanilla.cjs.map +1 -0
  60. package/dist/vanilla.d.cts +9 -0
  61. package/dist/vanilla.d.ts +9 -0
  62. package/dist/vanilla.js +19 -0
  63. package/dist/vanilla.js.map +1 -0
  64. package/dist/xlsx-worker.js +2888 -34
  65. package/dist/xlsx-worker.js.map +1 -1
  66. package/package.json +23 -3
  67. package/dist/chart-renderer-HQSQHDCB.js.map +0 -1
  68. package/dist/chart-renderer-ZUWRNNZT.cjs.map +0 -1
  69. package/dist/chunk-E2VSYCP2.cjs.map +0 -1
  70. package/dist/chunk-WFQGZI2Z.cjs.map +0 -1
  71. package/dist/surface-regl-NWR5ZZ5D.js.map +0 -1
  72. package/dist/surface-regl-WVLW3SEA.cjs.map +0 -1
@@ -0,0 +1,727 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ var _chunkO3V2MCOCcjs = require('./chunk-O3V2MCOC.cjs');
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+ var _chunkCJBI5F6Vcjs = require('./chunk-CJBI5F6V.cjs');
21
+ require('./chunk-T5WZHPIN.cjs');
22
+
23
+ // src/surface-regl.tsx
24
+ var _regl = require('regl'); var _regl2 = _interopRequireDefault(_regl);
25
+ function clamp(value, min, max) {
26
+ return Math.max(min, Math.min(max, value));
27
+ }
28
+ function safeNumber(value) {
29
+ if (typeof value === "number" && Number.isFinite(value)) {
30
+ return value;
31
+ }
32
+ if (typeof value === "string") {
33
+ const normalized = value.trim().replace(/,/g, "");
34
+ if (!normalized) {
35
+ return null;
36
+ }
37
+ const parsed = Number(normalized);
38
+ return Number.isFinite(parsed) ? parsed : null;
39
+ }
40
+ return null;
41
+ }
42
+ function parseRgbColor(color) {
43
+ const match = /^#?([0-9a-f]{6})$/i.exec(color);
44
+ if (!match) {
45
+ return null;
46
+ }
47
+ return {
48
+ blue: Number.parseInt(match[1].slice(4, 6), 16),
49
+ green: Number.parseInt(match[1].slice(2, 4), 16),
50
+ red: Number.parseInt(match[1].slice(0, 2), 16)
51
+ };
52
+ }
53
+ function resolveSurfaceBaseColor(chart, palette) {
54
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([chart, 'access', _2 => _2.chartColorPalette, 'optionalAccess', _3 => _3[0]]), () => ( _optionalChain([chart, 'access', _4 => _4.series, 'access', _5 => _5[0], 'optionalAccess', _6 => _6.color]))), () => ( _optionalChain([chart, 'access', _7 => _7.series, 'access', _8 => _8[0], 'optionalAccess', _9 => _9.lineColor]))), () => ( chart.axisLineColor)), () => ( chart.textColor)), () => ( palette.text));
55
+ }
56
+ function normalizeSurfaceRendererHexColor(value) {
57
+ if (typeof value !== "string") {
58
+ return null;
59
+ }
60
+ const trimmed = value.trim();
61
+ if (!trimmed) {
62
+ return null;
63
+ }
64
+ const normalized = trimmed.startsWith("#") ? trimmed.slice(1) : trimmed;
65
+ return /^[0-9a-f]{6}$/i.test(normalized) ? `#${normalized.toLowerCase()}` : null;
66
+ }
67
+ function resolveExplicitSurfaceSeriesColor(chart, kind) {
68
+ const shape = _optionalChain([chart, 'access', _10 => _10.series, 'access', _11 => _11[0], 'optionalAccess', _12 => _12.shapeProperties]);
69
+ if (kind === "fill" ? _optionalChain([shape, 'optionalAccess', _13 => _13.xmlFillHidden]) === true : _optionalChain([shape, 'optionalAccess', _14 => _14.xmlLineHidden]) === true) return "transparent";
70
+ const color = kind === "fill" ? _nullishCoalesce(_optionalChain([shape, 'optionalAccess', _15 => _15.xmlFillColor]), () => ( _optionalChain([shape, 'optionalAccess', _16 => _16.solidFillHex]))) : _nullishCoalesce(_optionalChain([shape, 'optionalAccess', _17 => _17.xmlLineColor]), () => ( _optionalChain([shape, 'optionalAccess', _18 => _18.lineColorHex])));
71
+ return normalizeSurfaceRendererHexColor(color);
72
+ }
73
+ function getSurfaceColorStops(chart, palette) {
74
+ const explicitFill = resolveExplicitSurfaceSeriesColor(chart, "fill");
75
+ if (explicitFill) return [explicitFill];
76
+ const colors = (_nullishCoalesce(chart.chartColorPalette, () => ( []))).filter((value) => typeof value === "string" && value.length > 0);
77
+ return colors.length > 0 ? colors : [resolveSurfaceBaseColor(chart, palette)];
78
+ }
79
+ function getSurfaceDomain(chart) {
80
+ const numericValues = chart.series.flatMap((series) => series.values.map((value) => safeNumber(value)).filter((value) => value != null));
81
+ if (numericValues.length === 0) {
82
+ return null;
83
+ }
84
+ const explicitMin = typeof _optionalChain([chart, 'access', _19 => _19.valueAxis, 'optionalAccess', _20 => _20.min]) === "number" && Number.isFinite(chart.valueAxis.min) ? chart.valueAxis.min : null;
85
+ const explicitMax = typeof _optionalChain([chart, 'access', _21 => _21.valueAxis, 'optionalAccess', _22 => _22.max]) === "number" && Number.isFinite(chart.valueAxis.max) ? chart.valueAxis.max : null;
86
+ const rawMin = Math.min(...numericValues);
87
+ const rawMax = Math.max(...numericValues);
88
+ const spanBase = Math.max(1e-6, rawMax - Math.min(0, rawMin));
89
+ const roughStep = spanBase / 5;
90
+ const magnitude = Math.pow(10, Math.floor(Math.log10(Math.max(roughStep, 1e-6))));
91
+ const normalized = roughStep / magnitude;
92
+ const niceStep = normalized <= 1 ? 1 : normalized <= 2 ? 2 : normalized <= 5 ? 5 : 10;
93
+ const step = typeof _optionalChain([chart, 'access', _23 => _23.valueAxis, 'optionalAccess', _24 => _24.majorUnit]) === "number" && chart.valueAxis.majorUnit > 0 ? chart.valueAxis.majorUnit : niceStep * magnitude;
94
+ const minValue = _nullishCoalesce(explicitMin, () => ( (rawMin >= 0 ? 0 : Math.floor(rawMin / step) * step)));
95
+ const maxValue = _nullishCoalesce(explicitMax, () => ( Math.ceil(rawMax / step) * step));
96
+ const safeMax = maxValue <= minValue ? minValue + step : maxValue;
97
+ const ticks = [];
98
+ for (let current = minValue; current <= safeMax + step * 1e-3; current += step) {
99
+ ticks.push(Number(current.toFixed(8)));
100
+ }
101
+ const boundedTicks = [.../* @__PURE__ */ new Set([...ticks.filter((tick) => tick < safeMax), safeMax])];
102
+ return {
103
+ maxValue,
104
+ minValue,
105
+ safeMax,
106
+ ticks: boundedTicks.length >= 2 ? boundedTicks : [minValue, safeMax]
107
+ };
108
+ }
109
+ function resolveSurfaceBandPaletteColor(chart, palette, domain, value) {
110
+ const bandIndex = resolveSurfaceBandIndex(domain, value);
111
+ const explicitColor = resolveSurfaceBandFormatColor(chart, "bandFormatColors", bandIndex);
112
+ if (explicitColor) return explicitColor;
113
+ const explicitFill = resolveExplicitSurfaceSeriesColor(chart, "fill");
114
+ if (explicitFill) return explicitFill;
115
+ const themeColors = _optionalChain([chart, 'access', _25 => _25.raw, 'optionalAccess', _26 => _26.builtinThemeColors]);
116
+ const paletteCount = Math.trunc((domain.safeMax - domain.minValue) / (domain.ticks[1] - domain.ticks[0])) + 1;
117
+ const builtinColor = themeColors ? _chunkCJBI5F6Vcjs.resolveBuiltinChartColor.call(void 0, _chunkCJBI5F6Vcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, bandIndex % paletteCount, paletteCount), themeColors) : void 0;
118
+ if (builtinColor) return builtinColor;
119
+ const stops = getSurfaceColorStops(chart, palette);
120
+ if (stops.length === 0) {
121
+ return resolveSurfaceBaseColor(chart, palette);
122
+ }
123
+ return _nullishCoalesce(_nullishCoalesce(stops[Math.min(stops.length - 1, Math.max(0, bandIndex))], () => ( stops[stops.length - 1])), () => ( resolveSurfaceBaseColor(chart, palette)));
124
+ }
125
+ function resolveSurfaceBandIndex(domain, value) {
126
+ const ticks = domain.ticks;
127
+ for (let index = 0; index < ticks.length - 1; index += 1) {
128
+ const end = _nullishCoalesce(ticks[index + 1], () => ( domain.safeMax));
129
+ if (value <= end || index === ticks.length - 2) {
130
+ return index;
131
+ }
132
+ }
133
+ return Math.max(0, ticks.length - 2);
134
+ }
135
+ function resolveSurfaceBandColor(chart, palette, domain, value) {
136
+ return resolveSurfaceBandPaletteColor(chart, palette, domain, value);
137
+ }
138
+ function resolveSurfaceBandFormatColor(chart, key, index) {
139
+ const colors = _optionalChain([chart, 'access', _27 => _27.raw, 'optionalAccess', _28 => _28[key]]);
140
+ if (!colors || typeof colors !== "object" || !Object.prototype.hasOwnProperty.call(colors, index)) return null;
141
+ const color = colors[index];
142
+ return typeof color === "string" && color.length > 0 ? color : null;
143
+ }
144
+ function resolveSurfaceWireframeColor(chart, palette, domain, value) {
145
+ const bandIndex = resolveSurfaceBandIndex(domain, value);
146
+ const themeColors = _optionalChain([chart, 'access', _29 => _29.raw, 'optionalAccess', _30 => _30.builtinThemeColors]);
147
+ const paletteCount = Math.trunc((domain.safeMax - domain.minValue) / (domain.ticks[1] - domain.ticks[0])) + 1;
148
+ const builtinLine = themeColors ? _chunkCJBI5F6Vcjs.resolveBuiltinChartColor.call(void 0, _chunkCJBI5F6Vcjs.getBuiltinChartSurfaceLine.call(void 0, chart.chartStyleId, bandIndex, paletteCount), themeColors) : void 0;
149
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(resolveSurfaceBandFormatColor(chart, "bandFormatLineColors", bandIndex), () => ( resolveExplicitSurfaceSeriesColor(chart, "line"))), () => ( builtinLine)), () => ( resolveSurfaceBandPaletteColor(chart, palette, domain, value)));
150
+ }
151
+ function colorToRgba(color, alpha = 1) {
152
+ if (color === "transparent") return [0, 0, 0, 0];
153
+ const rgb = parseRgbColor(color);
154
+ if (!rgb) {
155
+ return [0.1, 0.1, 0.1, alpha];
156
+ }
157
+ return [rgb.red / 255, rgb.green / 255, rgb.blue / 255, alpha];
158
+ }
159
+ function normalizeSurfaceX(column, cols) {
160
+ return cols <= 1 ? 0 : (column / (cols - 1) - 0.5) * 2;
161
+ }
162
+ function normalizeSurfaceY(row, rows) {
163
+ return rows <= 1 ? 0 : (row / (rows - 1) - 0.5) * 2;
164
+ }
165
+ function normalizeSurfaceZ(value, domain, heightExtent, axis) {
166
+ return -(_chunkO3V2MCOCcjs.normalizeSurfaceValue.call(void 0, value, domain.minValue, domain.safeMax, axis) - 0.5) * heightExtent;
167
+ }
168
+ function projectCartesian3dPoint(x, y, z, rotXRad, rotYRad, usePerspective, perspectiveStrength, rightAngleAxes) {
169
+ if (rightAngleAxes) {
170
+ return { depth: z, x: x + z * Math.sin(rotYRad), y: y - z * Math.sin(rotXRad) };
171
+ }
172
+ const cosX = Math.cos(rotXRad);
173
+ const sinX = Math.sin(rotXRad);
174
+ const cosY = Math.cos(rotYRad);
175
+ const sinY = Math.sin(rotYRad);
176
+ const x1 = x * cosY + z * sinY;
177
+ const z1 = -x * sinY + z * cosY;
178
+ const y1 = y * cosX - z1 * sinX;
179
+ const z2 = y * sinX + z1 * cosX;
180
+ const perspective = usePerspective ? 1 / Math.max(0.18, 1 + z2 * (0.24 + perspectiveStrength * 0.5)) : 1;
181
+ return {
182
+ depth: z2,
183
+ x: x1 * perspective,
184
+ y: y1 * perspective
185
+ };
186
+ }
187
+ function withProjectedDepth(point, depth) {
188
+ return {
189
+ ...point,
190
+ depth
191
+ };
192
+ }
193
+ function nudgeProjectedDepth(point, delta) {
194
+ return {
195
+ ...point,
196
+ depth: point.depth + delta
197
+ };
198
+ }
199
+ function isContourSurfaceChart(chart) {
200
+ const rawChartType = chart.raw && typeof chart.raw === "object" && typeof chart.raw.xmlChartType === "string" ? chart.raw.xmlChartType : "";
201
+ if (rawChartType === "surfaceChart") {
202
+ return true;
203
+ }
204
+ if (rawChartType === "surface3DChart") {
205
+ return false;
206
+ }
207
+ return chart.chartType === "Surface" && chart.is3d !== true;
208
+ }
209
+ function buildSurfaceMesh(chart, palette, layout) {
210
+ const rows = chart.series.length;
211
+ const cols = chart.series.reduce((max, series) => Math.max(max, series.values.length), 0);
212
+ if (rows < 2 || cols < 2) {
213
+ return null;
214
+ }
215
+ const matrix = chart.series.map((series) => Array.from({ length: cols }, (_, columnIndex) => safeNumber(series.values[columnIndex])));
216
+ const domain = getSurfaceDomain(chart);
217
+ if (!domain) {
218
+ return null;
219
+ }
220
+ const isContour = isContourSurfaceChart(chart);
221
+ const isWireframe = chart.wireframe === true;
222
+ const fillVertices = [];
223
+ const wallTriangles = [];
224
+ const contourLines = [];
225
+ const meshLines = [];
226
+ const rotX = (_nullishCoalesce(_optionalChain([chart, 'access', _31 => _31.view3d, 'optionalAccess', _32 => _32.rotX]), () => ( 25))) * (Math.PI / 180);
227
+ const rotY = (_nullishCoalesce(_optionalChain([chart, 'access', _33 => _33.view3d, 'optionalAccess', _34 => _34.rotY]), () => ( 30))) * (Math.PI / 180);
228
+ const usePerspective = !isContour && _optionalChain([chart, 'access', _35 => _35.view3d, 'optionalAccess', _36 => _36.rAngAx]) === false;
229
+ const perspectiveStrength = clamp((_nullishCoalesce(_optionalChain([chart, 'access', _37 => _37.view3d, 'optionalAccess', _38 => _38.perspective]), () => ( (usePerspective ? 30 : 0)))) / 100, 0, 1);
230
+ const ratios = _chunkO3V2MCOCcjs.surfaceDataRatios.call(void 0, rows, cols, _optionalChain([chart, 'access', _39 => _39.valueAxis, 'optionalAccess', _40 => _40.crossBetween]) !== "midCat", _optionalChain([chart, 'access', _41 => _41.view3d, 'optionalAccess', _42 => _42.heightPercent]), _optionalChain([chart, 'access', _43 => _43.view3d, 'optionalAccess', _44 => _44.depthPercent]), layout);
231
+ const depthScale = ratios.depth;
232
+ const heightExtent = 2 * ratios.height;
233
+ const usesFlatMaterial = chart.surfaceMaterial === "flat";
234
+ const wallLineColor = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([chart, 'access', _45 => _45.valueAxis, 'optionalAccess', _46 => _46.majorGridlineColor]), () => ( _optionalChain([chart, 'access', _47 => _47.backWall, 'optionalAccess', _48 => _48.lineColor]))), () => ( _optionalChain([chart, 'access', _49 => _49.sideWall, 'optionalAccess', _50 => _50.lineColor]))), () => ( _optionalChain([chart, 'access', _51 => _51.floor, 'optionalAccess', _52 => _52.lineColor]))), () => ( chart.axisLineColor)), () => ( "#a6a6a6"));
235
+ const backWallFill = _nullishCoalesce(_optionalChain([chart, 'access', _53 => _53.backWall, 'optionalAccess', _54 => _54.fillColor]), () => ( "#d9d9df"));
236
+ const sideWallFill = _nullishCoalesce(_optionalChain([chart, 'access', _55 => _55.sideWall, 'optionalAccess', _56 => _56.fillColor]), () => ( "#d5d7dc"));
237
+ const floorFill = _nullishCoalesce(_optionalChain([chart, 'access', _57 => _57.floor, 'optionalAccess', _58 => _58.fillColor]), () => ( "#d0d2d8"));
238
+ const projectPoint = (column, row, value) => {
239
+ const worldX = normalizeSurfaceX(column, cols);
240
+ if (isContour) {
241
+ return {
242
+ depth: 0,
243
+ worldX,
244
+ worldY: normalizeSurfaceY(row, rows),
245
+ worldZ: 0,
246
+ x: worldX,
247
+ y: normalizeSurfaceY(row, rows)
248
+ };
249
+ }
250
+ const worldY = normalizeSurfaceZ(value, domain, heightExtent, chart.valueAxis);
251
+ const worldZ = normalizeSurfaceY(row, rows) * depthScale;
252
+ const projected = projectCartesian3dPoint(worldX, worldY, worldZ, rotX, rotY, usePerspective, perspectiveStrength, _optionalChain([chart, 'access', _59 => _59.view3d, 'optionalAccess', _60 => _60.rAngAx]) !== false);
253
+ return {
254
+ depth: projected.depth,
255
+ worldX,
256
+ worldY,
257
+ worldZ,
258
+ x: projected.x,
259
+ y: projected.y
260
+ };
261
+ };
262
+ const addWallQuad = (a, b, c, d2, color) => {
263
+ wallTriangles.push(
264
+ { color, points: [a, b, c] },
265
+ { color, points: [a, c, d2] }
266
+ );
267
+ };
268
+ const addMeshLine = (from, to, color) => {
269
+ meshLines.push({ color, from, to });
270
+ };
271
+ for (let rowIndex = 0; rowIndex < rows - 1; rowIndex += 1) {
272
+ for (let columnIndex = 0; columnIndex < cols - 1; columnIndex += 1) {
273
+ const p00 = _optionalChain([matrix, 'access', _61 => _61[rowIndex], 'optionalAccess', _62 => _62[columnIndex]]);
274
+ const p10 = _optionalChain([matrix, 'access', _63 => _63[rowIndex], 'optionalAccess', _64 => _64[columnIndex + 1]]);
275
+ const p01 = _optionalChain([matrix, 'access', _65 => _65[rowIndex + 1], 'optionalAccess', _66 => _66[columnIndex]]);
276
+ const p11 = _optionalChain([matrix, 'access', _67 => _67[rowIndex + 1], 'optionalAccess', _68 => _68[columnIndex + 1]]);
277
+ if (p00 == null || p10 == null || p01 == null || p11 == null) {
278
+ continue;
279
+ }
280
+ const triangles = _chunkO3V2MCOCcjs.triangulateSurfaceQuad.call(void 0, [
281
+ { value: p00, x: columnIndex, y: rowIndex },
282
+ { value: p10, x: columnIndex + 1, y: rowIndex },
283
+ { value: p11, x: columnIndex + 1, y: rowIndex + 1 },
284
+ { value: p01, x: columnIndex, y: rowIndex + 1 }
285
+ ], chart.valueAxis);
286
+ for (const triangle of triangles) {
287
+ for (let band = 0; band < domain.ticks.length - 1; band += 1) {
288
+ const lower = domain.ticks[band];
289
+ const upper = domain.ticks[band + 1];
290
+ const polygon = _chunkO3V2MCOCcjs.clipSurfaceBand.call(void 0, _chunkO3V2MCOCcjs.clipSurfaceBand.call(void 0, triangle, lower, true, chart.valueAxis, band === 0), upper, false, chart.valueAxis);
291
+ if (polygon.length < 3) continue;
292
+ const bandColor = resolveSurfaceBandColor(chart, palette, domain, (lower + upper) / 2);
293
+ if (!isWireframe && bandColor !== "transparent") {
294
+ for (let index = 1; index < polygon.length - 1; index += 1) {
295
+ for (const vertex of [polygon[0], polygon[index], polygon[index + 1]]) {
296
+ const point = projectPoint(vertex.x, vertex.y, vertex.value);
297
+ fillVertices.push({ bandColor, point: isContour ? withProjectedDepth(point, 0.08) : point, value: vertex.value });
298
+ }
299
+ }
300
+ }
301
+ for (const group of _chunkO3V2MCOCcjs.groupSurfaceBandEdges.call(void 0, polygon, triangle, band, lower, isWireframe)) {
302
+ const edgeMidpoint = (domain.ticks[group.band] + domain.ticks[group.band + 1]) / 2;
303
+ const color = resolveSurfaceWireframeColor(chart, palette, domain, edgeMidpoint);
304
+ if (color !== "transparent") {
305
+ for (const [from, to] of group.edges) {
306
+ contourLines.push({ color, from: projectPoint(from.x, from.y, from.value), to: projectPoint(to.x, to.y, to.value) });
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ }
313
+ }
314
+ const columnSkip = Math.max(1, _nullishCoalesce(_optionalChain([chart, 'access', _69 => _69.categoryAxis, 'optionalAccess', _70 => _70.tickMarkSkip]), () => ( 1)));
315
+ const rowSkip = Math.max(1, _nullishCoalesce(_optionalChain([chart, 'access', _71 => _71.seriesAxis, 'optionalAccess', _72 => _72.tickMarkSkip]), () => ( 1)));
316
+ if (isContour) {
317
+ const topLeft = withProjectedDepth(projectPoint(0, 0, domain.minValue), -0.12);
318
+ const topRight = withProjectedDepth(projectPoint(cols - 1, 0, domain.minValue), -0.12);
319
+ const bottomRight = withProjectedDepth(projectPoint(cols - 1, rows - 1, domain.minValue), -0.12);
320
+ const bottomLeft = withProjectedDepth(projectPoint(0, rows - 1, domain.minValue), -0.12);
321
+ if (_optionalChain([chart, 'access', _73 => _73.backWall, 'optionalAccess', _74 => _74.hidden]) !== true && backWallFill !== "transparent") {
322
+ addWallQuad(topLeft, topRight, bottomRight, bottomLeft, backWallFill);
323
+ }
324
+ for (let columnIndex = 0; columnIndex < cols; columnIndex += columnSkip) {
325
+ addMeshLine(
326
+ withProjectedDepth(projectPoint(columnIndex, 0, domain.minValue), 0.04),
327
+ withProjectedDepth(projectPoint(columnIndex, rows - 1, domain.minValue), 0.04),
328
+ wallLineColor
329
+ );
330
+ }
331
+ for (let rowIndex = 0; rowIndex < rows; rowIndex += rowSkip) {
332
+ addMeshLine(
333
+ withProjectedDepth(projectPoint(0, rowIndex, domain.minValue), 0.04),
334
+ withProjectedDepth(projectPoint(cols - 1, rowIndex, domain.minValue), 0.04),
335
+ wallLineColor
336
+ );
337
+ }
338
+ } else {
339
+ const minPlaneValue = domain.minValue;
340
+ const wallDepthOffset = 0;
341
+ const backRow = _optionalChain([chart, 'access', _75 => _75.view3d, 'optionalAccess', _76 => _76.rAngAx]) !== false || Math.cos(rotX) * Math.cos(rotY) >= 0 ? rows - 1 : 0;
342
+ const sideColumn = Math.sin(rotY) >= 0 ? 0 : cols - 1;
343
+ if (_optionalChain([chart, 'access', _77 => _77.floor, 'optionalAccess', _78 => _78.hidden]) !== true && floorFill !== "transparent") {
344
+ addWallQuad(
345
+ nudgeProjectedDepth(projectPoint(0, 0, minPlaneValue), wallDepthOffset),
346
+ nudgeProjectedDepth(projectPoint(cols - 1, 0, minPlaneValue), wallDepthOffset),
347
+ nudgeProjectedDepth(projectPoint(cols - 1, rows - 1, minPlaneValue), wallDepthOffset),
348
+ nudgeProjectedDepth(projectPoint(0, rows - 1, minPlaneValue), wallDepthOffset),
349
+ floorFill
350
+ );
351
+ }
352
+ if (_optionalChain([chart, 'access', _79 => _79.backWall, 'optionalAccess', _80 => _80.hidden]) !== true && backWallFill !== "transparent") {
353
+ addWallQuad(
354
+ nudgeProjectedDepth(projectPoint(0, backRow, domain.safeMax), wallDepthOffset),
355
+ nudgeProjectedDepth(projectPoint(cols - 1, backRow, domain.safeMax), wallDepthOffset),
356
+ nudgeProjectedDepth(projectPoint(cols - 1, backRow, minPlaneValue), wallDepthOffset),
357
+ nudgeProjectedDepth(projectPoint(0, backRow, minPlaneValue), wallDepthOffset),
358
+ backWallFill
359
+ );
360
+ }
361
+ if (_optionalChain([chart, 'access', _81 => _81.sideWall, 'optionalAccess', _82 => _82.hidden]) !== true && sideWallFill !== "transparent") {
362
+ addWallQuad(
363
+ nudgeProjectedDepth(projectPoint(sideColumn, 0, domain.safeMax), wallDepthOffset),
364
+ nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, domain.safeMax), wallDepthOffset),
365
+ nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, minPlaneValue), wallDepthOffset),
366
+ nudgeProjectedDepth(projectPoint(sideColumn, 0, minPlaneValue), wallDepthOffset),
367
+ sideWallFill
368
+ );
369
+ }
370
+ for (const tick of _optionalChain([chart, 'access', _83 => _83.valueAxis, 'optionalAccess', _84 => _84.majorGridlines]) ? domain.ticks : []) {
371
+ if (_optionalChain([chart, 'access', _85 => _85.backWall, 'optionalAccess', _86 => _86.hidden]) !== true && wallLineColor !== "transparent") {
372
+ addMeshLine(nudgeProjectedDepth(projectPoint(0, backRow, tick), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(cols - 1, backRow, tick), wallDepthOffset * 0.75), wallLineColor);
373
+ }
374
+ if (_optionalChain([chart, 'access', _87 => _87.sideWall, 'optionalAccess', _88 => _88.hidden]) !== true && wallLineColor !== "transparent") {
375
+ addMeshLine(nudgeProjectedDepth(projectPoint(sideColumn, 0, tick), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, tick), wallDepthOffset * 0.75), wallLineColor);
376
+ }
377
+ }
378
+ for (let columnIndex = 0; _optionalChain([chart, 'access', _89 => _89.categoryAxis, 'optionalAccess', _90 => _90.majorGridlines]) && columnIndex < cols; columnIndex += columnSkip) {
379
+ if (_optionalChain([chart, 'access', _91 => _91.floor, 'optionalAccess', _92 => _92.hidden]) !== true && wallLineColor !== "transparent") {
380
+ addMeshLine(nudgeProjectedDepth(projectPoint(columnIndex, 0, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(columnIndex, rows - 1, minPlaneValue), wallDepthOffset * 0.75), wallLineColor);
381
+ }
382
+ if (_optionalChain([chart, 'access', _93 => _93.backWall, 'optionalAccess', _94 => _94.hidden]) !== true && wallLineColor !== "transparent") {
383
+ addMeshLine(nudgeProjectedDepth(projectPoint(columnIndex, backRow, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(columnIndex, backRow, domain.safeMax), wallDepthOffset * 0.75), wallLineColor);
384
+ }
385
+ }
386
+ for (let rowIndex = 0; _optionalChain([chart, 'access', _95 => _95.seriesAxis, 'optionalAccess', _96 => _96.majorGridlines]) && rowIndex < rows; rowIndex += rowSkip) {
387
+ if (_optionalChain([chart, 'access', _97 => _97.floor, 'optionalAccess', _98 => _98.hidden]) !== true && wallLineColor !== "transparent") {
388
+ addMeshLine(nudgeProjectedDepth(projectPoint(0, rowIndex, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(cols - 1, rowIndex, minPlaneValue), wallDepthOffset * 0.75), wallLineColor);
389
+ }
390
+ if (_optionalChain([chart, 'access', _99 => _99.sideWall, 'optionalAccess', _100 => _100.hidden]) !== true && wallLineColor !== "transparent") {
391
+ addMeshLine(nudgeProjectedDepth(projectPoint(sideColumn, rowIndex, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(sideColumn, rowIndex, domain.safeMax), wallDepthOffset * 0.75), wallLineColor);
392
+ }
393
+ }
394
+ }
395
+ const allPoints = [
396
+ ...fillVertices.map((vertex) => vertex.point),
397
+ ...wallTriangles.flatMap((triangle) => triangle.points),
398
+ ...meshLines.flatMap((line) => [line.from, line.to]),
399
+ ...contourLines.flatMap((line) => [line.from, line.to])
400
+ ];
401
+ if (allPoints.length === 0) {
402
+ return null;
403
+ }
404
+ const minX = Math.min(...allPoints.map((point) => point.x));
405
+ const maxX = Math.max(...allPoints.map((point) => point.x));
406
+ const minY = Math.min(...allPoints.map((point) => point.y));
407
+ const maxY = Math.max(...allPoints.map((point) => point.y));
408
+ const minDepth = Math.min(...allPoints.map((point) => point.depth));
409
+ const maxDepth = Math.max(...allPoints.map((point) => point.depth));
410
+ const scale = Math.min(
411
+ layout.plot.width / Math.max(0.25, maxX - minX),
412
+ layout.plot.height / Math.max(0.25, maxY - minY)
413
+ );
414
+ const centerX = layout.plot.left + layout.plot.width / 2;
415
+ const centerY = layout.plot.top + layout.plot.height / 2;
416
+ const centerRawX = (minX + maxX) / 2;
417
+ const centerRawY = (minY + maxY) / 2;
418
+ const toScreenX = (x) => centerX + (x - centerRawX) * scale;
419
+ const toScreenY = (y) => centerY + (y - centerRawY) * scale;
420
+ const toClipPoint = (point) => {
421
+ const screenX = toScreenX(point.x);
422
+ const screenY = toScreenY(point.y);
423
+ return {
424
+ x: screenX / layout.width * 2 - 1,
425
+ y: 1 - screenY / layout.height * 2,
426
+ z: clamp((point.depth - minDepth) / Math.max(1e-6, maxDepth - minDepth) * 2 - 1, -1, 1)
427
+ };
428
+ };
429
+ const fillPositions = [];
430
+ const fillColors = [];
431
+ const wallPositions = [];
432
+ const wallColors = [];
433
+ for (const triangle of wallTriangles) {
434
+ const world = triangle.points.map((point) => ({ x: point.worldX, y: point.worldY, z: -point.worldZ }));
435
+ const normal = _chunkO3V2MCOCcjs.transformSurfaceNormal.call(void 0, _chunkO3V2MCOCcjs.surfaceNormal.call(void 0, world[0], world[1], world[2]), _nullishCoalesce(_optionalChain([chart, 'access', _101 => _101.view3d, 'optionalAccess', _102 => _102.rotX]), () => ( 25)), _nullishCoalesce(_optionalChain([chart, 'access', _103 => _103.view3d, 'optionalAccess', _104 => _104.rotY]), () => ( 30)), _optionalChain([chart, 'access', _105 => _105.view3d, 'optionalAccess', _106 => _106.rAngAx]) !== false);
436
+ const rgba = colorToRgba(usesFlatMaterial ? triangle.color : _chunkO3V2MCOCcjs.shadeSurfaceMatteColor.call(void 0, triangle.color, normal), 1);
437
+ for (const point of triangle.points) {
438
+ const clip = toClipPoint(point);
439
+ wallPositions.push(clip.x, clip.y, clip.z);
440
+ wallColors.push(rgba[0], rgba[1], rgba[2], rgba[3]);
441
+ }
442
+ }
443
+ for (let index = 0; index < fillVertices.length; index += 3) {
444
+ const left = fillVertices[index];
445
+ const middle = fillVertices[index + 1];
446
+ const right = fillVertices[index + 2];
447
+ if (!left || !middle || !right) {
448
+ continue;
449
+ }
450
+ const world = [left, middle, right].map((vertex) => ({ x: vertex.point.worldX, y: vertex.point.worldY, z: -vertex.point.worldZ }));
451
+ const normal = _chunkO3V2MCOCcjs.transformSurfaceNormal.call(void 0, _chunkO3V2MCOCcjs.surfaceNormal.call(void 0, world[0], world[1], world[2]), _nullishCoalesce(_optionalChain([chart, 'access', _107 => _107.view3d, 'optionalAccess', _108 => _108.rotX]), () => ( 25)), _nullishCoalesce(_optionalChain([chart, 'access', _109 => _109.view3d, 'optionalAccess', _110 => _110.rotY]), () => ( 30)), _optionalChain([chart, 'access', _111 => _111.view3d, 'optionalAccess', _112 => _112.rAngAx]) !== false);
452
+ const shaded = colorToRgba(usesFlatMaterial ? left.bandColor : _chunkO3V2MCOCcjs.shadeSurfaceMatteColor.call(void 0, left.bandColor, normal), 1);
453
+ [left, middle, right].forEach((vertex) => {
454
+ const clip = toClipPoint(vertex.point);
455
+ fillPositions.push(clip.x, clip.y, clip.z);
456
+ fillColors.push(shaded[0], shaded[1], shaded[2], shaded[3]);
457
+ });
458
+ }
459
+ const linePositions = [];
460
+ const lineColors = [];
461
+ meshLines.forEach((line) => {
462
+ const from = toClipPoint(line.from);
463
+ const to = toClipPoint(line.to);
464
+ const rgba = colorToRgba(line.color, 1);
465
+ linePositions.push(from.x, from.y, from.z - 1e-5, to.x, to.y, to.z - 1e-5);
466
+ lineColors.push(rgba[0], rgba[1], rgba[2], rgba[3], rgba[0], rgba[1], rgba[2], rgba[3]);
467
+ });
468
+ contourLines.forEach((line) => {
469
+ const from = toClipPoint(line.from);
470
+ const to = toClipPoint(line.to);
471
+ const rgba = colorToRgba(line.color, 1);
472
+ linePositions.push(from.x, from.y, from.z - 1e-5, to.x, to.y, to.z - 1e-5);
473
+ lineColors.push(rgba[0], rgba[1], rgba[2], rgba[3], rgba[0], rgba[1], rgba[2], rgba[3]);
474
+ });
475
+ return {
476
+ fillColors: new Float32Array(fillColors),
477
+ fillPositions: new Float32Array(fillPositions),
478
+ lineColors: new Float32Array(lineColors),
479
+ linePositions: new Float32Array(linePositions),
480
+ wallColors: new Float32Array(wallColors),
481
+ wallPositions: new Float32Array(wallPositions)
482
+ };
483
+ }
484
+ var MemoSurfaceChartComposite = _chunkCJBI5F6Vcjs.N.call(void 0, function MemoSurfaceChartComposite2({
485
+ background,
486
+ borderColor,
487
+ chart,
488
+ fontFamily,
489
+ layout,
490
+ onDoubleClick,
491
+ onPointerDown,
492
+ overlay,
493
+ palette,
494
+ fallback
495
+ }) {
496
+ const canvasRef = _chunkCJBI5F6Vcjs.A.call(void 0, null);
497
+ const [ready, setReady] = _chunkCJBI5F6Vcjs.d.call(void 0, false);
498
+ const [failed, setFailed] = _chunkCJBI5F6Vcjs.d.call(void 0, false);
499
+ const isContour = isContourSurfaceChart(chart);
500
+ _chunkCJBI5F6Vcjs.h.call(void 0, () => {
501
+ if (isContour) {
502
+ setReady(false);
503
+ setFailed(false);
504
+ return;
505
+ }
506
+ const canvas = canvasRef.current;
507
+ if (!canvas) {
508
+ return;
509
+ }
510
+ let cancelled = false;
511
+ let reglInstance = null;
512
+ const drawSurface = () => {
513
+ try {
514
+ const scene = buildSurfaceMesh(chart, palette, layout);
515
+ if (!scene) {
516
+ if (!cancelled) {
517
+ setFailed(true);
518
+ setReady(false);
519
+ }
520
+ return;
521
+ }
522
+ const dpr = window.devicePixelRatio || 1;
523
+ canvas.width = Math.max(1, Math.round(layout.width * dpr));
524
+ canvas.height = Math.max(1, Math.round(layout.height * dpr));
525
+ reglInstance = _regl2.default.call(void 0, {
526
+ attributes: {
527
+ alpha: true,
528
+ antialias: true,
529
+ depth: true,
530
+ premultipliedAlpha: true
531
+ },
532
+ canvas
533
+ });
534
+ const fillCommand = scene.fillPositions.length > 0 ? reglInstance({
535
+ attributes: {
536
+ color: scene.fillColors,
537
+ position: scene.fillPositions
538
+ },
539
+ blend: {
540
+ enable: true,
541
+ func: {
542
+ dstRGB: "one minus src alpha",
543
+ dstAlpha: "one minus src alpha",
544
+ srcRGB: "src alpha",
545
+ srcAlpha: "src alpha"
546
+ }
547
+ },
548
+ count: scene.fillPositions.length / 3,
549
+ depth: {
550
+ enable: true
551
+ },
552
+ frag: `
553
+ precision mediump float;
554
+ varying vec4 vColor;
555
+ void main() {
556
+ gl_FragColor = vColor;
557
+ }
558
+ `,
559
+ primitive: "triangles",
560
+ vert: `
561
+ precision mediump float;
562
+ attribute vec3 position;
563
+ attribute vec4 color;
564
+ varying vec4 vColor;
565
+ void main() {
566
+ gl_Position = vec4(position, 1.0);
567
+ vColor = color;
568
+ }
569
+ `
570
+ }) : null;
571
+ const wallCommand = scene.wallPositions.length > 0 ? reglInstance({
572
+ attributes: {
573
+ color: scene.wallColors,
574
+ position: scene.wallPositions
575
+ },
576
+ blend: {
577
+ enable: true,
578
+ func: {
579
+ dstRGB: "one minus src alpha",
580
+ dstAlpha: "one minus src alpha",
581
+ srcRGB: "src alpha",
582
+ srcAlpha: "src alpha"
583
+ }
584
+ },
585
+ count: scene.wallPositions.length / 3,
586
+ depth: {
587
+ enable: true,
588
+ func: "lequal"
589
+ },
590
+ frag: `
591
+ precision mediump float;
592
+ varying vec4 vColor;
593
+ void main() {
594
+ gl_FragColor = vColor;
595
+ }
596
+ `,
597
+ primitive: "triangles",
598
+ vert: `
599
+ precision mediump float;
600
+ attribute vec3 position;
601
+ attribute vec4 color;
602
+ varying vec4 vColor;
603
+ void main() {
604
+ gl_Position = vec4(position, 1.0);
605
+ vColor = color;
606
+ }
607
+ `
608
+ }) : null;
609
+ const lineCommand = scene.linePositions.length > 0 ? reglInstance({
610
+ attributes: {
611
+ color: scene.lineColors,
612
+ position: scene.linePositions
613
+ },
614
+ blend: {
615
+ enable: true,
616
+ func: {
617
+ dstRGB: "one minus src alpha",
618
+ dstAlpha: "one minus src alpha",
619
+ srcRGB: "src alpha",
620
+ srcAlpha: "src alpha"
621
+ }
622
+ },
623
+ count: scene.linePositions.length / 3,
624
+ depth: {
625
+ enable: true,
626
+ func: "lequal"
627
+ },
628
+ frag: `
629
+ precision mediump float;
630
+ varying vec4 vColor;
631
+ void main() {
632
+ gl_FragColor = vColor;
633
+ }
634
+ `,
635
+ lineWidth: 1,
636
+ primitive: "lines",
637
+ vert: `
638
+ precision mediump float;
639
+ attribute vec3 position;
640
+ attribute vec4 color;
641
+ varying vec4 vColor;
642
+ void main() {
643
+ gl_Position = vec4(position, 1.0);
644
+ vColor = color;
645
+ }
646
+ `
647
+ }) : null;
648
+ reglInstance.clear({ color: [0, 0, 0, 0], depth: 1 });
649
+ _optionalChain([wallCommand, 'optionalCall', _113 => _113()]);
650
+ _optionalChain([fillCommand, 'optionalCall', _114 => _114()]);
651
+ _optionalChain([lineCommand, 'optionalCall', _115 => _115()]);
652
+ if (!cancelled) {
653
+ setReady(true);
654
+ setFailed(false);
655
+ }
656
+ } catch (e) {
657
+ if (!cancelled) {
658
+ setReady(false);
659
+ setFailed(true);
660
+ }
661
+ }
662
+ };
663
+ setReady(false);
664
+ setFailed(false);
665
+ drawSurface();
666
+ return () => {
667
+ cancelled = true;
668
+ _optionalChain([reglInstance, 'optionalAccess', _116 => _116.destroy, 'call', _117 => _117()]);
669
+ };
670
+ }, [
671
+ chart,
672
+ isContour,
673
+ layout,
674
+ palette
675
+ ]);
676
+ const shouldRenderFallback = isContour || failed || !ready;
677
+ return /* @__PURE__ */ _chunkCJBI5F6Vcjs.u.call(void 0,
678
+ "div",
679
+ {
680
+ "aria-label": _nullishCoalesce(_nullishCoalesce(chart.title, () => ( chart.name)), () => ( "Chart")),
681
+ role: "img",
682
+ style: {
683
+ background,
684
+ border: borderColor.trim().toLowerCase() === "transparent" ? "none" : `1px solid ${borderColor}`,
685
+ boxSizing: "border-box",
686
+ fontFamily,
687
+ height: "100%",
688
+ overflow: "hidden",
689
+ pointerEvents: "auto",
690
+ position: "relative",
691
+ width: "100%"
692
+ },
693
+ children: [
694
+ /* @__PURE__ */ _chunkCJBI5F6Vcjs.u.call(void 0,
695
+ "canvas",
696
+ {
697
+ ref: canvasRef,
698
+ style: {
699
+ display: shouldRenderFallback ? "none" : "block",
700
+ height: "100%",
701
+ inset: 0,
702
+ position: "absolute",
703
+ width: "100%"
704
+ }
705
+ }
706
+ ),
707
+ /* @__PURE__ */ _chunkCJBI5F6Vcjs.u.call(void 0,
708
+ "svg",
709
+ {
710
+ onDoubleClick,
711
+ onPointerDown,
712
+ style: { display: "block", height: "100%", inset: 0, position: "absolute", width: "100%" },
713
+ viewBox: `0 0 ${layout.width} ${layout.height}`,
714
+ children: [
715
+ shouldRenderFallback ? fallback : null,
716
+ overlay
717
+ ]
718
+ }
719
+ )
720
+ ]
721
+ }
722
+ );
723
+ }, (prev, next) => prev.chart === next.chart && prev.palette === next.palette && prev.background === next.background && prev.borderColor === next.borderColor && prev.fontFamily === next.fontFamily && prev.onDoubleClick === next.onDoubleClick && prev.onPointerDown === next.onPointerDown && prev.layout.width === next.layout.width && prev.layout.height === next.layout.height && prev.layout.plot.left === next.layout.plot.left && prev.layout.plot.top === next.layout.plot.top && prev.layout.plot.width === next.layout.plot.width && prev.layout.plot.height === next.layout.plot.height && prev.overlay === next.overlay && prev.fallback === next.fallback);
724
+
725
+
726
+ exports.MemoSurfaceChartComposite = MemoSurfaceChartComposite;
727
+ //# sourceMappingURL=surface-regl-AY7JZVYY.cjs.map