@chartgpu/chartgpu 0.2.5
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/LICENSE +21 -0
- package/README.md +208 -0
- package/dist/ChartGPU.d.ts +146 -0
- package/dist/ChartGPU.d.ts.map +1 -0
- package/dist/components/createAnnotationConfigDialog.d.ts +24 -0
- package/dist/components/createAnnotationConfigDialog.d.ts.map +1 -0
- package/dist/components/createDataZoomSlider.d.ts +14 -0
- package/dist/components/createDataZoomSlider.d.ts.map +1 -0
- package/dist/components/createLegend.d.ts +9 -0
- package/dist/components/createLegend.d.ts.map +1 -0
- package/dist/components/createTextOverlay.d.ts +17 -0
- package/dist/components/createTextOverlay.d.ts.map +1 -0
- package/dist/components/createTooltip.d.ts +12 -0
- package/dist/components/createTooltip.d.ts.map +1 -0
- package/dist/components/formatTooltip.d.ts +19 -0
- package/dist/components/formatTooltip.d.ts.map +1 -0
- package/dist/config/OptionResolver.d.ts +137 -0
- package/dist/config/OptionResolver.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +56 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/types.d.ts +553 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/core/GPUContext.d.ts +242 -0
- package/dist/core/GPUContext.d.ts.map +1 -0
- package/dist/core/RenderScheduler.d.ts +174 -0
- package/dist/core/RenderScheduler.d.ts.map +1 -0
- package/dist/core/createAnimationController.d.ts +15 -0
- package/dist/core/createAnimationController.d.ts.map +1 -0
- package/dist/core/createRenderCoordinator.d.ts +78 -0
- package/dist/core/createRenderCoordinator.d.ts.map +1 -0
- package/dist/core/renderCoordinator/animation/animationHelpers.d.ts +183 -0
- package/dist/core/renderCoordinator/animation/animationHelpers.d.ts.map +1 -0
- package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts +88 -0
- package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts.map +1 -0
- package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts +91 -0
- package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts.map +1 -0
- package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts +53 -0
- package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts.map +1 -0
- package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts +66 -0
- package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts.map +1 -0
- package/dist/core/renderCoordinator/gpu/textureManager.d.ts +69 -0
- package/dist/core/renderCoordinator/gpu/textureManager.d.ts.map +1 -0
- package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts +160 -0
- package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts.map +1 -0
- package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts +36 -0
- package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts.map +1 -0
- package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts +40 -0
- package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts.map +1 -0
- package/dist/core/renderCoordinator/render/renderOverlays.d.ts +70 -0
- package/dist/core/renderCoordinator/render/renderOverlays.d.ts.map +1 -0
- package/dist/core/renderCoordinator/render/renderSeries.d.ts +146 -0
- package/dist/core/renderCoordinator/render/renderSeries.d.ts.map +1 -0
- package/dist/core/renderCoordinator/renderers/rendererPool.d.ts +112 -0
- package/dist/core/renderCoordinator/renderers/rendererPool.d.ts.map +1 -0
- package/dist/core/renderCoordinator/types.d.ts +19 -0
- package/dist/core/renderCoordinator/types.d.ts.map +1 -0
- package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts +104 -0
- package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/axisUtils.d.ts +122 -0
- package/dist/core/renderCoordinator/utils/axisUtils.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/boundsComputation.d.ts +69 -0
- package/dist/core/renderCoordinator/utils/boundsComputation.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/canvasUtils.d.ts +52 -0
- package/dist/core/renderCoordinator/utils/canvasUtils.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts +71 -0
- package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/index.d.ts +12 -0
- package/dist/core/renderCoordinator/utils/index.d.ts.map +1 -0
- package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts +149 -0
- package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts.map +1 -0
- package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts +129 -0
- package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts.map +1 -0
- package/dist/data/cartesianData.d.ts +72 -0
- package/dist/data/cartesianData.d.ts.map +1 -0
- package/dist/data/createDataStore.d.ts +27 -0
- package/dist/data/createDataStore.d.ts.map +1 -0
- package/dist/data/createStreamBuffer.d.ts +20 -0
- package/dist/data/createStreamBuffer.d.ts.map +1 -0
- package/dist/data/lttbSample.d.ts +5 -0
- package/dist/data/lttbSample.d.ts.map +1 -0
- package/dist/data/ohlcSample.d.ts +21 -0
- package/dist/data/ohlcSample.d.ts.map +1 -0
- package/dist/data/packDataPoints.d.ts +65 -0
- package/dist/data/packDataPoints.d.ts.map +1 -0
- package/dist/data/sampleSeries.d.ts +20 -0
- package/dist/data/sampleSeries.d.ts.map +1 -0
- package/dist/esm/ChartGPUWorkerController-B50J-8sx.js +772 -0
- package/dist/esm/ChartGPUWorkerController-B50J-8sx.js.map +1 -0
- package/dist/esm/OptionResolver-R_gJDRSD.js +7150 -0
- package/dist/esm/OptionResolver-R_gJDRSD.js.map +1 -0
- package/dist/esm/assets/worker-entry-Wg897auv.js +779 -0
- package/dist/esm/assets/worker-entry-Wg897auv.js.map +1 -0
- package/dist/esm/createChartInWorker-C4fEeJL8.js +1224 -0
- package/dist/esm/createChartInWorker-C4fEeJL8.js.map +1 -0
- package/dist/esm/index.js +795 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.cjs +1270 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10504 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/createAnnotationAuthoring.d.ts +115 -0
- package/dist/interaction/createAnnotationAuthoring.d.ts.map +1 -0
- package/dist/interaction/createAnnotationDragHandler.d.ts +28 -0
- package/dist/interaction/createAnnotationDragHandler.d.ts.map +1 -0
- package/dist/interaction/createAnnotationHitTester.d.ts +32 -0
- package/dist/interaction/createAnnotationHitTester.d.ts.map +1 -0
- package/dist/interaction/createChartSync.d.ts +27 -0
- package/dist/interaction/createChartSync.d.ts.map +1 -0
- package/dist/interaction/createEventManager.d.ts +24 -0
- package/dist/interaction/createEventManager.d.ts.map +1 -0
- package/dist/interaction/createHoverState.d.ts +20 -0
- package/dist/interaction/createHoverState.d.ts.map +1 -0
- package/dist/interaction/createInsideZoom.d.ts +14 -0
- package/dist/interaction/createInsideZoom.d.ts.map +1 -0
- package/dist/interaction/createZoomState.d.ts +63 -0
- package/dist/interaction/createZoomState.d.ts.map +1 -0
- package/dist/interaction/findCandlestick.d.ts +41 -0
- package/dist/interaction/findCandlestick.d.ts.map +1 -0
- package/dist/interaction/findNearestPoint.d.ts +61 -0
- package/dist/interaction/findNearestPoint.d.ts.map +1 -0
- package/dist/interaction/findPieSlice.d.ts +36 -0
- package/dist/interaction/findPieSlice.d.ts.map +1 -0
- package/dist/interaction/findPointsAtX.d.ts +37 -0
- package/dist/interaction/findPointsAtX.d.ts.map +1 -0
- package/dist/renderers/createAnnotationMarkerRenderer.d.ts +58 -0
- package/dist/renderers/createAnnotationMarkerRenderer.d.ts.map +1 -0
- package/dist/renderers/createAreaRenderer.d.ts +19 -0
- package/dist/renderers/createAreaRenderer.d.ts.map +1 -0
- package/dist/renderers/createAxisRenderer.d.ts +19 -0
- package/dist/renderers/createAxisRenderer.d.ts.map +1 -0
- package/dist/renderers/createBarRenderer.d.ts +20 -0
- package/dist/renderers/createBarRenderer.d.ts.map +1 -0
- package/dist/renderers/createCandlestickRenderer.d.ts +19 -0
- package/dist/renderers/createCandlestickRenderer.d.ts.map +1 -0
- package/dist/renderers/createCrosshairRenderer.d.ts +43 -0
- package/dist/renderers/createCrosshairRenderer.d.ts.map +1 -0
- package/dist/renderers/createGridRenderer.d.ts +45 -0
- package/dist/renderers/createGridRenderer.d.ts.map +1 -0
- package/dist/renderers/createHighlightRenderer.d.ts +41 -0
- package/dist/renderers/createHighlightRenderer.d.ts.map +1 -0
- package/dist/renderers/createLineRenderer.d.ts +18 -0
- package/dist/renderers/createLineRenderer.d.ts.map +1 -0
- package/dist/renderers/createPieRenderer.d.ts +18 -0
- package/dist/renderers/createPieRenderer.d.ts.map +1 -0
- package/dist/renderers/createReferenceLineRenderer.d.ts +81 -0
- package/dist/renderers/createReferenceLineRenderer.d.ts.map +1 -0
- package/dist/renderers/createScatterDensityRenderer.d.ts +14 -0
- package/dist/renderers/createScatterDensityRenderer.d.ts.map +1 -0
- package/dist/renderers/createScatterRenderer.d.ts +20 -0
- package/dist/renderers/createScatterRenderer.d.ts.map +1 -0
- package/dist/renderers/rendererUtils.d.ts +100 -0
- package/dist/renderers/rendererUtils.d.ts.map +1 -0
- package/dist/themes/darkTheme.d.ts +11 -0
- package/dist/themes/darkTheme.d.ts.map +1 -0
- package/dist/themes/index.d.ts +8 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/lightTheme.d.ts +11 -0
- package/dist/themes/lightTheme.d.ts.map +1 -0
- package/dist/themes/types.d.ts +14 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/types/ChartGPU.d.ts +99 -0
- package/dist/types/ChartGPU.d.ts.map +1 -0
- package/dist/types/components/createDataZoomSlider.d.ts +14 -0
- package/dist/types/components/createDataZoomSlider.d.ts.map +1 -0
- package/dist/types/components/createLegend.d.ts +9 -0
- package/dist/types/components/createLegend.d.ts.map +1 -0
- package/dist/types/components/createTextOverlay.d.ts +17 -0
- package/dist/types/components/createTextOverlay.d.ts.map +1 -0
- package/dist/types/components/createTooltip.d.ts +12 -0
- package/dist/types/components/createTooltip.d.ts.map +1 -0
- package/dist/types/components/formatTooltip.d.ts +19 -0
- package/dist/types/components/formatTooltip.d.ts.map +1 -0
- package/dist/types/config/OptionResolver.d.ts +134 -0
- package/dist/types/config/OptionResolver.d.ts.map +1 -0
- package/dist/types/config/defaults.d.ts +55 -0
- package/dist/types/config/defaults.d.ts.map +1 -0
- package/dist/types/config/types.d.ts +485 -0
- package/dist/types/config/types.d.ts.map +1 -0
- package/dist/types/core/GPUContext.d.ts +242 -0
- package/dist/types/core/GPUContext.d.ts.map +1 -0
- package/dist/types/core/RenderScheduler.d.ts +174 -0
- package/dist/types/core/RenderScheduler.d.ts.map +1 -0
- package/dist/types/core/createAnimationController.d.ts +15 -0
- package/dist/types/core/createAnimationController.d.ts.map +1 -0
- package/dist/types/core/createRenderCoordinator.d.ts +129 -0
- package/dist/types/core/createRenderCoordinator.d.ts.map +1 -0
- package/dist/types/data/createDataStore.d.ts +33 -0
- package/dist/types/data/createDataStore.d.ts.map +1 -0
- package/dist/types/data/createStreamBuffer.d.ts +20 -0
- package/dist/types/data/createStreamBuffer.d.ts.map +1 -0
- package/dist/types/data/lttbSample.d.ts +5 -0
- package/dist/types/data/lttbSample.d.ts.map +1 -0
- package/dist/types/data/ohlcSample.d.ts +21 -0
- package/dist/types/data/ohlcSample.d.ts.map +1 -0
- package/dist/types/data/packDataPoints.d.ts +79 -0
- package/dist/types/data/packDataPoints.d.ts.map +1 -0
- package/dist/types/data/sampleSeries.d.ts +3 -0
- package/dist/types/data/sampleSeries.d.ts.map +1 -0
- package/dist/types/index.d.ts +35 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interaction/createChartSync.d.ts +12 -0
- package/dist/types/interaction/createChartSync.d.ts.map +1 -0
- package/dist/types/interaction/createEventManager.d.ts +24 -0
- package/dist/types/interaction/createEventManager.d.ts.map +1 -0
- package/dist/types/interaction/createHoverState.d.ts +20 -0
- package/dist/types/interaction/createHoverState.d.ts.map +1 -0
- package/dist/types/interaction/createInsideZoom.d.ts +14 -0
- package/dist/types/interaction/createInsideZoom.d.ts.map +1 -0
- package/dist/types/interaction/createZoomState.d.ts +63 -0
- package/dist/types/interaction/createZoomState.d.ts.map +1 -0
- package/dist/types/interaction/findCandlestick.d.ts +41 -0
- package/dist/types/interaction/findCandlestick.d.ts.map +1 -0
- package/dist/types/interaction/findNearestPoint.d.ts +61 -0
- package/dist/types/interaction/findNearestPoint.d.ts.map +1 -0
- package/dist/types/interaction/findPieSlice.d.ts +36 -0
- package/dist/types/interaction/findPieSlice.d.ts.map +1 -0
- package/dist/types/interaction/findPointsAtX.d.ts +37 -0
- package/dist/types/interaction/findPointsAtX.d.ts.map +1 -0
- package/dist/types/renderers/createAreaRenderer.d.ts +18 -0
- package/dist/types/renderers/createAreaRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createAxisRenderer.d.ts +19 -0
- package/dist/types/renderers/createAxisRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createBarRenderer.d.ts +20 -0
- package/dist/types/renderers/createBarRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createCandlestickRenderer.d.ts +19 -0
- package/dist/types/renderers/createCandlestickRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createCrosshairRenderer.d.ts +43 -0
- package/dist/types/renderers/createCrosshairRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createGridRenderer.d.ts +45 -0
- package/dist/types/renderers/createGridRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createHighlightRenderer.d.ts +41 -0
- package/dist/types/renderers/createHighlightRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createLineRenderer.d.ts +18 -0
- package/dist/types/renderers/createLineRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createPieRenderer.d.ts +18 -0
- package/dist/types/renderers/createPieRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createScatterDensityRenderer.d.ts +14 -0
- package/dist/types/renderers/createScatterDensityRenderer.d.ts.map +1 -0
- package/dist/types/renderers/createScatterRenderer.d.ts +19 -0
- package/dist/types/renderers/createScatterRenderer.d.ts.map +1 -0
- package/dist/types/renderers/rendererUtils.d.ts +100 -0
- package/dist/types/renderers/rendererUtils.d.ts.map +1 -0
- package/dist/types/themes/darkTheme.d.ts +11 -0
- package/dist/types/themes/darkTheme.d.ts.map +1 -0
- package/dist/types/themes/index.d.ts +8 -0
- package/dist/types/themes/index.d.ts.map +1 -0
- package/dist/types/themes/lightTheme.d.ts +11 -0
- package/dist/types/themes/lightTheme.d.ts.map +1 -0
- package/dist/types/themes/types.d.ts +14 -0
- package/dist/types/themes/types.d.ts.map +1 -0
- package/dist/types/utils/axisLabelStyling.d.ts +27 -0
- package/dist/types/utils/axisLabelStyling.d.ts.map +1 -0
- package/dist/types/utils/checkWebGPU.d.ts +39 -0
- package/dist/types/utils/checkWebGPU.d.ts.map +1 -0
- package/dist/types/utils/colors.d.ts +14 -0
- package/dist/types/utils/colors.d.ts.map +1 -0
- package/dist/types/utils/easing.d.ts +9 -0
- package/dist/types/utils/easing.d.ts.map +1 -0
- package/dist/types/utils/scales.d.ts +79 -0
- package/dist/types/utils/scales.d.ts.map +1 -0
- package/dist/utils/axisLabelStyling.d.ts +20 -0
- package/dist/utils/axisLabelStyling.d.ts.map +1 -0
- package/dist/utils/checkWebGPU.d.ts +39 -0
- package/dist/utils/checkWebGPU.d.ts.map +1 -0
- package/dist/utils/colors.d.ts +14 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/easing.d.ts +9 -0
- package/dist/utils/easing.d.ts.map +1 -0
- package/dist/utils/scales.d.ts +79 -0
- package/dist/utils/scales.d.ts.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoom helper utilities for domain calculations and zoom state checks.
|
|
3
|
+
*
|
|
4
|
+
* Provides pure functions for computing visible domains from zoom ranges,
|
|
5
|
+
* checking full-span zoom states, and other zoom-related calculations.
|
|
6
|
+
*
|
|
7
|
+
* @module zoomHelpers
|
|
8
|
+
*/
|
|
9
|
+
import type { ZoomRange } from '../../../interaction/createZoomState';
|
|
10
|
+
/**
|
|
11
|
+
* Domain boundaries with min and max values.
|
|
12
|
+
*/
|
|
13
|
+
export interface DomainBounds {
|
|
14
|
+
readonly min: number;
|
|
15
|
+
readonly max: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Visible domain with span fraction for performance optimization hints.
|
|
19
|
+
*/
|
|
20
|
+
export interface VisibleDomain extends DomainBounds {
|
|
21
|
+
/**
|
|
22
|
+
* Fraction of the base domain that is visible (0 to 1).
|
|
23
|
+
* Used to determine if full-resolution data can be used.
|
|
24
|
+
*/
|
|
25
|
+
readonly spanFraction: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Computes the visible X domain from base domain and zoom range.
|
|
29
|
+
*
|
|
30
|
+
* Converts a percent-space zoom range [0-100] to actual domain coordinates.
|
|
31
|
+
* Returns the full base domain when zoom is null/undefined or full-span.
|
|
32
|
+
*
|
|
33
|
+
* @param baseDomain - The complete data domain (unzoomed)
|
|
34
|
+
* @param zoomRange - Zoom window in percent space [0-100], or null for full view
|
|
35
|
+
* @returns Visible domain with min, max, and span fraction
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const baseDomain = { min: 0, max: 1000 };
|
|
40
|
+
* const zoomRange = { start: 25, end: 75 };
|
|
41
|
+
* const visible = computeVisibleDomain(baseDomain, zoomRange);
|
|
42
|
+
* // Returns: { min: 250, max: 750, spanFraction: 0.5 }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function computeVisibleDomain(baseDomain: DomainBounds, zoomRange?: ZoomRange | null): VisibleDomain;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a zoom range represents a full-span (unzoomed) view.
|
|
48
|
+
*
|
|
49
|
+
* A zoom is considered full-span if:
|
|
50
|
+
* - Range is null/undefined
|
|
51
|
+
* - Start is at or before 0% AND end is at or after 100%
|
|
52
|
+
*
|
|
53
|
+
* Small tolerance (0.5%) is applied to account for floating-point arithmetic
|
|
54
|
+
* and UI imprecision (e.g., slider at edge).
|
|
55
|
+
*
|
|
56
|
+
* @param zoomRange - Zoom window to check, or null
|
|
57
|
+
* @returns True if the zoom represents a full-span view
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* isFullSpanZoom(null); // true
|
|
62
|
+
* isFullSpanZoom({ start: 0, end: 100 }); // true
|
|
63
|
+
* isFullSpanZoom({ start: -0.1, end: 100.1 }); // true (tolerance)
|
|
64
|
+
* isFullSpanZoom({ start: 25, end: 75 }); // false
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function isFullSpanZoom(zoomRange: ZoomRange | null | undefined): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Computes a buffer zone around the visible domain for data caching.
|
|
70
|
+
*
|
|
71
|
+
* Adds a percentage buffer on each side of the visible domain to cache
|
|
72
|
+
* extra data points for smooth panning. This reduces resampling frequency
|
|
73
|
+
* when the user pans slightly beyond the current view.
|
|
74
|
+
*
|
|
75
|
+
* @param visibleDomain - Current visible domain
|
|
76
|
+
* @param bufferPercent - Buffer percentage (0 to 1), default 0.1 (10%)
|
|
77
|
+
* @returns Buffered domain bounds
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const visible = { min: 100, max: 200 };
|
|
82
|
+
* const buffered = computeBufferedDomain(visible, 0.1);
|
|
83
|
+
* // Returns: { min: 90, max: 210 } (±10% buffer)
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function computeBufferedDomain(visibleDomain: DomainBounds, bufferPercent?: number): DomainBounds;
|
|
87
|
+
/**
|
|
88
|
+
* Converts a domain coordinate to percent-space relative to base domain.
|
|
89
|
+
*
|
|
90
|
+
* Useful for converting mouse positions or data coordinates to zoom range
|
|
91
|
+
* percentages for zoom/pan operations.
|
|
92
|
+
*
|
|
93
|
+
* @param value - Domain coordinate to convert
|
|
94
|
+
* @param baseDomain - Base domain for reference
|
|
95
|
+
* @returns Percent value [0-100]
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const percent = domainValueToPercent(500, { min: 0, max: 1000 });
|
|
100
|
+
* // Returns: 50
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function domainValueToPercent(value: number, baseDomain: DomainBounds): number;
|
|
104
|
+
/**
|
|
105
|
+
* Converts a percent-space value to domain coordinate.
|
|
106
|
+
*
|
|
107
|
+
* Inverse of `domainValueToPercent`. Useful for converting zoom range
|
|
108
|
+
* percentages back to domain coordinates.
|
|
109
|
+
*
|
|
110
|
+
* @param percent - Percent value [0-100]
|
|
111
|
+
* @param baseDomain - Base domain for reference
|
|
112
|
+
* @returns Domain coordinate
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* const value = percentToDomainValue(50, { min: 0, max: 1000 });
|
|
117
|
+
* // Returns: 500
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function percentToDomainValue(percent: number, baseDomain: DomainBounds): number;
|
|
121
|
+
/**
|
|
122
|
+
* Calculates the zoom span (in percent) from a domain window.
|
|
123
|
+
*
|
|
124
|
+
* @param windowDomain - The zoomed window domain
|
|
125
|
+
* @param baseDomain - The full base domain
|
|
126
|
+
* @returns Span in percent [0-100]
|
|
127
|
+
*/
|
|
128
|
+
export declare function calculateZoomSpan(windowDomain: DomainBounds, baseDomain: DomainBounds): number;
|
|
129
|
+
//# sourceMappingURL=zoomHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoomHelpers.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/zoom/zoomHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,YAAY,EACxB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,GAC3B,aAAa,CAsBf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAS/E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,YAAY,EAC3B,aAAa,GAAE,MAAY,GAC1B,YAAY,CAWd;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,GAAG,MAAM,CAMpF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,GAAG,MAAM,CAGtF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,GAAG,MAAM,CAQ9F"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal cartesian data abstraction for CartesianSeriesData.
|
|
3
|
+
*
|
|
4
|
+
* Provides high-performance, allocation-minimizing primitives to support all three cartesian formats:
|
|
5
|
+
* - ReadonlyArray<DataPoint> (tuple or object)
|
|
6
|
+
* - XYArraysData (separate x/y/size arrays)
|
|
7
|
+
* - InterleavedXYData (typed array view with [x0,y0,x1,y1,...] layout)
|
|
8
|
+
*
|
|
9
|
+
* DO NOT export from public entrypoint (src/index.ts). This is internal-only.
|
|
10
|
+
*
|
|
11
|
+
* @module cartesianData
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
import type { CartesianSeriesData } from '../config/types';
|
|
15
|
+
/**
|
|
16
|
+
* Bounds type for min/max x and y values.
|
|
17
|
+
*/
|
|
18
|
+
export type Bounds = Readonly<{
|
|
19
|
+
xMin: number;
|
|
20
|
+
xMax: number;
|
|
21
|
+
yMin: number;
|
|
22
|
+
yMax: number;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the number of points in the CartesianSeriesData.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPointCount(data: CartesianSeriesData): number;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the x-coordinate of the point at index i.
|
|
30
|
+
* Returns NaN if the point is undefined, null, or non-object (for DataPoint[] format).
|
|
31
|
+
* This allows callers using `Number.isFinite()` to naturally skip missing points.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getX(data: CartesianSeriesData, i: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the y-coordinate of the point at index i.
|
|
36
|
+
* Returns NaN if the point is undefined, null, or non-object (for DataPoint[] format).
|
|
37
|
+
* This allows callers using `Number.isFinite()` to naturally skip missing points.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getY(data: CartesianSeriesData, i: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the size value of the point at index i, or undefined if not available.
|
|
42
|
+
* Returns undefined if the point is undefined, null, or non-object (for DataPoint[] format).
|
|
43
|
+
* Note: InterleavedXYData does NOT support interleaved size (use XYArraysData.size if needed).
|
|
44
|
+
*/
|
|
45
|
+
export declare function getSize(data: CartesianSeriesData, i: number): number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Packs XY coordinates from CartesianSeriesData into a Float32Array in interleaved layout.
|
|
48
|
+
*
|
|
49
|
+
* Writes `pointCount` points starting at `srcPointOffset` in the source data
|
|
50
|
+
* into `out` starting at `outFloatOffset` (measured in float32 elements, not bytes).
|
|
51
|
+
*
|
|
52
|
+
* Each point writes 2 floats: [x - xOffset, y].
|
|
53
|
+
* Size dimension is NOT packed (use getSize() separately if needed).
|
|
54
|
+
*
|
|
55
|
+
* @param out - Target Float32Array to write into
|
|
56
|
+
* @param outFloatOffset - Starting offset in `out` (in float32 elements)
|
|
57
|
+
* @param src - Source CartesianSeriesData
|
|
58
|
+
* @param srcPointOffset - Starting point index in source
|
|
59
|
+
* @param pointCount - Number of points to pack
|
|
60
|
+
* @param xOffset - Value to subtract from x coordinates (for Float32 precision preservation)
|
|
61
|
+
*/
|
|
62
|
+
export declare function packXYInto(out: Float32Array, outFloatOffset: number, src: CartesianSeriesData, srcPointOffset: number, pointCount: number, xOffset: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* Computes xMin/xMax/yMin/yMax bounds from CartesianSeriesData.
|
|
65
|
+
* Skips non-finite x or y values. Returns null if no finite points found.
|
|
66
|
+
* Ensures xMin !== xMax and yMin !== yMax for scale derivation (expands max by +1 if needed).
|
|
67
|
+
*
|
|
68
|
+
* @param data - CartesianSeriesData in any supported format
|
|
69
|
+
* @returns Bounds object or null if no finite points
|
|
70
|
+
*/
|
|
71
|
+
export declare function computeRawBoundsFromCartesianData(data: CartesianSeriesData): Bounds | null;
|
|
72
|
+
//# sourceMappingURL=cartesianData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cartesianData.d.ts","sourceRoot":"","sources":["../../src/data/cartesianData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAA8C,MAAM,iBAAiB,CAAC;AAEvG;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAqD1F;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAmB/D;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBjE;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBjE;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiBhF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,mBAAmB,EACxB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,IAAI,CA6DN;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAkE1F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CartesianSeriesData } from '../config/types';
|
|
2
|
+
export interface DataStore {
|
|
3
|
+
setSeries(index: number, data: CartesianSeriesData, options?: Readonly<{
|
|
4
|
+
xOffset?: number;
|
|
5
|
+
}>): void;
|
|
6
|
+
/**
|
|
7
|
+
* Appends new points to an existing series without re-uploading the entire buffer when possible.
|
|
8
|
+
*
|
|
9
|
+
* - Reuses the same geometric growth policy as `setSeries`.
|
|
10
|
+
* - When no reallocation is needed, writes only the appended byte range via `queue.writeBuffer(...)`.
|
|
11
|
+
* - Maintains `pointCount` for render path queries.
|
|
12
|
+
*
|
|
13
|
+
* Throws if the series has not been set yet.
|
|
14
|
+
*/
|
|
15
|
+
appendSeries(index: number, newPoints: CartesianSeriesData): void;
|
|
16
|
+
removeSeries(index: number): void;
|
|
17
|
+
getSeriesBuffer(index: number): GPUBuffer;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the number of points last set for the given series index.
|
|
20
|
+
*
|
|
21
|
+
* Throws if the series has not been set yet.
|
|
22
|
+
*/
|
|
23
|
+
getSeriesPointCount(index: number): number;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function createDataStore(device: GPUDevice): DataStore;
|
|
27
|
+
//# sourceMappingURL=createDataStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDataStore.d.ts","sourceRoot":"","sources":["../../src/data/createDataStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,MAAM,WAAW,SAAS;IACxB,SAAS,CACP,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,QAAQ,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GACvC,IAAI,CAAC;IACR;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClE,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,OAAO,IAAI,IAAI,CAAC;CACjB;AAyDD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CA2O5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface StreamBuffer {
|
|
2
|
+
/**
|
|
3
|
+
* Writes a new vertex payload into the streaming buffer.
|
|
4
|
+
*
|
|
5
|
+
* Notes:
|
|
6
|
+
* - `data` is interpreted as interleaved `vec2<f32>` vertices: `[x0, y0, x1, y1, ...]`.
|
|
7
|
+
* - Uses double buffering (alternates GPU buffers each write) to avoid writing into the same
|
|
8
|
+
* buffer the GPU might still be reading from the prior frame.
|
|
9
|
+
* - Uses a per-buffer CPU mirror (Uint32 bit patterns) to compute partial updates.
|
|
10
|
+
*/
|
|
11
|
+
write(data: Float32Array): void;
|
|
12
|
+
/** Returns the GPUBuffer that contains the most recently written data. */
|
|
13
|
+
getBuffer(): GPUBuffer;
|
|
14
|
+
/** Returns the vertex count for the most recently written data. */
|
|
15
|
+
getVertexCount(): number;
|
|
16
|
+
/** Destroys GPU resources (best-effort). Safe to call multiple times. */
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function createStreamBuffer(device: GPUDevice, maxSize: number): StreamBuffer;
|
|
20
|
+
//# sourceMappingURL=createStreamBuffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStreamBuffer.d.ts","sourceRoot":"","sources":["../../src/data/createStreamBuffer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,0EAA0E;IAC1E,SAAS,IAAI,SAAS,CAAC;IACvB,mEAAmE;IACnE,cAAc,IAAI,MAAM,CAAC;IACzB,yEAAyE;IACzE,OAAO,IAAI,IAAI,CAAC;CACjB;AAoBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAiKnF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DataPoint } from '../config/types';
|
|
2
|
+
export declare function lttbSample(data: Float32Array, targetPoints: number): Float32Array;
|
|
3
|
+
export declare function lttbSample(data: DataPoint[], targetPoints: number): DataPoint[];
|
|
4
|
+
export declare function lttbSample(data: ReadonlyArray<DataPoint>, targetPoints: number): ReadonlyArray<DataPoint>;
|
|
5
|
+
//# sourceMappingURL=lttbSample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lttbSample.d.ts","sourceRoot":"","sources":["../../src/data/lttbSample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AA6KjE,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAAC;AACnF,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OHLCDataPoint } from '../config/types';
|
|
2
|
+
/**
|
|
3
|
+
* Downsamples OHLC (candlestick) data to a target number of points using bucket aggregation.
|
|
4
|
+
*
|
|
5
|
+
* Each bucket aggregates candles preserving OHLC semantics:
|
|
6
|
+
* - timestamp and open from the first candle in the bucket
|
|
7
|
+
* - close from the last candle in the bucket
|
|
8
|
+
* - high as the maximum of all highs in the bucket
|
|
9
|
+
* - low as the minimum of all lows in the bucket
|
|
10
|
+
*
|
|
11
|
+
* @param data - Array of OHLC data points (tuples or objects)
|
|
12
|
+
* @param targetPoints - Desired number of output points
|
|
13
|
+
* @returns Downsampled array; same reference if no sampling needed
|
|
14
|
+
*
|
|
15
|
+
* Edge cases:
|
|
16
|
+
* - If `data.length <= targetPoints` or `targetPoints < 2`, returns the original array (same reference)
|
|
17
|
+
* - First and last candles are always preserved exactly (same element references)
|
|
18
|
+
* - Output shape matches input shape (tuples → tuples, objects → objects)
|
|
19
|
+
*/
|
|
20
|
+
export declare function ohlcSample(data: ReadonlyArray<OHLCDataPoint>, targetPoints: number): ReadonlyArray<OHLCDataPoint>;
|
|
21
|
+
//# sourceMappingURL=ohlcSample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ohlcSample.d.ts","sourceRoot":"","sources":["../../src/data/ohlcSample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AAMzE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,EAClC,YAAY,EAAE,MAAM,GACnB,aAAa,CAAC,aAAa,CAAC,CAgG9B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data point packing utilities for GPU buffer uploads.
|
|
3
|
+
*
|
|
4
|
+
* Internal utilities that convert high-level DataPoint/OHLCDataPoint arrays into
|
|
5
|
+
* interleaved Float32Array buffers suitable for direct GPU buffer uploads via
|
|
6
|
+
* `queue.writeBuffer()`.
|
|
7
|
+
*
|
|
8
|
+
* @module packDataPoints
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
import type { DataPoint, OHLCDataPoint } from '../config/types';
|
|
12
|
+
/**
|
|
13
|
+
* Packs DataPoint array into an interleaved Float32Array for GPU buffer uploads.
|
|
14
|
+
*
|
|
15
|
+
* **Internal utility** used by data store for efficient GPU buffer management.
|
|
16
|
+
*
|
|
17
|
+
* **Format**: `[x0, y0, x1, y1, x2, y2, ...]` (2 floats per point = 8 bytes stride)
|
|
18
|
+
*
|
|
19
|
+
* @param points - Array of data points (tuple or object form)
|
|
20
|
+
* @returns Interleaved Float32Array [x0,y0,x1,y1,...] for GPU vertex buffer upload
|
|
21
|
+
* @throws {TypeError} If points is null, undefined, or not an array
|
|
22
|
+
* @throws {RangeError} If points array is empty or contains invalid values
|
|
23
|
+
* @internal
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const points = [{ x: 0, y: 10 }, { x: 1, y: 20 }];
|
|
28
|
+
* const packed = packDataPoints(points);
|
|
29
|
+
* // packed = Float32Array[0, 10, 1, 20]
|
|
30
|
+
*
|
|
31
|
+
* // Upload to GPU buffer:
|
|
32
|
+
* device.queue.writeBuffer(vertexBuffer, 0, packed.buffer);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function packDataPoints(points: ReadonlyArray<DataPoint>): Float32Array;
|
|
36
|
+
/**
|
|
37
|
+
* Packs OHLCDataPoint array into an interleaved Float32Array for GPU buffer uploads.
|
|
38
|
+
*
|
|
39
|
+
* **Internal utility** used by data store for efficient candlestick GPU buffer management.
|
|
40
|
+
*
|
|
41
|
+
* **Format**: `[t0, o0, h0, l0, c0, t1, o1, h1, l1, c1, ...]` (5 floats per point = 20 bytes stride)
|
|
42
|
+
*
|
|
43
|
+
* Order follows ECharts convention: timestamp, open, high, low, close (t, o, h, l, c).
|
|
44
|
+
*
|
|
45
|
+
* @param points - Array of OHLC data points (tuple or object form)
|
|
46
|
+
* @returns Interleaved Float32Array [t0,o0,h0,l0,c0,t1,...] for GPU vertex buffer upload
|
|
47
|
+
* @throws {TypeError} If points is null, undefined, or not an array
|
|
48
|
+
* @throws {RangeError} If points array is empty or contains invalid values
|
|
49
|
+
* @internal
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const ohlcPoints = [
|
|
54
|
+
* { timestamp: 1000, open: 100, high: 110, low: 95, close: 105 },
|
|
55
|
+
* { timestamp: 2000, open: 105, high: 115, low: 100, close: 110 }
|
|
56
|
+
* ];
|
|
57
|
+
* const packed = packOHLCDataPoints(ohlcPoints);
|
|
58
|
+
* // packed = Float32Array[1000, 100, 110, 95, 105, 2000, 105, 115, 100, 110]
|
|
59
|
+
*
|
|
60
|
+
* // Upload to GPU buffer:
|
|
61
|
+
* device.queue.writeBuffer(vertexBuffer, 0, packed.buffer);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function packOHLCDataPoints(points: ReadonlyArray<OHLCDataPoint>): Float32Array;
|
|
65
|
+
//# sourceMappingURL=packDataPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packDataPoints.d.ts","sourceRoot":"","sources":["../../src/data/packDataPoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAiBhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,YAAY,CA2D7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,YAAY,CAiGrF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CartesianSeriesData, SeriesSampling } from '../config/types';
|
|
2
|
+
/**
|
|
3
|
+
* Samples CartesianSeriesData using the specified sampling strategy.
|
|
4
|
+
*
|
|
5
|
+
* Returns the ORIGINAL data reference when:
|
|
6
|
+
* - `sampling === 'none'`
|
|
7
|
+
* - `samplingThreshold` is invalid/non-positive
|
|
8
|
+
* - Point count <= threshold
|
|
9
|
+
*
|
|
10
|
+
* When sampling occurs:
|
|
11
|
+
* - For `lttb`:
|
|
12
|
+
* - Float32Array interleaved → returns sampled Float32Array
|
|
13
|
+
* - Other interleaved typed array → packs to Float32Array, returns sampled Float32Array
|
|
14
|
+
* - DataPoint[] → returns sampled DataPoint[]
|
|
15
|
+
* - XYArraysData → packs to Float32Array, returns sampled Float32Array
|
|
16
|
+
* - For `average`/`max`/`min`:
|
|
17
|
+
* - Returns DataPointTuple[] for all input formats
|
|
18
|
+
*/
|
|
19
|
+
export declare function sampleSeriesDataPoints(data: CartesianSeriesData, sampling: SeriesSampling, samplingThreshold: number): CartesianSeriesData;
|
|
20
|
+
//# sourceMappingURL=sampleSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleSeries.d.ts","sourceRoot":"","sources":["../../src/data/sampleSeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAoM3F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,mBAAmB,EACzB,QAAQ,EAAE,cAAc,EACxB,iBAAiB,EAAE,MAAM,GACxB,mBAAmB,CA8CrB"}
|