@tradecanvas/core 1.24.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{WebGLSeriesRenderer-BNrnoMHq.js → WebGLSeriesRenderer-C9lMIDnL.js} +2 -2
  2. package/dist/{WebGLSeriesRenderer-BNrnoMHq.js.map → WebGLSeriesRenderer-C9lMIDnL.js.map} +1 -1
  3. package/dist/{WebGLSeriesRenderer-Bclv4lzZ.cjs → WebGLSeriesRenderer-Hwer7mph.cjs} +2 -2
  4. package/dist/{WebGLSeriesRenderer-Bclv4lzZ.cjs.map → WebGLSeriesRenderer-Hwer7mph.cjs.map} +1 -1
  5. package/dist/axis/TimeAxis.d.ts.map +1 -1
  6. package/dist/charts/CompareRenderer.d.ts.map +1 -1
  7. package/dist/drawings/DrawingManager.d.ts +5 -4
  8. package/dist/drawings/DrawingManager.d.ts.map +1 -1
  9. package/dist/features/DataExporter.d.ts.map +1 -1
  10. package/dist/features/MeasureOverlay.d.ts.map +1 -1
  11. package/dist/{gpuContexts-Bn58hj7u.js → gpuContexts-B3iynnAn.js} +106 -93
  12. package/dist/gpuContexts-B3iynnAn.js.map +1 -0
  13. package/dist/gpuContexts-X-Q3OVWF.cjs +2 -0
  14. package/dist/gpuContexts-X-Q3OVWF.cjs.map +1 -0
  15. package/dist/index.cjs +4 -4
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +2978 -2974
  18. package/dist/index.js.map +1 -1
  19. package/dist/indicators/symbols/SymbolSeriesStore.d.ts +4 -3
  20. package/dist/indicators/symbols/SymbolSeriesStore.d.ts.map +1 -1
  21. package/dist/indicators/symbols/symbolIndicators.d.ts.map +1 -1
  22. package/dist/interaction/CrosshairHandler.d.ts +8 -0
  23. package/dist/interaction/CrosshairHandler.d.ts.map +1 -1
  24. package/dist/interaction/CrosshairTooltip.d.ts +4 -2
  25. package/dist/interaction/CrosshairTooltip.d.ts.map +1 -1
  26. package/dist/interaction/PinnedTooltip.d.ts +3 -2
  27. package/dist/interaction/PinnedTooltip.d.ts.map +1 -1
  28. package/dist/trading/fillMarks.d.ts.map +1 -1
  29. package/dist/ui/BarCountdown.d.ts.map +1 -1
  30. package/dist/ui/ChartLegend.d.ts +4 -1
  31. package/dist/ui/ChartLegend.d.ts.map +1 -1
  32. package/dist/ui/SessionBreaks.d.ts +0 -1
  33. package/dist/ui/SessionBreaks.d.ts.map +1 -1
  34. package/dist/viewport/ScaleMapping.d.ts +11 -5
  35. package/dist/viewport/ScaleMapping.d.ts.map +1 -1
  36. package/dist/viewport/index.d.ts +1 -1
  37. package/dist/viewport/index.d.ts.map +1 -1
  38. package/package.json +2 -2
  39. package/dist/gpuContexts-Bn58hj7u.js.map +0 -1
  40. package/dist/gpuContexts-DYrOp3uo.cjs +0 -2
  41. package/dist/gpuContexts-DYrOp3uo.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpuContexts-X-Q3OVWF.cjs","names":[],"sources":["../src/viewport/ScaleMapping.ts","../src/charts/pixelGrid.ts","../src/charts/denseBars.ts","../src/axis/gridLines.ts","../src/axis/GridRenderer.ts","../src/engine/gpuContexts.ts"],"sourcesContent":["import type { ViewportState } from '@tradecanvas/commons';\nimport { barTimeUnit } from '@tradecanvas/commons';\n\nexport function barIndexToX(index: number, viewport: ViewportState): number {\n const barUnit = viewport.barWidth + viewport.barSpacing;\n return index * barUnit - viewport.offset + viewport.chartRect.x + viewport.barWidth / 2;\n}\n\nexport function priceToY(price: number, viewport: ViewportState): number {\n const { min, max } = viewport.priceRange;\n const { y: top, height } = viewport.chartRect;\n let ratio: number;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logRange = Math.log(max) - logMin;\n if (logRange === 0) return top + height / 2;\n ratio = (Math.log(Math.max(price, Number.EPSILON)) - logMin) / logRange;\n } else {\n const range = max - min;\n if (range === 0) return top + height / 2;\n ratio = (price - min) / range;\n }\n return top + height * (viewport.invertScale ? ratio : 1 - ratio);\n}\n\n/**\n * `priceToY` for one frame, with the per-call work hoisted out: for renderers\n * that map every visible bar. Follows the log scale and the inverted scale.\n */\nexport function priceToYMapper(viewport: ViewportState): (price: number) => number {\n const { min, max } = viewport.priceRange;\n const { y: top, height } = viewport.chartRect;\n const invert = viewport.invertScale === true;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logRange = Math.log(max) - logMin;\n if (logRange === 0) return () => top + height / 2;\n const k = height / logRange;\n const bottom = top + height;\n return invert\n ? (price) => top + (Math.log(Math.max(price, Number.EPSILON)) - logMin) * k\n : (price) => bottom - (Math.log(Math.max(price, Number.EPSILON)) - logMin) * k;\n }\n const range = max - min;\n if (range === 0) return () => top + height / 2;\n const k = height / range;\n return invert ? (price) => top + (price - min) * k : (price) => top + (max - price) * k;\n}\n\n/**\n * Where bucket `b` of `count` equal price buckets across the price range sits\n * on screen (bucket 0 holds the lowest prices), on any scale. `toY` is the\n * frame's `priceToYMapper`.\n */\nexport function priceBucketRow(\n b: number,\n count: number,\n viewport: ViewportState,\n toY: (price: number) => number,\n): { top: number; height: number; mid: number } {\n const { min, max } = viewport.priceRange;\n const step = (max - min) / count;\n const yLow = toY(min + b * step);\n const yHigh = toY(min + (b + 1) * step);\n return { top: Math.min(yLow, yHigh), height: Math.abs(yLow - yHigh), mid: (yLow + yHigh) / 2 };\n}\n\nexport function xToBarIndex(x: number, viewport: ViewportState): number {\n const barUnit = viewport.barWidth + viewport.barSpacing;\n return Math.round((x - viewport.chartRect.x - viewport.barWidth / 2 + viewport.offset) / barUnit);\n}\n\nexport function yToPrice(y: number, viewport: ViewportState): number {\n const { min, max } = viewport.priceRange;\n const fromTop = (y - viewport.chartRect.y) / viewport.chartRect.height;\n const ratio = viewport.invertScale ? fromTop : 1 - fromTop;\n if (viewport.logScale && min > 0 && max > 0) {\n const logMin = Math.log(min);\n const logMax = Math.log(max);\n return Math.exp(logMin + (logMax - logMin) * ratio);\n }\n return min + (max - min) * ratio;\n}\n\ntype TimedSeries = ReadonlyArray<{ time: number }>;\n\nconst stepCache = new WeakMap<TimedSeries, { length: number; step: number }>();\n\n/**\n * Typical spacing between bar times — the median of the last ~20 intervals,\n * so a weekend or halt gap doesn't skew it. Used to place times beyond either\n * end of the data (the empty future the chart can be panned into). Cached per\n * series and length; 0 when there are fewer than two bars.\n */\nexport function barTimeStep(data: TimedSeries): number {\n const n = data.length;\n if (n < 2) return 0;\n const cached = stepCache.get(data);\n if (cached && cached.length === n) return cached.step;\n const diffs: number[] = [];\n for (let i = Math.max(1, n - 20); i < n; i++) diffs.push(data[i].time - data[i - 1].time);\n diffs.sort((a, b) => a - b);\n const step = Math.max(0, diffs[diffs.length >> 1]);\n stepCache.set(data, { length: n, step });\n return step;\n}\n\n/** Bars the spacing before the oldest bar is averaged over. */\nconst PAST_STEP_SAMPLE = 100;\n\nconst pastStepCache = new WeakMap<TimedSeries, { length: number; first: number; end: number; step: number }>();\n\n/**\n * The average spacing of the first bars, weekends, nights and halts\n * included: how far back in time a slot before the oldest bar goes, so an\n * extrapolated date lands about where the bars, once loaded, would put it.\n * Cached per series; `barTimeStep` when the first bars share one time, 0\n * when there are fewer than two bars.\n */\nexport function pastTimeStep(data: TimedSeries): number {\n const n = data.length;\n if (n < 2) return 0;\n const k = Math.min(n - 1, PAST_STEP_SAMPLE);\n const cached = pastStepCache.get(data);\n if (cached && cached.length === n && cached.first === data[0].time && cached.end === data[k].time) return cached.step;\n const average = (data[k].time - data[0].time) / k;\n const step = average > 0 ? average : barTimeStep(data);\n pastStepCache.set(data, { length: n, first: data[0].time, end: data[k].time, step });\n return step;\n}\n\n/** `barTimeStep` in milliseconds whatever unit the series uses (`barTimeUnit`). */\nexport function barTimeStepMs(data: TimedSeries): number {\n return barTimeStep(data) * barTimeUnit(data);\n}\n\n/**\n * Time at bar index `index`, extrapolated past either end of the data: by\n * `barTimeStep` into the future right of the newest bar, by `pastTimeStep`\n * before the oldest.\n */\nexport function barIndexToTime(index: number, data: TimedSeries): number {\n const n = data.length;\n if (n === 0) return index;\n const last = n - 1;\n if (index > last) return data[last].time + (index - last) * barTimeStep(data);\n if (index < 0) return data[0].time + index * pastTimeStep(data);\n const lo = Math.floor(index);\n if (lo === index || lo >= last) return data[lo].time;\n return data[lo].time + (index - lo) * (data[lo + 1].time - data[lo].time);\n}\n\n/**\n * Convert a bar timestamp to its data-array index via binary search.\n * Falls back to fractional interpolation when the timestamp falls between bars,\n * and extrapolates (as `barIndexToTime` does) for times beyond either end — so a drawing\n * anchored in the future keeps its place instead of collapsing onto the last bar.\n * Returns -1 if data is empty.\n */\nexport function timestampToBarIndex(timestamp: number, data: TimedSeries): number {\n if (data.length === 0) return -1;\n const first = data[0].time;\n const lastIdx = data.length - 1;\n const lastTime = data[lastIdx].time;\n if (timestamp <= first || timestamp >= lastTime) {\n if (timestamp === first) return 0;\n if (timestamp === lastTime) return lastIdx;\n const step = timestamp < first ? pastTimeStep(data) : barTimeStep(data);\n if (step <= 0) return timestamp < first ? 0 : lastIdx;\n return timestamp < first ? (timestamp - first) / step : lastIdx + (timestamp - lastTime) / step;\n }\n // Binary search\n let lo = 0, hi = data.length - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n if (data[mid].time === timestamp) return mid;\n if (data[mid].time < timestamp) lo = mid + 1;\n else hi = mid - 1;\n }\n // lo is the insertion point; interpolate between hi and lo\n if (lo >= data.length) return data.length - 1;\n if (hi < 0) return 0;\n const tLo = data[hi].time, tHi = data[lo].time;\n const frac = tHi !== tLo ? (timestamp - tLo) / (tHi - tLo) : 0;\n return hi + frac;\n}\n\n/**\n * Resolve an anchor `time` value to a (possibly fractional) bar index in the\n * current series. When `viewport.data` is set, `time` is interpreted as a real\n * timestamp and converted via `timestampToBarIndex`. Otherwise `time` is\n * already a bar index and is returned unchanged.\n */\nexport function resolveBarIndex(time: number, viewport: ViewportState): number {\n const data = viewport.data;\n if (data && data.length > 0) {\n return timestampToBarIndex(time, data);\n }\n return time;\n}\n\n/**\n * Map an anchor `time` value to its pixel x. Works whether `time` is a\n * timestamp (when `viewport.data` is set) or a bar index (legacy callers).\n */\nexport function timeToX(time: number, viewport: ViewportState): number {\n return barIndexToX(resolveBarIndex(time, viewport), viewport);\n}\n\n/**\n * Map a pixel x back to an anchor `time` value. Returns a real timestamp when\n * `viewport.data` is set (so the value survives timeframe switches), otherwise\n * returns a bar index for legacy callers.\n */\nexport function xToTime(x: number, viewport: ViewportState): number {\n const idx = xToBarIndex(x, viewport);\n const data = viewport.data;\n if (data && data.length > 0) {\n // Past either end (the empty future, or before the oldest bar) the time\n // is extrapolated, so drawings can be placed there.\n return barIndexToTime(idx, data);\n }\n return idx;\n}\n","/**\n * Drawing on whole device pixels. The chart draws in CSS pixels under the\n * device-pixel-ratio transform, so a 1 px line at a fractional position\n * spreads over two device pixels at half strength and looks soft and thick.\n * Bars drawn here go back to the canvas's own pixels and round to them: a\n * wick is one sharp column, a body has hard edges, at any ratio (1, 1.25, 2…).\n */\n\n/**\n * Rounding to a device pixel turns up from a hair under the half. Bar steps\n * are often round numbers (5.1 px, say) that put bars exactly on half a\n * pixel, where 64-bit arithmetic here and 32-bit on the GPU would round some\n * of them apart; a hair under, both land on the same side. The shaders use\n * the same constant.\n */\nexport const PIXEL_ROUNDING = 0.5037;\n\n/** The device pixel a device-pixel position rounds to. */\nexport function toPixel(v: number): number {\n return Math.floor(v + PIXEL_ROUNDING);\n}\n\nfunction transformOf(ctx: CanvasRenderingContext2D): { a: number; d: number; e: number; f: number } {\n const m = typeof ctx.getTransform === 'function' ? ctx.getTransform() : undefined;\n return {\n a: m && Number.isFinite(m.a) && m.a > 0 ? m.a : 1,\n d: m && Number.isFinite(m.d) && m.d > 0 ? m.d : 1,\n e: m && Number.isFinite(m.e) ? m.e : 0,\n f: m && Number.isFinite(m.f) ? m.f : 0,\n };\n}\n\n/** CSS to device-pixel mapping, rounded to whole pixels. */\nexport interface PixelGrid {\n /** Device pixels per CSS pixel. */\n ratio: number;\n /** The device pixel a CSS x falls on. */\n x(cssX: number): number;\n /** The device pixel a CSS y falls on. */\n y(cssY: number): number;\n /**\n * Left edge (device px) of a column `width` device pixels wide centred on\n * CSS x `cssCenter`: the same column `crispX` strokes for a line there.\n */\n left(cssCenter: number, width: number): number;\n}\n\n/**\n * Run `draw` with the transform reset to device pixels, then put it back.\n * A context without a readable transform (a test stand-in) is taken as 1:1.\n */\nexport function inDevicePixels<T>(ctx: CanvasRenderingContext2D, draw: (grid: PixelGrid) => T): T {\n const { a, d, e, f } = transformOf(ctx);\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n try {\n return draw({\n ratio: a,\n x: (v) => toPixel(v * a + e),\n y: (v) => toPixel(v * d + f),\n left: (v, width) => toPixel(v * a + e - width / 2),\n });\n } finally {\n ctx.restore();\n }\n}\n\n/**\n * A bar's columns in device pixels: the wick one CSS pixel wide (at least one\n * device pixel), the body about the bar's width, with an even difference so\n * the wick sits exactly in the middle.\n */\nexport function barColumns(barWidth: number, ratio: number): { body: number; wick: number } {\n const wick = Math.max(1, Math.floor(ratio));\n let body = Math.max(wick, Math.round(barWidth * ratio));\n if ((body - wick) % 2 !== 0) body -= 1;\n return { body: Math.max(body, wick), wick };\n}\n\n/** Snap a line's centre (in CSS px) so a `width`-wide stroke covers whole device pixels. */\nfunction snap(v: number, width: number, scale: number, shift: number): { at: number; width: number } {\n const w = Math.max(1, Math.round(width * scale));\n const half = w % 2 ? 0.5 : 0;\n return { at: (toPixel(v * scale + shift - half) + half - shift) / scale, width: w / scale };\n}\n\n/**\n * A horizontal line's y and width, snapped so the stroke covers whole device\n * pixels: one sharp row instead of a soft two-pixel smear.\n */\nexport function crispY(ctx: CanvasRenderingContext2D, y: number, width: number): { y: number; width: number } {\n const t = transformOf(ctx);\n const s = snap(y, width, t.d, t.f);\n return { y: s.at, width: s.width };\n}\n\n/** A vertical line's x and width, snapped like `crispY`. */\nexport function crispX(ctx: CanvasRenderingContext2D, x: number, width: number): { x: number; width: number } {\n const t = transformOf(ctx);\n const s = snap(x, width, t.a, t.e);\n return { x: s.at, width: s.width };\n}\n","import type { DataSeries, ViewportState } from '@tradecanvas/commons';\nimport { priceToYMapper } from '../viewport/ScaleMapping.js';\nimport { inDevicePixels } from './pixelGrid.js';\n\n/**\n * Below this bar width (CSS px) bar-shaped charts draw one column per pixel\n * instead of one shape per bar: thousands of sub-pixel candles would blur\n * into each other and cost a path segment each.\n */\nexport const DENSE_BAR_WIDTH = 1;\n\nexport function isDense(viewport: Pick<ViewportState, 'barWidth'>): boolean {\n return viewport.barWidth < DENSE_BAR_WIDTH;\n}\n\n/** The bars on one pixel column merged into one: first open, last close, extremes, largest volume. */\nexport interface PixelColumn {\n x: number;\n open: number;\n high: number;\n low: number;\n close: number;\n volume: number;\n}\n\n/**\n * Walk bars `from`..`to` merged per pixel column (`Math.floor` of their x).\n * The column object is reused between calls: copy it to keep it.\n */\nexport function forEachPixelColumn(\n data: DataSeries,\n from: number,\n to: number,\n toX: (index: number) => number,\n visit: (column: Readonly<PixelColumn>) => void,\n): void {\n const last = Math.min(to, data.length - 1);\n if (from > last) return;\n const col: PixelColumn = { x: 0, open: 0, high: 0, low: 0, close: 0, volume: 0 };\n let open = false;\n for (let i = Math.max(0, from); i <= last; i++) {\n const bar = data[i];\n const x = Math.floor(toX(i));\n if (open && x !== col.x) {\n visit(col);\n open = false;\n }\n if (!open) {\n col.x = x;\n col.open = bar.open;\n col.high = bar.high;\n col.low = bar.low;\n col.volume = bar.volume;\n open = true;\n } else {\n if (bar.high > col.high) col.high = bar.high;\n if (bar.low < col.low) col.low = bar.low;\n if (bar.volume > col.volume) col.volume = bar.volume;\n }\n col.close = bar.close;\n }\n if (open) visit(col);\n}\n\n/**\n * Draw a dense price series as one high–low line per pixel column, coloured by\n * the column's direction (its last close against its first open).\n */\nexport function renderDenseBars(\n ctx: CanvasRenderingContext2D,\n data: DataSeries,\n viewport: ViewportState,\n upColor: string,\n downColor: string,\n): void {\n const { from, to } = viewport.visibleRange;\n const barUnit = viewport.barWidth + viewport.barSpacing;\n const offsetX = -viewport.offset + viewport.chartRect.x + viewport.barWidth / 2;\n const toY = priceToYMapper(viewport);\n inDevicePixels(ctx, (px) => {\n const up = new Path2D();\n const down = new Path2D();\n forEachPixelColumn(data, from, to, (i) => i * barUnit + offsetX, (c) => {\n const top = px.y(toY(c.high));\n const bottom = px.y(toY(c.low));\n // A flat column still gets a pixel, like a doji's body.\n // Each column reaches the next with no gap: at 125% a CSS pixel is 1 or 2 device pixels.\n const left = px.x(c.x);\n const width = Math.max(1, px.x(c.x + 1) - left);\n (c.close >= c.open ? up : down).rect(left, Math.min(top, bottom), width, Math.max(Math.abs(bottom - top), 1));\n });\n ctx.fillStyle = upColor;\n ctx.fill(up);\n ctx.fillStyle = downColor;\n ctx.fill(down);\n });\n}\n","import type { ViewportState } from '@tradecanvas/commons';\nimport { computeTickStep } from '@tradecanvas/commons';\nimport { priceToYMapper } from '../viewport/ScaleMapping.js';\n\n/** The grid's lines as CSS-pixel centres: one across per price step, one down every few slots. */\nexport interface GridLines {\n horizontal: number[];\n vertical: number[];\n}\n\n/** Bars between vertical lines: at least this many pixels apart. */\nconst MIN_COLUMN_SPACING = 80;\n\n/** Where the grid lines go, for the 2D grid and the GPU alike. */\nexport function gridLines(viewport: ViewportState): GridLines {\n const { chartRect, priceRange } = viewport;\n if (priceRange.max - priceRange.min <= 0) return { horizontal: [], vertical: [] };\n const toY = priceToYMapper(viewport);\n\n const horizontal: number[] = [];\n const priceStep = computeTickStep(priceRange.min, priceRange.max, 8);\n const firstPrice = Math.ceil(priceRange.min / priceStep) * priceStep;\n for (let price = firstPrice; price <= priceRange.max; price += priceStep) {\n horizontal.push(Math.round(toY(price)) + 0.5);\n }\n\n const vertical: number[] = [];\n const barUnit = viewport.barWidth + viewport.barSpacing;\n const barsPerGrid = Math.max(1, Math.ceil(MIN_COLUMN_SPACING / barUnit));\n const offsetX = -viewport.offset + chartRect.x + viewport.barWidth / 2;\n // Every slot on screen — the empty space past either end of the data\n // (where the chart can be panned) keeps its grid too.\n const from = Math.floor(viewport.offset / barUnit);\n const to = Math.ceil((viewport.offset + chartRect.width) / barUnit);\n for (let i = from; i <= to; i++) {\n if (i % barsPerGrid !== 0) continue;\n vertical.push(Math.round(i * barUnit + offsetX) + 0.5);\n }\n return { horizontal, vertical };\n}\n","import type { ViewportState, Theme, ResolvedLineLook } from '@tradecanvas/commons';\nimport { lineDash } from '@tradecanvas/commons';\nimport { gridLines } from './gridLines.js';\n\n/** The grid's dashes, as its lines are drawn when `dashed`. */\nconst GRID_DASH = [4, 4];\n\nexport class GridRenderer {\n private visible = true;\n\n setVisible(v: boolean): void { this.visible = v; }\n isVisible(): boolean { return this.visible; }\n\n render(ctx: CanvasRenderingContext2D, viewport: ViewportState, theme: Theme): void {\n if (!this.visible) return;\n const { chartRect } = viewport;\n const { horizontal, vertical } = gridLines(viewport);\n const looks = gridLooks(theme);\n const h = looks.horizontal;\n const v = looks.vertical;\n // Both ways alike: one path, so a see-through colour isn't laid twice where they cross.\n if (h.visible && v.visible && h.color === v.color && h.style === v.style && h.width === v.width) {\n stroke(ctx, h, () => {\n for (const y of horizontal) {\n const at = onPixel(y, h.width);\n ctx.moveTo(chartRect.x, at);\n ctx.lineTo(chartRect.x + chartRect.width, at);\n }\n for (const x of vertical) {\n const at = onPixel(x, v.width);\n ctx.moveTo(at, chartRect.y);\n ctx.lineTo(at, chartRect.y + chartRect.height);\n }\n });\n ctx.setLineDash([]);\n return;\n }\n if (looks.horizontal.visible && horizontal.length > 0) {\n stroke(ctx, looks.horizontal, () => {\n for (const y of horizontal) {\n const at = onPixel(y, looks.horizontal.width);\n ctx.moveTo(chartRect.x, at);\n ctx.lineTo(chartRect.x + chartRect.width, at);\n }\n });\n }\n if (looks.vertical.visible && vertical.length > 0) {\n stroke(ctx, looks.vertical, () => {\n for (const x of vertical) {\n const at = onPixel(x, looks.vertical.width);\n ctx.moveTo(at, chartRect.y);\n ctx.lineTo(at, chartRect.y + chartRect.height);\n }\n });\n }\n ctx.setLineDash([]);\n }\n}\n\n/** The grid's looks each way: the resolved style's, or the theme's grid colour, solid, 1 px. */\nexport function gridLooks(theme: Theme): { horizontal: ResolvedLineLook; vertical: ResolvedLineLook } {\n const plain: ResolvedLineLook = { visible: true, color: theme.grid, style: 'solid', width: 1 };\n return theme.style?.grid ?? { horizontal: plain, vertical: plain };\n}\n\n/**\n * Whether the GPU can draw the grid as it looks: every way shown is solid,\n * 1 px, and they share a colour. Otherwise the grid goes on Canvas 2D.\n */\nexport function gridFitsGpu(theme: Theme): boolean {\n const { horizontal, vertical } = gridLooks(theme);\n const shown = [horizontal, vertical].filter((look) => look.visible);\n return shown.every((look) => look.style === 'solid' && look.width === 1 && look.color === shown[0].color);\n}\n\n/** One path per way: a single stroke call for all its lines. */\nfunction stroke(ctx: CanvasRenderingContext2D, look: ResolvedLineLook, path: () => void): void {\n ctx.strokeStyle = look.color;\n ctx.lineWidth = look.width;\n ctx.setLineDash(lineDash(look.style, GRID_DASH, look.width));\n ctx.beginPath();\n path();\n ctx.stroke();\n}\n\n/** Grid lines come on the half pixel (crisp at 1 px); an even width is crisp on the whole pixel. */\nfunction onPixel(at: number, width: number): number {\n return width % 2 === 0 ? Math.round(at) : at;\n}\n","/**\n * The WebGL contexts the charts on a page hold at once. Chrome and Safari\n * keep about 16 a page and, past that, drop the oldest, whoever's it is (a\n * live chart's, a map's), never to hand it back. The charts stop short of\n * that and leave the rest to the page; a chart asked for WebGL past the limit\n * draws with Canvas 2D until a context is let go. The count is per copy of\n * the library loaded on the page.\n */\n\n/** How many charts draw with WebGL at once, unless set otherwise. */\nexport const DEFAULT_MAX_WEBGL_CHARTS = 8;\n\nlet limit = DEFAULT_MAX_WEBGL_CHARTS;\nlet held = 0;\nconst waiting = new Set<() => void>();\n\n/**\n * At most `count` charts on the page draw with WebGL at once (default 8;\n * `Infinity` for no limit). Charts that draw with WebGL already keep it when\n * the limit drops below them; it holds for those asking from then on.\n */\nexport function setMaxWebGLCharts(count: number): void {\n limit = Number.isNaN(count) ? DEFAULT_MAX_WEBGL_CHARTS : Math.max(0, Math.floor(count));\n if (gpuContextsLeft() > 0) wakeWaiting();\n}\n\n/** How many more charts may draw with WebGL now. */\nexport function gpuContextsLeft(): number {\n return Math.max(0, limit - held);\n}\n\n/** A context of the charts' share, or null when they hold all of it: the function given back lets it go (once). */\nexport function claimGpuContext(): (() => void) | null {\n if (held >= limit) return null;\n held++;\n let released = false;\n return () => {\n if (released) return;\n released = true;\n held--;\n wakeWaiting();\n };\n}\n\n/** `callback`, once, the next time a context may be had; the function given back stops waiting. */\nexport function whenGpuContextFree(callback: () => void): () => void {\n waiting.add(callback);\n return () => {\n waiting.delete(callback);\n };\n}\n\nfunction wakeWaiting(): void {\n const callbacks = [...waiting];\n waiting.clear();\n for (const callback of callbacks) {\n try {\n callback();\n } catch (err) {\n // One that throws stops none of the others; its error still shows.\n queueMicrotask(() => {\n throw err;\n });\n }\n }\n}\n"],"mappings":"sCAGA,SAAgB,EAAY,EAAe,EAAiC,CAE1E,OAAO,GADS,EAAS,SAAW,EAAS,YACpB,EAAS,OAAS,EAAS,UAAU,EAAI,EAAS,SAAW,EAGxF,SAAgB,EAAS,EAAe,EAAiC,CACvE,GAAM,CAAE,MAAK,OAAQ,EAAS,WACxB,CAAE,EAAG,EAAK,UAAW,EAAS,UAChC,EACJ,GAAI,EAAS,UAAY,EAAM,GAAK,EAAM,EAAG,CAC3C,IAAM,EAAS,KAAK,IAAI,EAAI,CACtB,EAAW,KAAK,IAAI,EAAI,CAAG,EACjC,GAAI,IAAa,EAAG,OAAO,EAAM,EAAS,EAC1C,GAAS,KAAK,IAAI,KAAK,IAAI,SAAsB,CAAC,CAAG,GAAU,MAC1D,CACL,IAAM,EAAQ,EAAM,EACpB,GAAI,IAAU,EAAG,OAAO,EAAM,EAAS,EACvC,GAAS,EAAQ,GAAO,EAE1B,OAAO,EAAM,GAAU,EAAS,YAAc,EAAQ,EAAI,GA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