@deck.gl-community/infovis-layers 9.3.5 → 9.3.7
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/index.cjs +2998 -114
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/layers/animation-layer/animation-layer.d.ts +30 -0
- package/dist/layers/animation-layer/animation-layer.d.ts.map +1 -0
- package/dist/layers/animation-layer/animation-layer.js +53 -0
- package/dist/layers/animation-layer/animation-layer.js.map +1 -0
- package/dist/layers/animation-layer/animation.d.ts +86 -0
- package/dist/layers/animation-layer/animation.d.ts.map +1 -0
- package/dist/layers/animation-layer/animation.js +214 -0
- package/dist/layers/animation-layer/animation.js.map +1 -0
- package/dist/layers/block-layer/block-layer-fragment.glsl.d.ts +3 -0
- package/dist/layers/block-layer/block-layer-fragment.glsl.d.ts.map +1 -0
- package/dist/layers/block-layer/block-layer-fragment.glsl.js +41 -0
- package/dist/layers/block-layer/block-layer-fragment.glsl.js.map +1 -0
- package/dist/layers/block-layer/block-layer-uniforms.d.ts +27 -0
- package/dist/layers/block-layer/block-layer-uniforms.d.ts.map +1 -0
- package/dist/layers/block-layer/block-layer-uniforms.js +26 -0
- package/dist/layers/block-layer/block-layer-uniforms.js.map +1 -0
- package/dist/layers/block-layer/block-layer-vertex.glsl.d.ts +3 -0
- package/dist/layers/block-layer/block-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/layers/block-layer/block-layer-vertex.glsl.js +67 -0
- package/dist/layers/block-layer/block-layer-vertex.glsl.js.map +1 -0
- package/dist/layers/block-layer/block-layer.d.ts +71 -0
- package/dist/layers/block-layer/block-layer.d.ts.map +1 -0
- package/dist/layers/block-layer/block-layer.js +108 -0
- package/dist/layers/block-layer/block-layer.js.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layer.d.ts +148 -0
- package/dist/layers/fast-text-layer/fast-text-layer.d.ts.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layer.js +862 -0
- package/dist/layers/fast-text-layer/fast-text-layer.js.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layer.test.d.ts +2 -0
- package/dist/layers/fast-text-layer/fast-text-layer.test.d.ts.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layer.test.js +300 -0
- package/dist/layers/fast-text-layer/fast-text-layer.test.js.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layout.d.ts +179 -0
- package/dist/layers/fast-text-layer/fast-text-layout.d.ts.map +1 -0
- package/dist/layers/fast-text-layer/fast-text-layout.js +665 -0
- package/dist/layers/fast-text-layer/fast-text-layout.js.map +1 -0
- package/dist/layers/fast-text-layer/font-atlas.d.ts +98 -0
- package/dist/layers/fast-text-layer/font-atlas.d.ts.map +1 -0
- package/dist/layers/fast-text-layer/font-atlas.js +337 -0
- package/dist/layers/fast-text-layer/font-atlas.js.map +1 -0
- package/dist/layers/fast-text-layer/index.d.ts +4 -0
- package/dist/layers/fast-text-layer/index.d.ts.map +1 -0
- package/dist/layers/fast-text-layer/index.js +4 -0
- package/dist/layers/fast-text-layer/index.js.map +1 -0
- package/dist/layers/time-delta-layer.d.ts +22 -60
- package/dist/layers/time-delta-layer.d.ts.map +1 -1
- package/dist/layers/time-delta-layer.js +23 -45
- package/dist/layers/time-delta-layer.js.map +1 -1
- package/dist/synchronized-views/synchronized-views.js +1 -1
- package/dist/synchronized-views/synchronized-views.js.map +1 -1
- package/dist/utils/format-utils.d.ts +27 -3
- package/dist/utils/format-utils.d.ts.map +1 -1
- package/dist/utils/format-utils.js +72 -40
- package/dist/utils/format-utils.js.map +1 -1
- package/dist/utils/utf8-string-view.d.ts +53 -0
- package/dist/utils/utf8-string-view.d.ts.map +1 -0
- package/dist/utils/utf8-string-view.js +169 -0
- package/dist/utils/utf8-string-view.js.map +1 -0
- package/dist/utils/utf8-string-view.test.d.ts +2 -0
- package/dist/utils/utf8-string-view.test.d.ts.map +1 -0
- package/dist/utils/utf8-string-view.test.js +88 -0
- package/dist/utils/utf8-string-view.test.js.map +1 -0
- package/dist/views/bounds-utils.d.ts +23 -0
- package/dist/views/bounds-utils.d.ts.map +1 -0
- package/dist/views/bounds-utils.js +65 -0
- package/dist/views/bounds-utils.js.map +1 -0
- package/dist/views/layer-bounds-filter.d.ts +48 -0
- package/dist/views/layer-bounds-filter.d.ts.map +1 -0
- package/dist/views/layer-bounds-filter.js +99 -0
- package/dist/views/layer-bounds-filter.js.map +1 -0
- package/dist/views/orthographic-utils.d.ts +30 -2
- package/dist/views/orthographic-utils.d.ts.map +1 -1
- package/dist/views/orthographic-utils.js +33 -14
- package/dist/views/orthographic-utils.js.map +1 -1
- package/dist/views/view-layout/build-views-from-view-layout.d.ts +37 -0
- package/dist/views/view-layout/build-views-from-view-layout.d.ts.map +1 -0
- package/dist/views/view-layout/build-views-from-view-layout.js +413 -0
- package/dist/views/view-layout/build-views-from-view-layout.js.map +1 -0
- package/dist/views/view-layout/index.d.ts +3 -0
- package/dist/views/view-layout/index.d.ts.map +1 -0
- package/dist/views/view-layout/index.js +3 -0
- package/dist/views/view-layout/index.js.map +1 -0
- package/dist/views/view-layout/view-layout-item.d.ts +74 -0
- package/dist/views/view-layout/view-layout-item.d.ts.map +1 -0
- package/dist/views/view-layout/view-layout-item.js +48 -0
- package/dist/views/view-layout/view-layout-item.js.map +1 -0
- package/dist/views/view-layout/view-layout.test.d.ts +2 -0
- package/dist/views/view-layout/view-layout.test.d.ts.map +1 -0
- package/dist/views/view-layout/view-layout.test.js +112 -0
- package/dist/views/view-layout/view-layout.test.js.map +1 -0
- package/dist/views/viewport-bounds-utils.d.ts +55 -0
- package/dist/views/viewport-bounds-utils.d.ts.map +1 -0
- package/dist/views/viewport-bounds-utils.js +70 -0
- package/dist/views/viewport-bounds-utils.js.map +1 -0
- package/package.json +11 -4
- package/src/index.ts +91 -2
- package/src/layers/animation-layer/animation-layer.ts +92 -0
- package/src/layers/animation-layer/animation.ts +328 -0
- package/src/layers/block-layer/block-layer-fragment.glsl.ts +41 -0
- package/src/layers/block-layer/block-layer-uniforms.ts +43 -0
- package/src/layers/block-layer/block-layer-vertex.glsl.ts +67 -0
- package/src/layers/block-layer/block-layer.ts +199 -0
- package/src/layers/fast-text-layer/fast-text-layer.test.ts +359 -0
- package/src/layers/fast-text-layer/fast-text-layer.ts +1208 -0
- package/src/layers/fast-text-layer/fast-text-layout.ts +1124 -0
- package/src/layers/fast-text-layer/font-atlas.ts +574 -0
- package/src/layers/fast-text-layer/index.ts +37 -0
- package/src/layers/time-delta-layer.ts +47 -62
- package/src/synchronized-views/synchronized-views.ts +1 -1
- package/src/utils/format-utils.ts +90 -40
- package/src/utils/utf8-string-view.test.ts +119 -0
- package/src/utils/utf8-string-view.ts +273 -0
- package/src/views/bounds-utils.ts +88 -0
- package/src/views/layer-bounds-filter.ts +160 -0
- package/src/views/orthographic-utils.ts +65 -18
- package/src/views/view-layout/build-views-from-view-layout.ts +547 -0
- package/src/views/view-layout/index.ts +18 -0
- package/src/views/view-layout/view-layout-item.ts +125 -0
- package/src/views/view-layout/view-layout.test.ts +129 -0
- package/src/views/viewport-bounds-utils.ts +104 -0
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/layers/time-delta-layer.ts", "../src/utils/format-utils.ts", "../src/views/orthographic-utils.ts", "../src/views/view-state-utils.ts", "../src/views/layer-filter.ts", "../src/synchronized-views/synchronized-views.ts"],
|
|
4
|
-
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {TimeDeltaLayer, type TimeDeltaLayerProps} from './layers/time-delta-layer';\n\nexport {fitBoundsOrthographic} from './views/orthographic-utils';\nexport {formatTimeMs, formatTimeRangeMs} from './utils/format-utils';\nexport {validateViewState, mergeViewStates, type OptionalViewState} from './views/view-state-utils';\nexport {makeLayerFilter} from './views/layer-filter';\n\nexport {\n HEADER_VIEW_HEIGHT,\n LEGEND_VIEW_WIDTH,\n SYNCHRONIZED_VIEWS,\n SYNCHRONIZED_VIEW_STATE_CONSTRAINTS,\n getSynchronizedViewStates,\n fitSynchronizedViewStatesToBounds\n} from './synchronized-views/synchronized-views';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type LayerProps} from '@deck.gl/core';\nimport {LineLayer, TextLayer} from '@deck.gl/layers';\n\n// import {PathStyleExtension} from '@deck.gl/extensions';\n\nimport {formatTimeMs} from '../utils/format-utils';\n\nexport type TimeDeltaLayerProps = LayerProps & {\n unit: 'timestamp' | 'milliseconds';\n minTimeMs: number;\n maxTimeMs: number;\n /** Start time in milliseconds since epoch */\n startTimeMs: number;\n /** End time in milliseconds since epoch */\n endTimeMs: number;\n /** Optional: Y-coordinate for the axis line (default: 0) */\n y?: number;\n header: boolean;\n\n /** Optional: RGBA color for axis and ticks (default: [0, 0, 0, 255]) */\n color?: [number, number, number, number];\n /** Minimum Y-coordinate for grid lines. @todo (ib) Remve and calculate from viewport? */\n yMin?: number;\n /** Maximum Y-coordinate for grid lines. @todo (ib) Remve and calculate from viewport? */\n yMax?: number;\n};\n\nexport class TimeDeltaLayer extends CompositeLayer<TimeDeltaLayerProps> {\n static override layerName = 'TimeDeltaLayer';\n static override defaultProps: Required<Omit<TimeDeltaLayerProps, keyof LayerProps>> = {\n header: false,\n minTimeMs: 0,\n maxTimeMs: 100,\n startTimeMs: 0,\n endTimeMs: 100,\n y: 0,\n color: [0, 0, 0, 255],\n unit: 'timestamp',\n yMin: -1e6, // Should cover full viewport height in most cases\n yMax: 1e6 // Should cover full viewport height in most cases\n };\n\n override renderLayers() {\n const {startTimeMs, endTimeMs, color = [0, 0, 0, 255], yMin, yMax} = this.props;\n\n const timeDeltaPosition = [(startTimeMs + endTimeMs) / 2, 10];\n const timeDeltaMs = Math.abs(endTimeMs - startTimeMs);\n const timeDeltaLabel = formatTimeMs(timeDeltaMs, false);\n\n if (!this.props.header) {\n const timeLines = [\n {\n sourcePosition: [startTimeMs, yMin],\n targetPosition: [startTimeMs, yMax]\n },\n {\n sourcePosition: [endTimeMs, yMin],\n targetPosition: [endTimeMs, yMax]\n }\n ];\n return [\n // Interval end lines\n new LineLayer({\n id: 'time-delta-side-bars',\n data: timeLines,\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 4,\n widthUnits: 'pixels'\n })\n ];\n }\n\n // // Tick marks\n // new LineLayer({\n // id: 'time-delta-marks',\n // data: tickLines,\n // getSourcePosition: (d) => d.sourcePosition,\n // getTargetPosition: (d) => d.targetPosition,\n // getColor: color,\n // getWidth: 1,\n // }),\n\n // TODO - triggers broader root-level file updates\n // new PathLayer({\n // id: 'dotted-path',\n // data: route,\n // getPath: d => d.path,\n // getWidth: 4,\n // getColor: [255, 0, 0],\n\n // // Enable rounded caps on each dash\n // rounded: true,\n\n // // Add the dash extension\n // extensions: [\n // new PathStyleExtension({\n // dash: true,\n // // highPrecisionDash: true, // uncomment for finer control at low zoom\n // capRounded: true // draw dash ends as semicircles\n // })\n // ],\n\n // // [dashLength, gapLength] in pixels\n // // small dash + equal or larger gap = dotted effect\n // getDashArray: () => [2, 6]\n // })\n // ]\n const HEADER_Y = 12;\n const timeLines = [\n {\n sourcePosition: [startTimeMs, -100],\n targetPosition: [startTimeMs, HEADER_Y]\n },\n {\n sourcePosition: [endTimeMs, -100],\n targetPosition: [endTimeMs, HEADER_Y]\n }\n ];\n\n return [\n // Interval end lines\n new LineLayer({\n id: 'header-time-delta-side-bars',\n data: timeLines,\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 4,\n widthUnits: 'pixels'\n }),\n\n // Interval center\n new LineLayer({\n id: 'header-time-delta-dotted-line',\n data: [\n {\n sourcePosition: [startTimeMs, HEADER_Y - 7],\n targetPosition: [endTimeMs, HEADER_Y - 7]\n }\n ],\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 1,\n widthUnits: 'pixels'\n }),\n\n // Label\n new TextLayer({\n id: 'header-time-delta-label',\n data: [{position: timeDeltaPosition, text: timeDeltaLabel}],\n getPosition: d => d.position,\n getText: d => d.text,\n getSize: 12,\n getColor: color,\n getTextAnchor: 'middle',\n getAlignmentBaseline: 'top',\n background: true,\n getBackgroundColor: [255, 255, 255, 255], // Solid green background\n backgroundPadding: [4, 2] // Horizontal and vertical padding\n })\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/**\n * Convert a time in microseconds to a human-readable string\n * @param us Time in microseconds\n */\nexport function formatTimeMs(timeMs: number, space: boolean = true): string {\n const sep = space ? ' ' : '';\n const us = timeMs * 1000;\n if (us === 0) {\n return '0s';\n }\n if (Math.abs(us) < 1000) {\n return `${floatToStr(us)}${sep}\u00B5s`;\n }\n const ms = us / 1000;\n if (Math.abs(ms) < 1000) {\n return `${floatToStr(ms)}${sep} ms`;\n }\n const s = ms / 1000;\n if (Math.abs(s) < 60) {\n return `${floatToStr(s)}${sep} s`;\n }\n const m = s / 60;\n if (Math.abs(m) < 60) {\n return `${floatToStr(m)}${sep} min`;\n }\n const h = m / 60;\n if (Math.abs(h) < 24) {\n return `${floatToStr(h)}${sep} hrs`;\n }\n const d = h / 24;\n return `${floatToStr(d)}${sep} days`;\n}\n\nexport function formatTimeRangeMs(startMs: number, endMs: number): string {\n return `${formatTimeMs(startMs)} - ${formatTimeMs(endMs)}`;\n}\n\n/**\n * Convert a float to a string\n */\nfunction floatToStr(f: number, roundDigits: number = 5): string {\n if (Number.isInteger(f)) {\n return f.toString();\n }\n\n for (let i = 1; i < roundDigits - 1; i++) {\n const rounded = parseFloat(f.toPrecision(i));\n if (rounded === f) {\n return rounded.toPrecision(i);\n }\n }\n\n return f.toPrecision(roundDigits);\n}\n\n// export function formatTimesUs(ticks: number[]): string {\n// // Try from 0 up to a reasonable max (e.g. 20)\n// for (let d = 0; d <= 20; d++) {\n// const seen = new Set<string>();\n// let allDistinct = true;\n// for (const t of ticks) {\n// // Format each tick with d decimals\n// const str = t.toFixed(d);\n// if (seen.has(str)) {\n// allDistinct = false;\n// break;\n// }\n// seen.add(str);\n// }\n// if (allDistinct) {\n// return d;\n// }\n// }\n// // Fallback if somehow not distinct even at 20 decimals\n// return 20;\n// }\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\ntype Bounds = [[number, number], [number, number]];\n\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'single'\n): {target: [number, number]; zoom: number};\n\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'per-axis'\n): {target: [number, number]; zoom: [number, number]};\n\n/**\n * Compute center & zoom for an OrthographicViewport so that `bounds` fills the viewport.\n * @param width viewport width in px\n * @param height viewport height in px\n * @param bounds [[minX,minY],[maxX,maxY]] in the same world units you\u2019re rendering\n * @returns { target: [number, number], zoom: number }\n * target: center of the viewport in world units\n * zoom: deck.gl orthographic zoom level (log2(scale))\n * (deck.gl orthographic zoom is the log2 of the scale factor)\n */\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'single' | 'per-axis' = 'per-axis'\n): {target: [number, number]; zoom: number | [number, number]} {\n const [[minX, minY], [maxX, maxY]] = bounds;\n\n // center of the box\n const centerX = (minX + maxX) / 2;\n const centerY = (minY + maxY) / 2;\n\n // size of the box\n const boxW = maxX - minX;\n const boxH = maxY - minY;\n\n // scale (world units \u2192 screen pixels)\n const scaleX = width / boxW;\n const scaleY = height / boxH;\n\n // pick the smaller scale so the whole box fits\n const scale = Math.min(scaleX, scaleY);\n\n // deck.gl orthographic zoom is log2(scale)\n const zoom = Math.log2(scale);\n\n // 3) axis\u2010specific zooms (deck.gl\u2019s orthographic zoom = log2(scale))\n const zoomX = Math.log2(scaleX);\n const zoomY = Math.log2(scaleY);\n\n if (Number.isNaN(zoom) || Number.isNaN(zoomX) || Number.isNaN(zoom)) {\n // eslint-disable-next-line no-console\n console.warn('Invalid zoom values:', {zoom, zoomX, zoomY});\n }\n\n return {\n target: [centerX, centerY],\n zoom: zoomMode === 'single' ? zoom : [zoomX, zoomY]\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {type OrthographicViewState} from '@deck.gl/core';\n\nexport type OptionalizedViewState<T> = {\n [K in keyof T]: T[K] extends [number, number] | undefined\n ? [number | undefined, number | undefined] | undefined\n : T[K] extends [number, number, number] | undefined\n ? [number | undefined, number | undefined, number | undefined] | undefined\n : T[K] extends [number, number] | number | undefined\n ? [number | undefined, number | undefined] | undefined\n : T[K] extends [number, number, number] | [number, number] | undefined\n ?\n | [number | undefined, number | undefined, number | undefined]\n | [number | undefined, number | undefined]\n | undefined\n : T[K];\n};\n\nexport type OptionalViewState = OptionalizedViewState<OrthographicViewState>;\n\nexport function mergeViewStates(\n viewState1: OrthographicViewState,\n viewState2: OptionalViewState\n): OrthographicViewState {\n const target1 = viewState1.target ?? [0, 0];\n const zoom1 = viewState1.zoom ?? [1, 1];\n const mergedViewState = {\n ...viewState1,\n ...viewState2,\n target: [viewState2.target?.[0] ?? target1[0], viewState2.target?.[1] ?? target1[1]],\n zoom: [\n // ts-expect-error view state typing is awfully optional\n viewState2.zoom?.[0] ?? zoom1[0],\n // ts-expect-error view state typing is awfully optional\n viewState2.zoom?.[1] ?? zoom1[1]\n ]\n };\n // @ts-expect-error view state typing is awfully optional\n validateViewState(mergedViewState);\n // @ts-expect-error view state typing is awfully optional\n return mergedViewState;\n}\n\n// eslint-disable-next-line complexity\nexport function validateViewState(\n viewState: OrthographicViewState\n): viewState is OrthographicViewState {\n const isTargetValid =\n Array.isArray(viewState.target) &&\n viewState.target[0] !== undefined &&\n !Number.isNaN(viewState.target[0]) &&\n viewState.target[1] !== undefined &&\n !Number.isNaN(viewState.target[1]);\n const isZoomValid =\n Array.isArray(viewState.zoom) &&\n viewState.zoom[0] !== undefined &&\n !Number.isNaN(viewState.zoom[0]) &&\n viewState.zoom[1] !== undefined &&\n !Number.isNaN(viewState.zoom[1]);\n\n if (!isTargetValid || !isZoomValid) {\n // eslint-disable-next-line no-console\n console.warn('Invalid viewState:', viewState);\n }\n\n return isTargetValid && isZoomValid;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {type FilterContext} from '@deck.gl/core';\n\nexport type DeclarativeLayerFilter = Record<\n string,\n | {\n include: string[];\n }\n | {\n exclude: string[];\n }\n>;\n\ntype RegexpLayerFilter = Record<\n string,\n | {\n include: RegExp[];\n }\n | {\n exclude: RegExp[];\n }\n>;\n\nexport function makeLayerFilter(\n filters: DeclarativeLayerFilter\n): (context: FilterContext) => boolean {\n // Pre-compile the regexps for performance\n const regexpFilters: RegexpLayerFilter = {};\n for (const [key, value] of Object.entries(filters)) {\n if ('include' in value) {\n regexpFilters[key] = {\n include: value.include.map(v => new RegExp(v))\n };\n } else {\n regexpFilters[key] = {\n exclude: value.exclude.map(v => new RegExp(v))\n };\n }\n }\n\n // Return a function that checks if a layer matches the filter\n return ({viewport, layer}: FilterContext) => {\n let visible = true;\n const viewFilters = regexpFilters[viewport.id] || ({} as Record<string, RegExp[]>);\n // Check if the layer matches the filters for this viewport\n if ('include' in viewFilters) {\n if (!viewFilters.include.some(regexp => regexp.test(layer.id))) {\n visible = false;\n }\n }\n if ('exclude' in viewFilters) {\n if (viewFilters.exclude.some(regexp => regexp.test(layer.id))) {\n visible = false;\n }\n }\n // if (!visible) {\n // console.log(`Viewport ${viewport.id}: filtering out layer ${layer.id}`);\n // }\n return visible;\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {OrthographicController, OrthographicView} from '@deck.gl/core';\n\nimport {fitBoundsOrthographic} from '../views/orthographic-utils';\nimport {mergeViewStates} from '../views/view-state-utils';\n\nimport type {OptionalViewState} from '../views/view-state-utils';\nimport type {OrthographicViewState} from '@deck.gl/core';\n\nexport const HEADER_VIEW_HEIGHT = 50;\nexport const LEGEND_VIEW_WIDTH = 150;\n\nexport const SYNCHRONIZED_VIEWS = [\n new OrthographicView({\n id: 'main',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: LEGEND_VIEW_WIDTH,\n width: `calc(100% - ${LEGEND_VIEW_WIDTH}px`,\n y: HEADER_VIEW_HEIGHT,\n height: `calc(100% - ${HEADER_VIEW_HEIGHT}px)`,\n controller: {\n type: OrthographicController,\n // @ts-expect-error Specific to OrthographicController\n zoomAxis: 'X',\n inertia: false,\n scrollZoom: true\n }\n }),\n new OrthographicView({\n id: 'header',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: LEGEND_VIEW_WIDTH,\n width: `calc(100% - ${LEGEND_VIEW_WIDTH}px)`,\n height: 50,\n controller: false\n }),\n new OrthographicView({\n id: 'legend',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: 0,\n width: LEGEND_VIEW_WIDTH,\n y: HEADER_VIEW_HEIGHT,\n height: `calc(100% - ${HEADER_VIEW_HEIGHT}px)`,\n controller: false\n })\n];\n\nexport const SYNCHRONIZED_VIEW_STATE_CONSTRAINTS = {\n header: {target: [undefined, 20], zoom: [undefined, 0]} satisfies OptionalViewState,\n legend: {target: [-30, undefined], zoom: [1, undefined]} satisfies OptionalViewState\n};\n\nexport function getSynchronizedViewStates(viewState: OrthographicViewState) {\n return {\n header: mergeViewStates(viewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.header),\n legend: mergeViewStates(viewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.legend),\n main: viewState\n };\n}\n\nexport function fitSynchronizedViewStatesToBounds(props: {\n viewState: {\n header: OrthographicViewState;\n legend: OrthographicViewState;\n main: OrthographicViewState;\n };\n width: number;\n height: number;\n bounds: [[xMin: number, yMin: number], [xMax: number, yMax: number]];\n /** App should set to true on first call */\n initialize: boolean;\n headerHeight?: number;\n legendWidth?: number;\n}): {\n header: OrthographicViewState;\n legend: OrthographicViewState;\n main: OrthographicViewState;\n} {\n const {viewState, initialize} = props;\n const {headerHeight = HEADER_VIEW_HEIGHT, legendWidth = LEGEND_VIEW_WIDTH} = props;\n\n // Handle cases where the window size is too small for the header and/or legend\n const width = Math.max(props.width - legendWidth, 1);\n const height = Math.max(props.height - headerHeight, 1);\n\n const {target, zoom} = fitBoundsOrthographic(width, height, props.bounds, 'per-axis');\n target[1] = target[1] - 1.5; // ADD SOME TIME SPACE\n\n let mainViewState: OrthographicViewState;\n // Avoid messing with y axis if we have already fitted the view state\n if (initialize) {\n mainViewState = {...viewState.main, target, zoom};\n } else {\n mainViewState = {\n ...viewState.main,\n target: [viewState.main.target[0], target[1]],\n zoom: [(viewState.main.zoom as [number, number])[0], zoom[1]]\n };\n }\n const newViewState = {\n ...viewState,\n main: mainViewState,\n header: mergeViewStates(mainViewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.header),\n legend: mergeViewStates(mainViewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.legend)\n };\n return newViewState;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACIA,kBAA8C;AAC9C,oBAAmC;;;ACG7B,SAAU,aAAa,QAAgB,QAAiB,MAAI;AAChE,QAAM,MAAM,QAAQ,MAAM;AAC1B,QAAM,KAAK,SAAS;AACpB,MAAI,OAAO,GAAG;AACZ,WAAO;EACT;AACA,MAAI,KAAK,IAAI,EAAE,IAAI,KAAM;AACvB,WAAO,GAAG,WAAW,EAAE,IAAI;EAC7B;AACA,QAAM,KAAK,KAAK;AAChB,MAAI,KAAK,IA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AACd,oBAAgB,EAAC,GAAG,UAAU,MAAM,QAAQ,KAAI;EAClD,OAAO;AACL,oBAAgB;MACd,GAAG,UAAU;MACb,QAAQ,CAAC,UAAU,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;MAC5C,MAAM,CAAE,UAAU,KAAK,KAA0B,CAAC,GAAG,KAAK,CAAC,CAAC;;EAEhE;AACA,QAAM,eAAe;IACnB,GAAG;IACH,MAAM;IACN,QAAQ,gBAAgB,eAAe,oCAAoC,MAAM;IACjF,QAAQ,gBAAgB,eAAe,oCAAoC,MAAM;;AAEnF,SAAO;AACT;",
|
|
6
|
-
"names": ["timeLines", "import_core"]
|
|
3
|
+
"sources": ["../src/index.ts", "../src/layers/time-delta-layer.ts", "../src/utils/format-utils.ts", "../src/layers/animation-layer/animation-layer.ts", "../src/layers/animation-layer/animation.ts", "../src/layers/block-layer/block-layer.ts", "../src/layers/block-layer/block-layer-fragment.glsl.ts", "../src/layers/block-layer/block-layer-uniforms.ts", "../src/layers/block-layer/block-layer-vertex.glsl.ts", "../src/layers/fast-text-layer/fast-text-layer.ts", "../src/layers/fast-text-layer/fast-text-layout.ts", "../src/utils/utf8-string-view.ts", "../src/layers/fast-text-layer/font-atlas.ts", "../src/views/orthographic-utils.ts", "../src/views/view-layout/view-layout-item.ts", "../src/views/view-layout/build-views-from-view-layout.ts", "../src/views/bounds-utils.ts", "../src/views/view-state-utils.ts", "../src/views/layer-filter.ts", "../src/views/viewport-bounds-utils.ts", "../src/views/layer-bounds-filter.ts", "../src/synchronized-views/synchronized-views.ts"],
|
|
4
|
+
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {TimeDeltaLayer, type TimeDeltaLayerProps} from './layers/time-delta-layer';\nexport {\n AnimationLayer,\n type AnimationLayerProps\n} from './layers/animation-layer/animation-layer';\nexport type {\n AnimationFrame,\n AnimationFramesGroup\n} from './layers/animation-layer/animation';\nexport {BlockLayer, type BlockLayerProps} from './layers/block-layer/block-layer';\nexport {\n FastTextLayer,\n type FastTextLayerProps,\n type _FastTextLayerProps,\n buildFastTextUtf8ColumnSource,\n buildFastTextGlyphData,\n buildMultiLineGlyphData,\n buildSingleLineGlyphData,\n collectFastTextCharacterSet,\n updateFastTextDynamicGlyphAttributes,\n type BuildFastTextGlyphDataProps,\n type CollectFastTextCharacterSetProps,\n type FastTextAlignmentBaseline,\n type FastTextAnchor,\n type FastTextClipRect,\n type FastTextContentAlign,\n type FastTextDynamicGlyphUpdateStats,\n type FastTextGlyphBuildStats,\n type FastTextGlyphAttributes,\n type FastTextGlyphData,\n type FastTextUtf8Column,\n type FastTextUtf8ColumnSource,\n type FastTextUtf8ViewAccessor,\n type UpdateFastTextDynamicGlyphAttributesProps,\n buildFastTextCharacterMapping,\n createFastTextFontAtlas,\n DEFAULT_FAST_TEXT_FONT_SETTINGS,\n FastTextFontAtlasManager,\n type FastTextCharacter,\n type FastTextCharacterMapping,\n type FastTextFontAtlas,\n type FastTextFontSettings\n} from './layers/fast-text-layer/index';\n\nexport {fitBoundsOrthographic, getBoundsOrthographic} from './views/orthographic-utils';\nexport {\n buildViewsFromViewLayout,\n type CompiledDeckViews,\n type ViewLayoutRect,\n ViewLayoutItem,\n type ViewLayoutBaseProps,\n type ViewLayoutChild,\n type ViewLayoutColumnProps,\n type ViewLayoutInsets,\n type ViewLayoutItemProps,\n type ViewLayoutLength,\n type ViewLayoutOverlayProps,\n type ViewLayoutRowProps,\n type ViewLayoutSpacerProps,\n type ViewLayoutViewProps\n} from './views/view-layout/index';\nexport {\n getPaddedBlockBounds,\n type Bounds,\n type Geometry,\n type PaddedBlockBoundsOptions\n} from './views/bounds-utils';\nexport {formatTimeMs, formatTimeRangeMs, type FormatTimeMsOptions} from './utils/format-utils';\nexport {\n arrowFindUtf8,\n getArrowUtf8ColumnSource,\n getArrowUtf8RowView,\n getUtf8ColumnSourceRowView,\n makeUtf8StringView,\n type Utf8ColumnSource,\n type Utf8ColumnSourceChunk,\n type Utf8StringView\n} from './utils/utf8-string-view';\nexport {validateViewState, mergeViewStates, type OptionalViewState} from './views/view-state-utils';\nexport {makeLayerFilter} from './views/layer-filter';\nexport {\n DEFAULT_BOUNDS_EPSILON,\n boundsAreEqual,\n getViewportBoundsForViewState,\n isBoundsCompletelyOutside,\n type BoundsEqualityOptions,\n type ViewportBounds\n} from './views/viewport-bounds-utils';\nexport {\n type LayerFilter,\n type LayerBoundsFilterDecision,\n type LayerBoundsFilterOptions,\n combineLayerFilters,\n createViewportBoundsFilter\n} from './views/layer-bounds-filter';\n\nexport {\n HEADER_VIEW_HEIGHT,\n LEGEND_VIEW_WIDTH,\n SYNCHRONIZED_VIEWS,\n SYNCHRONIZED_VIEW_STATE_CONSTRAINTS,\n getSynchronizedViewStates,\n fitSynchronizedViewStatesToBounds\n} from './synchronized-views/synchronized-views';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type DefaultProps, type Layer, type LayerProps} from '@deck.gl/core';\nimport {LineLayer, TextLayer, type TextLayerProps} from '@deck.gl/layers';\n\n// import {PathStyleExtension} from '@deck.gl/extensions';\n\nimport {formatTimeMs} from '../utils/format-utils';\n\n/** Properties supported by {@link TimeDeltaLayer}. */\nexport type TimeDeltaLayerProps = LayerProps & _TimeDeltaLayerProps;\n\ntype _TimeDeltaLayerProps = Pick<TextLayerProps, 'fontFamily' | 'fontSettings' | 'fontWeight'> & {\n /** Legacy time label unit retained for compatibility. @defaultValue 'timestamp' */\n unit: 'timestamp' | 'milliseconds';\n /** Minimum trace time represented by the surrounding view. @defaultValue 0 */\n minTimeMs: number;\n /** Maximum trace time represented by the surrounding view. @defaultValue 100 */\n maxTimeMs: number;\n /** Start time in milliseconds since epoch. @defaultValue 0 */\n startTimeMs: number;\n /** End time in milliseconds since epoch. @defaultValue 100 */\n endTimeMs: number;\n /** Y coordinate for the header interval guide. @defaultValue 0 */\n y?: number;\n /** Whether to render the compact header label instead of full-height guide lines. @defaultValue false */\n header: boolean;\n\n /** Header label text size. @defaultValue 12 */\n fontSize?: number;\n\n /** RGBA color for interval guides and labels. @defaultValue [0, 0, 0, 255] */\n color?: [number, number, number, number];\n /** Minimum Y coordinate for full-height guide lines. @defaultValue -1e6 */\n yMin?: number;\n /** Maximum Y coordinate for full-height guide lines. @defaultValue 1e6 */\n yMax?: number;\n};\n\n/** Renders a selected time interval as header or viewport guide lines. */\nexport class TimeDeltaLayer extends CompositeLayer<Required<_TimeDeltaLayerProps>> {\n static override layerName = 'TimeDeltaLayer';\n static override defaultProps: DefaultProps<_TimeDeltaLayerProps> = {\n header: false,\n minTimeMs: 0,\n maxTimeMs: 100,\n startTimeMs: 0,\n endTimeMs: 100,\n y: 0,\n color: [0, 0, 0, 255],\n unit: 'timestamp',\n yMin: -1e6, // Should cover full viewport height in most cases\n yMax: 1e6, // Should cover full viewport height in most cases\n fontSize: 12,\n fontFamily: TextLayer.defaultProps.fontFamily,\n fontSettings: TextLayer.defaultProps.fontSettings,\n fontWeight: TextLayer.defaultProps.fontWeight\n };\n\n override renderLayers(): Layer[] {\n const {startTimeMs, endTimeMs, color = [0, 0, 0, 255], yMin, yMax} = this.props;\n\n if (!this.props.header) {\n const timeLines = [\n {\n sourcePosition: [startTimeMs, yMin],\n targetPosition: [startTimeMs, yMax]\n },\n {\n sourcePosition: [endTimeMs, yMin],\n targetPosition: [endTimeMs, yMax]\n }\n ];\n return [\n // Interval end lines\n new LineLayer({\n id: 'time-delta-side-bars',\n data: timeLines,\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 4,\n widthUnits: 'pixels'\n })\n ];\n }\n\n const {y, fontSize, fontFamily, fontSettings, fontWeight} = this.props;\n\n const timeDeltaPosition = [(startTimeMs + endTimeMs) / 2, y - 10];\n const timeDeltaMs = Math.abs(endTimeMs - startTimeMs);\n const timeDeltaLabel = formatTimeMs(timeDeltaMs, {space: false});\n\n const timeLines = [\n {\n sourcePosition: [startTimeMs, y],\n targetPosition: [startTimeMs, y - 7]\n },\n {\n sourcePosition: [endTimeMs, y],\n targetPosition: [endTimeMs, y - 7]\n }\n ];\n\n return [\n // Interval end lines\n new LineLayer({\n id: 'header-time-delta-side-bars',\n data: timeLines,\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 4,\n widthUnits: 'pixels'\n }),\n\n // Interval center\n new LineLayer({\n id: 'header-time-delta-dotted-line',\n data: [\n {\n sourcePosition: [startTimeMs, y - 7],\n targetPosition: [endTimeMs, y - 7]\n }\n ],\n getSourcePosition: d => d.sourcePosition,\n getTargetPosition: d => d.targetPosition,\n getColor: color,\n getWidth: 1,\n widthUnits: 'pixels'\n }),\n\n // Label\n new TextLayer({\n id: 'header-time-delta-label',\n data: [{position: timeDeltaPosition, text: timeDeltaLabel}],\n getPosition: d => d.position,\n getText: d => d.text,\n characterSet: '-0123456789.dhms\u00B5',\n getSize: fontSize,\n fontFamily,\n fontSettings,\n fontWeight,\n getColor: color,\n getTextAnchor: 'middle',\n getAlignmentBaseline: 'center',\n background: true,\n getBackgroundColor: [255 - color[0], 255 - color[1], 255 - color[2], 255],\n backgroundPadding: [4, 2] // Horizontal and vertical padding\n })\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/**\n * Options for formatting millisecond duration labels.\n */\nexport type FormatTimeMsOptions = {\n /** Whether to include a space between the value and unit. @defaultValue true */\n space?: boolean;\n /** Number of significant digits used for fractional values. @defaultValue 5 */\n roundDigits?: number;\n};\n\n/**\n * Convert a time in milliseconds to a human-readable string.\n * @param timeMs Time in milliseconds.\n * @param options Formatting options, or the legacy `space` boolean argument.\n * @returns Human-readable duration label.\n */\nexport function formatTimeMs(timeMs: number, options: boolean | FormatTimeMsOptions = {}): string {\n const normalizedOptions: FormatTimeMsOptions =\n typeof options === 'boolean' ? {space: options} : options;\n const {space = true, roundDigits = 5} = normalizedOptions;\n const sep = space ? ' ' : '';\n const us = timeMs * 1000;\n if (us === 0) {\n return '0s';\n }\n if (Math.abs(us) < 1000) {\n return `${floatToStr(us, roundDigits)}${sep}\u00B5s`;\n }\n const ms = us / 1000;\n if (Math.abs(ms) < 1000) {\n return `${floatToStr(ms, roundDigits)}${sep}ms`;\n }\n const s = ms / 1000;\n if (Math.abs(s) < 60) {\n return `${floatToStr(s, roundDigits)}${sep}s`;\n }\n const m = s / 60;\n if (Math.abs(m) < 60) {\n return formatMinuteDuration(s);\n }\n const h = m / 60;\n if (Math.abs(h) < 24) {\n return formatHourDuration(s);\n }\n return formatDayDuration(s);\n}\n\n/**\n * Convert a millisecond time range to a human-readable string.\n * @param startMs Range start in milliseconds.\n * @param endMs Range end in milliseconds.\n * @returns Human-readable start and end labels joined by a separator.\n */\nexport function formatTimeRangeMs(startMs: number, endMs: number): string {\n return `${formatTimeMs(startMs)} - ${formatTimeMs(endMs)}`;\n}\n\n/**\n * Convert a float to a string with a specified number of significant digits.\n * @param f The float to convert.\n * @param roundDigits The number of significant digits to round to (default is 5).\n * @returns The float as a string, rounded to the specified precision.\n */\nexport function floatToStr(f: number, roundDigits: number = 5): string {\n if (roundDigits < 1 || Number.isInteger(f)) {\n return f.toString();\n }\n\n // Round the float to the specified precision\n const precision = f.toPrecision(roundDigits);\n return parseFloat(precision).toString();\n}\n\n/**\n * Format a duration between one minute and one hour with whole seconds.\n * @param seconds Duration in seconds.\n * @returns A compact minutes-and-seconds duration label.\n */\nfunction formatMinuteDuration(seconds: number): string {\n const sign = seconds < 0 ? '-' : '';\n const totalSeconds = Math.floor(Math.abs(seconds));\n const minutes = Math.floor(totalSeconds / 60);\n const remainingSeconds = totalSeconds % 60;\n\n if (remainingSeconds === 0) {\n return `${sign}${minutes}m`;\n }\n\n return `${sign}${minutes}m${remainingSeconds}s`;\n}\n\n/**\n * Format a duration between one hour and one day with whole minutes.\n * @param seconds Duration in seconds.\n * @returns A compact hours-and-minutes duration label.\n */\nfunction formatHourDuration(seconds: number): string {\n const sign = seconds < 0 ? '-' : '';\n const totalMinutes = Math.floor(Math.abs(seconds) / 60);\n const hours = Math.floor(totalMinutes / 60);\n const remainingMinutes = totalMinutes % 60;\n\n if (remainingMinutes === 0) {\n return `${sign}${hours}h`;\n }\n\n return `${sign}${hours}h${remainingMinutes}m`;\n}\n\n/**\n * Format a duration of at least one day with whole hours.\n * @param seconds Duration in seconds.\n * @returns A compact days-and-hours duration label.\n */\nfunction formatDayDuration(seconds: number): string {\n const sign = seconds < 0 ? '-' : '';\n const totalHours = Math.floor(Math.abs(seconds) / 3600);\n const days = Math.floor(totalHours / 24);\n const remainingHours = totalHours % 24;\n\n if (remainingHours === 0) {\n return `${sign}${days}d`;\n }\n\n return `${sign}${days}d${remainingHours}h`;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer} from '@deck.gl/core';\n\nimport {\n AnimationFramesGroup,\n AnimationState,\n resolveAnimationFrames,\n resolveProps\n} from './animation';\n\nimport type {CompositeLayerProps, Layer} from '@deck.gl/core';\n\n/** Properties supported by {@link AnimationLayer}. */\nexport type AnimationLayerProps<LayerT extends Layer> = CompositeLayerProps &\n _AnimationLayerProps<LayerT>;\n\ntype _AnimationLayerProps<LayerT extends Layer> = {\n /** Base child layer cloned for each animation frame. */\n layer: LayerT;\n /** Frames that describe how child layer props change over time. */\n frames: AnimationFramesGroup<LayerT>;\n /** Number of additional animation iterations after the first pass. @defaultValue 0 */\n repeat?: number;\n /** Whether repeated frames restart or alternate in reverse. @defaultValue 'loop' */\n repeatType?: 'loop' | 'reverse';\n /** Delay in milliseconds before each repeated iteration. @defaultValue 0 */\n repeatDelay?: number;\n};\n\n/** A composite layer that animates its child layer with composable frames. */\nexport class AnimationLayer<LayerT extends Layer> extends CompositeLayer<\n _AnimationLayerProps<LayerT>\n> {\n static override layerName = 'AnimationLayer';\n\n override state: {\n layer?: LayerT;\n animationState?: AnimationState<LayerT>;\n } = {};\n\n // Hack - hijacking another flag to force updates\n override hasUniformTransition(): boolean {\n if (!this.props.visible) return false;\n const {animationState} = this.state;\n return !animationState || animationState.inProgress;\n }\n\n override updateState(): void {\n if (!this.props.visible) {\n // Disable animation when visible=false\n this.state.animationState = undefined;\n this.state.layer = undefined;\n return;\n }\n\n const time = this.context.timeline.getTime();\n const baseLayer = this.props.layer.clone({\n parameters: {\n ...this.props.layer.props.parameters,\n ...this.props.parameters\n }\n });\n let {animationState} = this.state;\n let layer = baseLayer;\n\n while (true) {\n if (animationState?.inProgress) {\n const nextProps = resolveProps(layer, animationState.frames, time - animationState.start);\n nextProps['id'] = `${this.id}-animation-layer`;\n layer = baseLayer.clone(nextProps);\n animationState.inProgress = time < animationState.end;\n this.setNeedsRedraw();\n }\n const nextState = resolveAnimationFrames(\n time,\n this.props as _AnimationLayerProps<LayerT>,\n animationState\n );\n if (nextState === animationState) break;\n animationState = nextState;\n }\n this.state.animationState = animationState;\n this.state.layer = layer;\n }\n\n override renderLayers() {\n return this.state.layer!;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/** A simple animation engine for deck.gl layers. */\nimport {type Layer} from '@deck.gl/core';\n\n/** One timed set of layer prop changes in an animation. */\nexport type AnimationFrame<LayerT extends Layer> = {\n /** Child layer prop values to transition to. */\n props: Partial<LayerT['props']>;\n /** Duration in milliseconds used to execute the transition. */\n duration: number;\n /** Pause in milliseconds before this frame starts. @defaultValue 0 */\n delay?: number;\n /** Easing function that defines the transition curve. @defaultValue linear */\n easing?: (t: number) => number;\n};\n\n/** A schedulable group of animation frames. */\nexport type AnimationFramesGroup<LayerT extends Layer> = {\n /**\n * How to schedule the child frames.\n * `sequence`: each frame starts after the previous frame ends.\n * `concurrence`: all frames start together.\n * `stagger`: frames start one-by-one at a fixed interval.\n */\n type: 'sequence' | 'concurrence' | 'stagger';\n /**\n * Optional delay in milliseconds.\n * In `sequence` mode, delay refers to the wait after a step ends and before starting the next step.\n * In `concurrence` mode, delay refers to the wait before starting all steps together.\n * In `stagger` mode, delay refers to the interval between starting steps\n */\n delay?: number;\n\n /** Frames or nested frame groups scheduled by this group. */\n frames: (AnimationFramesGroup<LayerT> | AnimationFrame<LayerT>)[];\n};\n\n/** Repeat and schedule options used to resolve an animation timeline. */\nexport type AnimationExtensionOptions<LayerT extends Layer> = {\n /** Frames scheduled by the animation. */\n frames: AnimationFramesGroup<LayerT>;\n /** Number of additional animation iterations after the first pass. @defaultValue 0 */\n repeat?: number;\n /** Whether repeated frames restart or alternate in reverse. @defaultValue 'loop' */\n repeatType?: 'loop' | 'reverse';\n /** Delay in milliseconds before each repeated iteration. @defaultValue 0 */\n repeatDelay?: number;\n};\n\ntype ResolvedAnimationFrame<LayerT extends Layer> = {\n /** Assigned at start time */\n from: Partial<LayerT['props']> | undefined;\n /** Provided by user */\n to: Partial<LayerT['props']>;\n /** Calculated start time of this frame if the whole animation starts at 0 */\n start: number;\n /** Calculated end time of this frame if the whole animation starts at 0 */\n end: number;\n /** Easing function */\n easing: (t: number) => number;\n};\n\n/** Runtime state for one resolved layer animation. */\nexport type AnimationState<LayerT extends Layer> = {\n /** Timeline timestamp at which the current iteration started. */\n start: number;\n /** Timeline timestamp at which the current iteration ends. */\n end: number;\n /** Whether the end state has not yet been fully committed. */\n inProgress: boolean;\n /** Number of completed animation iterations. */\n iterations: number;\n /** Resolved frames executed during the current iteration. */\n frames: ResolvedAnimationFrame<LayerT>[];\n};\n\nconst LINEAR_EASING = (t: number) => t;\n\ntype ResolvedFramesResult<LayerT extends Layer> = {\n frames: ResolvedAnimationFrame<LayerT>[];\n duration: number;\n};\n\nfunction resolveFramesGroup<LayerT extends Layer = Layer>(\n group: AnimationFramesGroup<LayerT> | AnimationFrame<LayerT>,\n baseStart: number\n): ResolvedFramesResult<LayerT> {\n if ('props' in group) {\n const delay = group.delay ?? 0;\n const start = baseStart + delay;\n const end = start + group.duration;\n return {\n frames: [\n {\n from: undefined,\n to: group.props,\n start,\n end,\n easing: group.easing ?? LINEAR_EASING\n }\n ],\n duration: delay + group.duration\n };\n }\n\n const delay = group.delay ?? 0;\n const frames: ResolvedAnimationFrame<LayerT>[] = [];\n\n if (group.type === 'sequence') {\n let current = baseStart;\n for (let i = 0; i < group.frames.length; i += 1) {\n const child = group.frames[i]!;\n const childResult = resolveFramesGroup(child, current);\n frames.push(...childResult.frames);\n current += childResult.duration;\n if (i < group.frames.length - 1) current += delay;\n }\n return {frames, duration: Math.max(0, current - baseStart)};\n }\n\n if (group.type === 'concurrence') {\n const start = baseStart + delay;\n let maxDuration = 0;\n for (const child of group.frames) {\n const childResult = resolveFramesGroup(child, start);\n frames.push(...childResult.frames);\n if (childResult.duration > maxDuration) maxDuration = childResult.duration;\n }\n return {frames, duration: delay + maxDuration};\n }\n\n let maxEnd = baseStart;\n for (let i = 0; i < group.frames.length; i += 1) {\n const child = group.frames[i]!;\n const childResult = resolveFramesGroup(child, baseStart + i * delay);\n frames.push(...childResult.frames);\n const childEnd = baseStart + i * delay + childResult.duration;\n if (childEnd > maxEnd) maxEnd = childEnd;\n }\n\n frames.sort((f1, f2) => f1.end - f2.end);\n\n return {frames, duration: Math.max(0, maxEnd - baseStart)};\n}\n\nfunction getFramesDuration<LayerT extends Layer = Layer>(\n frames: ResolvedAnimationFrame<LayerT>[]\n): number {\n let maxEnd = 0;\n for (const frame of frames) {\n if (frame.end > maxEnd) maxEnd = frame.end;\n }\n return maxEnd;\n}\n\nfunction reverseResolvedFrames<LayerT extends Layer = Layer>(\n frames: ResolvedAnimationFrame<LayerT>[]\n): ResolvedAnimationFrame<LayerT>[] {\n const duration = getFramesDuration(frames);\n const reversed: ResolvedAnimationFrame<LayerT>[] = [];\n for (let i = frames.length - 1; i >= 0; i -= 1) {\n const frame = frames[i]!;\n reversed.push({\n from: undefined,\n to: frame.from ?? frame.to,\n start: duration - frame.end,\n end: duration - frame.start,\n easing: frame.easing\n });\n }\n return reversed;\n}\n\n/**\n * Resolves the animation iteration that should be active at a timeline timestamp.\n * @param time - Current timeline timestamp in milliseconds.\n * @param opts - Animation frame and repeat configuration.\n * @param prevState - Previous animation state, when one has already been resolved.\n * @returns The current or next resolved animation state.\n */\nexport function resolveAnimationFrames<LayerT extends Layer = Layer>(\n time: number,\n opts: AnimationExtensionOptions<LayerT>,\n prevState?: AnimationState<LayerT>\n): AnimationState<LayerT> {\n const {frames, repeat = 0, repeatType = 'loop', repeatDelay = 0} = opts;\n if (!prevState) {\n const resolved = resolveFramesGroup(frames, 0);\n return {\n start: time,\n end: time + resolved.duration,\n inProgress: true,\n iterations: 0,\n frames: resolved.frames\n };\n }\n\n const state = prevState;\n if (time < state.end) {\n return state;\n }\n\n const iterationEnd = state.end;\n const iterations = state.iterations + 1;\n if (iterations > repeat) {\n return state;\n }\n const start = iterationEnd + repeatDelay;\n if (repeatType === 'reverse' && iterations % 2 === 1) {\n const duration = state.end - state.start;\n return {\n start,\n end: start + duration,\n iterations,\n frames: reverseResolvedFrames(state.frames),\n inProgress: true\n };\n } else {\n const resolved = resolveFramesGroup(frames, 0);\n return {\n start,\n end: start + resolved.duration,\n inProgress: true,\n iterations,\n frames: resolved.frames\n };\n }\n}\n\nfunction interpolateProp<PropT extends number | number[] | string | Function | object>(\n from: PropT | undefined,\n to: PropT | undefined,\n ratio: number\n): PropT | undefined {\n if (from === undefined || to === undefined) return to;\n if (typeof to === 'string' || typeof to === 'function') return to;\n if (typeof to === 'number' && typeof from === 'number') {\n return (from + (to - from) * ratio) as PropT;\n }\n if (Array.isArray(to) && Array.isArray(from)) {\n const len = to.length;\n const out = new Array(len);\n for (let i = 0; i < len; i += 1) {\n const toValue = to[i];\n const fromValue = from[i];\n out[i] =\n typeof toValue === 'number' && typeof fromValue === 'number'\n ? fromValue + (toValue - fromValue) * ratio\n : toValue;\n }\n return out as PropT;\n }\n return to;\n}\n\n/**\n * Resolves animated child layer props for a point inside one animation iteration.\n * @param layer - Base child layer whose props provide the interpolation starting values.\n * @param frames - Resolved frames for the active animation iteration.\n * @param timeSinceStart - Milliseconds elapsed since the iteration started.\n * @returns Child layer props that should be applied at the requested time.\n */\nexport function resolveProps<LayerT extends Layer = Layer>(\n layer: LayerT,\n frames: ResolvedAnimationFrame<LayerT>[],\n timeSinceStart: number\n): Partial<LayerT['props']> {\n if (timeSinceStart < 0 || frames.length === 0) return {} as LayerT['props'];\n\n const baseProps = layer.props as LayerT['props'];\n const nextProps: Partial<LayerT['props']> = {};\n let transitions = baseProps.transitions ? {...baseProps.transitions} : undefined;\n const updateTriggers = {...baseProps.updateTriggers};\n\n const getPropValue = (key: keyof LayerT['props']) =>\n Object.prototype.hasOwnProperty.call(nextProps, key) ? nextProps[key] : baseProps[key];\n\n for (const frame of frames) {\n if (timeSinceStart < frame.start) continue;\n\n const duration = frame.end - frame.start;\n if (duration <= 0) {\n Object.assign(nextProps, frame.to);\n continue;\n }\n\n if (frame.from === undefined) {\n const from: Partial<LayerT['props']> = {};\n for (const key of Object.keys(frame.to) as (keyof LayerT['props'])[]) {\n from[key] = getPropValue(key);\n }\n frame.from = from;\n }\n\n if (timeSinceStart >= frame.end) {\n Object.assign(nextProps, frame.to);\n continue;\n }\n\n const t = frame.easing((timeSinceStart - frame.start) / duration);\n for (const key of Object.keys(frame.to) as (keyof LayerT['props'])[]) {\n const toValue = frame.to[key];\n const fromValue = frame.from[key];\n if (\n String(key).startsWith('get') &&\n (typeof fromValue === 'function' || typeof toValue === 'function')\n ) {\n nextProps[key] = toValue as any;\n updateTriggers[key as string] = {...updateTriggers[key as string], animation: toValue};\n transitions ??= {};\n transitions[key as string] = {\n duration: frame.end - frame.start,\n easing: frame.easing\n };\n } else {\n const value = interpolateProp(fromValue as any, toValue, t);\n if (value !== undefined) {\n nextProps[key] = value;\n }\n }\n }\n }\n\n return nextProps;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n Accessor,\n AccessorFunction,\n color,\n Color,\n DefaultProps,\n Layer,\n LayerDataSource,\n LayerProps,\n picking,\n Position,\n project32,\n UNIT,\n Unit,\n UpdateParameters\n} from '@deck.gl/core';\nimport {Geometry, Model} from '@luma.gl/engine';\n\nimport fs from './block-layer-fragment.glsl';\nimport {BlockProps, blockUniforms} from './block-layer-uniforms';\nimport vs from './block-layer-vertex.glsl';\n\nconst DEFAULT_COLOR: [number, number, number, number] = [0, 0, 0, 255];\n\nconst defaultProps: DefaultProps<BlockLayerProps> = {\n sizeUnits: 'meters',\n widthMinPixels: {type: 'number', min: 0, value: 0},\n heightMinPixels: {type: 'number', min: 0, value: 0},\n sizeMaxPixels: {type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER},\n\n lineWidthUnits: 'pixels',\n\n getPosition: {type: 'accessor', value: (x: any) => x.position},\n getSize: {type: 'accessor', value: [10, 10]},\n getLineWidth: {type: 'accessor', value: 1},\n getFillColor: {type: 'accessor', value: DEFAULT_COLOR},\n getLineColor: {type: 'accessor', value: DEFAULT_COLOR}\n};\n\n/** Properties supported by {@link BlockLayer}. */\nexport type BlockLayerProps<DataT = unknown> = _BlockLayerProps<DataT> & LayerProps;\n\n/** Properties added by BlockLayer. */\ntype _BlockLayerProps<DataT> = {\n /** Data objects rendered as rectangular blocks. */\n data: LayerDataSource<DataT>;\n /**\n * The units of the block size, one of `'meters'`, `'common'`, and `'pixels'`.\n * @defaultValue 'meters'\n */\n sizeUnits?: Unit;\n\n /**\n * The minimum width in pixels. This prop can be used to prevent the block from getting too small when zoomed out.\n * @defaultValue 0\n */\n widthMinPixels?: number;\n /**\n * The minimum height in pixels. This prop can be used to prevent the block from getting too small when zoomed out.\n * @defaultValue 0\n */\n heightMinPixels?: number;\n /**\n * The maximum width or height in pixels. This prop can be used to prevent the block from getting too big when zoomed in.\n * @defaultValue Number.MAX_SAFE_INTEGER\n */\n sizeMaxPixels?: number;\n\n /**\n * The units of the stroke width, one of `'meters'`, `'common'`, and `'pixels'`.\n * @defaultValue 'pixels'\n */\n lineWidthUnits?: Unit;\n\n /**\n * The outline width of each object.\n * @defaultValue 1\n */\n getLineWidth?: Accessor<DataT, number>;\n\n /**\n * Method called to retrieve the position of each object.\n * @defaultValue object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n /** Width and height of each block. @defaultValue [10, 10] */\n getSize?: Accessor<DataT, [number, number]>;\n /**\n * The rgba color is in the format of `[r, g, b, [a]]`\n * @defaultValue [0, 0, 0, 255]\n */\n getLineColor?: Accessor<DataT, Color>;\n /**\n * The rgba color is in the format of `[r, g, b, [a]]`\n * @defaultValue [0, 0, 0, 255]\n */\n getFillColor?: Accessor<DataT, Color>;\n};\n\n/** Renders axis-aligned rectangular blocks with fill and outline colors. */\nexport class BlockLayer<DataT = any, ExtraPropsT extends {} = {}> extends Layer<\n ExtraPropsT & Required<_BlockLayerProps<DataT>>\n> {\n static override layerName = 'BlockLayer';\n static override defaultProps = defaultProps;\n\n override state: {\n model?: Model;\n } = {};\n\n override getShaders() {\n return super.getShaders({\n vs,\n fs,\n modules: [project32, color, picking, blockUniforms]\n });\n }\n\n initializeState() {\n this.getAttributeManager()!.addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n transition: true,\n accessor: 'getPosition'\n },\n instanceSizes: {\n size: 2,\n transition: true,\n accessor: 'getSize'\n },\n instanceLineWidths: {\n size: 1,\n transition: true,\n accessor: 'getLineWidth'\n },\n instanceLineColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getLineColor',\n defaultValue: DEFAULT_COLOR\n },\n instanceFillColors: {\n size: this.props.colorFormat.length,\n type: 'unorm8',\n transition: true,\n accessor: 'getFillColor',\n defaultValue: DEFAULT_COLOR\n }\n });\n }\n\n override updateState(params: UpdateParameters<this>): void {\n const {changeFlags} = params;\n super.updateState(params);\n if (changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this._getModel();\n this.getAttributeManager()!.invalidateAll();\n }\n }\n\n override draw() {\n const {sizeUnits, widthMinPixels, heightMinPixels, sizeMaxPixels, lineWidthUnits} = this.props;\n const model = this.state.model!;\n const blockProps: BlockProps = {\n sizeUnits: UNIT[sizeUnits],\n widthMinPixels,\n heightMinPixels,\n sizeMaxPixels,\n lineWidthUnits: UNIT[lineWidthUnits]\n };\n model.shaderInputs.setProps({block: blockProps});\n model.draw(this.context.renderPass);\n }\n\n protected _getModel(): Model {\n // a square\n const positions = [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0];\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager()!.getBufferLayouts(),\n geometry: new Geometry({\n topology: 'triangle-strip',\n attributes: {\n positions: new Float32Array(positions)\n }\n }),\n isInstanced: true\n });\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport default `\\\n#version 300 es\n#define SHADER_NAME block-layer-fragment-shader\n\nprecision highp float;\n\nin vec2 unitPosition;\nflat in vec4 vFillColor;\nflat in vec4 vLineColor;\nflat in float lineWidth;\nflat in vec2 size;\n\nout vec4 fragColor;\n\nvoid main(void) {\n if (lineWidth > 0.0) {\n vec2 relPosition = unitPosition * size;\n float distToBorder =\n min(\n min(\n min(relPosition.x, relPosition.y),\n size.x - relPosition.x\n ),\n size.y - relPosition.y\n );\n if (distToBorder <= lineWidth) {\n fragColor = vLineColor;\n } else {\n fragColor = vFillColor;\n }\n } else {\n fragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {ShaderModule} from '@luma.gl/shadertools';\n\nconst glslUniformBlock = `\\\nuniform blockUniforms {\n highp int sizeUnits;\n highp float widthMinPixels;\n highp float heightMinPixels;\n highp float sizeMaxPixels;\n highp int lineWidthUnits;\n} block;\n`;\n\n/** Shader uniform values used by {@link BlockLayer}. */\nexport type BlockProps = {\n /** Numeric deck.gl unit for block width and height. */\n sizeUnits: number;\n /** Minimum rendered block width in pixels. */\n widthMinPixels: number;\n /** Minimum rendered block height in pixels. */\n heightMinPixels: number;\n /** Maximum rendered block width or height in pixels. */\n sizeMaxPixels: number;\n /** Numeric deck.gl unit for block outline width. */\n lineWidthUnits: number;\n};\n\n/** Shader module that defines uniforms consumed by {@link BlockLayer}. */\nexport const blockUniforms = {\n name: 'block',\n vs: glslUniformBlock,\n fs: glslUniformBlock,\n uniformTypes: {\n sizeUnits: 'i32',\n widthMinPixels: 'f32',\n heightMinPixels: 'f32',\n sizeMaxPixels: 'f32',\n lineWidthUnits: 'i32'\n }\n} as const satisfies ShaderModule<BlockProps>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport default `\\\n#version 300 es\n#define SHADER_NAME block-layer-vertex-shader\n\nin vec3 positions;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec2 instanceSizes;\nin float instanceLineWidths;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin vec3 instancePickingColors;\n\nout vec2 unitPosition;\nflat out vec4 vFillColor;\nflat out vec4 vLineColor;\nflat out float lineWidth;\nflat out vec2 size;\n\n// This needs to be added back to the project module\nvec2 project_size_to_pixel(vec2 size, int unit) {\n if (unit == UNIT_PIXELS) return size;\n if (unit == UNIT_COMMON && project.projectionMode != PROJECTION_MODE_IDENTITY) {\n return size * project.scale;\n }\n return project_size(size) * project.scale;\n}\n\nfloat clamp_signed_size(float size, float minPixels, float maxPixels) {\n float clampedMagnitude = clamp(abs(size), minPixels, maxPixels);\n if (size < 0.0) {\n return -clampedMagnitude;\n }\n return clampedMagnitude;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n geometry.uv = positions.xy;\n\n vec2 pixelSize = project_size_to_pixel(instanceSizes, block.sizeUnits);\n pixelSize.x = clamp_signed_size(pixelSize.x, block.widthMinPixels, block.sizeMaxPixels);\n pixelSize.y = clamp_signed_size(pixelSize.y, block.heightMinPixels, block.sizeMaxPixels);\n unitPosition = positions.xy;\n size = pixelSize;\n lineWidth = project_size_to_pixel(vec2(instanceLineWidths, 0.0), block.lineWidthUnits).x;\n\n // Find the center of the point and add the current vertex\n vec3 offset = vec3(unitPosition * project_pixel_size(pixelSize), 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Apply opacity to instance color, or return instance picking color\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n`;\n", "// Minimal WebGL attribute text layer ported from WIP luma.gl text utilities.\n// SPDX-License-Identifier: MIT\n\nimport {color, createIterable, Layer, project32, UNIT} from '@deck.gl/core';\nimport {Buffer, Texture} from '@luma.gl/core';\nimport {Geometry, Model} from '@luma.gl/engine';\nimport {Log} from '@probe.gl/log';\n\nimport {\n buildFastTextGlyphData,\n buildFastTextUtf8ColumnSource,\n collectFastTextCharacterSet,\n FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE,\n updateFastTextDynamicGlyphAttributes\n} from './fast-text-layout';\nimport {DEFAULT_FAST_TEXT_FONT_SETTINGS, FastTextFontAtlasManager} from './font-atlas';\n\nimport type {\n FastTextAlignmentBaseline,\n FastTextAnchor,\n FastTextClipRect,\n FastTextContentAlign,\n FastTextDynamicGlyphUpdateStats,\n FastTextGlyphBuildStats,\n FastTextGlyphData,\n FastTextUtf8Column,\n FastTextUtf8ColumnSource,\n FastTextUtf8ViewAccessor\n} from './fast-text-layout';\nimport type {FastTextCharacterMapping, FastTextFontAtlas, FastTextFontSettings} from './font-atlas';\nimport type {\n Accessor,\n Color,\n DefaultProps,\n LayerContext,\n LayerDataSource,\n LayerProps,\n Position,\n Unit,\n UpdateParameters\n} from '@deck.gl/core';\nimport type {ShaderModule} from '@luma.gl/shadertools';\n\n/** Fast text layer props that intentionally cover dense Tracevis-style span labels. */\nexport type _FastTextLayerProps<DataT> = {\n /** Source label rows. */\n data: LayerDataSource<DataT>;\n /** If true, labels face the camera in screen space. */\n billboard?: boolean;\n /** Text size multiplier. */\n sizeScale?: number;\n /** Units for `size`, matching deck.gl size units. */\n sizeUnits?: Unit;\n /** Minimum rendered text size in screen pixels. */\n sizeMinPixels?: number;\n /** Maximum rendered text size in screen pixels. */\n sizeMaxPixels?: number;\n /** Fragment alpha cutoff below which a glyph pixel is discarded. */\n alphaCutoff?: number;\n /** Character set to place in the generated atlas, or `auto` to scan `getText`. */\n characterSet?: FastTextFontSettings['characterSet'] | 'auto';\n /** CSS font family used for generated atlases. */\n fontFamily?: FastTextFontSettings['fontFamily'];\n /** CSS font weight used for generated atlases. */\n fontWeight?: FastTextFontSettings['fontWeight'];\n /** Unitless line-height multiplier. */\n lineHeight?: number;\n /** Layer-wide text size. */\n size?: number;\n /** Layer-wide pixel offset applied after glyph layout. */\n pixelOffset?: readonly [number, number];\n /** Compatibility alias for callers that still inspect TextLayer-style pixel offset props. */\n getPixelOffset?: readonly [number, number];\n /** Additional atlas rasterization settings. */\n fontSettings?: FastTextFontSettings;\n /** Optional prebuilt mapping, supplied together with `fontAtlas`. */\n characterMapping?: FastTextCharacterMapping | null;\n /** Optional prebuilt atlas, supplied together with `characterMapping`. */\n fontAtlas?: FastTextFontAtlas | null;\n /** Label text accessor. */\n getText?: Accessor<DataT, string>;\n /** Optional UTF-8 text column used instead of `getText`. */\n textUtf8Column?: FastTextUtf8Column | null;\n /** Row accessor into `textUtf8Column`. Defaults to the source row index. */\n getTextUtf8Row?: Accessor<DataT, number | null>;\n /** Optional accessor that fills a reused UTF-8 byte view instead of calling `getText`. */\n getTextUtf8?: FastTextUtf8ViewAccessor<DataT> | null;\n /** Whether labels are expected to contain one line with no newline handling. */\n singleLine?: boolean;\n /** Label anchor position accessor. */\n getPosition?: Accessor<DataT, Position>;\n /** Label color accessor. */\n getColor?: Accessor<DataT, Color>;\n /** Layer-wide horizontal alignment. */\n textAnchor?: FastTextAnchor;\n /** Layer-wide vertical alignment. */\n alignmentBaseline?: FastTextAlignmentBaseline;\n /** Per-row content clip rectangle accessor. */\n getClipRect?: Accessor<DataT, FastTextClipRect>;\n /** Compatibility alias for callers that still inspect TextLayer-style content boxes. */\n getContentBox?: Accessor<DataT, FastTextClipRect>;\n /** Minimum visible content box dimensions in screen pixels. */\n contentCutoffPixels?: readonly [width: number, height: number];\n /** Horizontal alignment mode inside the visible content box. */\n contentAlignHorizontal?: FastTextContentAlign;\n /** Vertical alignment mode inside the visible content box. */\n contentAlignVertical?: FastTextContentAlign;\n};\n\n/** Props accepted by {@link FastTextLayer}. */\nexport type FastTextLayerProps<DataT = unknown> = _FastTextLayerProps<DataT> & LayerProps;\n\nconst defaultProps: DefaultProps<FastTextLayerProps> = {\n billboard: true,\n sizeScale: {type: 'number', value: 1, min: 0},\n sizeUnits: 'pixels',\n sizeMinPixels: {type: 'number', value: 0, min: 0},\n sizeMaxPixels: {type: 'number', value: Number.MAX_SAFE_INTEGER, min: 0},\n alphaCutoff: {type: 'number', value: 0.001, min: 0, max: 1},\n characterSet: {type: 'object', value: DEFAULT_FAST_TEXT_FONT_SETTINGS.characterSet},\n fontFamily: DEFAULT_FAST_TEXT_FONT_SETTINGS.fontFamily,\n fontWeight: DEFAULT_FAST_TEXT_FONT_SETTINGS.fontWeight,\n lineHeight: {type: 'number', value: 1, min: 0},\n size: {type: 'number', value: 32, min: 0},\n pixelOffset: {type: 'array', value: [0, 0]},\n getPixelOffset: {type: 'array', value: [0, 0]},\n fontSettings: {type: 'object', value: {}, compare: 1},\n characterMapping: {type: 'object', value: null, optional: true},\n fontAtlas: {type: 'object', value: null, optional: true},\n getText: {type: 'accessor', value: (datum: any) => datum.text},\n textUtf8Column: {type: 'object', value: null, optional: true},\n getTextUtf8Row: {\n type: 'accessor',\n value: (_datum: any, objectInfo: {index: number}) => objectInfo.index\n },\n getTextUtf8: {type: 'accessor', value: null},\n singleLine: true,\n getPosition: {type: 'accessor', value: (datum: any) => datum.position},\n getColor: {type: 'accessor', value: [0, 0, 0, 255]},\n textAnchor: 'middle',\n alignmentBaseline: 'center',\n getClipRect: {type: 'accessor', value: [0, 0, -1, -1]},\n getContentBox: {type: 'accessor', value: [0, 0, -1, -1]},\n contentCutoffPixels: {type: 'array', value: [0, 0]},\n contentAlignHorizontal: 'none',\n contentAlignVertical: 'none'\n};\n\n/** Lightweight bitmap text layer backed by one typed-array glyph instance stream. */\nexport class FastTextLayer<DataT = any, ExtraPropsT extends {} = {}> extends Layer<\n ExtraPropsT & Required<_FastTextLayerProps<DataT>>\n> {\n static defaultProps = defaultProps;\n static layerName = 'FastTextLayer';\n\n declare state: FastTextLayerState;\n\n /** Return the shader set used by the direct glyph instance model. */\n override getShaders() {\n return super.getShaders({\n vs: FAST_TEXT_VS,\n fs: FAST_TEXT_FS,\n modules: [project32, color, fastTextUniforms]\n });\n }\n\n /** Initialize the model and atlas manager. */\n override initializeState(): void {\n this.state = {\n fontAtlasManager: new FastTextFontAtlasManager()\n };\n this.state.model = this.getModel();\n }\n\n /** Rebuild text layout or update dynamic glyph attributes when inputs change. */\n override updateState(params: UpdateParameters<this>): void {\n super.updateState(params);\n\n if (params.changeFlags.extensionsChanged) {\n this.state.model?.destroy();\n this.state.model = this.getModel();\n if (this.state.buffers) {\n this.state.model.setAttributes(this.state.buffers);\n this.state.model.setInstanceCount(this.state.glyphData?.length ?? 0);\n }\n }\n\n if (shouldRebuildFastText(params) || this.hasMutableLayoutSourceChanged()) {\n this.rebuildGlyphState();\n } else {\n const dynamicUpdate = getFastTextDynamicUpdate(params);\n if (dynamicUpdate) {\n this.updateDynamicGlyphState(dynamicUpdate);\n }\n }\n }\n\n /** Draw the glyph model when atlas texture and glyph buffers are ready. */\n override draw(): void {\n const {atlasTexture, glyphData, model, fontSize} = this.state;\n if (!model || !atlasTexture || !glyphData || glyphData.length === 0 || !fontSize) {\n return;\n }\n\n model.shaderInputs.setProps({\n fastText: {\n fontAtlasTexture: atlasTexture,\n fontAtlasSize: [atlasTexture.width, atlasTexture.height],\n fontSize,\n size: this.props.size,\n sizeScale: this.props.sizeScale,\n sizeMinPixels: this.props.sizeMinPixels,\n sizeMaxPixels: this.props.sizeMaxPixels,\n pixelOffset: this.props.pixelOffset,\n billboard: this.props.billboard,\n sizeUnits: UNIT[this.props.sizeUnits],\n alphaCutoff: this.props.alphaCutoff,\n sdfEnabled: this.resolveSdfEnabled(),\n sdfBuffer: FAST_TEXT_SDF_BUFFER,\n sdfGamma: this.resolveSdfSmoothing(),\n contentCutoffPixels: this.props.contentCutoffPixels,\n contentAlign: [\n getFastTextContentAlignUniform(this.props.contentAlignHorizontal),\n getFastTextContentAlignUniform(this.props.contentAlignVertical)\n ],\n flipY: Boolean((this.context.viewport as {flipY?: boolean}).flipY)\n }\n });\n model.draw(this.context.renderPass);\n }\n\n /** Release GPU buffers, atlas texture, and the luma model. */\n override finalizeState(context: LayerContext): void {\n destroyFastTextBuffers(this.state.buffers);\n this.state.atlasTexture?.destroy();\n this.state.model?.destroy();\n super.finalizeState(context);\n }\n\n /** Build a luma model for instanced glyph quads. */\n private getModel(): Model {\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: FAST_TEXT_BUFFER_LAYOUT,\n geometry: new Geometry({\n topology: 'triangle-list',\n attributes: {\n positions: {\n size: 2,\n value: new Float32Array([0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1])\n }\n }\n }),\n isInstanced: true\n });\n }\n\n /** Rebuild CPU glyph data, GPU vertex buffers, and the font atlas texture. */\n private rebuildGlyphState(): void {\n const rebuildStartTime = performance.now();\n const atlasStartTime = performance.now();\n const atlas = this.resolveFontAtlas();\n const atlasDurationMs = performance.now() - atlasStartTime;\n const mapping = this.props.characterMapping ?? atlas.mapping;\n const glyphDataStartTime = performance.now();\n const glyphData = buildFastTextGlyphData({\n data: this.props.data,\n getText: this.props.getText,\n textUtf8Column: this.props.textUtf8Column,\n getTextUtf8Row: this.props.getTextUtf8Row,\n getTextUtf8: this.props.getTextUtf8,\n singleLine: this.props.singleLine,\n getPosition: this.props.getPosition,\n getColor: this.props.getColor,\n textAnchor: this.props.textAnchor,\n alignmentBaseline: this.props.alignmentBaseline,\n getClipRect: this.props.getClipRect,\n mapping,\n baselineOffset: atlas.baselineOffset,\n fontSize: this.resolveFontSize(),\n lineHeight: this.props.lineHeight\n });\n const glyphDataDurationMs = performance.now() - glyphDataStartTime;\n const bufferStartTime = performance.now();\n const buffers = createFastTextBuffers(this.context.device, glyphData);\n const bufferCreateDurationMs = performance.now() - bufferStartTime;\n\n destroyFastTextBuffers(this.state.buffers);\n this.state.model?.setAttributes(buffers);\n this.state.model?.setInstanceCount(glyphData.length);\n this.setState({\n glyphData,\n buffers,\n layoutSourceSignature: getFastTextLayoutSourceSignature(this.props)\n });\n logFastTextAttributeBuildProbe({\n atlasDurationMs,\n bufferCreateDurationMs,\n glyphDataDurationMs,\n glyphStats: glyphData.buildStats,\n layerId: this.props.id,\n totalDurationMs: performance.now() - rebuildStartTime\n });\n this.setNeedsRedraw();\n }\n\n /** Rewrite dynamic glyph attributes in place without rebuilding text layout. */\n private updateDynamicGlyphState(update: FastTextDynamicUpdate): void {\n const {glyphData, buffers} = this.state;\n if (!glyphData || !buffers) {\n this.rebuildGlyphState();\n return;\n }\n\n const updateStartTime = performance.now();\n const dynamicStats = updateFastTextDynamicGlyphAttributes({\n data: this.props.data,\n glyphData,\n getPosition: this.props.getPosition,\n getColor: this.props.getColor,\n getClipRect: this.props.getClipRect,\n updatePositions: update.positions,\n updateColors: update.colors,\n updateClipRects: update.clipRects\n });\n if (dynamicStats.rowCount !== glyphData.startIndices.length - 1) {\n this.rebuildGlyphState();\n return;\n }\n const bufferUploadStartTime = performance.now();\n if (update.positions) {\n buffers.instancePositions.write(glyphData.attributes.instancePositions);\n }\n if (update.colors || update.clipRects) {\n buffers.instanceGlyphData.write(glyphData.attributes.instanceGlyphData);\n }\n const bufferUploadDurationMs = performance.now() - bufferUploadStartTime;\n logFastTextDynamicAttributeUpdateProbe({\n bufferUploadDurationMs,\n dynamicStats,\n layerId: this.props.id,\n totalDurationMs: performance.now() - updateStartTime,\n update\n });\n this.setNeedsRedraw();\n }\n\n /** Return whether source data or UTF-8 column growth invalidated the current glyph layout. */\n private hasMutableLayoutSourceChanged(): boolean {\n const {glyphData, layoutSourceSignature} = this.state;\n if (!glyphData || !layoutSourceSignature) {\n return true;\n }\n return !areFastTextLayoutSourceSignaturesEqual(\n getFastTextLayoutSourceSignature(this.props),\n layoutSourceSignature\n );\n }\n\n /** Resolve a caller-supplied atlas or rebuild the local generated atlas. */\n private resolveFontAtlas(): FastTextFontAtlas {\n const {characterMapping, fontAtlas} = this.props;\n if (\n (this.props.textUtf8Column || this.props.getTextUtf8) &&\n this.props.characterSet === 'auto'\n ) {\n throw new Error('FastTextLayer characterSet=\"auto\" is not supported with UTF-8 text sources');\n }\n if (characterMapping || fontAtlas) {\n if (!characterMapping || !fontAtlas) {\n throw new Error(\n 'FastTextLayer requires characterMapping and fontAtlas to be supplied together'\n );\n }\n this.syncAtlasTexture(fontAtlas);\n return fontAtlas;\n }\n\n const characterSet =\n this.props.characterSet === 'auto'\n ? collectFastTextCharacterSet({\n data: this.props.data,\n getText: this.props.getText\n })\n : this.props.characterSet;\n this.state.fontAtlasManager.setProps({\n ...this.props.fontSettings,\n fontFamily: this.props.fontFamily,\n fontWeight: this.props.fontWeight,\n characterSet\n });\n const atlas = this.state.fontAtlasManager.atlas;\n if (!atlas) {\n throw new Error('FastTextLayer failed to build a font atlas');\n }\n this.syncAtlasTexture(atlas);\n return atlas;\n }\n\n /** Resolve the atlas pixel size used by glyph offsets. */\n private resolveFontSize(): number {\n return this.props.fontAtlas\n ? (this.props.fontSettings.fontSize ?? DEFAULT_FAST_TEXT_FONT_SETTINGS.fontSize)\n : this.state.fontAtlasManager.props.fontSize;\n }\n\n /** Resolve whether the current atlas should be sampled as SDF data. */\n private resolveSdfEnabled(): boolean {\n return this.props.fontAtlas\n ? (this.props.fontSettings.sdf ?? DEFAULT_FAST_TEXT_FONT_SETTINGS.sdf)\n : this.state.fontAtlasManager.props.sdf;\n }\n\n /** Resolve the SDF smoothing width for the current atlas. */\n private resolveSdfSmoothing(): number {\n return this.props.fontAtlas\n ? (this.props.fontSettings.smoothing ?? DEFAULT_FAST_TEXT_FONT_SETTINGS.smoothing)\n : this.state.fontAtlasManager.props.smoothing;\n }\n\n /** Upload a new atlas texture when the atlas object changes. */\n private syncAtlasTexture(atlas: FastTextFontAtlas): void {\n if (this.state.textureAtlas === atlas && this.state.atlasTexture) {\n return;\n }\n this.state.atlasTexture?.destroy();\n const texture = createFastTextAtlasTexture(this.context.device, atlas);\n this.setState({\n textureAtlas: atlas,\n atlasTexture: texture,\n fontSize: this.resolveFontSize()\n });\n }\n}\n\ntype FastTextLayerState = {\n /** Atlas manager owned by this layer when no external atlas is supplied. */\n fontAtlasManager: FastTextFontAtlasManager;\n /** Luma model used to draw glyph quads. */\n model?: Model;\n /** Last expanded CPU glyph data. */\n glyphData?: FastTextGlyphData;\n /** Primitive source-shape values captured when `glyphData` was built. */\n layoutSourceSignature?: FastTextLayoutSourceSignature;\n /** GPU buffers for the current glyph data. */\n buffers?: FastTextLayerBuffers;\n /** Atlas object currently uploaded to `atlasTexture`. */\n textureAtlas?: FastTextFontAtlas;\n /** GPU texture for the current font atlas. */\n atlasTexture?: Texture;\n /** Atlas font size in pixels for the current glyph offsets. */\n fontSize?: number;\n};\n\ntype FastTextLayerBuffers = {\n /** Packed glyph offsets, atlas frames, clip rectangles, and colors. */\n instanceGlyphData: Buffer;\n /** Repeated per-glyph anchor positions. */\n instancePositions: Buffer;\n};\n\ntype FastTextDynamicUpdate = {\n /** Whether per-glyph positions need to be rewritten. */\n positions: boolean;\n /** Whether per-glyph colors need to be rewritten. */\n colors: boolean;\n /** Whether per-glyph clip rectangles need to be rewritten. */\n clipRects: boolean;\n};\n\ntype FastTextLayoutSourceSignature = {\n /** Number of source rows visible through the data iterable. */\n dataRowCount: number;\n /** Whether source text comes from a row-level UTF-8 view accessor. */\n hasTextUtf8Accessor: boolean;\n /** Number of rows in the optional UTF-8 text column. */\n textUtf8ColumnRowCount: number;\n /** Number of chunks in the optional UTF-8 text column. */\n textUtf8ColumnChunkCount: number;\n /** Total entries across UTF-8 offset buffers. */\n textUtf8ColumnOffsetCount: number;\n /** Total bytes across UTF-8 value buffers. */\n textUtf8ColumnValueByteLength: number;\n};\n\ntype FastTextUniformProps = {\n /** Font atlas texture binding. */\n fontAtlasTexture: Texture;\n /** Font atlas dimensions in pixels. */\n fontAtlasSize: [number, number];\n /** Atlas font size in pixels. */\n fontSize: number;\n /** Layer-wide text size. */\n size: number;\n /** Text size multiplier. */\n sizeScale: number;\n /** Minimum rendered text size in screen pixels. */\n sizeMinPixels: number;\n /** Maximum rendered text size in screen pixels. */\n sizeMaxPixels: number;\n /** Layer-wide pixel offset applied after glyph layout. */\n pixelOffset: readonly [number, number];\n /** Whether text should face the camera in screen space. */\n billboard: boolean;\n /** Deck.gl unit enum for text size projection. */\n sizeUnits: number;\n /** Fragment alpha cutoff below which a glyph pixel is discarded. */\n alphaCutoff: number;\n /** Whether the atlas alpha channel contains signed distance values. */\n sdfEnabled: boolean;\n /** SDF edge threshold used for fill rendering. */\n sdfBuffer: number;\n /** SDF smoothing width around `sdfBuffer`. */\n sdfGamma: number;\n /** Minimum visible content-box dimensions in screen pixels. */\n contentCutoffPixels: readonly [number, number];\n /** Horizontal and vertical content alignment enum values. */\n contentAlign: readonly [number, number];\n /** Whether the active viewport flips the Y axis for content clipping. */\n flipY: boolean;\n};\n\nconst FAST_TEXT_CONTENT_ALIGN: Record<FastTextContentAlign, number> = {\n none: 0,\n start: 1,\n center: 2,\n end: 3\n};\nconst FAST_TEXT_ALIGN_START = FAST_TEXT_CONTENT_ALIGN.start;\nconst FAST_TEXT_ALIGN_CENTER = FAST_TEXT_CONTENT_ALIGN.center;\nconst FAST_TEXT_ALIGN_END = FAST_TEXT_CONTENT_ALIGN.end;\nconst FAST_TEXT_SDF_BUFFER = 192.0 / 256.0;\nconst fastTextLog = new Log({id: 'trace-layers'});\nconst FAST_TEXT_PROBE_LABEL_STYLE =\n 'background:#f59e0b;color:#111827;font-weight:700;padding:2px 8px;border-radius:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;';\n\nconst fastTextUniforms = {\n name: 'fastText',\n vs: `\\\nlayout(std140) uniform fastTextUniforms {\n vec2 fontAtlasSize;\n float fontSize;\n float size;\n float sizeScale;\n float sizeMinPixels;\n float sizeMaxPixels;\n vec2 pixelOffset;\n bool billboard;\n highp int sizeUnits;\n float alphaCutoff;\n bool sdfEnabled;\n float sdfBuffer;\n float sdfGamma;\n vec2 contentCutoffPixels;\n highp ivec2 contentAlign;\n bool flipY;\n} fastText;\n\n#define FAST_TEXT_ALIGN_MODE_START ${FAST_TEXT_ALIGN_START}\n#define FAST_TEXT_ALIGN_MODE_CENTER ${FAST_TEXT_ALIGN_CENTER}\n#define FAST_TEXT_ALIGN_MODE_END ${FAST_TEXT_ALIGN_END}\n`,\n fs: `\\\nlayout(std140) uniform fastTextUniforms {\n vec2 fontAtlasSize;\n float fontSize;\n float size;\n float sizeScale;\n float sizeMinPixels;\n float sizeMaxPixels;\n vec2 pixelOffset;\n bool billboard;\n highp int sizeUnits;\n float alphaCutoff;\n bool sdfEnabled;\n float sdfBuffer;\n float sdfGamma;\n vec2 contentCutoffPixels;\n highp ivec2 contentAlign;\n bool flipY;\n} fastText;\n`,\n uniformTypes: {\n fontAtlasSize: 'vec2<f32>',\n fontSize: 'f32',\n size: 'f32',\n sizeScale: 'f32',\n sizeMinPixels: 'f32',\n sizeMaxPixels: 'f32',\n pixelOffset: 'vec2<f32>',\n billboard: 'f32',\n sizeUnits: 'i32',\n alphaCutoff: 'f32',\n sdfEnabled: 'f32',\n sdfBuffer: 'f32',\n sdfGamma: 'f32',\n contentCutoffPixels: 'vec2<f32>',\n contentAlign: 'vec2<i32>',\n flipY: 'f32'\n }\n} as const satisfies ShaderModule<FastTextUniformProps>;\n\nconst FAST_TEXT_BUFFER_LAYOUT = [\n {name: 'instancePositions', stepMode: 'instance', format: 'float32x2'},\n {\n name: 'instanceGlyphData',\n stepMode: 'instance',\n byteStride: FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE,\n attributes: [\n {attribute: 'instanceGlyphOffsets', format: 'sint16x2', byteOffset: 0},\n {\n attribute: 'instanceGlyphFrames',\n format: 'uint16x4',\n byteOffset: Int16Array.BYTES_PER_ELEMENT * 2\n },\n {\n attribute: 'instanceClipRects',\n format: 'sint16x4',\n byteOffset: Int16Array.BYTES_PER_ELEMENT * 6\n },\n {\n attribute: 'instanceColors',\n format: 'unorm8x4',\n byteOffset: Int16Array.BYTES_PER_ELEMENT * 10\n }\n ]\n }\n] as const;\n\nconst DEFAULT_SAMPLER_PARAMETERS = {\n minFilter: 'linear',\n mipmapFilter: 'linear',\n magFilter: 'linear',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n} as const;\n\nconst FAST_TEXT_VS = `\\\n#version 300 es\n#define SHADER_NAME fast-text-layer-vertex-shader\n\nin vec2 positions;\nin vec2 instancePositions;\nin ivec2 instanceGlyphOffsets;\nin uvec4 instanceGlyphFrames;\nin ivec4 instanceClipRects;\nin vec4 instanceColors;\n\nout vec4 vColor;\nout vec2 vTextureCoords;\nout vec2 uv;\n\nfloat fastTextGetAlignmentPixelOffset(float anchor, float extent, float clipStart, float clipEnd, int mode) {\n if (clipEnd < clipStart) {\n return 0.0;\n }\n if (mode == FAST_TEXT_ALIGN_MODE_START) {\n return max(-(anchor + clipStart), 0.0);\n }\n if (mode == FAST_TEXT_ALIGN_MODE_CENTER) {\n float visibleMin = max(0.0, anchor + clipStart);\n float visibleMax = min(extent, anchor + clipEnd);\n return visibleMin < visibleMax ? (visibleMin + visibleMax) / 2.0 - anchor : 0.0;\n }\n if (mode == FAST_TEXT_ALIGN_MODE_END) {\n return min(extent - (anchor + clipEnd), 0.0);\n }\n return 0.0;\n}\n\nvoid fastTextClipGlyphVertex(vec2 pixelOffset, vec2 anchorPosScreen) {\n vec4 clipRect = vec4(instanceClipRects);\n vec2 clipXY = project_size_to_pixel(clipRect.xy);\n vec2 clipWH = project_size_to_pixel(clipRect.zw);\n if (fastText.flipY) {\n clipXY.y = -clipXY.y - clipWH.y;\n }\n\n if (fastText.contentAlign.x > 0 || fastText.contentAlign.y > 0) {\n vec2 viewportPixels = project.viewportSize / project.devicePixelRatio;\n vec2 scrollPixels = vec2(\n fastTextGetAlignmentPixelOffset(\n anchorPosScreen.x,\n viewportPixels.x,\n clipXY.x,\n clipXY.x + clipWH.x,\n fastText.contentAlign.x\n ),\n -fastTextGetAlignmentPixelOffset(\n anchorPosScreen.y,\n viewportPixels.y,\n -clipXY.y - clipWH.y,\n -clipXY.y,\n fastText.contentAlign.y\n )\n );\n pixelOffset += scrollPixels;\n gl_Position.xy += project_pixel_size_to_clipspace(scrollPixels);\n }\n\n if (clipRect.z >= 0.0) {\n if (pixelOffset.x < clipXY.x || pixelOffset.x > clipXY.x + clipWH.x) {\n gl_Position = vec4(0.0);\n } else if (fastText.contentCutoffPixels.x > 0.0) {\n float viewportWidth = project.viewportSize.x / project.devicePixelRatio;\n float left = max(anchorPosScreen.x + clipXY.x, 0.0);\n float right = min(anchorPosScreen.x + clipXY.x + clipWH.x, viewportWidth);\n if (right - left < fastText.contentCutoffPixels.x) {\n gl_Position = vec4(0.0);\n }\n }\n }\n if (clipRect.w >= 0.0) {\n if (pixelOffset.y < clipXY.y || pixelOffset.y > clipXY.y + clipWH.y) {\n gl_Position = vec4(0.0);\n } else if (fastText.contentCutoffPixels.y > 0.0) {\n float viewportHeight = project.viewportSize.y / project.devicePixelRatio;\n float top = max(anchorPosScreen.y - clipXY.y - clipWH.y, 0.0);\n float bottom = min(anchorPosScreen.y - clipXY.y, viewportHeight);\n if (bottom - top < fastText.contentCutoffPixels.y) {\n gl_Position = vec4(0.0);\n }\n }\n }\n}\n\nvoid main(void) {\n vec3 worldPosition = vec3(instancePositions, 0.0);\n geometry.worldPosition = worldPosition;\n geometry.uv = positions;\n uv = positions;\n\n vec4 glyphFrame = vec4(instanceGlyphFrames);\n vec2 glyphSize = glyphFrame.zw;\n float sizePixels = clamp(\n project_size_to_pixel(fastText.size * fastText.sizeScale, fastText.sizeUnits),\n fastText.sizeMinPixels,\n fastText.sizeMaxPixels\n );\n float instanceScale = fastText.fontSize == 0.0 ? 0.0 : sizePixels / fastText.fontSize;\n vec2 pixelOffset = vec2(instanceGlyphOffsets) + positions * glyphSize;\n pixelOffset = pixelOffset * instanceScale + fastText.pixelOffset;\n pixelOffset.y *= -1.0;\n\n vec2 anchorPosScreen;\n if (fastText.billboard) {\n gl_Position = project_position_to_clipspace(\n worldPosition,\n vec3(0.0),\n vec3(0.0),\n geometry.position\n );\n anchorPosScreen = gl_Position.xy / gl_Position.w;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offsetCommon = vec3(project_pixel_size(pixelOffset), 0.0);\n if (fastText.flipY) {\n offsetCommon.y *= -1.0;\n }\n DECKGL_FILTER_SIZE(offsetCommon, geometry);\n vec4 anchorPosition = project_position_to_clipspace(worldPosition, vec3(0.0), vec3(0.0));\n anchorPosScreen = anchorPosition.xy / anchorPosition.w;\n gl_Position = project_position_to_clipspace(\n worldPosition,\n vec3(0.0),\n offsetCommon,\n geometry.position\n );\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n }\n\n anchorPosScreen = vec2(anchorPosScreen.x + 1.0, 1.0 - anchorPosScreen.y) / 2.0 *\n project.viewportSize / project.devicePixelRatio;\n fastTextClipGlyphVertex(pixelOffset, anchorPosScreen);\n\n vTextureCoords = (glyphFrame.xy + positions * glyphSize) / fastText.fontAtlasSize;\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;\n\nconst FAST_TEXT_FS = `\\\n#version 300 es\n#define SHADER_NAME fast-text-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D fontAtlasTexture;\n\nin vec4 vColor;\nin vec2 vTextureCoords;\nin vec2 uv;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = uv;\n\n float alpha = texture(fontAtlasTexture, vTextureCoords).a;\n if (fastText.sdfEnabled) {\n alpha = smoothstep(fastText.sdfBuffer - fastText.sdfGamma, fastText.sdfBuffer + fastText.sdfGamma, alpha);\n }\n float outputAlpha = alpha * vColor.a;\n\n if (outputAlpha < fastText.alphaCutoff) {\n discard;\n }\n\n fragColor = vec4(vColor.rgb, outputAlpha * layer.opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n\n/** Capture primitive source-shape values that can change without prop identity changes. */\nfunction getFastTextLayoutSourceSignature(\n props: Required<_FastTextLayerProps<any>>\n): FastTextLayoutSourceSignature {\n const textUtf8ColumnSignature = getFastTextUtf8ColumnSourceSignature(props.textUtf8Column);\n return {\n dataRowCount: getFastTextDataRowCount(props.data),\n hasTextUtf8Accessor: Boolean(props.getTextUtf8),\n textUtf8ColumnRowCount: textUtf8ColumnSignature.rowCount,\n textUtf8ColumnChunkCount: textUtf8ColumnSignature.chunkCount,\n textUtf8ColumnOffsetCount: textUtf8ColumnSignature.offsetCount,\n textUtf8ColumnValueByteLength: textUtf8ColumnSignature.valueByteLength\n };\n}\n\n/** Return whether two captured source-shape signatures match. */\nfunction areFastTextLayoutSourceSignaturesEqual(\n signature: FastTextLayoutSourceSignature,\n oldSignature: FastTextLayoutSourceSignature\n): boolean {\n return (\n signature.dataRowCount === oldSignature.dataRowCount &&\n signature.hasTextUtf8Accessor === oldSignature.hasTextUtf8Accessor &&\n signature.textUtf8ColumnRowCount === oldSignature.textUtf8ColumnRowCount &&\n signature.textUtf8ColumnChunkCount === oldSignature.textUtf8ColumnChunkCount &&\n signature.textUtf8ColumnOffsetCount === oldSignature.textUtf8ColumnOffsetCount &&\n signature.textUtf8ColumnValueByteLength === oldSignature.textUtf8ColumnValueByteLength\n );\n}\n\n/** Count source data rows without relying on deck.gl's identity-based data change flag. */\nfunction getFastTextDataRowCount(data: LayerDataSource<any>): number {\n const arrayLikeLength = (data as {length?: unknown}).length;\n if (typeof arrayLikeLength === 'number') {\n return arrayLikeLength;\n }\n const tableLikeNumRows = (data as {numRows?: unknown}).numRows;\n if (typeof tableLikeNumRows === 'number') {\n return tableLikeNumRows;\n }\n\n const {iterable} = createIterable(data);\n let rowCount = 0;\n for (const _object of iterable) {\n rowCount++;\n }\n return rowCount;\n}\n\n/** Capture primitive shape values for the optional direct UTF-8 text source. */\nfunction getFastTextUtf8ColumnSourceSignature(\n textUtf8Column: FastTextUtf8Column | null | undefined\n): {\n /** Number of rows in the normalized source. */\n readonly rowCount: number;\n /** Number of chunks in the normalized source. */\n readonly chunkCount: number;\n /** Total entries across UTF-8 offset buffers. */\n readonly offsetCount: number;\n /** Total bytes across UTF-8 value buffers. */\n readonly valueByteLength: number;\n} {\n if (!textUtf8Column) {\n return {rowCount: 0, chunkCount: 0, offsetCount: 0, valueByteLength: 0};\n }\n const source = normalizeFastTextUtf8ColumnForComparison(textUtf8Column);\n if (!source) {\n return {rowCount: -1, chunkCount: -1, offsetCount: -1, valueByteLength: -1};\n }\n\n let offsetCount = 0;\n let valueByteLength = 0;\n for (const chunk of source.chunks) {\n offsetCount += chunk.valueOffsets.length;\n valueByteLength += chunk.values.byteLength;\n }\n return {\n rowCount: source.rowCount,\n chunkCount: source.chunks.length,\n offsetCount,\n valueByteLength\n };\n}\n\n/** Decide whether a deck update requires glyph data regeneration. */\nfunction shouldRebuildFastText(layerParams: UpdateParameters<FastTextLayer<any, any>>): boolean {\n const {props, oldProps, changeFlags} = layerParams;\n const updateTriggersChanged = changeFlags.updateTriggersChanged;\n return (\n Boolean(changeFlags.dataChanged) ||\n didFastTextAccessorPropChange(props.getText, oldProps.getText) ||\n !areFastTextUtf8ColumnsEqual(props.textUtf8Column, oldProps.textUtf8Column) ||\n didFastTextAccessorPropChange(props.getTextUtf8Row, oldProps.getTextUtf8Row) ||\n didFastTextAccessorPropChange(props.getTextUtf8, oldProps.getTextUtf8) ||\n props.singleLine !== oldProps.singleLine ||\n props.textAnchor !== oldProps.textAnchor ||\n props.alignmentBaseline !== oldProps.alignmentBaseline ||\n props.characterSet !== oldProps.characterSet ||\n props.fontFamily !== oldProps.fontFamily ||\n props.fontWeight !== oldProps.fontWeight ||\n props.lineHeight !== oldProps.lineHeight ||\n props.fontSettings !== oldProps.fontSettings ||\n props.characterMapping !== oldProps.characterMapping ||\n props.fontAtlas !== oldProps.fontAtlas ||\n Boolean(\n updateTriggersChanged &&\n (updateTriggersChanged.all ||\n updateTriggersChanged.getText ||\n updateTriggersChanged.getTextUtf8 ||\n updateTriggersChanged.getTextUtf8Row)\n )\n );\n}\n\n/** Return which dynamic FastText attributes can be updated without rebuilding text layout. */\nfunction getFastTextDynamicUpdate(\n layerParams: UpdateParameters<FastTextLayer<any, any>>\n): FastTextDynamicUpdate | null {\n const {props, oldProps, changeFlags} = layerParams;\n const updateTriggersChanged = changeFlags.updateTriggersChanged;\n const positions =\n didFastTextAccessorPropChange(props.getPosition, oldProps.getPosition) ||\n Boolean(updateTriggersChanged && updateTriggersChanged.getPosition);\n const colors =\n didFastTextAccessorPropChange(props.getColor, oldProps.getColor) ||\n Boolean(updateTriggersChanged && updateTriggersChanged.getColor);\n const clipRects =\n didFastTextAccessorPropChange(props.getClipRect, oldProps.getClipRect) ||\n Boolean(updateTriggersChanged && updateTriggersChanged.getClipRect);\n if (!positions && !colors && !clipRects) {\n return null;\n }\n return {positions, colors, clipRects};\n}\n\n/** Return whether two UTF-8 column props read from the same underlying Arrow buffers. */\nfunction areFastTextUtf8ColumnsEqual(\n textUtf8Column: FastTextUtf8Column | null | undefined,\n oldTextUtf8Column: FastTextUtf8Column | null | undefined\n): boolean {\n if (textUtf8Column === oldTextUtf8Column) {\n return true;\n }\n if (!textUtf8Column || !oldTextUtf8Column) {\n return false;\n }\n const source = normalizeFastTextUtf8ColumnForComparison(textUtf8Column);\n const oldSource = normalizeFastTextUtf8ColumnForComparison(oldTextUtf8Column);\n if (!source || !oldSource || source.rowCount !== oldSource.rowCount) {\n return false;\n }\n if (source.chunks.length !== oldSource.chunks.length) {\n return false;\n }\n for (let index = 0; index < source.chunks.length; index += 1) {\n const chunk = source.chunks[index]!;\n const oldChunk = oldSource.chunks[index]!;\n if (\n chunk.rowOffset !== oldChunk.rowOffset ||\n chunk.rowCount !== oldChunk.rowCount ||\n chunk.valueOffsetIndex !== oldChunk.valueOffsetIndex ||\n chunk.valueOffsets !== oldChunk.valueOffsets ||\n chunk.values !== oldChunk.values\n ) {\n return false;\n }\n }\n return true;\n}\n\n/** Normalize a UTF-8 column prop for same-buffer comparison. */\nfunction normalizeFastTextUtf8ColumnForComparison(\n textUtf8Column: FastTextUtf8Column\n): FastTextUtf8ColumnSource | null {\n return isFastTextUtf8ColumnSource(textUtf8Column)\n ? textUtf8Column\n : buildFastTextUtf8ColumnSource(textUtf8Column);\n}\n\n/** Return whether an object has the normalized FastText UTF-8 source shape. */\nfunction isFastTextUtf8ColumnSource(\n textUtf8Column: FastTextUtf8Column\n): textUtf8Column is FastTextUtf8ColumnSource {\n return 'rowCount' in textUtf8Column && 'chunks' in textUtf8Column;\n}\n\n/** Return whether an accessor prop changed in a way deck.gl expects attributes to observe. */\nfunction didFastTextAccessorPropChange<ValueT>(\n accessor: Accessor<any, ValueT>,\n oldAccessor: Accessor<any, ValueT>\n): boolean {\n if (typeof oldAccessor === 'function') {\n return false;\n }\n if (typeof accessor === 'function') {\n return true;\n }\n return !areFastTextAccessorConstantsEqual(accessor, oldAccessor);\n}\n\n/** Return whether two non-function accessor constants are shallowly equivalent. */\nfunction areFastTextAccessorConstantsEqual<ValueT>(\n accessor: Accessor<any, ValueT>,\n oldAccessor: Accessor<any, ValueT>\n): boolean {\n if (accessor === oldAccessor) {\n return true;\n }\n if (!Array.isArray(accessor) || !Array.isArray(oldAccessor)) {\n return false;\n }\n if (accessor.length !== oldAccessor.length) {\n return false;\n }\n for (let index = 0; index < accessor.length; index += 1) {\n if (accessor[index] !== oldAccessor[index]) {\n return false;\n }\n }\n return true;\n}\n\n/** Emit one compact timing probe for a completed FastText attribute rebuild. */\nfunction logFastTextAttributeBuildProbe(params: {\n /** Time spent resolving or generating the font atlas. */\n atlasDurationMs: number;\n /** Time spent creating GPU vertex buffers from generated attributes. */\n bufferCreateDurationMs: number;\n /** Time spent building CPU glyph attribute arrays. */\n glyphDataDurationMs: number;\n /** Detailed CPU glyph attribute build counters. */\n glyphStats: FastTextGlyphBuildStats;\n /** Deck layer id that rebuilt text attributes. */\n layerId: string;\n /** End-to-end time spent in the layer attribute rebuild. */\n totalDurationMs: number;\n}): void {\n getFastTextProbeLog().probe(\n 0,\n `%cFastTextLayer%c ${params.glyphStats.rowCount} rows in ${formatFastTextDurationMs(params.totalDurationMs)} ${params.layerId}`,\n FAST_TEXT_PROBE_LABEL_STYLE,\n '',\n {\n layerId: params.layerId,\n updateMode: 'full',\n sourceMode: params.glyphStats.sourceMode,\n layoutMode: params.glyphStats.layoutMode,\n rowCount: params.glyphStats.rowCount,\n glyphCount: params.glyphStats.glyphCount,\n attributeByteLength: params.glyphStats.attributeByteLength,\n atlasDurationMs: params.atlasDurationMs,\n glyphDataDurationMs: params.glyphDataDurationMs,\n columnNormalizeDurationMs: params.glyphStats.columnNormalizeDurationMs,\n countDurationMs: params.glyphStats.countDurationMs,\n allocateDurationMs: params.glyphStats.allocateDurationMs,\n writeDurationMs: params.glyphStats.writeDurationMs,\n textResolveDurationMs: params.glyphStats.textResolveDurationMs,\n styleAccessorDurationMs: params.glyphStats.styleAccessorDurationMs,\n layoutDurationMs: params.glyphStats.layoutDurationMs,\n glyphWriteDurationMs: params.glyphStats.glyphWriteDurationMs,\n bufferCreateDurationMs: params.bufferCreateDurationMs,\n totalDurationMs: params.totalDurationMs\n }\n )();\n}\n\n/** Emit one compact timing probe for a dynamic FastText attribute update. */\nfunction logFastTextDynamicAttributeUpdateProbe(params: {\n /** Time spent uploading rewritten dynamic CPU arrays to GPU buffers. */\n bufferUploadDurationMs: number;\n /** Detailed dynamic glyph attribute update counters. */\n dynamicStats: FastTextDynamicGlyphUpdateStats;\n /** Deck layer id that updated text attributes. */\n layerId: string;\n /** End-to-end time spent in the layer dynamic attribute update. */\n totalDurationMs: number;\n /** Dynamic attribute groups that changed. */\n update: FastTextDynamicUpdate;\n}): void {\n getFastTextProbeLog().probe(\n 0,\n `%cFastTextLayer%c dynamic ${params.dynamicStats.rowCount} rows in ${formatFastTextDurationMs(params.totalDurationMs)} ${params.layerId}`,\n FAST_TEXT_PROBE_LABEL_STYLE,\n '',\n {\n layerId: params.layerId,\n updateMode: 'dynamic',\n updatePositions: params.update.positions,\n updateColors: params.update.colors,\n updateClipRects: params.update.clipRects,\n rowCount: params.dynamicStats.rowCount,\n glyphCount: params.dynamicStats.glyphCount,\n attributeByteLength: params.dynamicStats.attributeByteLength,\n positionAccessorDurationMs: params.dynamicStats.positionAccessorDurationMs,\n colorAccessorDurationMs: params.dynamicStats.colorAccessorDurationMs,\n clipRectAccessorDurationMs: params.dynamicStats.clipRectAccessorDurationMs,\n writeDurationMs: params.dynamicStats.writeDurationMs,\n bufferUploadDurationMs: params.bufferUploadDurationMs,\n totalDurationMs: params.totalDurationMs\n }\n )();\n}\n\n/** Format a duration for compact inline probe messages. */\nfunction formatFastTextDurationMs(durationMs: number): string {\n return `${durationMs.toFixed(durationMs < 10 ? 2 : 1)}ms`;\n}\n\n/** Return the shared Tracevis debug log when it is available in the page. */\nfunction getFastTextProbeLog(): {\n /** Probe.gl-compatible timing probe method. */\n probe: (logLevel: unknown, message?: unknown, ...args: unknown[]) => () => void;\n} {\n const globalLog = (globalThis as {traceLayers?: {log?: typeof fastTextLog}}).traceLayers?.log;\n return globalLog ?? fastTextLog;\n}\n\n/** Create luma buffers for every per-glyph typed array. */\nfunction createFastTextBuffers(\n device: LayerContext['device'],\n glyphData: FastTextGlyphData\n): FastTextLayerBuffers {\n const {attributes} = glyphData;\n return {\n instanceGlyphData: createVertexBuffer(\n device,\n attributes.instanceGlyphData,\n new Uint8Array(FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE)\n ),\n instancePositions: createVertexBuffer(device, attributes.instancePositions, new Float32Array(2))\n };\n}\n\n/** Create one non-empty luma vertex buffer for a typed array. */\nfunction createVertexBuffer<T extends ArrayBufferView>(\n device: LayerContext['device'],\n data: T,\n fallback: T\n): Buffer {\n return device.createBuffer({\n data: data.byteLength > 0 ? data : fallback,\n usage: Buffer.VERTEX | Buffer.COPY_DST\n });\n}\n\n/** Destroy all owned glyph vertex buffers. */\nfunction destroyFastTextBuffers(buffers?: FastTextLayerBuffers): void {\n if (!buffers) {\n return;\n }\n for (const buffer of Object.values(buffers)) {\n buffer.destroy();\n }\n}\n\n/** Upload one canvas-backed font atlas into a luma texture. */\nfunction createFastTextAtlasTexture(\n device: LayerContext['device'],\n atlas: FastTextFontAtlas\n): Texture {\n const texture = device.createTexture({\n format: 'rgba8unorm',\n data: null,\n width: atlas.width,\n height: atlas.height,\n sampler: DEFAULT_SAMPLER_PARAMETERS,\n mipLevels: device.getMipLevelCount(atlas.width, atlas.height)\n });\n texture.copyExternalImage({\n image: atlas.data,\n width: atlas.width,\n height: atlas.height\n });\n regenerateMipmaps(texture);\n return texture;\n}\n\n/** Regenerate texture mipmaps for WebGL or WebGPU devices. */\nfunction regenerateMipmaps(texture: Texture): void {\n if (texture.device.type === 'webgl') {\n texture.generateMipmapsWebGL();\n } else if (texture.device.type === 'webgpu') {\n texture.device.generateMipmapsWebGPU(texture);\n }\n}\n\n/** Return the shader enum value for one fast-text content alignment mode. */\nfunction getFastTextContentAlignUniform(mode: FastTextContentAlign): number {\n return FAST_TEXT_CONTENT_ALIGN[mode];\n}\n", "// Minimal WebGL attribute text layout ported from WIP luma.gl text utilities.\n// SPDX-License-Identifier: MIT\n\nimport {createIterable} from '@deck.gl/core';\n\nimport {getArrowUtf8ColumnSource, getUtf8ColumnSourceRowView} from '../../utils/utf8-string-view';\n\nimport type {Utf8ColumnSource, Utf8StringView} from '../../utils/utf8-string-view';\nimport type {FastTextCharacter, FastTextCharacterMapping} from './font-atlas';\nimport type {Accessor, AccessorContext, Color, LayerDataSource, Position} from '@deck.gl/core';\nimport type * as arrow from 'apache-arrow';\n\n/** Horizontal label anchor accepted by {@link FastTextLayer}. */\nexport type FastTextAnchor = 'start' | 'middle' | 'end';\n\n/** Vertical label baseline accepted by {@link FastTextLayer}. */\nexport type FastTextAlignmentBaseline = 'top' | 'center' | 'bottom';\n\n/** Content alignment mode accepted by {@link FastTextLayer}. */\nexport type FastTextContentAlign = 'none' | 'start' | 'center' | 'end';\n\n/** Source-row clip rectangle in deck.gl text content coordinates. */\nexport type FastTextClipRect = readonly [x: number, y: number, width: number, height: number];\n\n/** Direct-buffer UTF-8 column source consumed by {@link FastTextLayer}. */\nexport type FastTextUtf8ColumnSource = Utf8ColumnSource;\n\n/** Arrow Utf8 vector or pre-normalized UTF-8 column source consumed by {@link FastTextLayer}. */\nexport type FastTextUtf8Column = arrow.Vector<arrow.Utf8> | FastTextUtf8ColumnSource;\n\n/** Accessor that fills a caller-owned UTF-8 byte view for one source row. */\nexport type FastTextUtf8ViewAccessor<DataT> = (\n object: DataT,\n out: Utf8StringView,\n objectInfo: AccessorContext<DataT>\n) => boolean;\n\n/**\n * Bytes per generated glyph vertex record.\n *\n * The record stores `sint16x2 glyphOffsets`, `uint16x4 glyphFrames`, `sint16x4 clipRect`,\n * and `unorm8x4 color`.\n */\nexport const FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE =\n Int16Array.BYTES_PER_ELEMENT * 10 + Uint8Array.BYTES_PER_ELEMENT * 4;\n\n/** Packed per-glyph typed arrays consumed by the fast text shader. */\nexport type FastTextGlyphAttributes = {\n /**\n * Interleaved generated glyph records.\n *\n * Each record stores `[offsetX, offsetY]` as signed 16-bit integers,\n * `[atlasX, atlasY, atlasWidth, atlasHeight]` as unsigned 16-bit integers,\n * `[clipX, clipY, clipWidth, clipHeight]` as signed 16-bit integers, and RGBA color as\n * four normalized unsigned bytes.\n */\n instanceGlyphData: Uint8Array;\n /** Per-glyph 2D source anchor position, repeated from source label rows. */\n instancePositions: Float32Array;\n};\n\n/** Timing counters captured while expanding source rows into FastText glyph attributes. */\nexport type FastTextGlyphBuildStats = {\n /** Source text path used for this glyph build. */\n sourceMode: 'string' | 'utf8-column' | 'utf8-view';\n /** Layout path used for this glyph build. */\n layoutMode: 'single-line' | 'multi-line';\n /** Number of source rows visited. */\n rowCount: number;\n /** Number of generated glyph instances. */\n glyphCount: number;\n /** Number of bytes occupied by generated CPU attribute arrays. */\n attributeByteLength: number;\n /** Time spent normalizing the optional Arrow UTF-8 column source. */\n columnNormalizeDurationMs: number;\n /** Time spent counting rows and glyphs before fixed-size allocation. */\n countDurationMs: number;\n /** Time spent allocating generated CPU attribute arrays. */\n allocateDurationMs: number;\n /** Time spent writing generated CPU attribute arrays. */\n writeDurationMs: number;\n /** Write-phase time spent resolving label text or UTF-8 row views. */\n textResolveDurationMs: number;\n /** Write-phase time spent resolving style accessors for position, color, and clip rect. */\n styleAccessorDurationMs: number;\n /** Write-phase time spent computing label layout offsets and widths. */\n layoutDurationMs: number;\n /** Write-phase time spent packing per-glyph attribute records. */\n glyphWriteDurationMs: number;\n /** Total time spent in FastText glyph-data construction. */\n totalDurationMs: number;\n};\n\n/** Result of expanding source text rows into one glyph instance stream. */\nexport type FastTextGlyphData = {\n /** Number of rendered glyph instances. */\n length: number;\n /** Cumulative glyph starts, one entry per source row plus a terminal entry. */\n startIndices: Uint32Array;\n /** Packed per-glyph attributes ready for GPU upload. */\n attributes: FastTextGlyphAttributes;\n /** Characters observed while visiting source text rows. */\n characterSet: Set<string>;\n /** Approximate CPU typed-array bytes occupied by this glyph data. */\n byteLength: number;\n /** Timing counters for the CPU glyph attribute build. */\n buildStats: FastTextGlyphBuildStats;\n};\n\n/** Inputs used to collect an automatic atlas character set. */\nexport type CollectFastTextCharacterSetProps<DataT> = {\n /** Source label rows. */\n data: LayerDataSource<DataT>;\n /** Source-row text accessor. */\n getText: Accessor<DataT, string>;\n};\n\n/** Inputs used to build a packed fast text glyph stream. */\nexport type BuildFastTextGlyphDataProps<DataT> = {\n /** Source label rows. */\n data: LayerDataSource<DataT>;\n /** Source-row text accessor used by the string path. */\n getText: Accessor<DataT, string>;\n /** Optional UTF-8 text column used by the byte path. */\n textUtf8Column?: FastTextUtf8Column | null;\n /** Source-row UTF-8 column row accessor. Defaults to the source row index. */\n getTextUtf8Row?: Accessor<DataT, number | null>;\n /** Optional accessor that fills a reused UTF-8 byte view for the source row. */\n getTextUtf8?: FastTextUtf8ViewAccessor<DataT> | null;\n /** Whether source labels are expected to be single-line strings. */\n singleLine: boolean;\n /** Source-row position accessor. */\n getPosition: Accessor<DataT, Position>;\n /** Source-row color accessor. */\n getColor: Accessor<DataT, Color>;\n /** Layer-wide horizontal text anchor. */\n textAnchor: FastTextAnchor;\n /** Layer-wide vertical alignment baseline. */\n alignmentBaseline: FastTextAlignmentBaseline;\n /** Source-row content clip rectangle accessor. */\n getClipRect: Accessor<DataT, FastTextClipRect>;\n /** Glyph metric lookup keyed by rendered character. */\n mapping: FastTextCharacterMapping;\n /** Atlas baseline offset in pixels. */\n baselineOffset: number;\n /** Atlas font size in pixels. */\n fontSize: number;\n /** Unitless line-height multiplier. */\n lineHeight: number;\n};\n\n/** Inputs used to rewrite dynamic per-row glyph attributes without rebuilding text layout. */\nexport type UpdateFastTextDynamicGlyphAttributesProps<DataT> = {\n /** Source label rows. */\n data: LayerDataSource<DataT>;\n /** Existing glyph data whose dynamic attributes should be updated in place. */\n glyphData: FastTextGlyphData;\n /** Source-row position accessor. */\n getPosition: Accessor<DataT, Position>;\n /** Source-row color accessor. */\n getColor: Accessor<DataT, Color>;\n /** Source-row content clip rectangle accessor. */\n getClipRect: Accessor<DataT, FastTextClipRect>;\n /** Whether to rewrite repeated per-glyph anchor positions. */\n updatePositions: boolean;\n /** Whether to rewrite packed per-glyph colors. */\n updateColors: boolean;\n /** Whether to rewrite packed per-glyph clip rectangles. */\n updateClipRects: boolean;\n};\n\n/** Timing counters captured while rewriting dynamic FastText glyph attributes. */\nexport type FastTextDynamicGlyphUpdateStats = {\n /** Number of source rows visited. */\n rowCount: number;\n /** Number of generated glyph instances visited. */\n glyphCount: number;\n /** Number of bytes occupied by the existing CPU attribute arrays. */\n attributeByteLength: number;\n /** Time spent resolving position accessors. */\n positionAccessorDurationMs: number;\n /** Time spent resolving color accessors. */\n colorAccessorDurationMs: number;\n /** Time spent resolving clip-rectangle accessors. */\n clipRectAccessorDurationMs: number;\n /** Time spent writing dynamic glyph attributes. */\n writeDurationMs: number;\n /** Total time spent updating dynamic glyph attributes. */\n totalDurationMs: number;\n};\n\n/** Build a direct-buffer UTF-8 column source without copying Arrow string bytes. */\nexport function buildFastTextUtf8ColumnSource(\n utf8Column: arrow.Vector<arrow.Utf8>\n): FastTextUtf8ColumnSource | null {\n return getArrowUtf8ColumnSource(utf8Column);\n}\n\n/** Collect all renderable characters reached by a text accessor. */\nexport function collectFastTextCharacterSet<DataT>(\n props: CollectFastTextCharacterSetProps<DataT>\n): Set<string> {\n const characterSet = new Set<string>();\n const {iterable, objectInfo} = createIterable(props.data);\n\n for (const object of iterable) {\n objectInfo.index++;\n const text = resolveAccessor(props.getText, object, objectInfo) ?? '';\n for (const character of Array.from(text)) {\n if (character !== '\\n') {\n characterSet.add(character);\n }\n }\n }\n\n return characterSet;\n}\n\n/** Build packed per-glyph attributes for one fast text layer update. */\nexport function buildFastTextGlyphData<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>\n): FastTextGlyphData {\n const buildStartTime = performance.now();\n const columnNormalizeStartTime = performance.now();\n const textUtf8Column = resolveFastTextUtf8ColumnSource(props.textUtf8Column);\n const columnNormalizeDurationMs = performance.now() - columnNormalizeStartTime;\n if (props.textUtf8Column && !textUtf8Column) {\n throw new Error('FastTextLayer textUtf8Column must expose Arrow Utf8 buffers');\n }\n if ((textUtf8Column || props.getTextUtf8) && !props.singleLine) {\n throw new Error('FastTextLayer UTF-8 text sources require singleLine text layout');\n }\n\n const glyphData = props.singleLine\n ? buildSingleLineGlyphData({\n ...props,\n textUtf8Column\n })\n : buildMultiLineGlyphData(props);\n return withFastTextGlyphBuildStats(glyphData, {\n columnNormalizeDurationMs,\n totalDurationMs: performance.now() - buildStartTime\n });\n}\n\n/** Build packed per-glyph attributes for source rows that are expected to contain no newlines. */\nexport function buildSingleLineGlyphData<DataT>(\n props: BuildFastTextGlyphDataProps<DataT> & {\n /** Normalized UTF-8 column source, when the byte path is active. */\n textUtf8Column?: FastTextUtf8ColumnSource | null;\n }\n): FastTextGlyphData {\n const buildStartTime = performance.now();\n const countStartTime = performance.now();\n const countResult = countSingleLineFastTextGlyphs(props);\n const countDurationMs = performance.now() - countStartTime;\n const allocateStartTime = performance.now();\n const attributes = allocateFastTextGlyphAttributes(countResult.glyphCount);\n const startIndices = new Uint32Array(countResult.rowCount + 1);\n const allocateDurationMs = performance.now() - allocateStartTime;\n const writeState: FastTextGlyphWriteState = {\n glyphIndex: 0,\n startIndices,\n attributes,\n glyphRecordViews: createFastTextGlyphRecordViews(attributes.instanceGlyphData)\n };\n const writeTimings = createFastTextGlyphWriteTimings();\n const byteLookup =\n props.textUtf8Column || props.getTextUtf8 ? buildFastTextByteGlyphLookup(props.mapping) : null;\n const scratchUtf8View: Utf8StringView = {data: EMPTY_BYTES, start: 0, end: 0};\n const {iterable, objectInfo} = createIterable(props.data);\n\n const writeStartTime = performance.now();\n for (const object of iterable) {\n objectInfo.index++;\n startIndices[objectInfo.index] = writeState.glyphIndex;\n if (props.textUtf8Column && byteLookup) {\n writeSingleLineUtf8LabelGlyphs(\n props,\n props.textUtf8Column,\n byteLookup,\n scratchUtf8View,\n object,\n objectInfo,\n writeState,\n writeTimings\n );\n } else if (props.getTextUtf8 && byteLookup) {\n writeSingleLineUtf8ViewLabelGlyphs(\n props,\n props.getTextUtf8,\n byteLookup,\n scratchUtf8View,\n object,\n objectInfo,\n writeState,\n writeTimings\n );\n } else {\n writeSingleLineStringLabelGlyphs(props, object, objectInfo, writeState, writeTimings);\n }\n }\n startIndices[countResult.rowCount] = writeState.glyphIndex;\n const writeDurationMs = performance.now() - writeStartTime;\n\n return createFastTextGlyphData(countResult, startIndices, attributes, {\n sourceMode: props.textUtf8Column ? 'utf8-column' : props.getTextUtf8 ? 'utf8-view' : 'string',\n layoutMode: 'single-line',\n columnNormalizeDurationMs: 0,\n countDurationMs,\n allocateDurationMs,\n writeDurationMs,\n ...writeTimings,\n totalDurationMs: performance.now() - buildStartTime\n });\n}\n\n/** Build packed per-glyph attributes for source rows that may contain newlines. */\nexport function buildMultiLineGlyphData<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>\n): FastTextGlyphData {\n const buildStartTime = performance.now();\n const countStartTime = performance.now();\n const countResult = countMultiLineFastTextGlyphs(props);\n const countDurationMs = performance.now() - countStartTime;\n const allocateStartTime = performance.now();\n const attributes = allocateFastTextGlyphAttributes(countResult.glyphCount);\n const startIndices = new Uint32Array(countResult.rowCount + 1);\n const allocateDurationMs = performance.now() - allocateStartTime;\n const writeState: FastTextGlyphWriteState = {\n glyphIndex: 0,\n startIndices,\n attributes,\n glyphRecordViews: createFastTextGlyphRecordViews(attributes.instanceGlyphData)\n };\n const writeTimings = createFastTextGlyphWriteTimings();\n const {iterable, objectInfo} = createIterable(props.data);\n\n const writeStartTime = performance.now();\n for (const object of iterable) {\n objectInfo.index++;\n startIndices[objectInfo.index] = writeState.glyphIndex;\n writeMultiLineLabelGlyphs(props, object, objectInfo, writeState, writeTimings);\n }\n startIndices[countResult.rowCount] = writeState.glyphIndex;\n const writeDurationMs = performance.now() - writeStartTime;\n\n return createFastTextGlyphData(countResult, startIndices, attributes, {\n sourceMode: 'string',\n layoutMode: 'multi-line',\n columnNormalizeDurationMs: 0,\n countDurationMs,\n allocateDurationMs,\n writeDurationMs,\n ...writeTimings,\n totalDurationMs: performance.now() - buildStartTime\n });\n}\n\n/** Rewrite dynamic per-row glyph attributes while preserving generated text layout attributes. */\nexport function updateFastTextDynamicGlyphAttributes<DataT>(\n props: UpdateFastTextDynamicGlyphAttributesProps<DataT>\n): FastTextDynamicGlyphUpdateStats {\n const updateStartTime = performance.now();\n const glyphRecordViews = createFastTextGlyphRecordViews(\n props.glyphData.attributes.instanceGlyphData\n );\n const {iterable, objectInfo} = createIterable(props.data);\n let rowCount = 0;\n let glyphCount = 0;\n let positionAccessorDurationMs = 0;\n let colorAccessorDurationMs = 0;\n let clipRectAccessorDurationMs = 0;\n let writeDurationMs = 0;\n\n for (const object of iterable) {\n objectInfo.index++;\n rowCount++;\n const rowGlyphStart = props.glyphData.startIndices[objectInfo.index] ?? 0;\n const rowGlyphEnd = props.glyphData.startIndices[objectInfo.index + 1] ?? rowGlyphStart;\n if (rowGlyphEnd <= rowGlyphStart) {\n continue;\n }\n\n let position: Position = DEFAULT_POSITION;\n let color: Color = DEFAULT_COLOR;\n let clipRect: FastTextClipRect = DEFAULT_CLIP_RECT;\n if (props.updatePositions) {\n const accessorStartTime = performance.now();\n position = resolveAccessor(props.getPosition, object, objectInfo) ?? DEFAULT_POSITION;\n positionAccessorDurationMs += performance.now() - accessorStartTime;\n }\n if (props.updateColors) {\n const accessorStartTime = performance.now();\n color = resolveAccessor(props.getColor, object, objectInfo) ?? DEFAULT_COLOR;\n colorAccessorDurationMs += performance.now() - accessorStartTime;\n }\n if (props.updateClipRects) {\n const accessorStartTime = performance.now();\n clipRect = resolveAccessor(props.getClipRect, object, objectInfo) ?? DEFAULT_CLIP_RECT;\n clipRectAccessorDurationMs += performance.now() - accessorStartTime;\n }\n\n const writeStartTime = performance.now();\n for (let glyphIndex = rowGlyphStart; glyphIndex < rowGlyphEnd; glyphIndex += 1) {\n if (props.updatePositions) {\n writeFastTextGlyphPosition(props.glyphData.attributes, glyphIndex, position);\n }\n if (props.updateClipRects) {\n writeFastTextGlyphClipRect(glyphRecordViews, glyphIndex, clipRect);\n }\n if (props.updateColors) {\n writeFastTextGlyphColor(glyphRecordViews, glyphIndex, color);\n }\n }\n writeDurationMs += performance.now() - writeStartTime;\n glyphCount += rowGlyphEnd - rowGlyphStart;\n }\n\n return {\n rowCount,\n glyphCount,\n attributeByteLength: props.glyphData.byteLength,\n positionAccessorDurationMs,\n colorAccessorDurationMs,\n clipRectAccessorDurationMs,\n writeDurationMs,\n totalDurationMs: performance.now() - updateStartTime\n };\n}\n\ntype FastTextGlyphCount = {\n /** Number of rendered glyph instances. */\n readonly glyphCount: number;\n /** Number of source text rows. */\n readonly rowCount: number;\n /** Characters observed while counting rows. */\n readonly characterSet: Set<string>;\n};\n\ntype FastTextGlyphWriteState = {\n /** Current glyph write cursor. */\n glyphIndex: number;\n /** Cumulative glyph starts by source row. */\n readonly startIndices: Uint32Array;\n /** Typed arrays receiving per-glyph attributes. */\n readonly attributes: FastTextGlyphAttributes;\n /** Typed views over the interleaved generated glyph record buffer. */\n readonly glyphRecordViews: FastTextGlyphRecordViews;\n};\n\ntype FastTextGlyphRecordViews = {\n /** Signed 16-bit view used for glyph offsets. */\n readonly int16Values: Int16Array;\n /** Unsigned 16-bit view used for atlas frames. */\n readonly uint16Values: Uint16Array;\n /** Unsigned 8-bit view used for packed colors. */\n readonly uint8Values: Uint8Array;\n};\n\ntype FastTextGlyphWriteTimings = {\n /** Write-phase time spent resolving label text or UTF-8 row views. */\n textResolveDurationMs: number;\n /** Write-phase time spent resolving style accessors for position, color, and clip rect. */\n styleAccessorDurationMs: number;\n /** Write-phase time spent computing label layout offsets and widths. */\n layoutDurationMs: number;\n /** Write-phase time spent packing per-glyph attribute records. */\n glyphWriteDurationMs: number;\n};\n\ntype FastTextByteGlyphLookup = readonly (FastTextCharacter | undefined)[];\n\ntype FastTextLineLayout = {\n /** Characters in this source text line. */\n readonly characters: readonly string[];\n /** Line width in atlas pixels, including missing-character advances. */\n readonly width: number;\n /** Renderable glyphs in this line. */\n readonly glyphCount: number;\n};\n\nconst MISSING_CHARACTER_ADVANCE = 32;\nconst FAST_TEXT_BYTE_LOOKUP_SIZE = 256;\nconst EMPTY_BYTES = new Uint8Array();\nconst DEFAULT_COLOR: readonly [number, number, number, number] = [0, 0, 0, 255];\nconst DEFAULT_POSITION: readonly [number, number, number] = [0, 0, 0];\nconst DEFAULT_CLIP_RECT: FastTextClipRect = [0, 0, -1, -1];\nconst ANCHOR_OFFSET_MULTIPLIER: Record<FastTextAnchor, number> = {\n start: 0,\n middle: -0.5,\n end: -1\n};\nconst BASELINE_OFFSET_MULTIPLIER: Record<FastTextAlignmentBaseline, number> = {\n top: 0,\n center: -0.5,\n bottom: -1\n};\n\n/** Count single-line rendered glyphs and rows before allocating fixed-size typed arrays. */\nfunction countSingleLineFastTextGlyphs<DataT>(\n props: Pick<\n BuildFastTextGlyphDataProps<DataT>,\n 'data' | 'getText' | 'getTextUtf8' | 'getTextUtf8Row' | 'mapping'\n > & {\n /** Normalized UTF-8 column source, when the byte path is active. */\n readonly textUtf8Column?: FastTextUtf8ColumnSource | null;\n }\n): FastTextGlyphCount {\n if (props.textUtf8Column) {\n return countSingleLineUtf8FastTextGlyphs(props, props.textUtf8Column);\n }\n if (props.getTextUtf8) {\n return countSingleLineUtf8ViewFastTextGlyphs(props, props.getTextUtf8);\n }\n return countSingleLineStringFastTextGlyphs(props);\n}\n\n/** Count single-line UTF-8 bytes as glyph records without decoding strings. */\nfunction countSingleLineUtf8FastTextGlyphs<DataT>(\n props: Pick<BuildFastTextGlyphDataProps<DataT>, 'data' | 'getTextUtf8Row'>,\n textUtf8Column: FastTextUtf8ColumnSource\n): FastTextGlyphCount {\n let glyphCount = 0;\n let rowCount = 0;\n const characterSet = new Set<string>();\n const textView: Utf8StringView = {data: EMPTY_BYTES, start: 0, end: 0};\n const {iterable, objectInfo} = createIterable(props.data);\n\n for (const object of iterable) {\n objectInfo.index++;\n rowCount++;\n const rowIndex = resolveTextUtf8Row(props.getTextUtf8Row, object, objectInfo);\n if (rowIndex == null || !getUtf8ColumnSourceRowView(textUtf8Column, rowIndex, textView)) {\n continue;\n }\n glyphCount += textView.end - textView.start;\n }\n\n return {glyphCount, rowCount, characterSet};\n}\n\n/** Count single-line UTF-8 byte-view labels without decoding strings. */\nfunction countSingleLineUtf8ViewFastTextGlyphs<DataT>(\n props: Pick<BuildFastTextGlyphDataProps<DataT>, 'data'>,\n getTextUtf8: FastTextUtf8ViewAccessor<DataT>\n): FastTextGlyphCount {\n let glyphCount = 0;\n let rowCount = 0;\n const characterSet = new Set<string>();\n const textView: Utf8StringView = {data: EMPTY_BYTES, start: 0, end: 0};\n const {iterable, objectInfo} = createIterable(props.data);\n\n for (const object of iterable) {\n objectInfo.index++;\n rowCount++;\n if (getTextUtf8(object, textView, objectInfo)) {\n glyphCount += Math.max(0, textView.end - textView.start);\n }\n }\n\n return {glyphCount, rowCount, characterSet};\n}\n\n/** Count single-line JavaScript string code units without scanning for newline separators. */\nfunction countSingleLineStringFastTextGlyphs<DataT>(\n props: Pick<BuildFastTextGlyphDataProps<DataT>, 'data' | 'getText'>\n): FastTextGlyphCount {\n let glyphCount = 0;\n let rowCount = 0;\n const characterSet = new Set<string>();\n const {iterable, objectInfo} = createIterable(props.data);\n\n for (const object of iterable) {\n objectInfo.index++;\n rowCount++;\n const text = resolveAccessor(props.getText, object, objectInfo) ?? '';\n glyphCount += text.length;\n for (let index = 0; index < text.length; index += 1) {\n characterSet.add(text[index]!);\n }\n }\n\n return {glyphCount, rowCount, characterSet};\n}\n\n/** Count multiline rendered glyphs and rows before allocating fixed-size typed arrays. */\nfunction countMultiLineFastTextGlyphs<DataT>(\n props: Pick<BuildFastTextGlyphDataProps<DataT>, 'data' | 'getText' | 'mapping'>\n): FastTextGlyphCount {\n let glyphCount = 0;\n let rowCount = 0;\n const characterSet = new Set<string>();\n const {iterable, objectInfo} = createIterable(props.data);\n\n for (const object of iterable) {\n objectInfo.index++;\n rowCount++;\n const text = resolveAccessor(props.getText, object, objectInfo) ?? '';\n for (const character of Array.from(text)) {\n if (character === '\\n') {\n continue;\n }\n characterSet.add(character);\n glyphCount++;\n }\n }\n\n return {glyphCount, rowCount, characterSet};\n}\n\n/** Allocate all per-glyph typed arrays for one glyph count. */\nfunction allocateFastTextGlyphAttributes(glyphCount: number): FastTextGlyphAttributes {\n return {\n instanceGlyphData: new Uint8Array(glyphCount * FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE),\n instancePositions: new Float32Array(glyphCount * 2)\n };\n}\n\n/** Build typed record views over the packed generated glyph data. */\nfunction createFastTextGlyphRecordViews(instanceGlyphData: Uint8Array): FastTextGlyphRecordViews {\n return {\n int16Values: new Int16Array(instanceGlyphData.buffer),\n uint16Values: new Uint16Array(instanceGlyphData.buffer),\n uint8Values: instanceGlyphData\n };\n}\n\n/** Create the public glyph data wrapper around generated typed arrays. */\nfunction createFastTextGlyphData(\n countResult: FastTextGlyphCount,\n startIndices: Uint32Array,\n attributes: FastTextGlyphAttributes,\n stats: Omit<FastTextGlyphBuildStats, 'rowCount' | 'glyphCount' | 'attributeByteLength'>\n): FastTextGlyphData {\n const byteLength =\n startIndices.byteLength +\n attributes.instanceGlyphData.byteLength +\n attributes.instancePositions.byteLength;\n return {\n length: countResult.glyphCount,\n startIndices,\n attributes,\n characterSet: countResult.characterSet,\n byteLength,\n buildStats: {\n ...stats,\n rowCount: countResult.rowCount,\n glyphCount: countResult.glyphCount,\n attributeByteLength: byteLength\n }\n };\n}\n\nfunction createFastTextGlyphWriteTimings(): FastTextGlyphWriteTimings {\n return {\n textResolveDurationMs: 0,\n styleAccessorDurationMs: 0,\n layoutDurationMs: 0,\n glyphWriteDurationMs: 0\n };\n}\n\n/** Return one glyph-data object with caller-supplied timing overrides. */\nfunction withFastTextGlyphBuildStats(\n glyphData: FastTextGlyphData,\n stats: Pick<FastTextGlyphBuildStats, 'columnNormalizeDurationMs' | 'totalDurationMs'>\n): FastTextGlyphData {\n return {\n ...glyphData,\n buildStats: {\n ...glyphData.buildStats,\n ...stats\n }\n };\n}\n\n/** Write all generated glyph records for one single-line JavaScript string label row. */\nfunction writeSingleLineStringLabelGlyphs<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>,\n object: DataT,\n objectInfo: AccessorContext<DataT>,\n writeState: FastTextGlyphWriteState,\n timings: FastTextGlyphWriteTimings\n): void {\n const textResolveStartTime = performance.now();\n const text = resolveAccessor(props.getText, object, objectInfo) ?? '';\n timings.textResolveDurationMs += performance.now() - textResolveStartTime;\n if (!text) {\n return;\n }\n\n const styleAccessorStartTime = performance.now();\n const position = resolveAccessor(props.getPosition, object, objectInfo) ?? DEFAULT_POSITION;\n const color = resolveAccessor(props.getColor, object, objectInfo) ?? DEFAULT_COLOR;\n const clipRect = resolveAccessor(props.getClipRect, object, objectInfo) ?? DEFAULT_CLIP_RECT;\n timings.styleAccessorDurationMs += performance.now() - styleAccessorStartTime;\n\n const layoutStartTime = performance.now();\n const width = getSingleLineStringWidth(text, props.mapping);\n const lineOffsetX = ANCHOR_OFFSET_MULTIPLIER[props.textAnchor] * width;\n const rowBaselineY = getSingleLineBaselineY(props);\n timings.layoutDurationMs += performance.now() - layoutStartTime;\n\n let cursorX = 0;\n\n const glyphWriteStartTime = performance.now();\n for (let index = 0; index < text.length; index += 1) {\n const character = text[index]!;\n const frame = props.mapping[character];\n writeFastTextGlyphRecord({\n frame,\n lineOffsetX,\n cursorX,\n rowBaselineY,\n position,\n color,\n clipRect,\n writeState\n });\n cursorX += frame?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n timings.glyphWriteDurationMs += performance.now() - glyphWriteStartTime;\n}\n\n/** Write all generated glyph records for one single-line UTF-8 byte label row. */\nfunction writeSingleLineUtf8LabelGlyphs<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>,\n textUtf8Column: FastTextUtf8ColumnSource,\n byteLookup: FastTextByteGlyphLookup,\n textView: Utf8StringView,\n object: DataT,\n objectInfo: AccessorContext<DataT>,\n writeState: FastTextGlyphWriteState,\n timings: FastTextGlyphWriteTimings\n): void {\n const textResolveStartTime = performance.now();\n const rowIndex = resolveTextUtf8Row(props.getTextUtf8Row, object, objectInfo);\n const hasTextView =\n rowIndex != null && getUtf8ColumnSourceRowView(textUtf8Column, rowIndex, textView);\n timings.textResolveDurationMs += performance.now() - textResolveStartTime;\n if (!hasTextView) {\n return;\n }\n if (textView.end <= textView.start) {\n return;\n }\n\n const styleAccessorStartTime = performance.now();\n const position = resolveAccessor(props.getPosition, object, objectInfo) ?? DEFAULT_POSITION;\n const color = resolveAccessor(props.getColor, object, objectInfo) ?? DEFAULT_COLOR;\n const clipRect = resolveAccessor(props.getClipRect, object, objectInfo) ?? DEFAULT_CLIP_RECT;\n timings.styleAccessorDurationMs += performance.now() - styleAccessorStartTime;\n\n const layoutStartTime = performance.now();\n const width = getSingleLineUtf8Width(textView, byteLookup);\n const lineOffsetX = ANCHOR_OFFSET_MULTIPLIER[props.textAnchor] * width;\n const rowBaselineY = getSingleLineBaselineY(props);\n timings.layoutDurationMs += performance.now() - layoutStartTime;\n\n let cursorX = 0;\n\n const glyphWriteStartTime = performance.now();\n for (let byteIndex = textView.start; byteIndex < textView.end; byteIndex += 1) {\n const frame = byteLookup[textView.data[byteIndex] ?? -1];\n writeFastTextGlyphRecord({\n frame,\n lineOffsetX,\n cursorX,\n rowBaselineY,\n position,\n color,\n clipRect,\n writeState\n });\n cursorX += frame?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n timings.glyphWriteDurationMs += performance.now() - glyphWriteStartTime;\n}\n\n/** Write all generated glyph records for one accessor-provided UTF-8 byte label row. */\nfunction writeSingleLineUtf8ViewLabelGlyphs<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>,\n getTextUtf8: FastTextUtf8ViewAccessor<DataT>,\n byteLookup: FastTextByteGlyphLookup,\n textView: Utf8StringView,\n object: DataT,\n objectInfo: AccessorContext<DataT>,\n writeState: FastTextGlyphWriteState,\n timings: FastTextGlyphWriteTimings\n): void {\n const textResolveStartTime = performance.now();\n const hasTextView = getTextUtf8(object, textView, objectInfo);\n timings.textResolveDurationMs += performance.now() - textResolveStartTime;\n if (!hasTextView || textView.end <= textView.start) {\n return;\n }\n\n const styleAccessorStartTime = performance.now();\n const position = resolveAccessor(props.getPosition, object, objectInfo) ?? DEFAULT_POSITION;\n const color = resolveAccessor(props.getColor, object, objectInfo) ?? DEFAULT_COLOR;\n const clipRect = resolveAccessor(props.getClipRect, object, objectInfo) ?? DEFAULT_CLIP_RECT;\n timings.styleAccessorDurationMs += performance.now() - styleAccessorStartTime;\n\n const layoutStartTime = performance.now();\n const width = getSingleLineUtf8Width(textView, byteLookup);\n const lineOffsetX = ANCHOR_OFFSET_MULTIPLIER[props.textAnchor] * width;\n const rowBaselineY = getSingleLineBaselineY(props);\n timings.layoutDurationMs += performance.now() - layoutStartTime;\n\n let cursorX = 0;\n\n const glyphWriteStartTime = performance.now();\n for (let byteIndex = textView.start; byteIndex < textView.end; byteIndex += 1) {\n const frame = byteLookup[textView.data[byteIndex] ?? -1];\n writeFastTextGlyphRecord({\n frame,\n lineOffsetX,\n cursorX,\n rowBaselineY,\n position,\n color,\n clipRect,\n writeState\n });\n cursorX += frame?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n timings.glyphWriteDurationMs += performance.now() - glyphWriteStartTime;\n}\n\n/** Write all generated glyph records for one multiline source label row. */\nfunction writeMultiLineLabelGlyphs<DataT>(\n props: BuildFastTextGlyphDataProps<DataT>,\n object: DataT,\n objectInfo: AccessorContext<DataT>,\n writeState: FastTextGlyphWriteState,\n timings: FastTextGlyphWriteTimings\n): void {\n const textResolveStartTime = performance.now();\n const text = resolveAccessor(props.getText, object, objectInfo) ?? '';\n timings.textResolveDurationMs += performance.now() - textResolveStartTime;\n if (!text) {\n return;\n }\n\n const styleAccessorStartTime = performance.now();\n const position = resolveAccessor(props.getPosition, object, objectInfo) ?? DEFAULT_POSITION;\n const color = resolveAccessor(props.getColor, object, objectInfo) ?? DEFAULT_COLOR;\n const clipRect = resolveAccessor(props.getClipRect, object, objectInfo) ?? DEFAULT_CLIP_RECT;\n timings.styleAccessorDurationMs += performance.now() - styleAccessorStartTime;\n\n const layoutStartTime = performance.now();\n const lines = buildFastTextLineLayouts(text, props.mapping);\n const lineHeightPixels = props.lineHeight * props.fontSize;\n const labelHeight = lines.length * lineHeightPixels;\n const blockOffsetY = BASELINE_OFFSET_MULTIPLIER[props.alignmentBaseline] * labelHeight;\n timings.layoutDurationMs += performance.now() - layoutStartTime;\n\n const glyphWriteStartTime = performance.now();\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n const lineOffsetX = ANCHOR_OFFSET_MULTIPLIER[props.textAnchor] * line.width;\n const rowBaselineY =\n blockOffsetY + props.baselineOffset + lineHeightPixels / 2 + lineIndex * lineHeightPixels;\n let cursorX = 0;\n\n for (const character of line.characters) {\n const frame = props.mapping[character];\n writeFastTextGlyphRecord({\n frame,\n lineOffsetX,\n cursorX,\n rowBaselineY,\n position,\n color,\n clipRect,\n writeState\n });\n cursorX += frame?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n }\n timings.glyphWriteDurationMs += performance.now() - glyphWriteStartTime;\n}\n\n/** Convert one source text into line widths and per-line characters. */\nfunction buildFastTextLineLayouts(\n text: string,\n mapping: FastTextCharacterMapping\n): FastTextLineLayout[] {\n const lines: FastTextLineLayout[] = [];\n let currentCharacters: string[] = [];\n let currentWidth = 0;\n let currentGlyphCount = 0;\n\n for (const character of Array.from(text)) {\n if (character === '\\n') {\n lines.push({\n characters: currentCharacters,\n width: currentWidth,\n glyphCount: currentGlyphCount\n });\n currentCharacters = [];\n currentWidth = 0;\n currentGlyphCount = 0;\n continue;\n }\n\n const frame = mapping[character];\n currentCharacters.push(character);\n currentWidth += frame?.advance ?? MISSING_CHARACTER_ADVANCE;\n if (frame) {\n currentGlyphCount++;\n }\n }\n\n lines.push({\n characters: currentCharacters,\n width: currentWidth,\n glyphCount: currentGlyphCount\n });\n return lines;\n}\n\n/** Resolve a caller-supplied Arrow vector or pre-normalized source into a direct UTF-8 source. */\nfunction resolveFastTextUtf8ColumnSource(\n textUtf8Column: FastTextUtf8Column | null | undefined\n): FastTextUtf8ColumnSource | null {\n if (!textUtf8Column) {\n return null;\n }\n return isFastTextUtf8ColumnSource(textUtf8Column)\n ? textUtf8Column\n : buildFastTextUtf8ColumnSource(textUtf8Column);\n}\n\n/** Return whether an object already has the normalized UTF-8 column-source shape. */\nfunction isFastTextUtf8ColumnSource(\n textUtf8Column: FastTextUtf8Column\n): textUtf8Column is FastTextUtf8ColumnSource {\n return 'rowCount' in textUtf8Column && 'chunks' in textUtf8Column;\n}\n\n/** Build an ASCII byte-to-glyph lookup from the string-keyed atlas mapping. */\nfunction buildFastTextByteGlyphLookup(mapping: FastTextCharacterMapping): FastTextByteGlyphLookup {\n const lookup = new Array<FastTextCharacter | undefined>(FAST_TEXT_BYTE_LOOKUP_SIZE);\n for (let byte = 0; byte < 128; byte += 1) {\n lookup[byte] = mapping[String.fromCharCode(byte)];\n }\n return lookup;\n}\n\n/** Resolve the source-row index inside a UTF-8 column. */\nfunction resolveTextUtf8Row<DataT>(\n getTextUtf8Row: Accessor<DataT, number | null> | undefined,\n object: DataT,\n objectInfo: AccessorContext<DataT>\n): number | null {\n return getTextUtf8Row === undefined\n ? objectInfo.index\n : resolveAccessor(getTextUtf8Row, object, objectInfo);\n}\n\n/** Compute one single-line string label width without looking for newline separators. */\nfunction getSingleLineStringWidth(text: string, mapping: FastTextCharacterMapping): number {\n let width = 0;\n for (let index = 0; index < text.length; index += 1) {\n width += mapping[text[index]!]?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n return width;\n}\n\n/** Compute one single-line UTF-8 byte label width without decoding bytes to characters. */\nfunction getSingleLineUtf8Width(\n textView: Utf8StringView,\n byteLookup: FastTextByteGlyphLookup\n): number {\n let width = 0;\n for (let byteIndex = textView.start; byteIndex < textView.end; byteIndex += 1) {\n width += byteLookup[textView.data[byteIndex] ?? -1]?.advance ?? MISSING_CHARACTER_ADVANCE;\n }\n return width;\n}\n\n/** Compute the baseline Y position for a one-line label. */\nfunction getSingleLineBaselineY<DataT>(props: BuildFastTextGlyphDataProps<DataT>): number {\n const lineHeightPixels = props.lineHeight * props.fontSize;\n const blockOffsetY = BASELINE_OFFSET_MULTIPLIER[props.alignmentBaseline] * lineHeightPixels;\n return blockOffsetY + props.baselineOffset + lineHeightPixels / 2;\n}\n\n/** Write one packed glyph record into the generated attribute arrays. */\nfunction writeFastTextGlyphRecord(params: {\n /** Glyph atlas frame and metrics, or undefined for missing glyphs. */\n readonly frame: FastTextCharacter | undefined;\n /** Line-level horizontal offset in atlas pixels. */\n readonly lineOffsetX: number;\n /** Cursor X position before the glyph advance is applied. */\n readonly cursorX: number;\n /** Baseline Y position for this glyph row. */\n readonly rowBaselineY: number;\n /** Source label anchor position. */\n readonly position: Position;\n /** Source label color. */\n readonly color: Color;\n /** Source label content clip rectangle. */\n readonly clipRect: FastTextClipRect;\n /** Mutable glyph write cursor and typed-array views. */\n readonly writeState: FastTextGlyphWriteState;\n}): void {\n const frame = params.frame;\n const glyphIndex = params.writeState.glyphIndex;\n const recordInt16Index =\n (glyphIndex * FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE) / Int16Array.BYTES_PER_ELEMENT;\n const glyphX =\n params.lineOffsetX + params.cursorX + (frame?.anchorX ?? 0) - (frame?.width ?? 0) / 2;\n const glyphY = params.rowBaselineY - (frame?.anchorY ?? 0);\n const writeState = params.writeState;\n\n writeFastTextGlyphPosition(writeState.attributes, glyphIndex, params.position);\n writeState.glyphRecordViews.int16Values[recordInt16Index] = toInt16(glyphX);\n writeState.glyphRecordViews.int16Values[recordInt16Index + 1] = toInt16(glyphY);\n writeState.glyphRecordViews.uint16Values[recordInt16Index + 2] = toUint16(frame?.x ?? 0);\n writeState.glyphRecordViews.uint16Values[recordInt16Index + 3] = toUint16(frame?.y ?? 0);\n writeState.glyphRecordViews.uint16Values[recordInt16Index + 4] = toUint16(frame?.width ?? 0);\n writeState.glyphRecordViews.uint16Values[recordInt16Index + 5] = toUint16(frame?.height ?? 0);\n writeFastTextGlyphClipRect(writeState.glyphRecordViews, glyphIndex, params.clipRect);\n writeFastTextGlyphColor(writeState.glyphRecordViews, glyphIndex, params.color);\n writeState.glyphIndex++;\n}\n\n/** Write one source anchor position into the repeated per-glyph position array. */\nfunction writeFastTextGlyphPosition(\n attributes: FastTextGlyphAttributes,\n glyphIndex: number,\n position: Position\n): void {\n const positionOffset = glyphIndex * 2;\n attributes.instancePositions[positionOffset] = position[0] ?? 0;\n attributes.instancePositions[positionOffset + 1] = position[1] ?? 0;\n}\n\n/** Write one source clip rectangle into the packed generated glyph record. */\nfunction writeFastTextGlyphClipRect(\n glyphRecordViews: FastTextGlyphRecordViews,\n glyphIndex: number,\n clipRect: FastTextClipRect\n): void {\n const recordInt16Index =\n (glyphIndex * FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE) / Int16Array.BYTES_PER_ELEMENT;\n glyphRecordViews.int16Values[recordInt16Index + 6] = toInt16(clipRect[0] ?? 0);\n glyphRecordViews.int16Values[recordInt16Index + 7] = toInt16(clipRect[1] ?? 0);\n glyphRecordViews.int16Values[recordInt16Index + 8] = toInt16ClipDimension(clipRect[2] ?? -1);\n glyphRecordViews.int16Values[recordInt16Index + 9] = toInt16ClipDimension(clipRect[3] ?? -1);\n}\n\n/** Write one source color into the packed generated glyph record. */\nfunction writeFastTextGlyphColor(\n glyphRecordViews: FastTextGlyphRecordViews,\n glyphIndex: number,\n color: Color\n): void {\n const recordByteIndex = glyphIndex * FAST_TEXT_GLYPH_VERTEX_BYTE_STRIDE;\n writeColor(\n glyphRecordViews.uint8Values,\n recordByteIndex + Int16Array.BYTES_PER_ELEMENT * 10,\n color\n );\n}\n\n/** Resolve deck accessors that may be constants or functions. */\nfunction resolveAccessor<DataT, ValueT>(\n accessor: Accessor<DataT, ValueT>,\n object: DataT,\n objectInfo: AccessorContext<DataT>\n): ValueT {\n return typeof accessor === 'function'\n ? (accessor as (object: DataT, objectInfo: AccessorContext<DataT>) => ValueT)(\n object,\n objectInfo\n )\n : accessor;\n}\n\n/** Write one deck color into a byte array with a default opaque alpha. */\nfunction writeColor(target: Uint8Array, offset: number, color: Color): void {\n target[offset] = clampByte(color[0] ?? DEFAULT_COLOR[0]);\n target[offset + 1] = clampByte(color[1] ?? DEFAULT_COLOR[1]);\n target[offset + 2] = clampByte(color[2] ?? DEFAULT_COLOR[2]);\n target[offset + 3] = clampByte(color[3] ?? DEFAULT_COLOR[3]);\n}\n\n/** Clamp one color channel into the unsigned byte range. */\nfunction clampByte(value: number): number {\n return Math.max(0, Math.min(255, Math.round(value)));\n}\n\n/** Round and validate one value for the signed 16-bit generated attribute record. */\nfunction toInt16(value: number): number {\n const integerValue = Math.round(value);\n if (integerValue < -32768 || integerValue > 32767) {\n throw new Error(`FastTextLayer value ${value} is outside the signed 16-bit range`);\n }\n return integerValue;\n}\n\n/** Round one clip dimension while preserving positive non-zero values. */\nfunction toInt16ClipDimension(value: number): number {\n const integerValue = value > 0 ? Math.max(1, Math.round(value)) : Math.round(value);\n if (integerValue < -32768 || integerValue > 32767) {\n throw new Error(`FastTextLayer value ${value} is outside the signed 16-bit range`);\n }\n return integerValue;\n}\n\n/** Round and validate one atlas frame value for the unsigned 16-bit generated attribute record. */\nfunction toUint16(value: number): number {\n const integerValue = Math.round(value);\n if (integerValue < 0 || integerValue > 65535) {\n throw new Error(\n `FastTextLayer glyph frame value ${value} is outside the unsigned 16-bit range`\n );\n }\n return integerValue;\n}\n", "import type * as arrow from 'apache-arrow';\n\n/** Byte-range view for one UTF-8 encoded string. */\nexport type Utf8StringView = {\n /** Backing UTF-8 bytes. */\n data: Uint8Array;\n /** Inclusive byte offset where the string starts. */\n start: number;\n /** Exclusive byte offset where the string ends. */\n end: number;\n};\n\n/** Normalized direct-buffer source for one Arrow Utf8 vector. */\nexport type Utf8ColumnSource = {\n /** Number of logical rows in the column. */\n readonly rowCount: number;\n /** Direct-buffer chunks that make up the column. */\n readonly chunks: readonly Utf8ColumnSourceChunk[];\n /** Returns whether one logical row is valid. */\n readonly isValid: (rowIndex: number) => boolean;\n};\n\n/** One direct-buffer chunk in a normalized Arrow Utf8 column source. */\nexport type Utf8ColumnSourceChunk = {\n /** Logical row index where this chunk starts. */\n readonly rowOffset: number;\n /** Number of logical rows in this chunk. */\n readonly rowCount: number;\n /** Row offset inside the chunk's value-offset buffer. */\n readonly valueOffsetIndex: number;\n /** UTF-8 value-offset buffer. */\n readonly valueOffsets: Int32Array | Uint32Array;\n /** Contiguous UTF-8 value bytes. */\n readonly values: Uint8Array;\n};\n\nconst textEncoder = new TextEncoder();\nconst textDecoder = new TextDecoder();\n\n/**\n * Encodes one JavaScript string into a reusable UTF-8 byte view.\n */\nexport function makeUtf8StringView(value: string): Utf8StringView {\n const data = textEncoder.encode(value);\n return {data, start: 0, end: data.length};\n}\n\n/**\n * Builds a direct-buffer source from an Arrow Utf8 vector without copying UTF-8 bytes.\n */\nexport function getArrowUtf8ColumnSource(\n utf8Column: arrow.Vector<arrow.Utf8>\n): Utf8ColumnSource | null {\n const chunks = getArrowUtf8DataChunks(utf8Column);\n if (!chunks || chunks.length === 0) {\n return null;\n }\n\n const sourceChunks: Utf8ColumnSourceChunk[] = [];\n let rowOffset = 0;\n for (const chunk of chunks) {\n const valueOffsets = chunk.valueOffsets;\n const values = chunk.values;\n if (!valueOffsets || !values) {\n return null;\n }\n sourceChunks.push({\n rowOffset,\n rowCount: chunk.length,\n valueOffsetIndex: 0,\n valueOffsets,\n values\n });\n rowOffset += chunk.length;\n }\n\n return {\n rowCount: utf8Column.length,\n chunks: sourceChunks,\n isValid: rowIndex => utf8Column.isValid(rowIndex)\n };\n}\n\n/**\n * Fills a reusable UTF-8 view for one Arrow Utf8 row without decoding the row to a string.\n */\nexport function getArrowUtf8RowView(\n utf8Column: arrow.Vector<arrow.Utf8>,\n rowIndex: number,\n out: Utf8StringView\n): boolean {\n if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex >= utf8Column.length) {\n return false;\n }\n if (!utf8Column.isValid(rowIndex)) {\n return false;\n }\n\n const chunks = getArrowUtf8DataChunks(utf8Column);\n if (!chunks || chunks.length === 0) {\n return false;\n }\n\n let rowOffset = 0;\n for (const chunk of chunks) {\n const chunkEnd = rowOffset + chunk.length;\n if (rowIndex >= rowOffset && rowIndex < chunkEnd) {\n const valueOffsets = chunk.valueOffsets;\n const values = chunk.values;\n if (!valueOffsets || !values) {\n return false;\n }\n return fillUtf8StringView(valueOffsets, values, rowIndex - rowOffset, out);\n }\n rowOffset = chunkEnd;\n }\n\n return false;\n}\n\n/**\n * Fills a reusable UTF-8 view for one normalized Utf8 column row.\n */\nexport function getUtf8ColumnSourceRowView(\n source: Utf8ColumnSource,\n rowIndex: number,\n out: Utf8StringView\n): boolean {\n if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex >= source.rowCount) {\n return false;\n }\n if (!source.isValid(rowIndex)) {\n return false;\n }\n\n for (const chunk of source.chunks) {\n const chunkEnd = chunk.rowOffset + chunk.rowCount;\n if (rowIndex < chunk.rowOffset || rowIndex >= chunkEnd) {\n continue;\n }\n\n return fillUtf8StringView(\n chunk.valueOffsets,\n chunk.values,\n chunk.valueOffsetIndex + rowIndex - chunk.rowOffset,\n out\n );\n }\n\n return false;\n}\n\n/**\n * Finds the first row in an Arrow Utf8 column whose bytes equal the requested string view.\n */\nexport function arrowFindUtf8(\n utf8Column: arrow.Vector<arrow.Utf8>,\n value: Utf8StringView,\n startRow = 0\n): number {\n const normalizedStartRow = Math.max(0, startRow);\n const fastResult = arrowFindUtf8InDataChunks(utf8Column, value, normalizedStartRow);\n if (fastResult !== null) {\n return fastResult;\n }\n\n const expected = decodeUtf8StringView(value);\n for (let rowIndex = normalizedStartRow; rowIndex < utf8Column.length; rowIndex += 1) {\n if (utf8Column.get(rowIndex) === expected) {\n return rowIndex;\n }\n }\n return -1;\n}\n\ntype ArrowUtf8DataChunk = {\n /** Number of rows in this Arrow data chunk. */\n readonly length: number;\n /** Row offset inside the chunk's value-offset buffer. */\n readonly offset?: number;\n /** UTF-8 value-offset buffer. */\n readonly valueOffsets?: Int32Array | Uint32Array;\n /** Contiguous UTF-8 value bytes. */\n readonly values?: Uint8Array;\n};\n\n/**\n * Scans Arrow's contiguous Utf8 buffers directly when the vector exposes them.\n */\nfunction arrowFindUtf8InDataChunks(\n utf8Column: arrow.Vector<arrow.Utf8>,\n value: Utf8StringView,\n startRow: number\n): number | null {\n const chunks = getArrowUtf8DataChunks(utf8Column);\n if (!chunks || chunks.length === 0) {\n return null;\n }\n\n let globalRowOffset = 0;\n for (const chunk of chunks) {\n const valueOffsets = chunk.valueOffsets;\n const values = chunk.values;\n if (!valueOffsets || !values) {\n return null;\n }\n\n const chunkStartRow = Math.max(0, startRow - globalRowOffset);\n for (let chunkRow = chunkStartRow; chunkRow < chunk.length; chunkRow += 1) {\n const globalRow = globalRowOffset + chunkRow;\n if (!utf8Column.isValid(globalRow)) {\n continue;\n }\n\n const start = valueOffsets[chunkRow];\n const end = valueOffsets[chunkRow + 1];\n if (start !== undefined && end !== undefined && utf8BytesEqual(values, start, end, value)) {\n return globalRow;\n }\n }\n globalRowOffset += chunk.length;\n }\n return -1;\n}\n\nfunction getArrowUtf8DataChunks(\n utf8Column: arrow.Vector<arrow.Utf8>\n): readonly ArrowUtf8DataChunk[] | undefined {\n return (utf8Column as unknown as {data?: readonly ArrowUtf8DataChunk[]}).data;\n}\n\nfunction fillUtf8StringView(\n valueOffsets: Int32Array | Uint32Array,\n values: Uint8Array,\n offsetIndex: number,\n out: Utf8StringView\n): boolean {\n const start = valueOffsets[offsetIndex];\n const end = valueOffsets[offsetIndex + 1];\n if (start === undefined || end === undefined) {\n return false;\n }\n\n out.data = values;\n out.start = start;\n out.end = end;\n return true;\n}\n\n/**\n * Returns whether a UTF-8 byte range equals one target UTF-8 view.\n */\nfunction utf8BytesEqual(\n data: Uint8Array,\n start: number,\n end: number,\n value: Utf8StringView\n): boolean {\n const valueLength = value.end - value.start;\n if (end - start !== valueLength) {\n return false;\n }\n for (let index = 0; index < valueLength; index += 1) {\n if (data[start + index] !== value.data[value.start + index]) {\n return false;\n }\n }\n return true;\n}\n\nfunction decodeUtf8StringView(value: Utf8StringView): string {\n return textDecoder.decode(value.data.subarray(value.start, value.end));\n}\n", "// deck.gl and luma.gl inspired text atlas utilities.\n// SPDX-License-Identifier: MIT\n\n/* global document */\n\n/** One rasterized font glyph entry in atlas pixel coordinates. */\nexport type FastTextCharacter = {\n /** Left atlas pixel coordinate. */\n x: number;\n /** Top atlas pixel coordinate. */\n y: number;\n /** Glyph bitmap width in atlas pixels. */\n width: number;\n /** Glyph bitmap height in atlas pixels. */\n height: number;\n /** Horizontal anchor in glyph bitmap pixels. */\n anchorX: number;\n /** Vertical anchor in glyph bitmap pixels. */\n anchorY: number;\n /** Horizontal cursor advance in atlas pixels. */\n advance: number;\n};\n\n/** Lookup from a rendered character to its atlas frame and metrics. */\nexport type FastTextCharacterMapping = Record<string, FastTextCharacter | undefined>;\n\n/** Font rasterization inputs used to build a generated atlas. */\nexport type FastTextFontSettings = {\n /** CSS font family used when rasterizing glyphs. */\n fontFamily?: string;\n /** CSS font weight used when rasterizing glyphs. */\n fontWeight?: string | number;\n /** Characters to rasterize into the atlas. */\n characterSet?: Set<string> | readonly string[] | string;\n /** Atlas rasterization size in CSS pixels. */\n fontSize?: number;\n /** Transparent pixel padding around every glyph. */\n buffer?: number;\n /** Whether generated atlases encode signed distance fields. */\n sdf?: boolean;\n /** SDF inside-glyph cutoff. Larger values make glyphs thinner. */\n cutoff?: number;\n /** SDF distance radius in atlas pixels. */\n radius?: number;\n /** SDF edge smoothing used by the shader. */\n smoothing?: number;\n};\n\n/** Font atlas consumed by {@link FastTextLayer}. */\nexport type FastTextFontAtlas = {\n /** Distance from a label baseline to its visual center in atlas pixels. */\n baselineOffset: number;\n /** Glyph metric lookup keyed by rendered character. */\n mapping: FastTextCharacterMapping;\n /** Canvas containing the packed glyph bitmaps. */\n data: HTMLCanvasElement;\n /** Atlas width in pixels. */\n width: number;\n /** Atlas height in pixels. */\n height: number;\n};\n\n/** Default font settings used by {@link FastTextLayer}. */\nexport const DEFAULT_FAST_TEXT_FONT_SETTINGS: Required<FastTextFontSettings> = {\n fontFamily: 'Monaco, monospace',\n fontWeight: 'normal',\n characterSet: getDefaultCharacterSet(),\n fontSize: 64,\n buffer: 4,\n sdf: true,\n cutoff: 0.25,\n radius: 12,\n smoothing: 0.1\n};\n\n/** Build a font atlas for a fixed character set without retaining a process cache. */\nexport function createFastTextFontAtlas(settings: FastTextFontSettings = {}): FastTextFontAtlas {\n if (typeof document === 'undefined') {\n throw new Error('FastTextLayer font atlas generation requires document.createElement');\n }\n\n const resolvedSettings = {\n ...DEFAULT_FAST_TEXT_FONT_SETTINGS,\n ...settings,\n characterSet: normalizeCharacterSet(\n settings.characterSet ?? DEFAULT_FAST_TEXT_FONT_SETTINGS.characterSet\n )\n };\n const canvas = document.createElement('canvas');\n canvas.width = MAX_CANVAS_WIDTH;\n const context = canvas.getContext('2d', {willReadFrequently: true});\n if (!context) {\n throw new Error('FastTextLayer font atlas generation requires a 2D canvas context');\n }\n\n setTextStyle(context, resolvedSettings);\n const sdfRenderer = resolvedSettings.sdf\n ? createFastTextSdfRenderer(resolvedSettings)\n : undefined;\n const mappingResult = buildFastTextCharacterMapping({\n characterSet: resolvedSettings.characterSet,\n measureText: character => measureFastText(context, resolvedSettings.fontSize, character),\n buffer: resolvedSettings.buffer,\n maxCanvasWidth: MAX_CANVAS_WIDTH\n });\n\n canvas.height = mappingResult.canvasHeight;\n setTextStyle(context, resolvedSettings);\n\n for (const character of resolvedSettings.characterSet) {\n const frame = mappingResult.mapping[character];\n if (frame) {\n if (sdfRenderer) {\n drawFastTextSdfCharacter(context, sdfRenderer, character, frame, resolvedSettings.buffer);\n } else {\n context.fillText(character, frame.x, frame.y + frame.anchorY);\n }\n }\n }\n\n const fontMetrics = measureFastText(context, resolvedSettings.fontSize);\n return {\n baselineOffset: (fontMetrics.ascent - fontMetrics.descent) / 2,\n mapping: mappingResult.mapping,\n data: canvas,\n width: canvas.width,\n height: canvas.height\n };\n}\n\n/** Build glyph atlas frames from text measurements without drawing the atlas canvas. */\nexport function buildFastTextCharacterMapping({\n characterSet,\n measureText,\n buffer,\n maxCanvasWidth\n}: {\n /** Characters that need atlas entries. */\n characterSet: Set<string>;\n /** Glyph measurement callback for one character. */\n measureText: (character: string) => FastTextMeasuredCharacter;\n /** Transparent pixel padding around every glyph. */\n buffer: number;\n /** Maximum atlas row width in pixels. */\n maxCanvasWidth: number;\n}): {\n /** Glyph metric lookup keyed by rendered character. */\n mapping: FastTextCharacterMapping;\n /** Power-of-two atlas height in pixels. */\n canvasHeight: number;\n} {\n const mapping: FastTextCharacterMapping = {};\n let x = 0;\n let yMin = 0;\n let yMax = 0;\n\n for (const character of characterSet) {\n const {advance, width, ascent, descent} = measureText(character);\n const height = ascent + descent;\n if (x + width + buffer * 2 > maxCanvasWidth) {\n x = 0;\n yMin = yMax;\n }\n mapping[character] = {\n x: x + buffer,\n y: yMin + buffer,\n width,\n height,\n advance,\n anchorX: width / 2,\n anchorY: ascent\n };\n x += width + buffer * 2;\n yMax = Math.max(yMax, yMin + height + buffer * 2);\n }\n\n return {\n mapping,\n canvasHeight: Math.max(1, nextPowerOfTwo(yMax))\n };\n}\n\n/** Minimal atlas manager that rebuilds only when rasterization inputs change. */\nexport class FastTextFontAtlasManager {\n /** Current resolved font settings. */\n props: Required<FastTextFontSettings> = {...DEFAULT_FAST_TEXT_FONT_SETTINGS};\n private currentAtlas?: FastTextFontAtlas;\n private currentKey?: string;\n\n /** Current atlas, if one has been built. */\n get atlas(): Readonly<FastTextFontAtlas> | undefined {\n return this.currentAtlas;\n }\n\n /** Current character mapping, if an atlas has been built. */\n get mapping(): FastTextCharacterMapping | undefined {\n return this.currentAtlas?.mapping;\n }\n\n /** Update font settings and return whether the atlas was rebuilt. */\n setProps(props: FastTextFontSettings = {}): boolean {\n this.props = {\n ...this.props,\n ...props,\n characterSet: normalizeCharacterSet(props.characterSet ?? this.props.characterSet)\n };\n const nextKey = getFontAtlasKey(this.props);\n if (this.currentAtlas && this.currentKey === nextKey) {\n return false;\n }\n\n this.currentAtlas = createFastTextFontAtlas(this.props);\n this.currentKey = nextKey;\n return true;\n }\n}\n\ntype FastTextMeasuredCharacter = {\n /** Horizontal cursor advance in atlas pixels. */\n readonly advance: number;\n /** Glyph bitmap width in atlas pixels. */\n readonly width: number;\n /** Distance from baseline to glyph top in atlas pixels. */\n readonly ascent: number;\n /** Distance from baseline to glyph bottom in atlas pixels. */\n readonly descent: number;\n};\n\nconst MAX_CANVAS_WIDTH = 1024;\nconst DEFAULT_ASCENT = 0.9;\nconst DEFAULT_DESCENT = 0.3;\n\n/** Return the default printable ASCII atlas character set. */\nfunction getDefaultCharacterSet(): string[] {\n const characterSet: string[] = [];\n for (let code = 32; code < 128; code++) {\n characterSet.push(String.fromCharCode(code));\n }\n return characterSet;\n}\n\n/** Normalize caller-supplied character sets into a Set for deterministic use. */\nfunction normalizeCharacterSet(\n characterSet: Set<string> | readonly string[] | string\n): Set<string> {\n return typeof characterSet === 'string'\n ? new Set(Array.from(characterSet))\n : new Set(characterSet);\n}\n\n/** Generate a stable atlas key from font settings and sorted character set contents. */\nfunction getFontAtlasKey(settings: Required<FastTextFontSettings>): string {\n const characters = Array.from(settings.characterSet).sort().join('');\n return [\n settings.fontFamily,\n settings.fontWeight,\n settings.fontSize,\n settings.buffer,\n settings.sdf,\n settings.cutoff,\n settings.radius,\n characters\n ].join('\\n');\n}\n\n/** Apply font rendering settings to a 2D canvas context. */\nfunction setTextStyle(\n context: CanvasRenderingContext2D,\n settings: Pick<Required<FastTextFontSettings>, 'fontFamily' | 'fontSize' | 'fontWeight'>\n): void {\n context.font = `${settings.fontWeight} ${settings.fontSize}px ${settings.fontFamily}`;\n context.fillStyle = '#000';\n context.textBaseline = 'alphabetic';\n context.textAlign = 'left';\n}\n\n/** Measure one character or the fallback font metrics for the current canvas font. */\nfunction measureFastText(\n context: CanvasRenderingContext2D,\n fontSize: number,\n character?: string\n): FastTextMeasuredCharacter {\n if (character === undefined) {\n const fontMetrics = context.measureText('A');\n if (fontMetrics.fontBoundingBoxAscent) {\n return {\n advance: 0,\n width: 0,\n ascent: Math.ceil(fontMetrics.fontBoundingBoxAscent),\n descent: Math.ceil(fontMetrics.fontBoundingBoxDescent)\n };\n }\n return {\n advance: 0,\n width: 0,\n ascent: fontSize * DEFAULT_ASCENT,\n descent: fontSize * DEFAULT_DESCENT\n };\n }\n\n const metrics = context.measureText(character);\n if (!metrics.actualBoundingBoxAscent) {\n return {\n advance: metrics.width,\n width: metrics.width,\n ascent: fontSize * DEFAULT_ASCENT,\n descent: fontSize * DEFAULT_DESCENT\n };\n }\n return {\n advance: metrics.width,\n width: Math.ceil(metrics.actualBoundingBoxRight - metrics.actualBoundingBoxLeft),\n ascent: Math.ceil(metrics.actualBoundingBoxAscent),\n descent: Math.ceil(metrics.actualBoundingBoxDescent)\n };\n}\n\n/** Create a local TinySDF-style renderer for one resolved font. */\nfunction createFastTextSdfRenderer(\n settings: Pick<\n Required<FastTextFontSettings>,\n 'buffer' | 'cutoff' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'radius'\n >\n): FastTextSdfRenderer {\n const buffer = Math.ceil(settings.buffer);\n const size = Math.ceil(settings.fontSize + buffer * 4);\n const scratchSize = size + buffer;\n const canvas = document.createElement('canvas');\n canvas.width = size;\n canvas.height = size;\n const context = canvas.getContext('2d', {willReadFrequently: true});\n if (!context) {\n throw new Error('FastTextLayer SDF generation requires a 2D canvas context');\n }\n\n setTextStyle(context, settings);\n const gridOuter = new Float64Array(scratchSize * scratchSize);\n const gridInner = new Float64Array(scratchSize * scratchSize);\n const f = new Float64Array(scratchSize);\n const z = new Float64Array(scratchSize + 1);\n const v = new Uint16Array(scratchSize);\n return {\n draw: character =>\n drawFastTextSdfGlyph({\n character,\n context,\n fontSize: settings.fontSize,\n buffer,\n cutoff: settings.cutoff,\n radius: settings.radius,\n size,\n gridOuter,\n gridInner,\n f,\n z,\n v\n })\n };\n}\n\n/** Draw one SDF glyph into the target atlas canvas. */\nfunction drawFastTextSdfCharacter(\n context: CanvasRenderingContext2D,\n sdfRenderer: FastTextSdfRenderer,\n character: string,\n frame: FastTextCharacter,\n buffer: number\n): void {\n const {data, width, height} = sdfRenderer.draw(character);\n const imageData = context.createImageData(width, height);\n populateAlphaChannel(data, imageData);\n\n const x = frame.x - buffer;\n const y = frame.y - buffer;\n const x0 = Math.max(0, Math.round(x));\n const y0 = Math.max(0, Math.round(y));\n const w = Math.min(width, context.canvas.width - x0);\n const h = Math.min(height, context.canvas.height - y0);\n context.putImageData(imageData, x0, y0, 0, 0, w, h);\n\n frame.x += x0 - x;\n frame.y += y0 - y;\n}\n\n/** Copy grayscale SDF values into an ImageData alpha channel. */\nfunction populateAlphaChannel(\n alphaChannel: Uint8ClampedArray | Uint8Array,\n imageData: ImageData\n): void {\n for (let index = 0; index < alphaChannel.length; index++) {\n imageData.data[4 * index + 3] = alphaChannel[index];\n }\n}\n\ntype FastTextSdfRenderer = {\n /** Draw one character into a grayscale SDF glyph buffer. */\n draw: (character: string) => FastTextSdfGlyph;\n};\n\ntype FastTextSdfGlyph = {\n /** Grayscale SDF values for the glyph image. */\n readonly data: Uint8ClampedArray;\n /** Width of the returned SDF image in pixels. */\n readonly width: number;\n /** Height of the returned SDF image in pixels. */\n readonly height: number;\n};\n\ntype DrawFastTextSdfGlyphProps = {\n /** Character to rasterize. */\n readonly character: string;\n /** Canvas context configured with the target font. */\n readonly context: CanvasRenderingContext2D;\n /** Font size used for metric fallbacks. */\n readonly fontSize: number;\n /** SDF padding around the glyph. */\n readonly buffer: number;\n /** SDF inside-glyph cutoff. */\n readonly cutoff: number;\n /** SDF distance radius. */\n readonly radius: number;\n /** Square scratch canvas dimension. */\n readonly size: number;\n /** Scratch grid for distances outside the glyph. */\n readonly gridOuter: Float64Array;\n /** Scratch grid for distances inside the glyph. */\n readonly gridInner: Float64Array;\n /** Scratch values for the 1D distance transform. */\n readonly f: Float64Array;\n /** Scratch boundary locations for the 1D distance transform. */\n readonly z: Float64Array;\n /** Scratch source indices for the 1D distance transform. */\n readonly v: Uint16Array;\n};\n\nconst FAST_TEXT_SDF_INF = 1e20;\n\n/** Rasterize one glyph and convert its alpha mask into signed distance values. */\nfunction drawFastTextSdfGlyph({\n character,\n context,\n fontSize,\n buffer,\n cutoff,\n radius,\n size,\n gridOuter,\n gridInner,\n f,\n z,\n v\n}: DrawFastTextSdfGlyphProps): FastTextSdfGlyph {\n const metrics = context.measureText(character);\n const glyphTop = Math.ceil(metrics.actualBoundingBoxAscent ?? fontSize * DEFAULT_ASCENT);\n const glyphWidth = Math.max(\n 0,\n Math.min(\n size - buffer,\n Math.ceil(\n (metrics.actualBoundingBoxRight ?? metrics.width) - (metrics.actualBoundingBoxLeft ?? 0)\n )\n )\n );\n const glyphHeight = Math.min(\n size - buffer,\n glyphTop + Math.ceil(metrics.actualBoundingBoxDescent ?? fontSize * DEFAULT_DESCENT)\n );\n const width = glyphWidth + 2 * buffer;\n const height = glyphHeight + 2 * buffer;\n const data = new Uint8ClampedArray(Math.max(width * height, 0));\n if (glyphWidth === 0 || glyphHeight === 0) {\n return {data, width, height};\n }\n\n context.clearRect(buffer, buffer, glyphWidth, glyphHeight);\n context.fillText(character, buffer, buffer + glyphTop);\n const imageData = context.getImageData(buffer, buffer, glyphWidth, glyphHeight);\n\n gridOuter.fill(FAST_TEXT_SDF_INF, 0, data.length);\n gridInner.fill(0, 0, data.length);\n\n for (let y = 0; y < glyphHeight; y++) {\n for (let x = 0; x < glyphWidth; x++) {\n const alpha = imageData.data[4 * (y * glyphWidth + x) + 3] / 255;\n if (alpha === 0) {\n continue;\n }\n\n const gridIndex = (y + buffer) * width + x + buffer;\n if (alpha === 1) {\n gridOuter[gridIndex] = 0;\n gridInner[gridIndex] = FAST_TEXT_SDF_INF;\n } else {\n const distance = 0.5 - alpha;\n gridOuter[gridIndex] = distance > 0 ? distance * distance : 0;\n gridInner[gridIndex] = distance < 0 ? distance * distance : 0;\n }\n }\n }\n\n transformFastTextSdfGrid(gridOuter, 0, 0, width, height, width, f, v, z);\n transformFastTextSdfGrid(gridInner, buffer, buffer, glyphWidth, glyphHeight, width, f, v, z);\n\n for (let index = 0; index < data.length; index++) {\n const distance = Math.sqrt(gridOuter[index]) - Math.sqrt(gridInner[index]);\n data[index] = Math.round(255 - 255 * (distance / radius + cutoff));\n }\n return {data, width, height};\n}\n\n/** Run a 2D squared Euclidean distance transform over one SDF grid. */\nfunction transformFastTextSdfGrid(\n data: Float64Array,\n x0: number,\n y0: number,\n width: number,\n height: number,\n gridSize: number,\n f: Float64Array,\n v: Uint16Array,\n z: Float64Array\n): void {\n for (let x = x0; x < x0 + width; x++) {\n transformFastTextSdfGrid1d(data, y0 * gridSize + x, gridSize, height, f, v, z);\n }\n for (let y = y0; y < y0 + height; y++) {\n transformFastTextSdfGrid1d(data, y * gridSize + x0, 1, width, f, v, z);\n }\n}\n\n/** Run the 1D pass for the squared Euclidean distance transform. */\nfunction transformFastTextSdfGrid1d(\n grid: Float64Array,\n offset: number,\n stride: number,\n length: number,\n f: Float64Array,\n v: Uint16Array,\n z: Float64Array\n): void {\n v[0] = 0;\n z[0] = -FAST_TEXT_SDF_INF;\n z[1] = FAST_TEXT_SDF_INF;\n f[0] = grid[offset];\n\n for (let q = 1, k = 0; q < length; q++) {\n f[q] = grid[offset + q * stride];\n const q2 = q * q;\n let s = 0;\n do {\n const r = v[k];\n s = (f[q] - f[r] + q2 - r * r) / (q - r) / 2;\n } while (s <= z[k] && --k > -1);\n\n k++;\n v[k] = q;\n z[k] = s;\n z[k + 1] = FAST_TEXT_SDF_INF;\n }\n\n for (let q = 0, k = 0; q < length; q++) {\n while (z[k + 1] < q) {\n k++;\n }\n const r = v[k];\n const qr = q - r;\n grid[offset + q * stride] = f[r] + qr * qr;\n }\n}\n\n/** Return the next power-of-two canvas dimension for one positive number. */\nfunction nextPowerOfTwo(value: number): number {\n return Math.pow(2, Math.ceil(Math.log2(Math.max(1, value))));\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds} from './bounds-utils';\n\n/**\n * Fits two-dimensional bounds into an orthographic viewport using one shared zoom value.\n * @param width - Viewport width in pixels.\n * @param height - Viewport height in pixels.\n * @param bounds - World-space bounds to fit.\n * @param zoomMode - Shared-zoom mode selector.\n * @returns View target and shared/per-axis zoom values.\n */\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'single'\n): {target: [number, number]; zoom: number; zoomX: number; zoomY: number};\n\n/**\n * Fits two-dimensional bounds into an orthographic viewport using one zoom per axis.\n * @param width - Viewport width in pixels.\n * @param height - Viewport height in pixels.\n * @param bounds - World-space bounds to fit.\n * @param zoomMode - Per-axis zoom mode selector.\n * @returns View target and per-axis zoom values.\n */\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'per-axis'\n): {target: [number, number]; zoom: [number, number]; zoomX: number; zoomY: number};\n\n/**\n * Fits two-dimensional bounds into an orthographic viewport.\n * @param width - Viewport width in pixels.\n * @param height - Viewport height in pixels.\n * @param bounds - World-space bounds to fit.\n * @param zoomMode - Whether to use one shared zoom or one zoom per axis.\n * @returns View target plus deck.gl orthographic zoom values.\n */\nexport function fitBoundsOrthographic(\n width: number,\n height: number,\n bounds: Readonly<Bounds>,\n zoomMode: 'single' | 'per-axis' = 'per-axis'\n): {\n target: [number, number];\n zoom: number | [number, number];\n zoomX: number;\n zoomY: number;\n} {\n const [[minX, minY], [maxX, maxY]] = bounds;\n\n // center of the box\n const centerX = (minX + maxX) / 2;\n const centerY = (minY + maxY) / 2;\n\n // size of the box\n const boxW = Math.max(0, maxX - minX);\n const boxH = Math.max(0, maxY - minY);\n\n // scale (world units \u2192 screen pixels)\n const scaleX = boxW ? Math.max(1, width) / boxW : 1;\n const scaleY = boxH ? Math.max(1, height) / boxH : 1;\n\n // pick the smaller scale so the whole box fits\n const scale = Math.min(scaleX, scaleY);\n\n // deck.gl orthographic zoom is log2(scale)\n const zoom = Math.log2(scale);\n\n // 3) axis\u2010specific zooms (deck.gl\u2019s orthographic zoom = log2(scale))\n const zoomX = Math.log2(scaleX);\n const zoomY = Math.log2(scaleY);\n\n if (Number.isNaN(zoom) || Number.isNaN(zoomX) || Number.isNaN(zoomY)) {\n // eslint-disable-next-line no-console\n console.warn('Invalid zoom values:', {zoom, zoomX, zoomY});\n }\n\n return {\n target: [centerX, centerY],\n zoom: zoomMode === 'single' ? zoom : [zoomX, zoomY],\n zoomX: zoomMode === 'single' ? zoom : zoomX,\n zoomY: zoomMode === 'single' ? zoom : zoomY\n };\n}\n\n/**\n * Computes world-space bounds covered by an orthographic viewport.\n * @param width - Viewport width in pixels.\n * @param height - Viewport height in pixels.\n * @param zoom - Deck.gl orthographic zoom level, as one value or `[zoomX, zoomY]`.\n * @param target - Deck.gl orthographic target `[centerX, centerY]`.\n * @returns World-space bounds covered by the viewport.\n */\nexport function getBoundsOrthographic(\n width: number,\n height: number,\n zoom: number | [number, number],\n target: [number, number]\n): Bounds {\n const [centerX, centerY] = target;\n const scaleX = Array.isArray(zoom) ? 2 ** zoom[0] : 2 ** zoom;\n const scaleY = Array.isArray(zoom) ? 2 ** zoom[1] : 2 ** zoom;\n const worldW = width / scaleX;\n const worldH = height / scaleY;\n\n return [\n [centerX - worldW / 2, centerY - worldH / 2],\n [centerX + worldW / 2, centerY + worldH / 2]\n ];\n}\n", "import {View} from '@deck.gl/core';\n\n/** CSS-like length accepted by the view layout builder. */\nexport type ViewLayoutLength = number | string;\n\n/** Insets applied inside an allocated child rectangle before compiling its contents. */\nexport type ViewLayoutInsets = {\n /** Top inset in pixels. */\n top?: number;\n /** Right inset in pixels. */\n right?: number;\n /** Bottom inset in pixels. */\n bottom?: number;\n /** Left inset in pixels. */\n left?: number;\n};\n\n/** A raw deck.gl view or nested layout item allowed inside `children`. */\nexport type ViewLayoutChild = ViewLayoutItem | View | null | false | undefined;\n\n/** Common layout metadata shared by every authored layout item. */\nexport type ViewLayoutBaseProps = {\n /** Optional width expression resolved against the current parent bounds. */\n width?: ViewLayoutLength;\n /** Optional height expression resolved against the current parent bounds. */\n height?: ViewLayoutLength;\n /** Optional insets applied after parent layout allocation. */\n inset?: ViewLayoutInsets;\n};\n\n/** One horizontal layout container that splits width among its children. */\nexport type ViewLayoutRowProps = ViewLayoutBaseProps & {\n /** Discriminator for horizontal stack layout. */\n type: 'row';\n /** Ordered child items or raw deck views. */\n children: readonly ViewLayoutChild[];\n};\n\n/** One vertical layout container that splits height among its children. */\nexport type ViewLayoutColumnProps = ViewLayoutBaseProps & {\n /** Discriminator for vertical stack layout. */\n type: 'column';\n /** Ordered child items or raw deck views. */\n children: readonly ViewLayoutChild[];\n};\n\n/** One overlay container that gives each child the same parent bounds. */\nexport type ViewLayoutOverlayProps = ViewLayoutBaseProps & {\n /** Discriminator for overlay layout. */\n type: 'overlay';\n /** Ordered child items or raw deck views. */\n children: readonly ViewLayoutChild[];\n};\n\n/** One wrapped raw deck view with optional layout-only overrides. */\nexport type ViewLayoutViewProps = ViewLayoutBaseProps & {\n /** Discriminator for a wrapped raw deck view. */\n type: 'view';\n /** Underlying deck.gl view instance to compile. */\n view: View;\n};\n\n/** One empty slot used to reserve fixed space in a stack. */\nexport type ViewLayoutSpacerProps = ViewLayoutBaseProps & {\n /** Discriminator for an empty spacer item. */\n type: 'spacer';\n};\n\n/** Discriminated union accepted by the `ViewLayoutItem` constructor. */\nexport type ViewLayoutItemProps =\n | ViewLayoutRowProps\n | ViewLayoutColumnProps\n | ViewLayoutOverlayProps\n | ViewLayoutViewProps\n | ViewLayoutSpacerProps;\n\n/**\n * Thin runtime wrapper around one discriminated-union layout node.\n */\nexport class ViewLayoutItem {\n /** Validated props backing this layout node. */\n readonly props: ViewLayoutItemProps;\n\n /**\n * Creates one validated layout item from discriminated-union props.\n *\n * @param props - Layout item props keyed by `type`.\n */\n constructor(props: ViewLayoutItemProps) {\n assertViewLayoutItemProps(props);\n this.props = props;\n }\n}\n\n/**\n * Validates one discriminated-union prop object before storing it on a layout item.\n *\n * @param props - Candidate layout props passed to the constructor.\n */\nfunction assertViewLayoutItemProps(props: ViewLayoutItemProps): void {\n if (!props || typeof props !== 'object') {\n throw new Error('ViewLayoutItem props must be an object.');\n }\n\n switch (props.type) {\n case 'row':\n case 'column':\n case 'overlay':\n if (!Array.isArray(props.children)) {\n throw new Error(`ViewLayoutItem \"${props.type}\" requires a children array.`);\n }\n break;\n case 'view':\n if (!(props.view instanceof View)) {\n throw new Error('ViewLayoutItem \"view\" requires a deck.gl View instance.');\n }\n break;\n case 'spacer':\n break;\n default: {\n const exhaustiveCheck: never = props;\n throw new Error(`Unsupported view layout item: ${String(exhaustiveCheck)}`);\n }\n }\n}\n", "import {View} from '@deck.gl/core';\n\nimport {ViewLayoutItem} from './view-layout-item';\n\nimport type {ViewLayoutChild, ViewLayoutInsets, ViewLayoutLength} from './view-layout-item';\n\n/** Rectangle resolved by the layout compiler for one view id. */\nexport type ViewLayoutRect = {\n /** Left coordinate in deck pixels. */\n x: number;\n /** Top coordinate in deck pixels. */\n y: number;\n /** Width in deck pixels. */\n width: number;\n /** Height in deck pixels. */\n height: number;\n};\n\n/** Concrete views plus resolved rectangles produced by `buildViewsFromViewLayout`. */\nexport type CompiledDeckViews = {\n /** Concrete deck.gl views with numeric bounds resolved for the current canvas size. */\n views: View[];\n /** Resolved rectangles keyed by deck view id. */\n rectsById: Record<string, ViewLayoutRect>;\n};\n\n/** Minimal deck.gl view props shape needed by the layout compiler. */\ntype LayoutAwareViewProps = {\n /** Stable deck.gl view id. */\n id?: string;\n /** Left offset relative to the current parent bounds. */\n x?: ViewLayoutLength;\n /** Top offset relative to the current parent bounds. */\n y?: ViewLayoutLength;\n /** Width expression resolved against the current parent bounds. */\n width?: ViewLayoutLength;\n /** Height expression resolved against the current parent bounds. */\n height?: ViewLayoutLength;\n} & Record<string, unknown>;\n\n/**\n * Compiles one `ViewLayoutItem` tree into concrete deck.gl views and resolved rectangles.\n *\n * @param args - Root layout plus the current canvas size and optional previous compilation.\n * @returns Concrete views with numeric bounds plus resolved rectangles keyed by view id.\n */\nexport function buildViewsFromViewLayout(args: {\n /** Root layout tree to compile. */\n layout: ViewLayoutItem;\n /** Current deck width in pixels. */\n width: number;\n /** Current deck height in pixels. */\n height: number;\n /** Optional previous compilation used for structural view reuse. */\n previous?: CompiledDeckViews;\n}): CompiledDeckViews {\n const rootRect: ViewLayoutRect = {\n x: 0,\n y: 0,\n width: Math.max(1, args.width),\n height: Math.max(1, args.height)\n };\n const previousViewsById = new Map(\n (args.previous?.views ?? [])\n .map(view => [getViewId(view), view] as const)\n .filter((entry): entry is [string, View] => Boolean(entry[0]))\n );\n const outputViews: View[] = [];\n const rectsById: Record<string, ViewLayoutRect> = {};\n\n compileLayoutItem({\n item: args.layout,\n rect: rootRect,\n outputViews,\n rectsById,\n previousViewsById\n });\n\n return {\n views: outputViews,\n rectsById\n };\n}\n\n/**\n * Compiles one validated layout node inside the given parent rectangle.\n *\n * @param args - Layout item, allocated bounds, and compilation accumulators.\n */\nfunction compileLayoutItem(args: {\n item: ViewLayoutItem;\n rect: ViewLayoutRect;\n outputViews: View[];\n rectsById: Record<string, ViewLayoutRect>;\n previousViewsById: Map<string, View>;\n}): void {\n const {item} = args;\n\n switch (item.props.type) {\n case 'row':\n compileStackLayout({...args, orientation: 'row', children: item.props.children});\n return;\n case 'column':\n compileStackLayout({...args, orientation: 'column', children: item.props.children});\n return;\n case 'overlay':\n compileOverlayLayout({...args, children: item.props.children});\n return;\n case 'view':\n compileResolvedView({\n view: item.props.view,\n rect: applyInsets(args.rect, item.props.inset),\n outputViews: args.outputViews,\n rectsById: args.rectsById,\n previousViewsById: args.previousViewsById\n });\n return;\n case 'spacer':\n return;\n }\n}\n\n/**\n * Compiles one stack container by splitting the stack axis across its children.\n *\n * @param args - Stack orientation, children, and compilation accumulators.\n */\nfunction compileStackLayout(args: {\n item: ViewLayoutItem;\n rect: ViewLayoutRect;\n orientation: 'row' | 'column';\n children: readonly ViewLayoutChild[];\n outputViews: View[];\n rectsById: Record<string, ViewLayoutRect>;\n previousViewsById: Map<string, View>;\n}): void {\n const containerRect = applyInsets(args.rect, args.item.props.inset);\n const children = args.children.filter(isPresentChild);\n if (children.length === 0) {\n return;\n }\n\n const containerAxisLength =\n args.orientation === 'row' ? containerRect.width : containerRect.height;\n const explicitLengths = children.map(child =>\n resolveStackChildAxisLength(child, args.orientation, containerAxisLength)\n );\n const fixedLength = explicitLengths.reduce<number>((sum, length) => sum + (length ?? 0), 0);\n const flexibleChildCount = explicitLengths.filter(length => length === undefined).length;\n const flexibleLength =\n flexibleChildCount > 0\n ? Math.max(containerAxisLength - fixedLength, 0) / flexibleChildCount\n : 0;\n\n let cursor = args.orientation === 'row' ? containerRect.x : containerRect.y;\n children.forEach((child, index) => {\n const childAxisLength = explicitLengths[index] ?? flexibleLength;\n const childRect =\n args.orientation === 'row'\n ? {\n x: cursor,\n y: containerRect.y,\n width: childAxisLength,\n height: containerRect.height\n }\n : {\n x: containerRect.x,\n y: cursor,\n width: containerRect.width,\n height: childAxisLength\n };\n cursor += childAxisLength;\n compileLayoutChild({\n child,\n rect: childRect,\n outputViews: args.outputViews,\n rectsById: args.rectsById,\n previousViewsById: args.previousViewsById\n });\n });\n}\n\n/**\n * Compiles one overlay container by giving every child the same parent rectangle.\n *\n * @param args - Overlay children, parent rectangle, and compilation accumulators.\n */\nfunction compileOverlayLayout(args: {\n item: ViewLayoutItem;\n rect: ViewLayoutRect;\n children: readonly ViewLayoutChild[];\n outputViews: View[];\n rectsById: Record<string, ViewLayoutRect>;\n previousViewsById: Map<string, View>;\n}): void {\n const containerRect = applyInsets(args.rect, args.item.props.inset);\n args.children.filter(isPresentChild).forEach(child =>\n compileLayoutChild({\n child,\n rect: containerRect,\n outputViews: args.outputViews,\n rectsById: args.rectsById,\n previousViewsById: args.previousViewsById\n })\n );\n}\n\n/**\n * Compiles one child entry, which may be a nested layout item or a raw deck view.\n *\n * @param args - Child node plus the rectangle allocated for it.\n */\nfunction compileLayoutChild(args: {\n child: Exclude<ViewLayoutChild, null | false | undefined>;\n rect: ViewLayoutRect;\n outputViews: View[];\n rectsById: Record<string, ViewLayoutRect>;\n previousViewsById: Map<string, View>;\n}): void {\n if (args.child instanceof ViewLayoutItem) {\n compileLayoutItem({\n item: args.child,\n rect: args.rect,\n outputViews: args.outputViews,\n rectsById: args.rectsById,\n previousViewsById: args.previousViewsById\n });\n return;\n }\n\n compileResolvedView({\n view: args.child,\n rect: args.rect,\n outputViews: args.outputViews,\n rectsById: args.rectsById,\n previousViewsById: args.previousViewsById\n });\n}\n\n/**\n * Resolves one raw deck view against a parent rectangle and reuses a previous instance when equal.\n *\n * @param args - View instance, allocated rectangle, and compilation accumulators.\n */\nfunction compileResolvedView(args: {\n view: View;\n rect: ViewLayoutRect;\n outputViews: View[];\n rectsById: Record<string, ViewLayoutRect>;\n previousViewsById: Map<string, View>;\n}): void {\n const resolvedRect = resolveViewRectWithinParent(args.view, args.rect);\n const viewId = getRequiredViewId(args.view);\n args.rectsById[viewId] = resolvedRect;\n const nextProps = {\n ...args.view.props,\n x: resolvedRect.x,\n y: resolvedRect.y,\n width: resolvedRect.width,\n height: resolvedRect.height\n };\n const previousView = args.previousViewsById.get(viewId);\n const nextView =\n previousView &&\n previousView.constructor === args.view.constructor &&\n arePropsEqual(previousView.props as Record<string, unknown>, nextProps)\n ? previousView\n : instantiateView(args.view, nextProps);\n args.outputViews.push(nextView);\n}\n\n/**\n * Resolves one stack child length in the active stack axis, if it declares one.\n *\n * @param child - Stack child to inspect.\n * @param orientation - Active stack orientation.\n * @param parentAxisLength - Parent length in the active stack axis.\n * @returns Numeric child length, or `undefined` when the child should share remaining space.\n */\nfunction resolveStackChildAxisLength(\n child: Exclude<ViewLayoutChild, null | false | undefined>,\n orientation: 'row' | 'column',\n parentAxisLength: number\n): number | undefined {\n const axisValue = getAxisLengthValue(child, orientation);\n if (axisValue === undefined) {\n return undefined;\n }\n return resolveLength(axisValue, parentAxisLength);\n}\n\n/**\n * Resolves one raw deck view rectangle within the given parent rectangle.\n *\n * @param view - Raw deck view instance to position.\n * @param parentRect - Parent rectangle allocated by the layout compiler.\n * @returns Concrete rectangle for the compiled view.\n */\nfunction resolveViewRectWithinParent(view: View, parentRect: ViewLayoutRect): ViewLayoutRect {\n const props = view.props as LayoutAwareViewProps;\n const x = parentRect.x + resolveOffset(props.x, parentRect.width);\n const y = parentRect.y + resolveOffset(props.y, parentRect.height);\n const width = resolveDimension(props.width, parentRect.width, parentRect.width);\n const height = resolveDimension(props.height, parentRect.height, parentRect.height);\n return {\n x,\n y,\n width,\n height\n };\n}\n\n/**\n * Re-instantiates one deck view with a new resolved props object.\n *\n * @param view - Existing deck view instance whose constructor should be reused.\n * @param props - Resolved props for the compiled view.\n * @returns Fresh deck view instance with resolved numeric bounds.\n */\nfunction instantiateView(view: View, props: Record<string, unknown>): View {\n const ViewConstructor = view.constructor as new (viewProps: Record<string, unknown>) => View;\n return new ViewConstructor(props);\n}\n\n/**\n * Reads the stack-axis length expression from one child, whether nested or raw.\n *\n * @param child - Candidate child entry.\n * @param orientation - Active stack orientation.\n * @returns Width for rows, height for columns, or `undefined` for flexible children.\n */\nfunction getAxisLengthValue(\n child: Exclude<ViewLayoutChild, null | false | undefined>,\n orientation: 'row' | 'column'\n): ViewLayoutLength | undefined {\n if (child instanceof ViewLayoutItem) {\n return orientation === 'row' ? child.props.width : child.props.height;\n }\n const props = child.props as LayoutAwareViewProps;\n return orientation === 'row'\n ? (props.width as ViewLayoutLength | undefined)\n : (props.height as ViewLayoutLength | undefined);\n}\n\n/**\n * Shrinks one rectangle by optional insets.\n *\n * @param rect - Rectangle allocated by the parent layout step.\n * @param inset - Insets to apply inside that rectangle.\n * @returns Inset rectangle clamped to non-negative size.\n */\nfunction applyInsets(rect: ViewLayoutRect, inset: ViewLayoutInsets | undefined): ViewLayoutRect {\n if (!inset) {\n return rect;\n }\n const top = inset.top ?? 0;\n const right = inset.right ?? 0;\n const bottom = inset.bottom ?? 0;\n const left = inset.left ?? 0;\n return {\n x: rect.x + left,\n y: rect.y + top,\n width: Math.max(0, rect.width - left - right),\n height: Math.max(0, rect.height - top - bottom)\n };\n}\n\n/**\n * Resolves one optional x/y offset against a parent length.\n *\n * @param value - Authored offset expression.\n * @param parentLength - Parent width or height used for percentage resolution.\n * @returns Numeric offset in deck pixels.\n */\nfunction resolveOffset(value: unknown, parentLength: number): number {\n if (value === undefined || value === null) {\n return 0;\n }\n return resolveLength(value as ViewLayoutLength, parentLength);\n}\n\n/**\n * Resolves one optional width or height against a parent length.\n *\n * @param value - Authored dimension expression.\n * @param parentLength - Parent width or height used for percentage resolution.\n * @param fallback - Fallback dimension used when no explicit expression is provided.\n * @returns Numeric dimension in deck pixels.\n */\nfunction resolveDimension(value: unknown, parentLength: number, fallback: number): number {\n if (value === undefined || value === null) {\n return fallback;\n }\n return resolveLength(value as ViewLayoutLength, parentLength);\n}\n\n/**\n * Resolves one numeric, percentage, or `calc(...)` length expression.\n *\n * @param value - Authored length expression.\n * @param parentLength - Parent length used for percentage resolution.\n * @returns Numeric length in deck pixels.\n */\nfunction resolveLength(value: ViewLayoutLength, parentLength: number): number {\n if (typeof value === 'number') {\n return value;\n }\n\n const normalized = value.trim();\n if (normalized.length === 0) {\n throw new Error('View layout length must not be empty.');\n }\n if (normalized.startsWith('calc(') && normalized.endsWith(')')) {\n return resolveCalcExpression(normalized.slice(5, -1), parentLength);\n }\n return resolveLengthTerm(normalized, parentLength);\n}\n\n/**\n * Resolves one simple `calc(...)` expression made of additive length terms.\n *\n * @param expression - Inner `calc(...)` expression without the wrapper.\n * @param parentLength - Parent length used for percentage resolution.\n * @returns Numeric length in deck pixels.\n */\nfunction resolveCalcExpression(expression: string, parentLength: number): number {\n const sanitized = expression.replace(/\\s+/g, '');\n const terms = sanitized.match(/[+-]?[^+-]+/g);\n if (!terms) {\n throw new Error(`Unsupported calc expression: calc(${expression})`);\n }\n return terms.reduce((sum, term) => sum + resolveLengthTerm(term, parentLength), 0);\n}\n\n/**\n * Resolves one atomic length term such as `10`, `10px`, or `50%`.\n *\n * @param term - One atomic length term.\n * @param parentLength - Parent length used for percentage resolution.\n * @returns Numeric length in deck pixels.\n */\nfunction resolveLengthTerm(term: string, parentLength: number): number {\n if (term.endsWith('%')) {\n return (Number.parseFloat(term.slice(0, -1)) / 100) * parentLength;\n }\n if (term.endsWith('px')) {\n return Number.parseFloat(term.slice(0, -2));\n }\n return Number.parseFloat(term);\n}\n\n/**\n * Reads the string id from one deck view when present.\n *\n * @param view - Deck view instance to inspect.\n * @returns String id or `null` when absent.\n */\nfunction getViewId(view: View): string | null {\n const viewId = (view.props as LayoutAwareViewProps).id;\n return typeof viewId === 'string' && viewId.length > 0 ? viewId : null;\n}\n\n/**\n * Reads the required id from one deck view, throwing when missing.\n *\n * @param view - Deck view instance to inspect.\n * @returns Non-empty string id.\n */\nfunction getRequiredViewId(view: View): string {\n const viewId = getViewId(view);\n if (!viewId) {\n throw new Error('Every compiled deck view must have a string id.');\n }\n return viewId;\n}\n\n/**\n * Compares two props objects for structural equality.\n *\n * @param left - Previous props object.\n * @param right - Next props object.\n * @returns Whether both props objects are structurally equal.\n */\nfunction arePropsEqual(left: Record<string, unknown>, right: Record<string, unknown>): boolean {\n if (left === right) {\n return true;\n }\n\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n return leftKeys.every(key => areValuesEqual(left[key], right[key]));\n}\n\n/**\n * Recursively compares two primitive, array, or plain-object values.\n *\n * @param left - Previous value.\n * @param right - Next value.\n * @returns Whether both values are structurally equal.\n */\nfunction areValuesEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) {\n return true;\n }\n if (Array.isArray(left) && Array.isArray(right)) {\n return (\n left.length === right.length &&\n left.every((value, index) => areValuesEqual(value, right[index]))\n );\n }\n if (isPlainObject(left) && isPlainObject(right)) {\n const leftEntries = Object.keys(left);\n const rightEntries = Object.keys(right);\n return (\n leftEntries.length === rightEntries.length &&\n leftEntries.every(key => areValuesEqual(left[key], right[key]))\n );\n }\n return false;\n}\n\n/**\n * Detects plain object records used by structural equality.\n *\n * @param value - Candidate value.\n * @returns Whether the value is a plain object record.\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n Boolean(value) && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype\n );\n}\n\n/**\n * Removes falsey optional children from authored child arrays.\n *\n * @param child - Candidate authored child entry.\n * @returns Whether the child should be compiled.\n */\nfunction isPresentChild(\n child: ViewLayoutChild\n): child is Exclude<ViewLayoutChild, null | false | undefined> {\n return Boolean(child);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/** Two-dimensional world-space bounds represented by minimum and maximum corners. */\nexport type Bounds = [[number, number], [number, number]];\n/** Interleaved X/Y block geometry values accepted by {@link getPaddedBlockBounds}. */\nexport type Geometry = ArrayLike<number> | null | undefined;\n\n/** Padding configuration for {@link getPaddedBlockBounds}. */\nexport type PaddedBlockBoundsOptions = {\n /** Padding added as a fraction of geometry width and height. @defaultValue 0.1 */\n paddingFraction?: number;\n /** Minimum world-space padding added on each axis. @defaultValue 1 */\n minimumPadding?: number;\n};\n\n/**\n * Computes padded bounds for a block geometry represented as an interleaved array of X/Y\n * coordinates.\n *\n * @param geometry - The geometry describing the block perimeter, or `null`/`undefined` when the\n * block has not been rendered.\n * @param options - Optional padding configuration. When omitted, a small percentage padding is\n * applied so that the block does not touch the viewport edges.\n * @returns The padded bounds for the geometry or `null` if the input does not contain any points.\n */\nexport function getPaddedBlockBounds(\n geometry: Geometry,\n options?: PaddedBlockBoundsOptions\n): Bounds | null {\n const bounds = getGeometryBounds(geometry);\n if (!bounds) {\n return null;\n }\n\n const paddingFraction = options?.paddingFraction ?? 0.1;\n const minimumPadding = options?.minimumPadding ?? 1;\n return padBounds(bounds, paddingFraction, minimumPadding);\n}\n\nfunction getGeometryBounds(geometry: Geometry): Bounds | null {\n if (!geometry || geometry.length < 2) {\n return null;\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n\n for (let index = 0; index < geometry.length; index += 2) {\n const x = geometry[index]!;\n const y = geometry[index + 1]!;\n\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n if (\n !Number.isFinite(minX) ||\n !Number.isFinite(minY) ||\n !Number.isFinite(maxX) ||\n !Number.isFinite(maxY)\n ) {\n return null;\n }\n\n return [\n [minX, minY],\n [maxX, maxY]\n ];\n}\n\nfunction padBounds(bounds: Bounds, paddingFraction: number, minimumPadding: number): Bounds {\n const [[minX, minY], [maxX, maxY]] = bounds;\n const width = maxX - minX;\n const height = maxY - minY;\n const paddingX = Math.max(width * paddingFraction, minimumPadding);\n const paddingY = Math.max(height * paddingFraction, minimumPadding);\n\n return [\n [minX - paddingX, minY - paddingY],\n [maxX + paddingX, maxY + paddingY]\n ];\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {type OrthographicViewState} from '@deck.gl/core';\n\nexport type OptionalizedViewState<T> = {\n [K in keyof T]: T[K] extends [number, number] | undefined\n ? [number | undefined, number | undefined] | undefined\n : T[K] extends [number, number, number] | undefined\n ? [number | undefined, number | undefined, number | undefined] | undefined\n : T[K] extends [number, number] | number | undefined\n ? [number | undefined, number | undefined] | undefined\n : T[K] extends [number, number, number] | [number, number] | undefined\n ?\n | [number | undefined, number | undefined, number | undefined]\n | [number | undefined, number | undefined]\n | undefined\n : T[K];\n};\n\nexport type OptionalViewState = OptionalizedViewState<OrthographicViewState>;\n\nexport function mergeViewStates(\n viewState1: OrthographicViewState,\n viewState2: OptionalViewState\n): OrthographicViewState {\n const target1 = viewState1.target ?? [0, 0];\n const zoom1 = viewState1.zoom ?? [1, 1];\n const mergedViewState = {\n ...viewState1,\n ...viewState2,\n target: [viewState2.target?.[0] ?? target1[0], viewState2.target?.[1] ?? target1[1]],\n zoom: [\n // ts-expect-error view state typing is awfully optional\n viewState2.zoom?.[0] ?? zoom1[0],\n // ts-expect-error view state typing is awfully optional\n viewState2.zoom?.[1] ?? zoom1[1]\n ]\n };\n // @ts-expect-error view state typing is awfully optional\n validateViewState(mergedViewState);\n // @ts-expect-error view state typing is awfully optional\n return mergedViewState;\n}\n\n// eslint-disable-next-line complexity\nexport function validateViewState(\n viewState: OrthographicViewState\n): viewState is OrthographicViewState {\n const isTargetValid =\n Array.isArray(viewState.target) &&\n viewState.target[0] !== undefined &&\n !Number.isNaN(viewState.target[0]) &&\n viewState.target[1] !== undefined &&\n !Number.isNaN(viewState.target[1]);\n const isZoomValid =\n Array.isArray(viewState.zoom) &&\n viewState.zoom[0] !== undefined &&\n !Number.isNaN(viewState.zoom[0]) &&\n viewState.zoom[1] !== undefined &&\n !Number.isNaN(viewState.zoom[1]);\n\n if (!isTargetValid || !isZoomValid) {\n // eslint-disable-next-line no-console\n console.warn('Invalid viewState:', viewState);\n }\n\n return isTargetValid && isZoomValid;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {type FilterContext} from '@deck.gl/core';\n\nexport type DeclarativeLayerFilter = Record<\n string,\n | {\n include: string[];\n }\n | {\n exclude: string[];\n }\n>;\n\ntype RegexpLayerFilter = Record<\n string,\n | {\n include: RegExp[];\n }\n | {\n exclude: RegExp[];\n }\n>;\n\nexport function makeLayerFilter(\n filters: DeclarativeLayerFilter\n): (context: FilterContext) => boolean {\n // Pre-compile the regexps for performance\n const regexpFilters: RegexpLayerFilter = {};\n for (const [key, value] of Object.entries(filters)) {\n if ('include' in value) {\n regexpFilters[key] = {\n include: value.include.map(v => new RegExp(v))\n };\n } else {\n regexpFilters[key] = {\n exclude: value.exclude.map(v => new RegExp(v))\n };\n }\n }\n\n // Return a function that checks if a layer matches the filter\n return ({viewport, layer}: FilterContext) => {\n let visible = true;\n const viewFilters = regexpFilters[viewport.id] || ({} as Record<string, RegExp[]>);\n // Check if the layer matches the filters for this viewport\n if ('include' in viewFilters) {\n if (!viewFilters.include.some(regexp => regexp.test(layer.id))) {\n visible = false;\n }\n }\n if ('exclude' in viewFilters) {\n if (viewFilters.exclude.some(regexp => regexp.test(layer.id))) {\n visible = false;\n }\n }\n // if (!visible) {\n // console.log(`Viewport ${viewport.id}: filtering out layer ${layer.id}`);\n // }\n return visible;\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Bounds} from './bounds-utils';\nimport type {OrthographicViewState} from '@deck.gl/core';\n\n/** Default floating-point tolerance used when comparing bounds values. @defaultValue 1e-6 */\nexport const DEFAULT_BOUNDS_EPSILON = 1e-6;\n\n/**\n * Axis-aligned bounding box describing the area that is currently visible in a Deck.gl viewport.\n *\n */\nexport type ViewportBounds = {\n /** Inclusive minimum world-space X coordinate within the viewport. */\n minX: number;\n /** Inclusive maximum world-space X coordinate within the viewport. */\n maxX: number;\n /** Inclusive minimum world-space Y coordinate within the viewport. */\n minY: number;\n /** Inclusive maximum world-space Y coordinate within the viewport. */\n maxY: number;\n};\n\n/** Floating-point comparison configuration for {@link boundsAreEqual}. */\nexport type BoundsEqualityOptions = {\n /** Maximum allowed coordinate delta before bounds differ. @defaultValue DEFAULT_BOUNDS_EPSILON */\n epsilon?: number;\n};\n\n/**\n * Returns `true` when two bounds tuples are identical within a configurable floating-point\n * tolerance.\n *\n * @param a - First bounds tuple to compare.\n * @param b - Second bounds tuple to compare.\n * @param options - Comparison configuration.\n * @param options.epsilon - Maximum allowed absolute difference between coordinate values before\n * the bounds are considered distinct. Defaults to {@link DEFAULT_BOUNDS_EPSILON}.\n */\nexport function boundsAreEqual(a: Bounds, b: Bounds, options?: BoundsEqualityOptions): boolean {\n const epsilon = options?.epsilon ?? DEFAULT_BOUNDS_EPSILON;\n let [ax, ay] = a[0];\n let [bx, by] = b[0];\n if (Math.abs(ax - bx) > epsilon || Math.abs(ay - by) > epsilon) {\n return false;\n }\n [ax, ay] = a[1];\n [bx, by] = b[1];\n if (Math.abs(ax - bx) > epsilon || Math.abs(ay - by) > epsilon) {\n return false;\n }\n return true;\n}\n\n/**\n * Computes the world-space bounds of an orthographic viewport given its view state and Deck.gl\n * dimensions.\n *\n * @param view - The orthographic view state describing the viewport target and zoom level.\n * @param deckDimensions - The pixel dimensions of the Deck.gl canvas hosting the view.\n * @returns The minimum and maximum X/Y world-space coordinates visible within the viewport.\n */\nexport function getViewportBoundsForViewState(\n view: OrthographicViewState,\n deckDimensions: {width: number; height: number}\n): ViewportBounds {\n const target = view.target ?? [0, 0];\n const zoomValue = view.zoom;\n const zoomArray = Array.isArray(zoomValue)\n ? zoomValue\n : typeof zoomValue === 'number'\n ? [zoomValue, zoomValue]\n : [0, 0];\n\n const zoomX = zoomArray[0] ?? 0;\n const zoomY = zoomArray[1] ?? zoomArray[0] ?? 0;\n const scaleX = 2 ** zoomX || 1;\n const scaleY = 2 ** zoomY || 1;\n const halfWidth = deckDimensions.width / scaleX / 2;\n const halfHeight = deckDimensions.height / scaleY / 2;\n\n return {\n minX: target[0] - halfWidth,\n maxX: target[0] + halfWidth,\n minY: target[1] - halfHeight,\n maxY: target[1] + halfHeight\n } satisfies ViewportBounds;\n}\n\n/**\n * Determines whether a bounds tuple lies entirely outside the supplied viewport bounds.\n *\n * @param bounds - The bounds tuple that may or may not intersect with the viewport.\n * @param viewport - The viewport bounds to test against.\n * @returns `true` when the bounds are completely outside of the viewport; otherwise `false`.\n */\nexport function isBoundsCompletelyOutside(bounds: Bounds, viewport: ViewportBounds): boolean {\n const [[minX, minY], [maxX, maxY]] = bounds;\n return (\n maxX < viewport.minX || minX > viewport.maxX || maxY < viewport.minY || minY > viewport.maxY\n );\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {FilterContext, Layer, Viewport} from '@deck.gl/core';\n\n/** Deck.gl layer filter callback or `null` when no filter should be applied. */\nexport type LayerFilter = ((context: FilterContext) => boolean) | null;\n\n/** Flat two-dimensional bounds represented as `[minX, minY, maxX, maxY]`. */\nexport type Bounds = [number, number, number, number];\n\n/** Reason emitted when the viewport bounds filter makes or skips a filter decision. */\nexport type LayerBoundsFilterDecision =\n | {\n /** Indicates that the layer was filtered because it missed the viewport. */\n decision: 'filter';\n /** Deck.gl filter context evaluated by the filter. */\n context: FilterContext;\n /** Layer bounds evaluated by the filter. */\n layerBounds: Bounds;\n /** Viewport bounds evaluated by the filter. */\n viewportBounds: Bounds;\n }\n | {\n /** Indicates that the layer did not expose usable bounds. */\n decision: 'missing-layer-bounds';\n /** Deck.gl filter context evaluated by the filter. */\n context: FilterContext;\n }\n | {\n /** Indicates that the viewport did not expose usable bounds. */\n decision: 'missing-viewport-bounds';\n /** Deck.gl filter context evaluated by the filter. */\n context: FilterContext;\n /** Layer bounds evaluated before viewport bounds were found missing. */\n layerBounds: Bounds;\n };\n\n/** Configuration for {@link createViewportBoundsFilter}. */\nexport type LayerBoundsFilterOptions = {\n /** Callback invoked when the filter skips or applies a bounds decision. */\n onDecision?: (decision: LayerBoundsFilterDecision) => void;\n};\n\ntype BoundsCache<Id extends WeakKey> = WeakMap<Id, Bounds | null>;\n\n/**\n * Combine multiple layer filters.\n * Returns null when none of the supplied filters are defined.\n * @param filters - Layer filters to evaluate in order.\n * @returns One filter that requires every defined filter to pass, or `null`.\n */\nexport function combineLayerFilters(filters: (LayerFilter | undefined | null)[]): LayerFilter {\n const definedFilters = filters.filter(Boolean) as ((context: FilterContext) => boolean)[];\n if (!definedFilters.length) {\n return null;\n }\n if (definedFilters.length === 1) {\n return definedFilters[0]!;\n }\n return context => definedFilters.every(filter => filter(context));\n}\n\n/**\n * Creates a layer filter that compares layer and viewport bounds.\n * Layers that do not intersect the viewport bounds are filtered out.\n * @param options - Optional decision callback configuration.\n * @returns Layer filter that keeps only layers intersecting the current viewport.\n */\nexport function createViewportBoundsFilter(options?: LayerBoundsFilterOptions): LayerFilter {\n const layerBoundsCache: BoundsCache<Layer> = new WeakMap();\n const viewportBoundsCache: BoundsCache<Viewport> = new WeakMap();\n\n return (context: FilterContext) => {\n const {layer, viewport} = context;\n\n let layerBounds = layerBoundsCache.get(layer);\n if (layerBounds === undefined) {\n layerBounds = getLayerBounds(layer);\n layerBoundsCache.set(layer, layerBounds);\n }\n if (!layerBounds) {\n options?.onDecision?.({decision: 'missing-layer-bounds', context});\n return true;\n }\n\n let viewportBounds = viewportBoundsCache.get(viewport);\n if (viewportBounds === undefined) {\n viewportBounds = getViewportBounds(viewport);\n viewportBoundsCache.set(viewport, viewportBounds);\n }\n if (!viewportBounds) {\n options?.onDecision?.({decision: 'missing-viewport-bounds', context, layerBounds});\n return true;\n }\n\n const shouldRender = boundsOverlap(layerBounds, viewportBounds);\n if (!shouldRender) {\n options?.onDecision?.({decision: 'filter', context, layerBounds, viewportBounds});\n }\n return shouldRender;\n };\n}\n\nfunction getLayerBounds(layer: Layer): Bounds | null {\n const bounds = layer.getBounds();\n if (!bounds || bounds.length < 2) {\n return null;\n }\n return normalizeBounds(bounds[0], bounds[1]);\n}\n\nfunction getViewportBounds(viewport: Viewport): Bounds | null {\n const bounds = viewport.getBounds();\n if (!bounds || bounds.length < 4) {\n return null;\n }\n\n const [minX, minY, maxX, maxY] = bounds;\n if (\n !isFiniteNumber(minX) ||\n !isFiniteNumber(minY) ||\n !isFiniteNumber(maxX) ||\n !isFiniteNumber(maxY)\n ) {\n return null;\n }\n return normalizeBounds([minX, minY], [maxX, maxY]);\n}\n\nfunction normalizeBounds(min: number[] | undefined, max: number[] | undefined): Bounds | null {\n if (!min || !max || min.length < 2 || max.length < 2) {\n return null;\n }\n\n const minX = Math.min(min[0]!, max[0]!);\n const minY = Math.min(min[1]!, max[1]!);\n const maxX = Math.max(min[0]!, max[0]!);\n const maxY = Math.max(min[1]!, max[1]!);\n\n if (\n !isFiniteNumber(minX) ||\n !isFiniteNumber(minY) ||\n !isFiniteNumber(maxX) ||\n !isFiniteNumber(maxY)\n ) {\n return null;\n }\n\n return [minX, minY, maxX, maxY];\n}\n\nfunction boundsOverlap(a: Bounds, b: Bounds): boolean {\n return !(a[2] < b[0] || b[2] < a[0] || a[3] < b[1] || b[3] < a[1]);\n}\n\nfunction isFiniteNumber(value: number): boolean {\n return Number.isFinite(value);\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {OrthographicController, OrthographicView} from '@deck.gl/core';\n\nimport {fitBoundsOrthographic} from '../views/orthographic-utils';\nimport {mergeViewStates} from '../views/view-state-utils';\n\nimport type {OptionalViewState} from '../views/view-state-utils';\nimport type {OrthographicViewState} from '@deck.gl/core';\n\nexport const HEADER_VIEW_HEIGHT = 50;\nexport const LEGEND_VIEW_WIDTH = 150;\n\nexport const SYNCHRONIZED_VIEWS = [\n new OrthographicView({\n id: 'main',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: LEGEND_VIEW_WIDTH,\n width: `calc(100% - ${LEGEND_VIEW_WIDTH}px)`,\n y: HEADER_VIEW_HEIGHT,\n height: `calc(100% - ${HEADER_VIEW_HEIGHT}px)`,\n controller: {\n type: OrthographicController,\n // @ts-expect-error Specific to OrthographicController\n zoomAxis: 'X',\n inertia: false,\n scrollZoom: true\n }\n }),\n new OrthographicView({\n id: 'header',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: LEGEND_VIEW_WIDTH,\n width: `calc(100% - ${LEGEND_VIEW_WIDTH}px)`,\n height: 50,\n controller: false\n }),\n new OrthographicView({\n id: 'legend',\n flipY: false,\n clear: true, // [1, 1, 1, 1],\n x: 0,\n width: LEGEND_VIEW_WIDTH,\n y: HEADER_VIEW_HEIGHT,\n height: `calc(100% - ${HEADER_VIEW_HEIGHT}px)`,\n controller: false\n })\n];\n\nexport const SYNCHRONIZED_VIEW_STATE_CONSTRAINTS = {\n header: {target: [undefined, 20], zoom: [undefined, 0]} satisfies OptionalViewState,\n legend: {target: [-30, undefined], zoom: [1, undefined]} satisfies OptionalViewState\n};\n\nexport function getSynchronizedViewStates(viewState: OrthographicViewState) {\n return {\n header: mergeViewStates(viewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.header),\n legend: mergeViewStates(viewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.legend),\n main: viewState\n };\n}\n\nexport function fitSynchronizedViewStatesToBounds(props: {\n viewState: {\n header: OrthographicViewState;\n legend: OrthographicViewState;\n main: OrthographicViewState;\n };\n width: number;\n height: number;\n bounds: [[xMin: number, yMin: number], [xMax: number, yMax: number]];\n /** App should set to true on first call */\n initialize: boolean;\n headerHeight?: number;\n legendWidth?: number;\n}): {\n header: OrthographicViewState;\n legend: OrthographicViewState;\n main: OrthographicViewState;\n} {\n const {viewState, initialize} = props;\n const {headerHeight = HEADER_VIEW_HEIGHT, legendWidth = LEGEND_VIEW_WIDTH} = props;\n\n // Handle cases where the window size is too small for the header and/or legend\n const width = Math.max(props.width - legendWidth, 1);\n const height = Math.max(props.height - headerHeight, 1);\n\n const {target, zoom} = fitBoundsOrthographic(width, height, props.bounds, 'per-axis');\n target[1] = target[1] - 1.5; // ADD SOME TIME SPACE\n\n let mainViewState: OrthographicViewState;\n // Avoid messing with y axis if we have already fitted the view state\n if (initialize) {\n mainViewState = {...viewState.main, target, zoom};\n } else {\n mainViewState = {\n ...viewState.main,\n target: [viewState.main.target[0], target[1]],\n zoom: [(viewState.main.zoom as [number, number])[0], zoom[1]]\n };\n }\n const newViewState = {\n ...viewState,\n main: mainViewState,\n header: mergeViewStates(mainViewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.header),\n legend: mergeViewStates(mainViewState, SYNCHRONIZED_VIEW_STATE_CONSTRAINTS.legend)\n };\n return newViewState;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,kBAA6E;AAC7E,oBAAwD;;;ACelD,SAAU,aAAa,QAAgB,UAAyC,CAAA,GAAE;AACtF,QAAM,oBACJ,OAAO,YAAY,YAAY,EAAC,OAAO,QAAO,IAAI;AACpD,QAAM,EAAC,QAAQ,MAAM,cAAc,EAAC,IAAI;AACxC,QAAM,MAAM,QAAQ,MAAM;AAC1B,QAAM,KAAK,SAAS;AACpB,MAAI,OAAO,GAAG;AACZ,WAAO;EACT;AACA,MAAI,KAAK,IAAI,EAAE,IAAI,KAAM;AACvB,WAAO,GAAG,WAAW,IAAI,WAAW,IAAI;EAC1C;AACA,QAAM,KAAK,KAAK;AAChB,MAAI,KAAK,IAAI,EAAE,IAAI,KAAM;AACvB,WAAO,GAAG,WAAW,IAAI,WAAW,IAAI;EAC1C;AACA,QAAM,IAAI,KAAK;AACf,MAAI,KAAK,IAAI,CAAC,IAAI,IAAI;AACpB,WAAO,GAAG,WAAW,GAAG,WAAW,IAAI;EACzC;AACA,QAAM,IAAI,IAAI;AACd,MAAI,KAAK,IAAI,CAAC,IAAI,IAAI;AACpB,WAAO,qBAAqB,CAAC;EAC/B;AACA,QAAM,IAAI,IAAI;AACd,MAAI,KAAK,IAAI,CAAC,IAAI,IAAI;AACpB,WAAO,mBAAmB,CAAC;EAC7B;AACA,SAAO,kBAAkB,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O,CAAC,GAAG,OAAO,CAAC,CAAC;MAC5C,MAAM,CAAE,UAAU,KAAK,KAA0B,CAAC,GAAG,KAAK,CAAC,CAAC;;EAEhE;AACA,QAAM,eAAe;IACnB,GAAG;IACH,MAAM;IACN,QAAQ,gBAAgB,eAAe,oCAAoC,MAAM;IACjF,QAAQ,gBAAgB,eAAe,oCAAoC,MAAM;;AAEnF,SAAO;AACT;",
|
|
6
|
+
"names": ["color", "timeLines", "import_core", "delay", "import_core", "import_core", "import_engine", "import_core", "color", "DEFAULT_COLOR", "defaultProps", "isFastTextUtf8ColumnSource", "import_core", "import_core"]
|
|
7
7
|
}
|