@extend-ai/react-xlsx 0.20.1 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chart-renderer-K2VM257E.cjs → chart-renderer-3QDNTMRN.cjs} +525 -603
- package/dist/chart-renderer-3QDNTMRN.cjs.map +1 -0
- package/dist/{chart-renderer-RXO7WP4Q.js → chart-renderer-7DTEXXG6.js} +19 -97
- package/dist/chart-renderer-7DTEXXG6.js.map +1 -0
- package/dist/{chart-renderer-KGLAI4DN.js → chart-renderer-F355CYSE.js} +13 -92
- package/dist/chart-renderer-F355CYSE.js.map +1 -0
- package/dist/{chart-renderer-K6GORT3R.cjs → chart-renderer-LGW4EH4M.cjs} +286 -365
- package/dist/chart-renderer-LGW4EH4M.cjs.map +1 -0
- package/dist/{chunk-WSQDFXDW.js → chunk-3LMOGW6A.js} +22 -6
- package/dist/chunk-3LMOGW6A.js.map +1 -0
- package/dist/chunk-A4S3AMON.js +108 -0
- package/dist/chunk-A4S3AMON.js.map +1 -0
- package/dist/chunk-AJT23BDP.js +111 -0
- package/dist/chunk-AJT23BDP.js.map +1 -0
- package/dist/{chunk-CJBI5F6V.cjs → chunk-AZWBTFJI.cjs} +12 -93
- package/dist/chunk-AZWBTFJI.cjs.map +1 -0
- package/dist/{chunk-54YBFWL3.cjs → chunk-D2UA4P6N.cjs} +14 -3
- package/dist/chunk-D2UA4P6N.cjs.map +1 -0
- package/dist/{chunk-GXJO6CK6.js → chunk-GXYDJPHM.js} +40 -12
- package/dist/chunk-GXYDJPHM.js.map +1 -0
- package/dist/chunk-IDNIGBUM.cjs +108 -0
- package/dist/chunk-IDNIGBUM.cjs.map +1 -0
- package/dist/{chunk-3JTCYAUX.js → chunk-IYGZTLDY.js} +14 -3
- package/dist/chunk-IYGZTLDY.js.map +1 -0
- package/dist/chunk-M55TBS4X.cjs +111 -0
- package/dist/chunk-M55TBS4X.cjs.map +1 -0
- package/dist/{chunk-2MVEKDY2.cjs → chunk-OCF75R75.cjs} +25 -9
- package/dist/chunk-OCF75R75.cjs.map +1 -0
- package/dist/{chunk-NBH72POD.js → chunk-PUI6QI4U.js} +11 -92
- package/dist/chunk-PUI6QI4U.js.map +1 -0
- package/dist/{chunk-HAHCVXCU.cjs → chunk-ZJ76CZAL.cjs} +787 -759
- package/dist/chunk-ZJ76CZAL.cjs.map +1 -0
- package/dist/index.cjs +22 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/{internal-trWFv9In.d.cts → internal-BJsg5os3.d.cts} +10 -0
- package/dist/{internal-trWFv9In.d.ts → internal-BJsg5os3.d.ts} +10 -0
- package/dist/internal.cjs +5 -4
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +4 -3
- package/dist/preact-LICENSE.txt +21 -0
- package/dist/region-map-geography-24TXETDP.cjs +184 -0
- package/dist/region-map-geography-24TXETDP.cjs.map +1 -0
- package/dist/region-map-geography-OR6DHAF7.js +182 -0
- package/dist/region-map-geography-OR6DHAF7.js.map +1 -0
- package/dist/shared-chart-3STFRVWT.js +215 -0
- package/dist/shared-chart-3STFRVWT.js.map +1 -0
- package/dist/shared-chart-BFQNYOIQ.js +221 -0
- package/dist/shared-chart-BFQNYOIQ.js.map +1 -0
- package/dist/shared-chart-DVC5S2P6.cjs +222 -0
- package/dist/shared-chart-DVC5S2P6.cjs.map +1 -0
- package/dist/shared-chart-MFQSQG4K.cjs +216 -0
- package/dist/shared-chart-MFQSQG4K.cjs.map +1 -0
- package/dist/{surface-regl-2NNG62KS.cjs → surface-regl-BBJ6OIKK.cjs} +14 -12
- package/dist/surface-regl-BBJ6OIKK.cjs.map +1 -0
- package/dist/{surface-regl-TJUWTLAZ.js → surface-regl-R2N54JT2.js} +7 -5
- package/dist/{surface-regl-TJUWTLAZ.js.map → surface-regl-R2N54JT2.js.map} +1 -1
- package/dist/us-atlas-LICENSE.txt +13 -0
- package/dist/vanilla.cjs +5 -4
- package/dist/vanilla.cjs.map +1 -1
- package/dist/vanilla.d.cts +2 -2
- package/dist/vanilla.d.ts +2 -2
- package/dist/vanilla.js +4 -3
- package/dist/world-atlas-LICENSE.txt +13 -0
- package/dist/xlsx-worker.js +15 -0
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +7 -6
- package/dist/chart-renderer-K2VM257E.cjs.map +0 -1
- package/dist/chart-renderer-K6GORT3R.cjs.map +0 -1
- package/dist/chart-renderer-KGLAI4DN.js.map +0 -1
- package/dist/chart-renderer-RXO7WP4Q.js.map +0 -1
- package/dist/chunk-2MVEKDY2.cjs.map +0 -1
- package/dist/chunk-3JTCYAUX.js.map +0 -1
- package/dist/chunk-54YBFWL3.cjs.map +0 -1
- package/dist/chunk-CJBI5F6V.cjs.map +0 -1
- package/dist/chunk-GXJO6CK6.js.map +0 -1
- package/dist/chunk-HAHCVXCU.cjs.map +0 -1
- package/dist/chunk-NBH72POD.js.map +0 -1
- package/dist/chunk-WSQDFXDW.js.map +0 -1
- package/dist/region-map-geography-VEN5CPRS.cjs +0 -184
- package/dist/region-map-geography-VEN5CPRS.cjs.map +0 -1
- package/dist/region-map-geography-YD54DI3H.js +0 -182
- package/dist/region-map-geography-YD54DI3H.js.map +0 -1
- package/dist/surface-regl-2NNG62KS.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/react-xlsx/react-xlsx/packages/react-xlsx/dist/surface-regl-2NNG62KS.cjs","../src/surface-regl.tsx"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACrBA,wEAAuB;AAyEvB,SAAS,KAAA,CAAM,KAAA,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AACM,MAAA;AACU,QAAA;AACA,UAAA;AACA,UAAA;AAChB,QAAA;AACF,MAAA;AACF,IAAA;AAEc,IAAA;AACC,IAAA;AACH,IAAA;AAEC,IAAA;AACC,MAAA;AACU,sBAAA;AACxB,IAAA;AACC,EAAA;AACD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACD,EAAA;AAEoD,EAAA;AAGnD,EAAA;AAAC,IAAA;AAAA,IAAA;AAC0C,MAAA;AACpC,MAAA;AACE,MAAA;AACL,QAAA;AAC6D,QAAA;AAClD,QAAA;AACX,QAAA;AACQ,QAAA;AACE,QAAA;AACK,QAAA;AACL,QAAA;AACH,QAAA;AACT,MAAA;AAEA,MAAA;AAAA,wBAAA;AAAC,UAAA;AAAA,UAAA;AACM,YAAA;AACE,YAAA;AACoC,cAAA;AACjC,cAAA;AACD,cAAA;AACG,cAAA;AACH,cAAA;AACT,YAAA;AAAA,UAAA;AACF,QAAA;AACA,wBAAA;AAAC,UAAA;AAAA,UAAA;AACC,YAAA;AACA,YAAA;AACqD,YAAA;AACR,YAAA;AAE5C,YAAA;AAAkC,cAAA;AAClC,cAAA;AAAA,YAAA;AAAA,UAAA;AACH,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAIuB;AD9I+C;AACA;AACA","file":"/home/runner/work/react-xlsx/react-xlsx/packages/react-xlsx/dist/surface-regl-2NNG62KS.cjs","sourcesContent":[null,"import { getBuiltinChartColor, getBuiltinChartSurfaceLine, resolveBuiltinChartColor } from \"./builtin-chart-styles\";\nimport createREGL from \"regl\";\nimport * as React from \"react\";\nimport { shadeSurfaceMatteColor, surfaceNormal, transformSurfaceNormal } from \"./surface-lighting\";\nimport { clipSurfaceBand, groupSurfaceBandEdges, normalizeSurfaceValue, surfaceDataRatios, triangulateSurfaceQuad } from \"./surface-geometry\";\nimport type { XlsxChart } from \"./types\";\n\ntype SurfacePalette = {\n border: string;\n mutedText: string;\n surface: string;\n text: string;\n};\n\ntype SurfaceLayout = {\n height: number;\n plot: {\n height: number;\n left: number;\n top: number;\n width: number;\n };\n width: number;\n};\n\ntype SurfaceCompositeProps = {\n background: string;\n borderColor: string;\n chart: XlsxChart;\n fontFamily: string;\n layout: SurfaceLayout;\n onDoubleClick?: React.MouseEventHandler<SVGSVGElement>;\n onPointerDown?: React.PointerEventHandler<SVGSVGElement>;\n overlay: React.ReactNode;\n palette: SurfacePalette;\n fallback: React.ReactNode;\n};\n\ntype SurfaceDomain = {\n maxValue: number;\n minValue: number;\n safeMax: number;\n ticks: number[];\n};\n\ntype SurfacePoint3D = {\n depth: number;\n worldX: number;\n worldY: number;\n worldZ: number;\n x: number;\n y: number;\n};\n\ntype SurfaceVertex = {\n bandColor: string;\n point: SurfacePoint3D;\n value: number;\n};\n\ntype SolidSurfaceTriangle = {\n color: string;\n points: [SurfacePoint3D, SurfacePoint3D, SurfacePoint3D];\n};\n\ntype SurfaceScene = {\n fillColors: Float32Array;\n fillPositions: Float32Array;\n lineColors: Float32Array;\n linePositions: Float32Array;\n wallColors: Float32Array;\n wallPositions: Float32Array;\n};\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction safeNumber(value: unknown) {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === \"string\") {\n const normalized = value.trim().replace(/,/g, \"\");\n if (!normalized) {\n return null;\n }\n const parsed = Number(normalized);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n}\n\nfunction parseRgbColor(color: string) {\n const match = /^#?([0-9a-f]{6})$/i.exec(color);\n if (!match) {\n return null;\n }\n return {\n blue: Number.parseInt(match[1].slice(4, 6), 16),\n green: Number.parseInt(match[1].slice(2, 4), 16),\n red: Number.parseInt(match[1].slice(0, 2), 16)\n };\n}\n\nfunction mixRgbColor(color: string, mixWith: string, ratio: number) {\n const base = parseRgbColor(color);\n const target = parseRgbColor(mixWith);\n if (!base || !target) {\n return color;\n }\n const clamped = clamp(ratio, 0, 1);\n const mixChannel = (left: number, right: number) => Math.round(left + (right - left) * clamped);\n return `#${[\n mixChannel(base.red, target.red),\n mixChannel(base.green, target.green),\n mixChannel(base.blue, target.blue)\n ].map((value) => value.toString(16).padStart(2, \"0\")).join(\"\")}`;\n}\n\nfunction lightenColor(color: string, ratio: number) {\n return mixRgbColor(color, \"#ffffff\", ratio);\n}\n\nfunction darkenColor(color: string, ratio: number) {\n return mixRgbColor(color, \"#000000\", ratio);\n}\n\nfunction resolveSurfaceBaseColor(chart: XlsxChart, palette: Pick<SurfacePalette, \"text\">) {\n return chart.chartColorPalette?.[0]\n ?? chart.series[0]?.color\n ?? chart.series[0]?.lineColor\n ?? chart.axisLineColor\n ?? chart.textColor\n ?? palette.text;\n}\n\nfunction normalizeSurfaceRendererHexColor(value: unknown) {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n if (!trimmed) {\n return null;\n }\n const normalized = trimmed.startsWith(\"#\") ? trimmed.slice(1) : trimmed;\n return /^[0-9a-f]{6}$/i.test(normalized) ? `#${normalized.toLowerCase()}` : null;\n}\n\nfunction resolveExplicitSurfaceSeriesColor(chart: XlsxChart, kind: \"fill\" | \"line\") {\n const shape = chart.series[0]?.shapeProperties;\n if (kind === \"fill\" ? shape?.xmlFillHidden === true : shape?.xmlLineHidden === true) return \"transparent\";\n const color = kind === \"fill\"\n ? shape?.xmlFillColor ?? shape?.solidFillHex\n : shape?.xmlLineColor ?? shape?.lineColorHex;\n return normalizeSurfaceRendererHexColor(color);\n}\n\nfunction getSurfaceColorStops(chart: XlsxChart, palette: SurfacePalette) {\n const explicitFill = resolveExplicitSurfaceSeriesColor(chart, \"fill\");\n if (explicitFill) return [explicitFill];\n const colors = (chart.chartColorPalette ?? []).filter((value): value is string => typeof value === \"string\" && value.length > 0);\n return colors.length > 0 ? colors : [resolveSurfaceBaseColor(chart, palette)];\n}\n\nfunction getSurfaceDomain(chart: XlsxChart): SurfaceDomain | null {\n const numericValues = chart.series.flatMap((series) => (\n series.values\n .map((value) => safeNumber(value))\n .filter((value): value is number => value != null)\n ));\n if (numericValues.length === 0) {\n return null;\n }\n const explicitMin = typeof chart.valueAxis?.min === \"number\" && Number.isFinite(chart.valueAxis.min)\n ? chart.valueAxis.min\n : null;\n const explicitMax = typeof chart.valueAxis?.max === \"number\" && Number.isFinite(chart.valueAxis.max)\n ? chart.valueAxis.max\n : null;\n const rawMin = Math.min(...numericValues);\n const rawMax = Math.max(...numericValues);\n const spanBase = Math.max(1e-6, rawMax - Math.min(0, rawMin));\n const roughStep = spanBase / 5;\n const magnitude = Math.pow(10, Math.floor(Math.log10(Math.max(roughStep, 1e-6))));\n const normalized = roughStep / magnitude;\n const niceStep = normalized <= 1 ? 1 : normalized <= 2 ? 2 : normalized <= 5 ? 5 : 10;\n const step = typeof chart.valueAxis?.majorUnit === \"number\" && chart.valueAxis.majorUnit > 0\n ? chart.valueAxis.majorUnit\n : niceStep * magnitude;\n const minValue = explicitMin ?? (rawMin >= 0 ? 0 : Math.floor(rawMin / step) * step);\n const maxValue = explicitMax ?? Math.ceil(rawMax / step) * step;\n const safeMax = maxValue <= minValue ? minValue + step : maxValue;\n const ticks: number[] = [];\n for (let current = minValue; current <= safeMax + step * 0.001; current += step) {\n ticks.push(Number(current.toFixed(8)));\n }\n const boundedTicks = [...new Set([...ticks.filter((tick) => tick < safeMax), safeMax])];\n return {\n maxValue,\n minValue,\n safeMax,\n ticks: boundedTicks.length >= 2 ? boundedTicks : [minValue, safeMax]\n };\n}\n\nfunction resolveSurfaceBandPaletteColor(chart: XlsxChart, palette: SurfacePalette, domain: SurfaceDomain, value: number) {\n const bandIndex = resolveSurfaceBandIndex(domain, value);\n const explicitColor = resolveSurfaceBandFormatColor(chart, \"bandFormatColors\", bandIndex);\n if (explicitColor) return explicitColor;\n const explicitFill = resolveExplicitSurfaceSeriesColor(chart, \"fill\");\n if (explicitFill) return explicitFill;\n const themeColors = chart.raw?.builtinThemeColors as Record<number, string> | undefined;\n const paletteCount = Math.trunc((domain.safeMax - domain.minValue) / (domain.ticks[1] - domain.ticks[0])) + 1;\n const builtinColor = themeColors ? resolveBuiltinChartColor(getBuiltinChartColor(chart.chartStyleId, bandIndex % paletteCount, paletteCount), themeColors) : undefined;\n if (builtinColor) return builtinColor;\n const stops = getSurfaceColorStops(chart, palette);\n if (stops.length === 0) {\n return resolveSurfaceBaseColor(chart, palette);\n }\n return stops[Math.min(stops.length - 1, Math.max(0, bandIndex))] ?? stops[stops.length - 1] ?? resolveSurfaceBaseColor(chart, palette);\n}\n\nfunction resolveSurfaceBandIndex(domain: SurfaceDomain, value: number) {\n const ticks = domain.ticks;\n for (let index = 0; index < ticks.length - 1; index += 1) {\n const end = ticks[index + 1] ?? domain.safeMax;\n if (value <= end || index === ticks.length - 2) {\n return index;\n }\n }\n return Math.max(0, ticks.length - 2);\n}\n\nfunction resolveSurfaceBandColor(chart: XlsxChart, palette: SurfacePalette, domain: SurfaceDomain, value: number) {\n return resolveSurfaceBandPaletteColor(chart, palette, domain, value);\n}\n\nfunction resolveSurfaceBandFormatColor(chart: XlsxChart, key: \"bandFormatColors\" | \"bandFormatLineColors\", index: number) {\n const colors = chart.raw?.[key];\n if (!colors || typeof colors !== \"object\" || !Object.prototype.hasOwnProperty.call(colors, index)) return null;\n const color = (colors as Record<number, unknown>)[index];\n return typeof color === \"string\" && color.length > 0 ? color : null;\n}\n\nfunction resolveSurfaceWireframeColor(chart: XlsxChart, palette: SurfacePalette, domain: SurfaceDomain, value: number) {\n const bandIndex = resolveSurfaceBandIndex(domain, value);\n const themeColors = chart.raw?.builtinThemeColors as Record<number, string> | undefined;\n const paletteCount = Math.trunc((domain.safeMax - domain.minValue) / (domain.ticks[1] - domain.ticks[0])) + 1;\n const builtinLine = themeColors ? resolveBuiltinChartColor(getBuiltinChartSurfaceLine(chart.chartStyleId, bandIndex, paletteCount), themeColors) : undefined;\n return resolveSurfaceBandFormatColor(chart, \"bandFormatLineColors\", bandIndex)\n ?? resolveExplicitSurfaceSeriesColor(chart, \"line\")\n ?? builtinLine\n ?? resolveSurfaceBandPaletteColor(chart, palette, domain, value);\n}\n\nfunction colorToRgba(color: string, alpha = 1) {\n if (color === \"transparent\") return [0, 0, 0, 0] as const;\n const rgb = parseRgbColor(color);\n if (!rgb) {\n return [0.1, 0.1, 0.1, alpha] as const;\n }\n return [rgb.red / 255, rgb.green / 255, rgb.blue / 255, alpha] as const;\n}\n\nfunction normalizeSurfaceX(column: number, cols: number) {\n return cols <= 1 ? 0 : ((column / (cols - 1)) - 0.5) * 2;\n}\n\nfunction normalizeSurfaceY(row: number, rows: number) {\n return rows <= 1 ? 0 : ((row / (rows - 1)) - 0.5) * 2;\n}\n\nfunction normalizeSurfaceZ(value: number, domain: SurfaceDomain, heightExtent: number, axis?: XlsxChart[\"valueAxis\"]) {\n return -(normalizeSurfaceValue(value, domain.minValue, domain.safeMax, axis) - 0.5) * heightExtent;\n}\n\nfunction projectCartesian3dPoint(\n x: number,\n y: number,\n z: number,\n rotXRad: number,\n rotYRad: number,\n usePerspective: boolean,\n perspectiveStrength: number,\n rightAngleAxes: boolean\n) {\n if (rightAngleAxes) {\n return { depth: z, x: x + z * Math.sin(rotYRad), y: y - z * Math.sin(rotXRad) };\n }\n const cosX = Math.cos(rotXRad);\n const sinX = Math.sin(rotXRad);\n const cosY = Math.cos(rotYRad);\n const sinY = Math.sin(rotYRad);\n const x1 = x * cosY + z * sinY;\n const z1 = -x * sinY + z * cosY;\n const y1 = y * cosX - z1 * sinX;\n const z2 = y * sinX + z1 * cosX;\n const perspective = usePerspective\n ? 1 / Math.max(0.18, 1 + z2 * (0.24 + perspectiveStrength * 0.5))\n : 1;\n return {\n depth: z2,\n x: x1 * perspective,\n y: y1 * perspective\n };\n}\n\nfunction withProjectedDepth(point: SurfacePoint3D, depth: number): SurfacePoint3D {\n return {\n ...point,\n depth\n };\n}\n\nfunction nudgeProjectedDepth(point: SurfacePoint3D, delta: number): SurfacePoint3D {\n return {\n ...point,\n depth: point.depth + delta\n };\n}\n\nfunction isContourSurfaceChart(chart: XlsxChart) {\n const rawChartType = chart.raw && typeof chart.raw === \"object\" && typeof chart.raw.xmlChartType === \"string\"\n ? chart.raw.xmlChartType\n : \"\";\n if (rawChartType === \"surfaceChart\") {\n return true;\n }\n if (rawChartType === \"surface3DChart\") {\n return false;\n }\n return chart.chartType === \"Surface\" && chart.is3d !== true;\n}\n\nfunction buildSurfaceMesh(chart: XlsxChart, palette: SurfacePalette, layout: SurfaceLayout): SurfaceScene | null {\n const rows = chart.series.length;\n const cols = chart.series.reduce((max, series) => Math.max(max, series.values.length), 0);\n if (rows < 2 || cols < 2) {\n return null;\n }\n const matrix = chart.series.map((series) => (\n Array.from({ length: cols }, (_, columnIndex) => safeNumber(series.values[columnIndex]))\n ));\n const domain = getSurfaceDomain(chart);\n if (!domain) {\n return null;\n }\n const isContour = isContourSurfaceChart(chart);\n const isWireframe = chart.wireframe === true;\n const fillVertices: SurfaceVertex[] = [];\n const wallTriangles: SolidSurfaceTriangle[] = [];\n const contourLines: Array<{ color: string; from: SurfacePoint3D; to: SurfacePoint3D }> = [];\n const meshLines: Array<{ color: string; from: SurfacePoint3D; to: SurfacePoint3D }> = [];\n const rotX = (chart.view3d?.rotX ?? 25) * (Math.PI / 180);\n const rotY = (chart.view3d?.rotY ?? 30) * (Math.PI / 180);\n const usePerspective = !isContour && chart.view3d?.rAngAx === false;\n const perspectiveStrength = clamp((chart.view3d?.perspective ?? (usePerspective ? 30 : 0)) / 100, 0, 1);\n const ratios = surfaceDataRatios(rows, cols, chart.valueAxis?.crossBetween !== \"midCat\", chart.view3d?.heightPercent, chart.view3d?.depthPercent, layout);\n const depthScale = ratios.depth;\n const heightExtent = 2 * ratios.height;\n const usesFlatMaterial = chart.surfaceMaterial === \"flat\";\n const wallLineColor = chart.valueAxis?.majorGridlineColor ?? chart.backWall?.lineColor ?? chart.sideWall?.lineColor ?? chart.floor?.lineColor ?? chart.axisLineColor ?? \"#a6a6a6\";\n const backWallFill = chart.backWall?.fillColor ?? \"#d9d9df\";\n const sideWallFill = chart.sideWall?.fillColor ?? \"#d5d7dc\";\n const floorFill = chart.floor?.fillColor ?? \"#d0d2d8\";\n const projectPoint = (column: number, row: number, value: number): SurfacePoint3D => {\n const worldX = normalizeSurfaceX(column, cols);\n if (isContour) {\n return {\n depth: 0,\n worldX,\n worldY: normalizeSurfaceY(row, rows),\n worldZ: 0,\n x: worldX,\n y: normalizeSurfaceY(row, rows)\n };\n }\n const worldY = normalizeSurfaceZ(value, domain, heightExtent, chart.valueAxis);\n const worldZ = normalizeSurfaceY(row, rows) * depthScale;\n const projected = projectCartesian3dPoint(worldX, worldY, worldZ, rotX, rotY, usePerspective, perspectiveStrength, chart.view3d?.rAngAx !== false);\n return {\n depth: projected.depth,\n worldX,\n worldY,\n worldZ,\n x: projected.x,\n y: projected.y\n };\n };\n const addWallQuad = (a: SurfacePoint3D, b: SurfacePoint3D, c: SurfacePoint3D, d: SurfacePoint3D, color: string) => {\n wallTriangles.push(\n { color, points: [a, b, c] },\n { color, points: [a, c, d] }\n );\n };\n const addMeshLine = (from: SurfacePoint3D, to: SurfacePoint3D, color: string) => {\n meshLines.push({ color, from, to });\n };\n\n for (let rowIndex = 0; rowIndex < rows - 1; rowIndex += 1) {\n for (let columnIndex = 0; columnIndex < cols - 1; columnIndex += 1) {\n const p00 = matrix[rowIndex]?.[columnIndex];\n const p10 = matrix[rowIndex]?.[columnIndex + 1];\n const p01 = matrix[rowIndex + 1]?.[columnIndex];\n const p11 = matrix[rowIndex + 1]?.[columnIndex + 1];\n if (p00 == null || p10 == null || p01 == null || p11 == null) {\n continue;\n }\n const triangles = triangulateSurfaceQuad([\n { value: p00, x: columnIndex, y: rowIndex },\n { value: p10, x: columnIndex + 1, y: rowIndex },\n { value: p11, x: columnIndex + 1, y: rowIndex + 1 },\n { value: p01, x: columnIndex, y: rowIndex + 1 }\n ], chart.valueAxis);\n for (const triangle of triangles) {\n for (let band = 0; band < domain.ticks.length - 1; band += 1) {\n const lower = domain.ticks[band];\n const upper = domain.ticks[band + 1];\n const polygon = clipSurfaceBand(clipSurfaceBand(triangle, lower, true, chart.valueAxis, band === 0), upper, false, chart.valueAxis);\n if (polygon.length < 3) continue;\n const bandColor = resolveSurfaceBandColor(chart, palette, domain, (lower + upper) / 2);\n if (!isWireframe && bandColor !== \"transparent\") {\n for (let index = 1; index < polygon.length - 1; index += 1) {\n for (const vertex of [polygon[0], polygon[index], polygon[index + 1]]) {\n const point = projectPoint(vertex.x, vertex.y, vertex.value);\n fillVertices.push({ bandColor, point: isContour ? withProjectedDepth(point, 0.08) : point, value: vertex.value });\n }\n }\n }\n for (const group of groupSurfaceBandEdges(polygon, triangle, band, lower, isWireframe)) {\n const edgeMidpoint = (domain.ticks[group.band] + domain.ticks[group.band + 1]) / 2;\n const color = resolveSurfaceWireframeColor(chart, palette, domain, edgeMidpoint);\n if (color !== \"transparent\") {\n for (const [from, to] of group.edges) {\n contourLines.push({ color, from: projectPoint(from.x, from.y, from.value), to: projectPoint(to.x, to.y, to.value) });\n }\n }\n }\n }\n }\n }\n }\n\n const columnSkip = Math.max(1, chart.categoryAxis?.tickMarkSkip ?? 1);\n const rowSkip = Math.max(1, chart.seriesAxis?.tickMarkSkip ?? 1);\n if (isContour) {\n const topLeft = withProjectedDepth(projectPoint(0, 0, domain.minValue), -0.12);\n const topRight = withProjectedDepth(projectPoint(cols - 1, 0, domain.minValue), -0.12);\n const bottomRight = withProjectedDepth(projectPoint(cols - 1, rows - 1, domain.minValue), -0.12);\n const bottomLeft = withProjectedDepth(projectPoint(0, rows - 1, domain.minValue), -0.12);\n if (chart.backWall?.hidden !== true && backWallFill !== \"transparent\") {\n addWallQuad(topLeft, topRight, bottomRight, bottomLeft, backWallFill);\n }\n for (let columnIndex = 0; columnIndex < cols; columnIndex += columnSkip) {\n addMeshLine(\n withProjectedDepth(projectPoint(columnIndex, 0, domain.minValue), 0.04),\n withProjectedDepth(projectPoint(columnIndex, rows - 1, domain.minValue), 0.04),\n wallLineColor\n );\n }\n for (let rowIndex = 0; rowIndex < rows; rowIndex += rowSkip) {\n addMeshLine(\n withProjectedDepth(projectPoint(0, rowIndex, domain.minValue), 0.04),\n withProjectedDepth(projectPoint(cols - 1, rowIndex, domain.minValue), 0.04),\n wallLineColor\n );\n }\n } else {\n const minPlaneValue = domain.minValue;\n const wallDepthOffset = 0;\n const backRow = chart.view3d?.rAngAx !== false || Math.cos(rotX) * Math.cos(rotY) >= 0 ? rows - 1 : 0;\n const sideColumn = Math.sin(rotY) >= 0 ? 0 : cols - 1;\n if (chart.floor?.hidden !== true && floorFill !== \"transparent\") {\n addWallQuad(\n nudgeProjectedDepth(projectPoint(0, 0, minPlaneValue), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(cols - 1, 0, minPlaneValue), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(cols - 1, rows - 1, minPlaneValue), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(0, rows - 1, minPlaneValue), wallDepthOffset),\n floorFill\n );\n }\n if (chart.backWall?.hidden !== true && backWallFill !== \"transparent\") {\n addWallQuad(\n nudgeProjectedDepth(projectPoint(0, backRow, domain.safeMax), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(cols - 1, backRow, domain.safeMax), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(cols - 1, backRow, minPlaneValue), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(0, backRow, minPlaneValue), wallDepthOffset),\n backWallFill\n );\n }\n if (chart.sideWall?.hidden !== true && sideWallFill !== \"transparent\") {\n addWallQuad(\n nudgeProjectedDepth(projectPoint(sideColumn, 0, domain.safeMax), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, domain.safeMax), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, minPlaneValue), wallDepthOffset),\n nudgeProjectedDepth(projectPoint(sideColumn, 0, minPlaneValue), wallDepthOffset),\n sideWallFill\n );\n }\n for (const tick of chart.valueAxis?.majorGridlines ? domain.ticks : []) {\n if (chart.backWall?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(0, backRow, tick), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(cols - 1, backRow, tick), wallDepthOffset * 0.75), wallLineColor);\n }\n if (chart.sideWall?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(sideColumn, 0, tick), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(sideColumn, rows - 1, tick), wallDepthOffset * 0.75), wallLineColor);\n }\n }\n for (let columnIndex = 0; chart.categoryAxis?.majorGridlines && columnIndex < cols; columnIndex += columnSkip) {\n if (chart.floor?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(columnIndex, 0, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(columnIndex, rows - 1, minPlaneValue), wallDepthOffset * 0.75), wallLineColor);\n }\n if (chart.backWall?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(columnIndex, backRow, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(columnIndex, backRow, domain.safeMax), wallDepthOffset * 0.75), wallLineColor);\n }\n }\n for (let rowIndex = 0; chart.seriesAxis?.majorGridlines && rowIndex < rows; rowIndex += rowSkip) {\n if (chart.floor?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(0, rowIndex, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(cols - 1, rowIndex, minPlaneValue), wallDepthOffset * 0.75), wallLineColor);\n }\n if (chart.sideWall?.hidden !== true && wallLineColor !== \"transparent\") {\n addMeshLine(nudgeProjectedDepth(projectPoint(sideColumn, rowIndex, minPlaneValue), wallDepthOffset * 0.75), nudgeProjectedDepth(projectPoint(sideColumn, rowIndex, domain.safeMax), wallDepthOffset * 0.75), wallLineColor);\n }\n }\n }\n\n const allPoints = [\n ...fillVertices.map((vertex) => vertex.point),\n ...wallTriangles.flatMap((triangle) => triangle.points),\n ...meshLines.flatMap((line) => [line.from, line.to]),\n ...contourLines.flatMap((line) => [line.from, line.to])\n ];\n if (allPoints.length === 0) {\n return null;\n }\n\n const minX = Math.min(...allPoints.map((point) => point.x));\n const maxX = Math.max(...allPoints.map((point) => point.x));\n const minY = Math.min(...allPoints.map((point) => point.y));\n const maxY = Math.max(...allPoints.map((point) => point.y));\n const minDepth = Math.min(...allPoints.map((point) => point.depth));\n const maxDepth = Math.max(...allPoints.map((point) => point.depth));\n const scale = Math.min(\n layout.plot.width / Math.max(0.25, maxX - minX),\n layout.plot.height / Math.max(0.25, maxY - minY)\n );\n const centerX = layout.plot.left + layout.plot.width / 2;\n const centerY = layout.plot.top + layout.plot.height / 2;\n const centerRawX = (minX + maxX) / 2;\n const centerRawY = (minY + maxY) / 2;\n const toScreenX = (x: number) => centerX + (x - centerRawX) * scale;\n const toScreenY = (y: number) => centerY + (y - centerRawY) * scale;\n const toClipPoint = (point: SurfacePoint3D) => {\n const screenX = toScreenX(point.x);\n const screenY = toScreenY(point.y);\n return {\n x: (screenX / layout.width) * 2 - 1,\n y: 1 - (screenY / layout.height) * 2,\n z: clamp(((point.depth - minDepth) / Math.max(1e-6, maxDepth - minDepth)) * 2 - 1, -1, 1)\n };\n };\n\n const fillPositions: number[] = [];\n const fillColors: number[] = [];\n const wallPositions: number[] = [];\n const wallColors: number[] = [];\n for (const triangle of wallTriangles) {\n const world = triangle.points.map(point => ({ x: point.worldX, y: point.worldY, z: -point.worldZ }));\n const normal = transformSurfaceNormal(surfaceNormal(world[0], world[1], world[2]), chart.view3d?.rotX ?? 25, chart.view3d?.rotY ?? 30, chart.view3d?.rAngAx !== false);\n const rgba = colorToRgba(usesFlatMaterial ? triangle.color : shadeSurfaceMatteColor(triangle.color, normal), 1);\n for (const point of triangle.points) {\n const clip = toClipPoint(point);\n wallPositions.push(clip.x, clip.y, clip.z);\n wallColors.push(rgba[0], rgba[1], rgba[2], rgba[3]);\n }\n }\n for (let index = 0; index < fillVertices.length; index += 3) {\n const left = fillVertices[index];\n const middle = fillVertices[index + 1];\n const right = fillVertices[index + 2];\n if (!left || !middle || !right) {\n continue;\n }\n const world = [left, middle, right].map(vertex => ({ x: vertex.point.worldX, y: vertex.point.worldY, z: -vertex.point.worldZ }));\n const normal = transformSurfaceNormal(surfaceNormal(world[0], world[1], world[2]), chart.view3d?.rotX ?? 25, chart.view3d?.rotY ?? 30, chart.view3d?.rAngAx !== false);\n const shaded = colorToRgba(usesFlatMaterial ? left.bandColor : shadeSurfaceMatteColor(left.bandColor, normal), 1);\n [left, middle, right].forEach((vertex) => {\n const clip = toClipPoint(vertex.point);\n fillPositions.push(clip.x, clip.y, clip.z);\n fillColors.push(shaded[0], shaded[1], shaded[2], shaded[3]);\n });\n }\n\n const linePositions: number[] = [];\n const lineColors: number[] = [];\n meshLines.forEach((line) => {\n const from = toClipPoint(line.from);\n const to = toClipPoint(line.to);\n const rgba = colorToRgba(line.color, 1);\n linePositions.push(from.x, from.y, from.z - 0.00001, to.x, to.y, to.z - 0.00001);\n lineColors.push(rgba[0], rgba[1], rgba[2], rgba[3], rgba[0], rgba[1], rgba[2], rgba[3]);\n });\n contourLines.forEach((line) => {\n const from = toClipPoint(line.from);\n const to = toClipPoint(line.to);\n const rgba = colorToRgba(line.color, 1);\n linePositions.push(from.x, from.y, from.z - 0.00001, to.x, to.y, to.z - 0.00001);\n lineColors.push(rgba[0], rgba[1], rgba[2], rgba[3], rgba[0], rgba[1], rgba[2], rgba[3]);\n });\n\n return {\n fillColors: new Float32Array(fillColors),\n fillPositions: new Float32Array(fillPositions),\n lineColors: new Float32Array(lineColors),\n linePositions: new Float32Array(linePositions),\n wallColors: new Float32Array(wallColors),\n wallPositions: new Float32Array(wallPositions)\n };\n}\n\nexport const MemoSurfaceChartComposite = React.memo(function MemoSurfaceChartComposite({\n background,\n borderColor,\n chart,\n fontFamily,\n layout,\n onDoubleClick,\n onPointerDown,\n overlay,\n palette,\n fallback\n}: SurfaceCompositeProps) {\n const canvasRef = React.useRef<HTMLCanvasElement | null>(null);\n const [ready, setReady] = React.useState(false);\n const [failed, setFailed] = React.useState(false);\n const isContour = isContourSurfaceChart(chart);\n\n React.useEffect(() => {\n if (isContour) {\n setReady(false);\n setFailed(false);\n return;\n }\n const canvas = canvasRef.current;\n if (!canvas) {\n return;\n }\n let cancelled = false;\n let reglInstance: ReturnType<typeof createREGL> | null = null;\n\n const drawSurface = () => {\n try {\n const scene = buildSurfaceMesh(chart, palette, layout);\n if (!scene) {\n if (!cancelled) {\n setFailed(true);\n setReady(false);\n }\n return;\n }\n const dpr = window.devicePixelRatio || 1;\n canvas.width = Math.max(1, Math.round(layout.width * dpr));\n canvas.height = Math.max(1, Math.round(layout.height * dpr));\n reglInstance = createREGL({\n attributes: {\n alpha: true,\n antialias: true,\n depth: true,\n premultipliedAlpha: true\n },\n canvas\n });\n const fillCommand = scene.fillPositions.length > 0\n ? reglInstance({\n attributes: {\n color: scene.fillColors,\n position: scene.fillPositions\n },\n blend: {\n enable: true,\n func: {\n dstRGB: \"one minus src alpha\",\n dstAlpha: \"one minus src alpha\",\n srcRGB: \"src alpha\",\n srcAlpha: \"src alpha\"\n }\n },\n count: scene.fillPositions.length / 3,\n depth: {\n enable: true\n },\n frag: `\n precision mediump float;\n varying vec4 vColor;\n void main() {\n gl_FragColor = vColor;\n }\n `,\n primitive: \"triangles\",\n vert: `\n precision mediump float;\n attribute vec3 position;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(position, 1.0);\n vColor = color;\n }\n `\n })\n : null;\n const wallCommand = scene.wallPositions.length > 0\n ? reglInstance({\n attributes: {\n color: scene.wallColors,\n position: scene.wallPositions\n },\n blend: {\n enable: true,\n func: {\n dstRGB: \"one minus src alpha\",\n dstAlpha: \"one minus src alpha\",\n srcRGB: \"src alpha\",\n srcAlpha: \"src alpha\"\n }\n },\n count: scene.wallPositions.length / 3,\n depth: {\n enable: true,\n func: \"lequal\"\n },\n frag: `\n precision mediump float;\n varying vec4 vColor;\n void main() {\n gl_FragColor = vColor;\n }\n `,\n primitive: \"triangles\",\n vert: `\n precision mediump float;\n attribute vec3 position;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(position, 1.0);\n vColor = color;\n }\n `\n })\n : null;\n const lineCommand = scene.linePositions.length > 0\n ? reglInstance({\n attributes: {\n color: scene.lineColors,\n position: scene.linePositions\n },\n blend: {\n enable: true,\n func: {\n dstRGB: \"one minus src alpha\",\n dstAlpha: \"one minus src alpha\",\n srcRGB: \"src alpha\",\n srcAlpha: \"src alpha\"\n }\n },\n count: scene.linePositions.length / 3,\n depth: {\n enable: true,\n func: \"lequal\"\n },\n frag: `\n precision mediump float;\n varying vec4 vColor;\n void main() {\n gl_FragColor = vColor;\n }\n `,\n lineWidth: 1,\n primitive: \"lines\",\n vert: `\n precision mediump float;\n attribute vec3 position;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(position, 1.0);\n vColor = color;\n }\n `\n })\n : null;\n\n reglInstance.clear({ color: [0, 0, 0, 0], depth: 1 });\n wallCommand?.();\n fillCommand?.();\n lineCommand?.();\n if (!cancelled) {\n setReady(true);\n setFailed(false);\n }\n } catch {\n if (!cancelled) {\n setReady(false);\n setFailed(true);\n }\n }\n };\n\n setReady(false);\n setFailed(false);\n drawSurface();\n\n return () => {\n cancelled = true;\n reglInstance?.destroy();\n };\n }, [\n chart,\n isContour,\n layout,\n palette\n ]);\n\n const shouldRenderFallback = isContour || failed || !ready;\n\n return (\n <div\n aria-label={chart.title ?? chart.name ?? \"Chart\"}\n role=\"img\"\n style={{\n background,\n border: borderColor.trim().toLowerCase() === \"transparent\" ? \"none\" : `1px solid ${borderColor}`,\n boxSizing: \"border-box\",\n fontFamily,\n height: \"100%\",\n overflow: \"hidden\",\n pointerEvents: \"auto\",\n position: \"relative\",\n width: \"100%\"\n }}\n >\n <canvas\n ref={canvasRef}\n style={{\n display: shouldRenderFallback ? \"none\" : \"block\",\n height: \"100%\",\n inset: 0,\n position: \"absolute\",\n width: \"100%\"\n }}\n />\n <svg\n onDoubleClick={onDoubleClick}\n onPointerDown={onPointerDown}\n style={{ display: \"block\", height: \"100%\", inset: 0, position: \"absolute\", width: \"100%\" }}\n viewBox={`0 0 ${layout.width} ${layout.height}`}\n >\n {shouldRenderFallback ? fallback : null}\n {overlay}\n </svg>\n </div>\n );\n}, (prev, next) => (\n prev.chart === next.chart\n && prev.palette === next.palette\n && prev.background === next.background\n && prev.borderColor === next.borderColor\n && prev.fontFamily === next.fontFamily\n && prev.onDoubleClick === next.onDoubleClick\n && prev.onPointerDown === next.onPointerDown\n && prev.layout.width === next.layout.width\n && prev.layout.height === next.layout.height\n && prev.layout.plot.left === next.layout.plot.left\n && prev.layout.plot.top === next.layout.plot.top\n && prev.layout.plot.width === next.layout.plot.width\n && prev.layout.plot.height === next.layout.plot.height\n && prev.overlay === next.overlay\n && prev.fallback === next.fallback\n));\n"]}
|