velo-plot 1.11.1
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 +119 -0
- package/dist/EventEmitter-DAbs2K1C.js +60 -0
- package/dist/EventEmitter-DAbs2K1C.js.map +1 -0
- package/dist/core/Chart.d.ts +15 -0
- package/dist/core/ChartControls.d.ts +41 -0
- package/dist/core/ChartInitQueue.d.ts +50 -0
- package/dist/core/ChartLegend.d.ts +74 -0
- package/dist/core/ChartStatistics.d.ts +18 -0
- package/dist/core/EventEmitter.d.ts +30 -0
- package/dist/core/InteractionManager.d.ts +96 -0
- package/dist/core/OverlayRenderer.d.ts +89 -0
- package/dist/core/Series.d.ts +4 -0
- package/dist/core/animation/AnimationEngine.d.ts +156 -0
- package/dist/core/animation/index.d.ts +6 -0
- package/dist/core/annotations/AnnotationManager.d.ts +61 -0
- package/dist/core/annotations/index.d.ts +5 -0
- package/dist/core/annotations/types.d.ts +159 -0
- package/dist/core/chart/ChartAnimatedNavigation.d.ts +53 -0
- package/dist/core/chart/ChartAxisManager.d.ts +61 -0
- package/dist/core/chart/ChartCore.d.ts +336 -0
- package/dist/core/chart/ChartExporter.d.ts +18 -0
- package/dist/core/chart/ChartNavigation.d.ts +33 -0
- package/dist/core/chart/ChartPluginBridge.d.ts +34 -0
- package/dist/core/chart/ChartRenderLoop.d.ts +100 -0
- package/dist/core/chart/ChartRenderer.d.ts +52 -0
- package/dist/core/chart/ChartScaling.d.ts +31 -0
- package/dist/core/chart/ChartSeries.d.ts +4 -0
- package/dist/core/chart/ChartSetup.d.ts +67 -0
- package/dist/core/chart/ChartStateManager.d.ts +54 -0
- package/dist/core/chart/ChartUI.d.ts +40 -0
- package/dist/core/chart/exporter/SVGExporter.d.ts +6 -0
- package/dist/core/chart/exporter/index.d.ts +5 -0
- package/dist/core/chart/index.d.ts +14 -0
- package/dist/core/chart/series/SeriesActions.d.ts +7 -0
- package/dist/core/chart/series/SeriesBuffer.d.ts +4 -0
- package/dist/core/chart/series/index.d.ts +6 -0
- package/dist/core/chart/series/types.d.ts +22 -0
- package/dist/core/chart/types.d.ts +188 -0
- package/dist/core/clipboard/index.d.ts +137 -0
- package/dist/core/debug/index.d.ts +143 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/keybindings/index.d.ts +157 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/types.d.ts +165 -0
- package/dist/core/loading/index.d.ts +104 -0
- package/dist/core/locale/index.d.ts +91 -0
- package/dist/core/responsive/ResponsiveManager.d.ts +133 -0
- package/dist/core/responsive/index.d.ts +4 -0
- package/dist/core/selection/SelectionManager.d.ts +165 -0
- package/dist/core/selection/index.d.ts +4 -0
- package/dist/core/series/Series.d.ts +73 -0
- package/dist/core/series/SeriesBounds.d.ts +3 -0
- package/dist/core/series/SeriesDataUtils.d.ts +7 -0
- package/dist/core/series/index.d.ts +6 -0
- package/dist/core/sync/index.d.ts +147 -0
- package/dist/core/theme-editor/index.d.ts +122 -0
- package/dist/examples/PluginDemonstration.d.ts +20 -0
- package/dist/examples.d.ts +25 -0
- package/dist/gpu/adapter/gpuRenderer.d.ts +135 -0
- package/dist/gpu/adapter/index.d.ts +7 -0
- package/dist/gpu/adapter/seriesAdapter.d.ts +88 -0
- package/dist/gpu/backends/webgl/WebGLBackend.d.ts +42 -0
- package/dist/gpu/backends/webgl/index.d.ts +5 -0
- package/dist/gpu/backends/webgl/programFactory.d.ts +30 -0
- package/dist/gpu/backends/webgl/shaders.d.ts +14 -0
- package/dist/gpu/backends/webgpu/MassiveDataRenderer.d.ts +111 -0
- package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +58 -0
- package/dist/gpu/backends/webgpu/pipelines/bandPipeline.d.ts +24 -0
- package/dist/gpu/backends/webgpu/pipelines/heatmapPipeline.d.ts +28 -0
- package/dist/gpu/backends/webgpu/pipelines/index.d.ts +10 -0
- package/dist/gpu/backends/webgpu/pipelines/instancedLinePipeline.d.ts +23 -0
- package/dist/gpu/backends/webgpu/pipelines/instancedPointPipeline.d.ts +25 -0
- package/dist/gpu/backends/webgpu/pipelines/linePipeline.d.ts +23 -0
- package/dist/gpu/backends/webgpu/pipelines/pointPipeline.d.ts +28 -0
- package/dist/gpu/backends/webgpu/pipelines/trianglePipeline.d.ts +5 -0
- package/dist/gpu/backends/webgpu/pipelines/triangleShader.d.ts +1 -0
- package/dist/gpu/backends/webgpu/shaders/heatmap.wgsl.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/index.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/instanced.wgsl.d.ts +16 -0
- package/dist/gpu/backends/webgpu/shaders/line.wgsl.d.ts +8 -0
- package/dist/gpu/backends/webgpu/shaders/point.wgsl.d.ts +9 -0
- package/dist/gpu/benchmark/benchmark.d.ts +74 -0
- package/dist/gpu/benchmark/index.d.ts +5 -0
- package/dist/gpu/compute/gpuCompute.d.ts +72 -0
- package/dist/gpu/compute/index.d.ts +6 -0
- package/dist/gpu/compute/shaders.d.ts +9 -0
- package/dist/gpu/drawList.d.ts +77 -0
- package/dist/gpu/examples/gallery.d.ts +20 -0
- package/dist/gpu/examples/index.d.ts +3 -0
- package/dist/gpu/examples/webgpu-line-demo.d.ts +8 -0
- package/dist/gpu/examples/webgpu-triangle.d.ts +1 -0
- package/dist/gpu/frame.d.ts +25 -0
- package/dist/gpu/index.d.ts +24 -0
- package/dist/gpu/resources/bufferStore.d.ts +40 -0
- package/dist/gpu/resources/index.d.ts +9 -0
- package/dist/gpu/resources/pipelineCache.d.ts +33 -0
- package/dist/gpu/resources/textureStore.d.ts +41 -0
- package/dist/gpu/types.d.ts +47 -0
- package/dist/index-BMiZoKmm.js +536 -0
- package/dist/index-BMiZoKmm.js.map +1 -0
- package/dist/index-Ce2JgkH_.js +282 -0
- package/dist/index-Ce2JgkH_.js.map +1 -0
- package/dist/index-D8ifudJH.js +2431 -0
- package/dist/index-D8ifudJH.js.map +1 -0
- package/dist/index-Dag88bW4.js +499 -0
- package/dist/index-Dag88bW4.js.map +1 -0
- package/dist/index-qhscKTDy.js +309 -0
- package/dist/index-qhscKTDy.js.map +1 -0
- package/dist/index-x4stH3jD.js +282 -0
- package/dist/index-x4stH3jD.js.map +1 -0
- package/dist/index.core-CYu3tydL.js +7252 -0
- package/dist/index.core-CYu3tydL.js.map +1 -0
- package/dist/index.core.d.ts +20 -0
- package/dist/index.d.ts +51 -0
- package/dist/overlay/CanvasOverlay.d.ts +102 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/plugins/3d/Area3DRenderer.d.ts +122 -0
- package/dist/plugins/3d/Axes3D.d.ts +104 -0
- package/dist/plugins/3d/Bubble3DRenderer.d.ts +198 -0
- package/dist/plugins/3d/Impulse3DRenderer.d.ts +130 -0
- package/dist/plugins/3d/Line3DRenderer.d.ts +118 -0
- package/dist/plugins/3d/PointCloud3DRenderer.d.ts +84 -0
- package/dist/plugins/3d/Raycaster3D.d.ts +137 -0
- package/dist/plugins/3d/Ribbon3DRenderer.d.ts +83 -0
- package/dist/plugins/3d/SurfaceBar3DRenderer.d.ts +92 -0
- package/dist/plugins/3d/SurfaceMesh3DRenderer.d.ts +130 -0
- package/dist/plugins/3d/Tooltip3D.d.ts +71 -0
- package/dist/plugins/3d/VectorField3DRenderer.d.ts +86 -0
- package/dist/plugins/3d/Voxel3DRenderer.d.ts +89 -0
- package/dist/plugins/3d/Waterfall3DRenderer.d.ts +94 -0
- package/dist/plugins/3d/camera/OrbitCamera.d.ts +99 -0
- package/dist/plugins/3d/camera/index.d.ts +1 -0
- package/dist/plugins/3d/colorThemes.d.ts +39 -0
- package/dist/plugins/3d/controls/OrbitController.d.ts +69 -0
- package/dist/plugins/3d/controls/index.d.ts +1 -0
- package/dist/plugins/3d/index.d.ts +50 -0
- package/dist/plugins/3d/math/Mat4.d.ts +33 -0
- package/dist/plugins/3d/math/Vec3.d.ts +37 -0
- package/dist/plugins/3d/math/index.d.ts +4 -0
- package/dist/plugins/3d/mesh/InstancedMesh.d.ts +42 -0
- package/dist/plugins/3d/mesh/geometry.d.ts +34 -0
- package/dist/plugins/3d/mesh/index.d.ts +2 -0
- package/dist/plugins/3d/series/Area3D.d.ts +17 -0
- package/dist/plugins/3d/series/Column3D.d.ts +20 -0
- package/dist/plugins/3d/series/Heatmap3D.d.ts +17 -0
- package/dist/plugins/3d/series/Impulse3D.d.ts +16 -0
- package/dist/plugins/3d/series/PointLine3D.d.ts +20 -0
- package/dist/plugins/3d/series/Ribbon3D.d.ts +17 -0
- package/dist/plugins/3d/series/Scatter3D.d.ts +21 -0
- package/dist/plugins/3d/series/SurfaceMesh3D.d.ts +35 -0
- package/dist/plugins/3d/series/Waterfall3D.d.ts +38 -0
- package/dist/plugins/3d/series/index.d.ts +13 -0
- package/dist/plugins/3d/series/types.d.ts +143 -0
- package/dist/plugins/3d/shader/index.d.ts +2 -0
- package/dist/plugins/3d/shader/programs.d.ts +24 -0
- package/dist/plugins/3d/shader/sources.d.ts +27 -0
- package/dist/plugins/3d/types.d.ts +71 -0
- package/dist/plugins/3d.d.ts +3 -0
- package/dist/plugins/3d.js +5498 -0
- package/dist/plugins/3d.js.map +1 -0
- package/dist/plugins/PluginContext.d.ts +53 -0
- package/dist/plugins/PluginManager.d.ts +129 -0
- package/dist/plugins/PluginRegistry.d.ts +38 -0
- package/dist/plugins/analysis/SeriesFit.d.ts +3 -0
- package/dist/plugins/analysis/contours.d.ts +20 -0
- package/dist/plugins/analysis/fft.d.ts +138 -0
- package/dist/plugins/analysis/filters.d.ts +76 -0
- package/dist/plugins/analysis/fitting.d.ts +24 -0
- package/dist/plugins/analysis/index.d.ts +29 -0
- package/dist/plugins/analysis/indicators.d.ts +148 -0
- package/dist/plugins/analysis/math.d.ts +32 -0
- package/dist/plugins/analysis/statistics.d.ts +78 -0
- package/dist/plugins/analysis/utils.d.ts +150 -0
- package/dist/plugins/analysis.d.ts +3 -0
- package/dist/plugins/analysis.js +1202 -0
- package/dist/plugins/analysis.js.map +1 -0
- package/dist/plugins/annotations/index.d.ts +16 -0
- package/dist/plugins/annotations.d.ts +3 -0
- package/dist/plugins/annotations.js +438 -0
- package/dist/plugins/annotations.js.map +1 -0
- package/dist/plugins/anomaly-detection/algorithms.d.ts +38 -0
- package/dist/plugins/anomaly-detection/index.d.ts +16 -0
- package/dist/plugins/anomaly-detection/types.d.ts +57 -0
- package/dist/plugins/broken-axis/BrokenAxisScale.d.ts +24 -0
- package/dist/plugins/broken-axis/exports.d.ts +6 -0
- package/dist/plugins/broken-axis/index.d.ts +6 -0
- package/dist/plugins/broken-axis/types.d.ts +50 -0
- package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +40 -0
- package/dist/plugins/builtins/crosshair/index.d.ts +1 -0
- package/dist/plugins/builtins/data-logger/DataLoggerPlugin.d.ts +11 -0
- package/dist/plugins/builtins/data-logger/index.d.ts +1 -0
- package/dist/plugins/builtins/direction-indicator/DirectionIndicatorPlugin.d.ts +17 -0
- package/dist/plugins/builtins/direction-indicator/index.d.ts +2 -0
- package/dist/plugins/builtins/grid-highlight/GridHighlightPlugin.d.ts +17 -0
- package/dist/plugins/builtins/grid-highlight/index.d.ts +1 -0
- package/dist/plugins/builtins/index.d.ts +25 -0
- package/dist/plugins/builtins/stats/StatsPlugin.d.ts +11 -0
- package/dist/plugins/builtins/stats/index.d.ts +1 -0
- package/dist/plugins/builtins/watermark/WatermarkPlugin.d.ts +15 -0
- package/dist/plugins/builtins/watermark/index.d.ts +1 -0
- package/dist/plugins/caching/exports.d.ts +6 -0
- package/dist/plugins/caching/index.d.ts +6 -0
- package/dist/plugins/caching/types.d.ts +120 -0
- package/dist/plugins/clipboard/index.d.ts +20 -0
- package/dist/plugins/clipboard.d.ts +3 -0
- package/dist/plugins/clipboard.js +270 -0
- package/dist/plugins/clipboard.js.map +1 -0
- package/dist/plugins/context-menu/index.d.ts +12 -0
- package/dist/plugins/context-menu/renderer.d.ts +43 -0
- package/dist/plugins/context-menu/types.d.ts +202 -0
- package/dist/plugins/context-menu.d.ts +3 -0
- package/dist/plugins/context-menu.js +621 -0
- package/dist/plugins/context-menu.js.map +1 -0
- package/dist/plugins/data-export/formatters.d.ts +34 -0
- package/dist/plugins/data-export/index.d.ts +15 -0
- package/dist/plugins/data-export/types.d.ts +166 -0
- package/dist/plugins/data-export.d.ts +3 -0
- package/dist/plugins/data-export.js +463 -0
- package/dist/plugins/data-export.js.map +1 -0
- package/dist/plugins/data-transform/index.d.ts +6 -0
- package/dist/plugins/data-transform/types.d.ts +34 -0
- package/dist/plugins/debug/index.d.ts +24 -0
- package/dist/plugins/debug.d.ts +3 -0
- package/dist/plugins/debug.js +330 -0
- package/dist/plugins/debug.js.map +1 -0
- package/dist/plugins/drag-edit/exports.d.ts +6 -0
- package/dist/plugins/drag-edit/index.d.ts +6 -0
- package/dist/plugins/drag-edit/types.d.ts +118 -0
- package/dist/plugins/forecasting/algorithms.d.ts +6 -0
- package/dist/plugins/forecasting/exports.d.ts +3 -0
- package/dist/plugins/forecasting/index.d.ts +11 -0
- package/dist/plugins/forecasting/types.d.ts +88 -0
- package/dist/plugins/gpu/index.d.ts +24 -0
- package/dist/plugins/gpu.d.ts +3 -0
- package/dist/plugins/gpu.js +2430 -0
- package/dist/plugins/gpu.js.map +1 -0
- package/dist/plugins/i18n/index.d.ts +22 -0
- package/dist/plugins/i18n.d.ts +3 -0
- package/dist/plugins/i18n.js +37 -0
- package/dist/plugins/i18n.js.map +1 -0
- package/dist/plugins/index.d.ts +110 -0
- package/dist/plugins/keyboard/index.d.ts +15 -0
- package/dist/plugins/keyboard.d.ts +3 -0
- package/dist/plugins/keyboard.js +8 -0
- package/dist/plugins/keyboard.js.map +1 -0
- package/dist/plugins/latex/exports.d.ts +6 -0
- package/dist/plugins/latex/index.d.ts +8 -0
- package/dist/plugins/latex/parser.d.ts +6 -0
- package/dist/plugins/latex/renderer.d.ts +6 -0
- package/dist/plugins/latex/symbols.d.ts +28 -0
- package/dist/plugins/latex/types.d.ts +88 -0
- package/dist/plugins/lazy-load/exports.d.ts +6 -0
- package/dist/plugins/lazy-load/index.d.ts +6 -0
- package/dist/plugins/lazy-load/types.d.ts +121 -0
- package/dist/plugins/loading/index.d.ts +15 -0
- package/dist/plugins/loading.d.ts +3 -0
- package/dist/plugins/loading.js +7 -0
- package/dist/plugins/loading.js.map +1 -0
- package/dist/plugins/ml-integration/exports.d.ts +11 -0
- package/dist/plugins/ml-integration/index.d.ts +6 -0
- package/dist/plugins/ml-integration/native-algorithms.d.ts +69 -0
- package/dist/plugins/ml-integration/types.d.ts +74 -0
- package/dist/plugins/offscreen/exports.d.ts +6 -0
- package/dist/plugins/offscreen/index.d.ts +6 -0
- package/dist/plugins/offscreen/pool.d.ts +32 -0
- package/dist/plugins/offscreen/types.d.ts +35 -0
- package/dist/plugins/pattern-recognition/index.d.ts +6 -0
- package/dist/plugins/pattern-recognition/patterns.d.ts +3 -0
- package/dist/plugins/pattern-recognition/types.d.ts +245 -0
- package/dist/plugins/radar/index.d.ts +6 -0
- package/dist/plugins/radar/types.d.ts +40 -0
- package/dist/plugins/regression/algorithms.d.ts +6 -0
- package/dist/plugins/regression/index.d.ts +6 -0
- package/dist/plugins/regression/types.d.ts +261 -0
- package/dist/plugins/roi/exports.d.ts +6 -0
- package/dist/plugins/roi/index.d.ts +49 -0
- package/dist/plugins/roi/types.d.ts +60 -0
- package/dist/plugins/snapshot/index.d.ts +11 -0
- package/dist/plugins/snapshot/types.d.ts +38 -0
- package/dist/plugins/streaming/index.d.ts +32 -0
- package/dist/plugins/streaming.d.ts +3 -0
- package/dist/plugins/streaming.js +13 -0
- package/dist/plugins/streaming.js.map +1 -0
- package/dist/plugins/sync/index.d.ts +22 -0
- package/dist/plugins/sync.d.ts +3 -0
- package/dist/plugins/sync.js +261 -0
- package/dist/plugins/sync.js.map +1 -0
- package/dist/plugins/theme-editor/index.d.ts +18 -0
- package/dist/plugins/theme-editor.d.ts +3 -0
- package/dist/plugins/theme-editor.js +7 -0
- package/dist/plugins/theme-editor.js.map +1 -0
- package/dist/plugins/tools/delta-tool/index.d.ts +159 -0
- package/dist/plugins/tools/index.d.ts +21 -0
- package/dist/plugins/tools/peak-tool/index.d.ts +159 -0
- package/dist/plugins/tools/tooltip/TooltipManager.d.ts +213 -0
- package/dist/plugins/tools/tooltip/TooltipPositioner.d.ts +83 -0
- package/dist/plugins/tools/tooltip/TooltipRenderer.d.ts +64 -0
- package/dist/plugins/tools/tooltip/index.d.ts +18 -0
- package/dist/plugins/tools/tooltip/templates/AnnotationTemplate.d.ts +18 -0
- package/dist/plugins/tools/tooltip/templates/CrosshairTemplate.d.ts +39 -0
- package/dist/plugins/tools/tooltip/templates/DefaultTemplate.d.ts +30 -0
- package/dist/plugins/tools/tooltip/templates/HeatmapTemplate.d.ts +34 -0
- package/dist/plugins/tools/tooltip/templates/MinimalTemplate.d.ts +26 -0
- package/dist/plugins/tools/tooltip/templates/RangeTemplate.d.ts +18 -0
- package/dist/plugins/tools/tooltip/templates/ScientificTemplate.d.ts +34 -0
- package/dist/plugins/tools/tooltip/templates/index.d.ts +27 -0
- package/dist/plugins/tools/tooltip/themes.d.ts +48 -0
- package/dist/plugins/tools/tooltip/types.d.ts +396 -0
- package/dist/plugins/tools.d.ts +3 -0
- package/dist/plugins/tools.js +9 -0
- package/dist/plugins/tools.js.map +1 -0
- package/dist/plugins/types.d.ts +451 -0
- package/dist/plugins/video-recorder/exports.d.ts +6 -0
- package/dist/plugins/video-recorder/index.d.ts +6 -0
- package/dist/plugins/video-recorder/types.d.ts +55 -0
- package/dist/plugins/virtualization/exports.d.ts +6 -0
- package/dist/plugins/virtualization/index.d.ts +6 -0
- package/dist/plugins/virtualization/types.d.ts +48 -0
- package/dist/react/SciPlot.d.ts +60 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/useSciPlot.d.ts +56 -0
- package/dist/renderer/BarRenderer.d.ts +14 -0
- package/dist/renderer/CandlestickRenderer.d.ts +12 -0
- package/dist/renderer/GaugeRenderer.d.ts +3 -0
- package/dist/renderer/HeatmapRenderer.d.ts +15 -0
- package/dist/renderer/NativeWebGLRenderer.d.ts +16 -0
- package/dist/renderer/PolarRenderer.d.ts +64 -0
- package/dist/renderer/RendererInterface.d.ts +70 -0
- package/dist/renderer/SankeyRenderer.d.ts +3 -0
- package/dist/renderer/WebGPURenderer.d.ts +16 -0
- package/dist/renderer/index.d.ts +13 -0
- package/dist/renderer/native/NativeWebGLRenderer.d.ts +31 -0
- package/dist/renderer/native/bufferStore.d.ts +11 -0
- package/dist/renderer/native/draw.d.ts +47 -0
- package/dist/renderer/native/programFactory.d.ts +3 -0
- package/dist/renderer/native/renderFrame.d.ts +3 -0
- package/dist/renderer/native/shaderSources.d.ts +6 -0
- package/dist/renderer/native/textureStore.d.ts +8 -0
- package/dist/renderer/native/types.d.ts +77 -0
- package/dist/renderer/native/utils.d.ts +31 -0
- package/dist/renderer/radar/RadarRenderer.d.ts +71 -0
- package/dist/renderer/radar/index.d.ts +10 -0
- package/dist/renderer/shaders.d.ts +77 -0
- package/dist/renderer/ternary/TernaryRenderer.d.ts +39 -0
- package/dist/renderer/ternary/index.d.ts +6 -0
- package/dist/renderer/ternary/types.d.ts +56 -0
- package/dist/scales/index.d.ts +54 -0
- package/dist/serialization/index.d.ts +153 -0
- package/dist/streaming/backpressure.d.ts +179 -0
- package/dist/streaming/index.d.ts +7 -0
- package/dist/streaming/mock.d.ts +12 -0
- package/dist/streaming/types.d.ts +57 -0
- package/dist/streaming/utils.d.ts +19 -0
- package/dist/streaming/websocket.d.ts +6 -0
- package/dist/testing/index.d.ts +225 -0
- package/dist/theme/colorSchemes.d.ts +56 -0
- package/dist/theme/index.d.ts +138 -0
- package/dist/types.d.ts +753 -0
- package/dist/utils-Dbro9-qM.js +254 -0
- package/dist/utils-Dbro9-qM.js.map +1 -0
- package/dist/velo-plot.d.ts +1 -0
- package/dist/velo-plot.full.d.ts +1 -0
- package/dist/velo-plot.full.js +5804 -0
- package/dist/velo-plot.full.js.map +1 -0
- package/dist/velo-plot.js +31 -0
- package/dist/velo-plot.js.map +1 -0
- package/dist/workers/downsample.d.ts +34 -0
- package/dist/workers/downsample.worker.d.ts +46 -0
- package/package.json +185 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginBrokenAxisConfig } from './types';
|
|
2
|
+
import { ChartPlugin } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare function PluginBrokenAxis(config?: PluginBrokenAxisConfig): ChartPlugin<PluginBrokenAxisConfig>;
|
|
5
|
+
export default PluginBrokenAxis;
|
|
6
|
+
export type { PluginBrokenAxisConfig, BrokenAxisAPI, AxisBreak, BrokenAxisOptions, } from './types';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for Broken Axis plugin
|
|
3
|
+
* @module plugins/broken-axis/types
|
|
4
|
+
*/
|
|
5
|
+
export type AxisBreakSymbol = "diagonal" | "zigzag" | "wave" | "simple";
|
|
6
|
+
export interface AxisBreak {
|
|
7
|
+
/** Start value of the break in data units */
|
|
8
|
+
start: number;
|
|
9
|
+
/** End value of the break in data units */
|
|
10
|
+
end: number;
|
|
11
|
+
/**
|
|
12
|
+
* Ratio of the plot area this break should take (0-1).
|
|
13
|
+
* Usually small (e.g., 0.02 for 2% of the axis length).
|
|
14
|
+
* Default is 0.02.
|
|
15
|
+
*/
|
|
16
|
+
visualRatio?: number;
|
|
17
|
+
/** Visual symbol to draw at the break */
|
|
18
|
+
symbol?: AxisBreakSymbol;
|
|
19
|
+
}
|
|
20
|
+
export interface BrokenAxisOptions {
|
|
21
|
+
/** Array of breaks defined for the axis */
|
|
22
|
+
breaks: AxisBreak[];
|
|
23
|
+
/** Default symbol for all breaks in this axis if not specified */
|
|
24
|
+
defaultSymbol?: AxisBreakSymbol;
|
|
25
|
+
/** Color of the break symbols (defaults to axis color) */
|
|
26
|
+
symbolColor?: string;
|
|
27
|
+
/** Size of the symbol in pixels (width/height depending on orientation) */
|
|
28
|
+
symbolSize?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface PluginBrokenAxisConfig {
|
|
31
|
+
/** Enable broken axes (default: true) */
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Mapping of axis ID to its broken axis configuration.
|
|
35
|
+
* Use 'default' for the main X axis.
|
|
36
|
+
*/
|
|
37
|
+
axes: Record<string, BrokenAxisOptions>;
|
|
38
|
+
}
|
|
39
|
+
export interface BrokenAxisAPI {
|
|
40
|
+
/** Add a break to an axis */
|
|
41
|
+
addBreak(axisId: string, axisBreak: AxisBreak): void;
|
|
42
|
+
/** Remove all breaks from an axis */
|
|
43
|
+
clearBreaks(axisId: string): void;
|
|
44
|
+
/** Enable/disable the plugin */
|
|
45
|
+
setEnabled(enabled: boolean): void;
|
|
46
|
+
/** Get current breaks for an axis */
|
|
47
|
+
getBreaks(axisId: string): AxisBreak[];
|
|
48
|
+
/** Update configuration */
|
|
49
|
+
updateConfig(config: Partial<PluginBrokenAxisConfig>): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CrosshairValueMode, CornerPosition } from '../../../core/layout';
|
|
2
|
+
|
|
3
|
+
export interface CrosshairPluginConfig {
|
|
4
|
+
/** Show vertical line (default: true) */
|
|
5
|
+
showVertical?: boolean;
|
|
6
|
+
/** Show horizontal line (default: true) */
|
|
7
|
+
showHorizontal?: boolean;
|
|
8
|
+
/** Line color (default: from theme) */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** Line style (default: 'dashed') */
|
|
11
|
+
lineStyle?: "solid" | "dashed" | "dotted";
|
|
12
|
+
/** Line width (default: 1) */
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use valueDisplayMode instead
|
|
16
|
+
* Show axis labels (will be converted to valueDisplayMode)
|
|
17
|
+
*/
|
|
18
|
+
showAxisLabels?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Display mode for X,Y coordinate values (default: 'disabled')
|
|
21
|
+
* - 'disabled': Never show coordinate values
|
|
22
|
+
* - 'corner': Show values in a fixed corner position
|
|
23
|
+
* - 'floating': Show values next to the cursor (axis labels)
|
|
24
|
+
*/
|
|
25
|
+
valueDisplayMode?: CrosshairValueMode;
|
|
26
|
+
/**
|
|
27
|
+
* Corner position when valueDisplayMode is 'corner' (default: 'top-left')
|
|
28
|
+
*/
|
|
29
|
+
cornerPosition?: CornerPosition;
|
|
30
|
+
/** Snap to nearest data point (default: false) */
|
|
31
|
+
snapToData?: boolean;
|
|
32
|
+
/** Value format options */
|
|
33
|
+
valueFormat?: {
|
|
34
|
+
/** X value precision (default: 4) */
|
|
35
|
+
xPrecision?: number;
|
|
36
|
+
/** Y value precision (default: 4) */
|
|
37
|
+
yPrecision?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export declare const CrosshairPlugin: import('../..').PluginFactory<CrosshairPluginConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CrosshairPlugin';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DataLoggerConfig {
|
|
2
|
+
/** Log data updates (default: true) */
|
|
3
|
+
logDataUpdates?: boolean;
|
|
4
|
+
/** Log view changes (default: true) */
|
|
5
|
+
logViewChanges?: boolean;
|
|
6
|
+
/** Log interactions (default: false) */
|
|
7
|
+
logInteractions?: boolean;
|
|
8
|
+
/** Maximum log entries to keep (default: 100) */
|
|
9
|
+
maxEntries?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const DataLoggerPlugin: import('../..').PluginFactory<DataLoggerConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataLoggerPlugin';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DirectionIndicatorConfig {
|
|
2
|
+
/** Series ID to track (if not specified, tracks the first series) */
|
|
3
|
+
seriesId?: string;
|
|
4
|
+
/** Number of recent points to analyze for direction (default: 20) */
|
|
5
|
+
sampleSize?: number;
|
|
6
|
+
/** Arrow color (default: from theme) */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Arrow size in pixels (default: 40) */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** Minimum velocity to show arrow (default: 0.01) */
|
|
11
|
+
minVelocity?: number;
|
|
12
|
+
/** Number of points for smoothing the position/angle (default: 20) */
|
|
13
|
+
historySize?: number;
|
|
14
|
+
/** Hide arrow if no new points are received for this duration in ms (default: undefined/disabled) */
|
|
15
|
+
idleTimeout?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const DirectionIndicatorPlugin: import('../..').PluginFactory<DirectionIndicatorConfig>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface GridHighlightConfig {
|
|
2
|
+
/** Highlight intervals on X axis */
|
|
3
|
+
xIntervals?: Array<{
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
color: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Highlight intervals on Y axis */
|
|
9
|
+
yIntervals?: Array<{
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
color: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Opacity for highlight regions (default: 0.1) */
|
|
15
|
+
opacity?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const GridHighlightPlugin: import('../..').PluginFactory<GridHighlightConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GridHighlightPlugin';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sci Plot - Built-in Plugins
|
|
3
|
+
*
|
|
4
|
+
* Collection of official plugins that demonstrate the plugin system
|
|
5
|
+
* capabilities and provide common functionality.
|
|
6
|
+
*
|
|
7
|
+
* @module plugins/builtins
|
|
8
|
+
*/
|
|
9
|
+
export * from './crosshair';
|
|
10
|
+
export * from './stats';
|
|
11
|
+
export * from './watermark';
|
|
12
|
+
export * from './grid-highlight';
|
|
13
|
+
export * from './data-logger';
|
|
14
|
+
export * from './direction-indicator';
|
|
15
|
+
/**
|
|
16
|
+
* Plugin collection for easy registration
|
|
17
|
+
*/
|
|
18
|
+
export declare const BuiltinPlugins: {
|
|
19
|
+
Crosshair: import('..').PluginFactory<import('./crosshair').CrosshairPluginConfig>;
|
|
20
|
+
Statistics: import('..').PluginFactory<import('./stats').StatsPluginConfig>;
|
|
21
|
+
Watermark: import('..').PluginFactory<import('./watermark').WatermarkPluginConfig>;
|
|
22
|
+
GridHighlight: import('..').PluginFactory<import('./grid-highlight').GridHighlightConfig>;
|
|
23
|
+
DataLogger: import('..').PluginFactory<import('./data-logger').DataLoggerConfig>;
|
|
24
|
+
DirectionIndicator: import('..').PluginFactory<import('./direction-indicator').DirectionIndicatorConfig>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface StatsPluginConfig {
|
|
2
|
+
/** Position of the stats overlay */
|
|
3
|
+
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
4
|
+
/** Which stats to show */
|
|
5
|
+
show?: Array<"count" | "mean" | "min" | "max" | "std" | "range">;
|
|
6
|
+
/** Series ID to compute stats for (default: all) */
|
|
7
|
+
seriesId?: string;
|
|
8
|
+
/** Update on every data change (default: true) */
|
|
9
|
+
autoUpdate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const StatsPlugin: import('../..').PluginFactory<StatsPluginConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StatsPlugin';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface WatermarkPluginConfig {
|
|
2
|
+
/** Watermark text */
|
|
3
|
+
text: string;
|
|
4
|
+
/** Font size (default: 48) */
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
/** Font family (default: system-ui) */
|
|
7
|
+
fontFamily?: string;
|
|
8
|
+
/** Text color with opacity (default: rgba(128,128,128,0.15)) */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** Position (default: center) */
|
|
11
|
+
position?: "center" | "bottom-right" | "bottom-left";
|
|
12
|
+
/** Rotation in degrees (default: -30 for center, 0 for corners) */
|
|
13
|
+
rotation?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const WatermarkPlugin: import('../..').PluginFactory<WatermarkPluginConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WatermarkPlugin';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginCachingConfig } from './types';
|
|
2
|
+
import { ChartPlugin } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare function PluginCaching(userConfig?: Partial<PluginCachingConfig>): ChartPlugin<PluginCachingConfig>;
|
|
5
|
+
export default PluginCaching;
|
|
6
|
+
export type { PluginCachingConfig, CachingAPI, CacheEntry, CacheStats, CacheStrategy, CacheInvalidationEvent, } from './types';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for caching plugin
|
|
3
|
+
* @module plugins/caching/types
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Cache entry with metadata
|
|
7
|
+
*/
|
|
8
|
+
export interface CacheEntry<T = any> {
|
|
9
|
+
/** Cached value */
|
|
10
|
+
value: T;
|
|
11
|
+
/** Timestamp when cached */
|
|
12
|
+
timestamp: number;
|
|
13
|
+
/** Last access timestamp */
|
|
14
|
+
lastAccess: number;
|
|
15
|
+
/** Access count */
|
|
16
|
+
hits: number;
|
|
17
|
+
/** Approximate size in bytes */
|
|
18
|
+
size: number;
|
|
19
|
+
/** Optional TTL (time to live) in ms */
|
|
20
|
+
ttl?: number;
|
|
21
|
+
/** Optional tags for bulk invalidation */
|
|
22
|
+
tags?: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Cache statistics
|
|
26
|
+
*/
|
|
27
|
+
export interface CacheStats {
|
|
28
|
+
/** Total cache hits */
|
|
29
|
+
hits: number;
|
|
30
|
+
/** Total cache misses */
|
|
31
|
+
misses: number;
|
|
32
|
+
/** Hit ratio (0-1) */
|
|
33
|
+
hitRatio: number;
|
|
34
|
+
/** Current cache size in bytes */
|
|
35
|
+
currentSize: number;
|
|
36
|
+
/** Maximum cache size in bytes */
|
|
37
|
+
maxSize: number;
|
|
38
|
+
/** Number of entries */
|
|
39
|
+
entryCount: number;
|
|
40
|
+
/** Number of evictions */
|
|
41
|
+
evictions: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Cache strategy
|
|
45
|
+
*/
|
|
46
|
+
export type CacheStrategy = 'lru' | 'lfu' | 'fifo';
|
|
47
|
+
/**
|
|
48
|
+
* Cache invalidation event
|
|
49
|
+
*/
|
|
50
|
+
export interface CacheInvalidationEvent {
|
|
51
|
+
/** Keys invalidated */
|
|
52
|
+
keys: string[];
|
|
53
|
+
/** Reason for invalidation */
|
|
54
|
+
reason: 'manual' | 'ttl' | 'size' | 'tag';
|
|
55
|
+
/** Timestamp */
|
|
56
|
+
timestamp: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Plugin configuration
|
|
60
|
+
*/
|
|
61
|
+
export interface PluginCachingConfig {
|
|
62
|
+
/** Enable caching (default: true) */
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
/** Maximum cache size in bytes (default: 50MB) */
|
|
65
|
+
maxSize?: number;
|
|
66
|
+
/** Cache strategy (default: 'lru') */
|
|
67
|
+
strategy?: CacheStrategy;
|
|
68
|
+
/** Default TTL in milliseconds (default: undefined = no expiration) */
|
|
69
|
+
defaultTTL?: number;
|
|
70
|
+
/** Enable automatic invalidation on data changes (default: true) */
|
|
71
|
+
autoInvalidate?: boolean;
|
|
72
|
+
/** Cache specific data types */
|
|
73
|
+
cacheTypes?: {
|
|
74
|
+
/** Cache transformed data (default: true) */
|
|
75
|
+
transforms?: boolean;
|
|
76
|
+
/** Cache analysis results (default: true) */
|
|
77
|
+
analysis?: boolean;
|
|
78
|
+
/** Cache rendered frames (default: false) */
|
|
79
|
+
frames?: boolean;
|
|
80
|
+
/** Cache computed bounds (default: true) */
|
|
81
|
+
bounds?: boolean;
|
|
82
|
+
};
|
|
83
|
+
/** Callback when cache is invalidated */
|
|
84
|
+
onInvalidate?: (event: CacheInvalidationEvent) => void;
|
|
85
|
+
/** Enable debug logging (default: false) */
|
|
86
|
+
debug?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Plugin API
|
|
90
|
+
*/
|
|
91
|
+
export interface CachingAPI {
|
|
92
|
+
/** Get value from cache */
|
|
93
|
+
get<T>(key: string): T | undefined;
|
|
94
|
+
/** Set value in cache */
|
|
95
|
+
set<T>(key: string, value: T, options?: {
|
|
96
|
+
ttl?: number;
|
|
97
|
+
tags?: string[];
|
|
98
|
+
size?: number;
|
|
99
|
+
}): void;
|
|
100
|
+
/** Check if key exists */
|
|
101
|
+
has(key: string): boolean;
|
|
102
|
+
/** Delete specific key */
|
|
103
|
+
delete(key: string): boolean;
|
|
104
|
+
/** Clear all cache */
|
|
105
|
+
clear(): void;
|
|
106
|
+
/** Invalidate by tags */
|
|
107
|
+
invalidateByTags(tags: string[]): number;
|
|
108
|
+
/** Get cache statistics */
|
|
109
|
+
getStats(): CacheStats;
|
|
110
|
+
/** Reset statistics */
|
|
111
|
+
resetStats(): void;
|
|
112
|
+
/** Get all keys */
|
|
113
|
+
keys(): string[];
|
|
114
|
+
/** Get cache size */
|
|
115
|
+
size(): number;
|
|
116
|
+
/** Prune expired entries */
|
|
117
|
+
prune(): number;
|
|
118
|
+
/** Update configuration */
|
|
119
|
+
updateConfig(config: Partial<PluginCachingConfig>): void;
|
|
120
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChartPlugin } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* SciPlot Engine - Clipboard Plugin
|
|
4
|
+
*
|
|
5
|
+
* Provides clipboard integration for copying chart data and images.
|
|
6
|
+
*
|
|
7
|
+
* @module plugins/clipboard
|
|
8
|
+
*/
|
|
9
|
+
export * from '../../core/clipboard';
|
|
10
|
+
export interface PluginClipboardConfig {
|
|
11
|
+
/** Default format for copied data: 'csv' | 'json' | 'image' */
|
|
12
|
+
defaultFormat?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* SciPlot Clipboard Plugin
|
|
16
|
+
*
|
|
17
|
+
* Adds support for copying data and screenshots to the clipboard.
|
|
18
|
+
*/
|
|
19
|
+
export declare function PluginClipboard(_config?: PluginClipboardConfig): ChartPlugin<PluginClipboardConfig>;
|
|
20
|
+
export default PluginClipboard;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var x = (o, t, e) => t in o ? b(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var h = (o, t, e) => x(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const g = {
|
|
5
|
+
tsv: { separator: " ", quote: !1, extension: "tsv" },
|
|
6
|
+
csv: { separator: ",", quote: !0, extension: "csv" },
|
|
7
|
+
json: { separator: "", quote: !1, extension: "json" },
|
|
8
|
+
markdown: { separator: " | ", quote: !1, extension: "md" }
|
|
9
|
+
};
|
|
10
|
+
class N {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
h(this, "defaultOptions", {
|
|
13
|
+
format: "tsv",
|
|
14
|
+
includeHeaders: !0,
|
|
15
|
+
precision: 6,
|
|
16
|
+
scientific: !0,
|
|
17
|
+
scientificThreshold: 1e6,
|
|
18
|
+
lineSeparator: `
|
|
19
|
+
`,
|
|
20
|
+
includeSeriesName: !1
|
|
21
|
+
});
|
|
22
|
+
t && (this.defaultOptions = { ...this.defaultOptions, ...t });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Copy data points to clipboard
|
|
26
|
+
*/
|
|
27
|
+
async copyPoints(t, e) {
|
|
28
|
+
const i = { ...this.defaultOptions, ...e };
|
|
29
|
+
if (!t || t.length === 0)
|
|
30
|
+
return {
|
|
31
|
+
success: !1,
|
|
32
|
+
pointCount: 0,
|
|
33
|
+
seriesCount: 0,
|
|
34
|
+
error: "No data points to copy"
|
|
35
|
+
};
|
|
36
|
+
try {
|
|
37
|
+
const r = this.formatPoints(t, i);
|
|
38
|
+
await this.writeToClipboard(r);
|
|
39
|
+
const s = new Set(t.map((a) => a.seriesId).filter(Boolean));
|
|
40
|
+
return {
|
|
41
|
+
success: !0,
|
|
42
|
+
pointCount: t.length,
|
|
43
|
+
seriesCount: s.size || 1,
|
|
44
|
+
text: r
|
|
45
|
+
};
|
|
46
|
+
} catch (r) {
|
|
47
|
+
return {
|
|
48
|
+
success: !1,
|
|
49
|
+
pointCount: 0,
|
|
50
|
+
seriesCount: 0,
|
|
51
|
+
error: r instanceof Error ? r.message : "Failed to copy to clipboard"
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Copy series data to clipboard
|
|
57
|
+
*/
|
|
58
|
+
async copySeries(t, e) {
|
|
59
|
+
const i = [];
|
|
60
|
+
for (const s of t)
|
|
61
|
+
for (let a = 0; a < s.x.length; a++)
|
|
62
|
+
i.push({
|
|
63
|
+
x: s.x[a],
|
|
64
|
+
y: s.y[a],
|
|
65
|
+
seriesId: s.id,
|
|
66
|
+
seriesName: s.name || s.id,
|
|
67
|
+
index: a
|
|
68
|
+
});
|
|
69
|
+
const r = { ...e };
|
|
70
|
+
return t.length > 1 && r.includeSeriesName === void 0 && (r.includeSeriesName = !0), this.copyPoints(i, r);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Format data points to string
|
|
74
|
+
*/
|
|
75
|
+
formatPoints(t, e) {
|
|
76
|
+
const i = e.format || "tsv";
|
|
77
|
+
return i === "json" ? this.formatAsJson(t, e) : i === "markdown" ? this.formatAsMarkdown(t, e) : this.formatAsDelimited(t, e);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Format as delimited text (TSV/CSV)
|
|
81
|
+
*/
|
|
82
|
+
formatAsDelimited(t, e) {
|
|
83
|
+
var d, u, c;
|
|
84
|
+
const i = e.format || "tsv", r = g[i], s = e.separator || r.separator, a = e.lineSeparator || `
|
|
85
|
+
`, l = [];
|
|
86
|
+
if (e.includeHeaders) {
|
|
87
|
+
const n = [];
|
|
88
|
+
e.includeSeriesName && n.push(((d = e.headers) == null ? void 0 : d.series) || "Series"), n.push(((u = e.headers) == null ? void 0 : u.x) || "X"), n.push(((c = e.headers) == null ? void 0 : c.y) || "Y"), l.push(n.join(s));
|
|
89
|
+
}
|
|
90
|
+
for (const n of t) {
|
|
91
|
+
const f = [];
|
|
92
|
+
if (e.includeSeriesName) {
|
|
93
|
+
const m = n.seriesName || n.seriesId || "";
|
|
94
|
+
f.push(r.quote ? `"${m}"` : m);
|
|
95
|
+
}
|
|
96
|
+
f.push(this.formatNumber(n.x, e)), f.push(this.formatNumber(n.y, e)), l.push(f.join(s));
|
|
97
|
+
}
|
|
98
|
+
return l.join(a);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Format as JSON
|
|
102
|
+
*/
|
|
103
|
+
formatAsJson(t, e) {
|
|
104
|
+
const i = t.map((r) => {
|
|
105
|
+
const s = {
|
|
106
|
+
x: this.roundNumber(r.x, e.precision || 6),
|
|
107
|
+
y: this.roundNumber(r.y, e.precision || 6)
|
|
108
|
+
};
|
|
109
|
+
return e.includeSeriesName && r.seriesId && (s.series = r.seriesName || r.seriesId), s;
|
|
110
|
+
});
|
|
111
|
+
return JSON.stringify(i, null, 2);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Format as Markdown table
|
|
115
|
+
*/
|
|
116
|
+
formatAsMarkdown(t, e) {
|
|
117
|
+
var l, d, u;
|
|
118
|
+
const i = [], r = " | ", s = [];
|
|
119
|
+
e.includeSeriesName && s.push(((l = e.headers) == null ? void 0 : l.series) || "Series"), s.push(((d = e.headers) == null ? void 0 : d.x) || "X"), s.push(((u = e.headers) == null ? void 0 : u.y) || "Y"), i.push("| " + s.join(r) + " |");
|
|
120
|
+
const a = s.map(() => "---");
|
|
121
|
+
i.push("| " + a.join(r) + " |");
|
|
122
|
+
for (const c of t) {
|
|
123
|
+
const n = [];
|
|
124
|
+
e.includeSeriesName && n.push(c.seriesName || c.seriesId || ""), n.push(this.formatNumber(c.x, e)), n.push(this.formatNumber(c.y, e)), i.push("| " + n.join(r) + " |");
|
|
125
|
+
}
|
|
126
|
+
return i.join(`
|
|
127
|
+
`);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Format a number for output
|
|
131
|
+
*/
|
|
132
|
+
formatNumber(t, e) {
|
|
133
|
+
const i = e.precision ?? 6, r = e.scientificThreshold ?? 1e6;
|
|
134
|
+
return isFinite(t) ? e.scientific && (Math.abs(t) >= r || Math.abs(t) < 1e-4 && t !== 0) ? t.toExponential(i) : this.roundNumber(t, i).toString() : t.toString();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Round a number to specified precision
|
|
138
|
+
*/
|
|
139
|
+
roundNumber(t, e) {
|
|
140
|
+
const i = Math.pow(10, e);
|
|
141
|
+
return Math.round(t * i) / i;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Write text to system clipboard
|
|
145
|
+
*/
|
|
146
|
+
async writeToClipboard(t) {
|
|
147
|
+
navigator.clipboard && navigator.clipboard.writeText ? await navigator.clipboard.writeText(t) : this.fallbackCopyToClipboard(t);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Fallback clipboard copy using hidden textarea
|
|
151
|
+
*/
|
|
152
|
+
fallbackCopyToClipboard(t) {
|
|
153
|
+
const e = document.createElement("textarea");
|
|
154
|
+
e.value = t, e.style.position = "fixed", e.style.left = "-9999px", e.style.top = "-9999px", document.body.appendChild(e), e.focus(), e.select();
|
|
155
|
+
try {
|
|
156
|
+
document.execCommand("copy");
|
|
157
|
+
} finally {
|
|
158
|
+
document.body.removeChild(e);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Read from clipboard (for paste functionality)
|
|
163
|
+
*/
|
|
164
|
+
async readFromClipboard() {
|
|
165
|
+
if (navigator.clipboard && navigator.clipboard.readText)
|
|
166
|
+
try {
|
|
167
|
+
return await navigator.clipboard.readText();
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Parse clipboard text to data points
|
|
175
|
+
*/
|
|
176
|
+
parseClipboardData(t, e) {
|
|
177
|
+
const i = [], r = e || this.detectFormat(t);
|
|
178
|
+
if (r === "json")
|
|
179
|
+
return this.parseJson(t);
|
|
180
|
+
const s = t.trim().split(/\r?\n/), a = r === "csv" ? "," : r === "tsv" ? " " : ",", d = s.length > 0 && /^[a-zA-Z]/.test(s[0].trim()) ? 1 : 0;
|
|
181
|
+
for (let u = d; u < s.length; u++) {
|
|
182
|
+
const c = s[u].split(a).map((n) => n.trim().replace(/^"|"$/g, ""));
|
|
183
|
+
if (c.length >= 2) {
|
|
184
|
+
const n = parseFloat(c[0]), f = parseFloat(c[1]);
|
|
185
|
+
!isNaN(n) && !isNaN(f) && i.push({ x: n, y: f, index: u - d });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return i;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Detect format from text content
|
|
192
|
+
*/
|
|
193
|
+
detectFormat(t) {
|
|
194
|
+
const e = t.trim();
|
|
195
|
+
return e.startsWith("[") || e.startsWith("{") ? "json" : e.includes(" ") ? "tsv" : e.includes(" | ") ? "markdown" : "csv";
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Parse JSON data
|
|
199
|
+
*/
|
|
200
|
+
parseJson(t) {
|
|
201
|
+
try {
|
|
202
|
+
const e = JSON.parse(t), i = [], r = Array.isArray(e) ? e : [e];
|
|
203
|
+
for (let s = 0; s < r.length; s++) {
|
|
204
|
+
const a = r[s];
|
|
205
|
+
typeof a.x == "number" && typeof a.y == "number" && i.push({
|
|
206
|
+
x: a.x,
|
|
207
|
+
y: a.y,
|
|
208
|
+
seriesId: a.series || a.seriesId,
|
|
209
|
+
seriesName: a.seriesName || a.series,
|
|
210
|
+
index: s
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return i;
|
|
214
|
+
} catch {
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Set default options
|
|
220
|
+
*/
|
|
221
|
+
setDefaults(t) {
|
|
222
|
+
this.defaultOptions = { ...this.defaultOptions, ...t };
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Get current default options
|
|
226
|
+
*/
|
|
227
|
+
getDefaults() {
|
|
228
|
+
return { ...this.defaultOptions };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
let p = null;
|
|
232
|
+
function y() {
|
|
233
|
+
return p || (p = new N()), p;
|
|
234
|
+
}
|
|
235
|
+
async function w(o, t) {
|
|
236
|
+
return y().copyPoints(o, t);
|
|
237
|
+
}
|
|
238
|
+
function v(o, t) {
|
|
239
|
+
const e = y();
|
|
240
|
+
return e.formatPoints(o, { ...e.getDefaults(), ...t });
|
|
241
|
+
}
|
|
242
|
+
const C = {
|
|
243
|
+
name: "velo-plot-clipboard",
|
|
244
|
+
version: "1.0.0",
|
|
245
|
+
description: "Clipboard integration for velo-plot",
|
|
246
|
+
provides: ["interaction"],
|
|
247
|
+
tags: ["clipboard", "copy", "paste", "export"]
|
|
248
|
+
};
|
|
249
|
+
function j(o = {}) {
|
|
250
|
+
return {
|
|
251
|
+
manifest: C,
|
|
252
|
+
onInit(t) {
|
|
253
|
+
},
|
|
254
|
+
onDestroy(t) {
|
|
255
|
+
},
|
|
256
|
+
api: {
|
|
257
|
+
copyCurrentView() {
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export {
|
|
263
|
+
N as ClipboardManager,
|
|
264
|
+
j as PluginClipboard,
|
|
265
|
+
w as copyToClipboard,
|
|
266
|
+
j as default,
|
|
267
|
+
v as formatData,
|
|
268
|
+
y as getClipboardManager
|
|
269
|
+
};
|
|
270
|
+
//# sourceMappingURL=clipboard.js.map
|