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.
Files changed (370) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/dist/EventEmitter-DAbs2K1C.js +60 -0
  4. package/dist/EventEmitter-DAbs2K1C.js.map +1 -0
  5. package/dist/core/Chart.d.ts +15 -0
  6. package/dist/core/ChartControls.d.ts +41 -0
  7. package/dist/core/ChartInitQueue.d.ts +50 -0
  8. package/dist/core/ChartLegend.d.ts +74 -0
  9. package/dist/core/ChartStatistics.d.ts +18 -0
  10. package/dist/core/EventEmitter.d.ts +30 -0
  11. package/dist/core/InteractionManager.d.ts +96 -0
  12. package/dist/core/OverlayRenderer.d.ts +89 -0
  13. package/dist/core/Series.d.ts +4 -0
  14. package/dist/core/animation/AnimationEngine.d.ts +156 -0
  15. package/dist/core/animation/index.d.ts +6 -0
  16. package/dist/core/annotations/AnnotationManager.d.ts +61 -0
  17. package/dist/core/annotations/index.d.ts +5 -0
  18. package/dist/core/annotations/types.d.ts +159 -0
  19. package/dist/core/chart/ChartAnimatedNavigation.d.ts +53 -0
  20. package/dist/core/chart/ChartAxisManager.d.ts +61 -0
  21. package/dist/core/chart/ChartCore.d.ts +336 -0
  22. package/dist/core/chart/ChartExporter.d.ts +18 -0
  23. package/dist/core/chart/ChartNavigation.d.ts +33 -0
  24. package/dist/core/chart/ChartPluginBridge.d.ts +34 -0
  25. package/dist/core/chart/ChartRenderLoop.d.ts +100 -0
  26. package/dist/core/chart/ChartRenderer.d.ts +52 -0
  27. package/dist/core/chart/ChartScaling.d.ts +31 -0
  28. package/dist/core/chart/ChartSeries.d.ts +4 -0
  29. package/dist/core/chart/ChartSetup.d.ts +67 -0
  30. package/dist/core/chart/ChartStateManager.d.ts +54 -0
  31. package/dist/core/chart/ChartUI.d.ts +40 -0
  32. package/dist/core/chart/exporter/SVGExporter.d.ts +6 -0
  33. package/dist/core/chart/exporter/index.d.ts +5 -0
  34. package/dist/core/chart/index.d.ts +14 -0
  35. package/dist/core/chart/series/SeriesActions.d.ts +7 -0
  36. package/dist/core/chart/series/SeriesBuffer.d.ts +4 -0
  37. package/dist/core/chart/series/index.d.ts +6 -0
  38. package/dist/core/chart/series/types.d.ts +22 -0
  39. package/dist/core/chart/types.d.ts +188 -0
  40. package/dist/core/clipboard/index.d.ts +137 -0
  41. package/dist/core/debug/index.d.ts +143 -0
  42. package/dist/core/index.d.ts +17 -0
  43. package/dist/core/keybindings/index.d.ts +157 -0
  44. package/dist/core/layout/index.d.ts +12 -0
  45. package/dist/core/layout/types.d.ts +165 -0
  46. package/dist/core/loading/index.d.ts +104 -0
  47. package/dist/core/locale/index.d.ts +91 -0
  48. package/dist/core/responsive/ResponsiveManager.d.ts +133 -0
  49. package/dist/core/responsive/index.d.ts +4 -0
  50. package/dist/core/selection/SelectionManager.d.ts +165 -0
  51. package/dist/core/selection/index.d.ts +4 -0
  52. package/dist/core/series/Series.d.ts +73 -0
  53. package/dist/core/series/SeriesBounds.d.ts +3 -0
  54. package/dist/core/series/SeriesDataUtils.d.ts +7 -0
  55. package/dist/core/series/index.d.ts +6 -0
  56. package/dist/core/sync/index.d.ts +147 -0
  57. package/dist/core/theme-editor/index.d.ts +122 -0
  58. package/dist/examples/PluginDemonstration.d.ts +20 -0
  59. package/dist/examples.d.ts +25 -0
  60. package/dist/gpu/adapter/gpuRenderer.d.ts +135 -0
  61. package/dist/gpu/adapter/index.d.ts +7 -0
  62. package/dist/gpu/adapter/seriesAdapter.d.ts +88 -0
  63. package/dist/gpu/backends/webgl/WebGLBackend.d.ts +42 -0
  64. package/dist/gpu/backends/webgl/index.d.ts +5 -0
  65. package/dist/gpu/backends/webgl/programFactory.d.ts +30 -0
  66. package/dist/gpu/backends/webgl/shaders.d.ts +14 -0
  67. package/dist/gpu/backends/webgpu/MassiveDataRenderer.d.ts +111 -0
  68. package/dist/gpu/backends/webgpu/WebGPUBackend.d.ts +58 -0
  69. package/dist/gpu/backends/webgpu/pipelines/bandPipeline.d.ts +24 -0
  70. package/dist/gpu/backends/webgpu/pipelines/heatmapPipeline.d.ts +28 -0
  71. package/dist/gpu/backends/webgpu/pipelines/index.d.ts +10 -0
  72. package/dist/gpu/backends/webgpu/pipelines/instancedLinePipeline.d.ts +23 -0
  73. package/dist/gpu/backends/webgpu/pipelines/instancedPointPipeline.d.ts +25 -0
  74. package/dist/gpu/backends/webgpu/pipelines/linePipeline.d.ts +23 -0
  75. package/dist/gpu/backends/webgpu/pipelines/pointPipeline.d.ts +28 -0
  76. package/dist/gpu/backends/webgpu/pipelines/trianglePipeline.d.ts +5 -0
  77. package/dist/gpu/backends/webgpu/pipelines/triangleShader.d.ts +1 -0
  78. package/dist/gpu/backends/webgpu/shaders/heatmap.wgsl.d.ts +8 -0
  79. package/dist/gpu/backends/webgpu/shaders/index.d.ts +8 -0
  80. package/dist/gpu/backends/webgpu/shaders/instanced.wgsl.d.ts +16 -0
  81. package/dist/gpu/backends/webgpu/shaders/line.wgsl.d.ts +8 -0
  82. package/dist/gpu/backends/webgpu/shaders/point.wgsl.d.ts +9 -0
  83. package/dist/gpu/benchmark/benchmark.d.ts +74 -0
  84. package/dist/gpu/benchmark/index.d.ts +5 -0
  85. package/dist/gpu/compute/gpuCompute.d.ts +72 -0
  86. package/dist/gpu/compute/index.d.ts +6 -0
  87. package/dist/gpu/compute/shaders.d.ts +9 -0
  88. package/dist/gpu/drawList.d.ts +77 -0
  89. package/dist/gpu/examples/gallery.d.ts +20 -0
  90. package/dist/gpu/examples/index.d.ts +3 -0
  91. package/dist/gpu/examples/webgpu-line-demo.d.ts +8 -0
  92. package/dist/gpu/examples/webgpu-triangle.d.ts +1 -0
  93. package/dist/gpu/frame.d.ts +25 -0
  94. package/dist/gpu/index.d.ts +24 -0
  95. package/dist/gpu/resources/bufferStore.d.ts +40 -0
  96. package/dist/gpu/resources/index.d.ts +9 -0
  97. package/dist/gpu/resources/pipelineCache.d.ts +33 -0
  98. package/dist/gpu/resources/textureStore.d.ts +41 -0
  99. package/dist/gpu/types.d.ts +47 -0
  100. package/dist/index-BMiZoKmm.js +536 -0
  101. package/dist/index-BMiZoKmm.js.map +1 -0
  102. package/dist/index-Ce2JgkH_.js +282 -0
  103. package/dist/index-Ce2JgkH_.js.map +1 -0
  104. package/dist/index-D8ifudJH.js +2431 -0
  105. package/dist/index-D8ifudJH.js.map +1 -0
  106. package/dist/index-Dag88bW4.js +499 -0
  107. package/dist/index-Dag88bW4.js.map +1 -0
  108. package/dist/index-qhscKTDy.js +309 -0
  109. package/dist/index-qhscKTDy.js.map +1 -0
  110. package/dist/index-x4stH3jD.js +282 -0
  111. package/dist/index-x4stH3jD.js.map +1 -0
  112. package/dist/index.core-CYu3tydL.js +7252 -0
  113. package/dist/index.core-CYu3tydL.js.map +1 -0
  114. package/dist/index.core.d.ts +20 -0
  115. package/dist/index.d.ts +51 -0
  116. package/dist/overlay/CanvasOverlay.d.ts +102 -0
  117. package/dist/overlay/index.d.ts +4 -0
  118. package/dist/plugins/3d/Area3DRenderer.d.ts +122 -0
  119. package/dist/plugins/3d/Axes3D.d.ts +104 -0
  120. package/dist/plugins/3d/Bubble3DRenderer.d.ts +198 -0
  121. package/dist/plugins/3d/Impulse3DRenderer.d.ts +130 -0
  122. package/dist/plugins/3d/Line3DRenderer.d.ts +118 -0
  123. package/dist/plugins/3d/PointCloud3DRenderer.d.ts +84 -0
  124. package/dist/plugins/3d/Raycaster3D.d.ts +137 -0
  125. package/dist/plugins/3d/Ribbon3DRenderer.d.ts +83 -0
  126. package/dist/plugins/3d/SurfaceBar3DRenderer.d.ts +92 -0
  127. package/dist/plugins/3d/SurfaceMesh3DRenderer.d.ts +130 -0
  128. package/dist/plugins/3d/Tooltip3D.d.ts +71 -0
  129. package/dist/plugins/3d/VectorField3DRenderer.d.ts +86 -0
  130. package/dist/plugins/3d/Voxel3DRenderer.d.ts +89 -0
  131. package/dist/plugins/3d/Waterfall3DRenderer.d.ts +94 -0
  132. package/dist/plugins/3d/camera/OrbitCamera.d.ts +99 -0
  133. package/dist/plugins/3d/camera/index.d.ts +1 -0
  134. package/dist/plugins/3d/colorThemes.d.ts +39 -0
  135. package/dist/plugins/3d/controls/OrbitController.d.ts +69 -0
  136. package/dist/plugins/3d/controls/index.d.ts +1 -0
  137. package/dist/plugins/3d/index.d.ts +50 -0
  138. package/dist/plugins/3d/math/Mat4.d.ts +33 -0
  139. package/dist/plugins/3d/math/Vec3.d.ts +37 -0
  140. package/dist/plugins/3d/math/index.d.ts +4 -0
  141. package/dist/plugins/3d/mesh/InstancedMesh.d.ts +42 -0
  142. package/dist/plugins/3d/mesh/geometry.d.ts +34 -0
  143. package/dist/plugins/3d/mesh/index.d.ts +2 -0
  144. package/dist/plugins/3d/series/Area3D.d.ts +17 -0
  145. package/dist/plugins/3d/series/Column3D.d.ts +20 -0
  146. package/dist/plugins/3d/series/Heatmap3D.d.ts +17 -0
  147. package/dist/plugins/3d/series/Impulse3D.d.ts +16 -0
  148. package/dist/plugins/3d/series/PointLine3D.d.ts +20 -0
  149. package/dist/plugins/3d/series/Ribbon3D.d.ts +17 -0
  150. package/dist/plugins/3d/series/Scatter3D.d.ts +21 -0
  151. package/dist/plugins/3d/series/SurfaceMesh3D.d.ts +35 -0
  152. package/dist/plugins/3d/series/Waterfall3D.d.ts +38 -0
  153. package/dist/plugins/3d/series/index.d.ts +13 -0
  154. package/dist/plugins/3d/series/types.d.ts +143 -0
  155. package/dist/plugins/3d/shader/index.d.ts +2 -0
  156. package/dist/plugins/3d/shader/programs.d.ts +24 -0
  157. package/dist/plugins/3d/shader/sources.d.ts +27 -0
  158. package/dist/plugins/3d/types.d.ts +71 -0
  159. package/dist/plugins/3d.d.ts +3 -0
  160. package/dist/plugins/3d.js +5498 -0
  161. package/dist/plugins/3d.js.map +1 -0
  162. package/dist/plugins/PluginContext.d.ts +53 -0
  163. package/dist/plugins/PluginManager.d.ts +129 -0
  164. package/dist/plugins/PluginRegistry.d.ts +38 -0
  165. package/dist/plugins/analysis/SeriesFit.d.ts +3 -0
  166. package/dist/plugins/analysis/contours.d.ts +20 -0
  167. package/dist/plugins/analysis/fft.d.ts +138 -0
  168. package/dist/plugins/analysis/filters.d.ts +76 -0
  169. package/dist/plugins/analysis/fitting.d.ts +24 -0
  170. package/dist/plugins/analysis/index.d.ts +29 -0
  171. package/dist/plugins/analysis/indicators.d.ts +148 -0
  172. package/dist/plugins/analysis/math.d.ts +32 -0
  173. package/dist/plugins/analysis/statistics.d.ts +78 -0
  174. package/dist/plugins/analysis/utils.d.ts +150 -0
  175. package/dist/plugins/analysis.d.ts +3 -0
  176. package/dist/plugins/analysis.js +1202 -0
  177. package/dist/plugins/analysis.js.map +1 -0
  178. package/dist/plugins/annotations/index.d.ts +16 -0
  179. package/dist/plugins/annotations.d.ts +3 -0
  180. package/dist/plugins/annotations.js +438 -0
  181. package/dist/plugins/annotations.js.map +1 -0
  182. package/dist/plugins/anomaly-detection/algorithms.d.ts +38 -0
  183. package/dist/plugins/anomaly-detection/index.d.ts +16 -0
  184. package/dist/plugins/anomaly-detection/types.d.ts +57 -0
  185. package/dist/plugins/broken-axis/BrokenAxisScale.d.ts +24 -0
  186. package/dist/plugins/broken-axis/exports.d.ts +6 -0
  187. package/dist/plugins/broken-axis/index.d.ts +6 -0
  188. package/dist/plugins/broken-axis/types.d.ts +50 -0
  189. package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +40 -0
  190. package/dist/plugins/builtins/crosshair/index.d.ts +1 -0
  191. package/dist/plugins/builtins/data-logger/DataLoggerPlugin.d.ts +11 -0
  192. package/dist/plugins/builtins/data-logger/index.d.ts +1 -0
  193. package/dist/plugins/builtins/direction-indicator/DirectionIndicatorPlugin.d.ts +17 -0
  194. package/dist/plugins/builtins/direction-indicator/index.d.ts +2 -0
  195. package/dist/plugins/builtins/grid-highlight/GridHighlightPlugin.d.ts +17 -0
  196. package/dist/plugins/builtins/grid-highlight/index.d.ts +1 -0
  197. package/dist/plugins/builtins/index.d.ts +25 -0
  198. package/dist/plugins/builtins/stats/StatsPlugin.d.ts +11 -0
  199. package/dist/plugins/builtins/stats/index.d.ts +1 -0
  200. package/dist/plugins/builtins/watermark/WatermarkPlugin.d.ts +15 -0
  201. package/dist/plugins/builtins/watermark/index.d.ts +1 -0
  202. package/dist/plugins/caching/exports.d.ts +6 -0
  203. package/dist/plugins/caching/index.d.ts +6 -0
  204. package/dist/plugins/caching/types.d.ts +120 -0
  205. package/dist/plugins/clipboard/index.d.ts +20 -0
  206. package/dist/plugins/clipboard.d.ts +3 -0
  207. package/dist/plugins/clipboard.js +270 -0
  208. package/dist/plugins/clipboard.js.map +1 -0
  209. package/dist/plugins/context-menu/index.d.ts +12 -0
  210. package/dist/plugins/context-menu/renderer.d.ts +43 -0
  211. package/dist/plugins/context-menu/types.d.ts +202 -0
  212. package/dist/plugins/context-menu.d.ts +3 -0
  213. package/dist/plugins/context-menu.js +621 -0
  214. package/dist/plugins/context-menu.js.map +1 -0
  215. package/dist/plugins/data-export/formatters.d.ts +34 -0
  216. package/dist/plugins/data-export/index.d.ts +15 -0
  217. package/dist/plugins/data-export/types.d.ts +166 -0
  218. package/dist/plugins/data-export.d.ts +3 -0
  219. package/dist/plugins/data-export.js +463 -0
  220. package/dist/plugins/data-export.js.map +1 -0
  221. package/dist/plugins/data-transform/index.d.ts +6 -0
  222. package/dist/plugins/data-transform/types.d.ts +34 -0
  223. package/dist/plugins/debug/index.d.ts +24 -0
  224. package/dist/plugins/debug.d.ts +3 -0
  225. package/dist/plugins/debug.js +330 -0
  226. package/dist/plugins/debug.js.map +1 -0
  227. package/dist/plugins/drag-edit/exports.d.ts +6 -0
  228. package/dist/plugins/drag-edit/index.d.ts +6 -0
  229. package/dist/plugins/drag-edit/types.d.ts +118 -0
  230. package/dist/plugins/forecasting/algorithms.d.ts +6 -0
  231. package/dist/plugins/forecasting/exports.d.ts +3 -0
  232. package/dist/plugins/forecasting/index.d.ts +11 -0
  233. package/dist/plugins/forecasting/types.d.ts +88 -0
  234. package/dist/plugins/gpu/index.d.ts +24 -0
  235. package/dist/plugins/gpu.d.ts +3 -0
  236. package/dist/plugins/gpu.js +2430 -0
  237. package/dist/plugins/gpu.js.map +1 -0
  238. package/dist/plugins/i18n/index.d.ts +22 -0
  239. package/dist/plugins/i18n.d.ts +3 -0
  240. package/dist/plugins/i18n.js +37 -0
  241. package/dist/plugins/i18n.js.map +1 -0
  242. package/dist/plugins/index.d.ts +110 -0
  243. package/dist/plugins/keyboard/index.d.ts +15 -0
  244. package/dist/plugins/keyboard.d.ts +3 -0
  245. package/dist/plugins/keyboard.js +8 -0
  246. package/dist/plugins/keyboard.js.map +1 -0
  247. package/dist/plugins/latex/exports.d.ts +6 -0
  248. package/dist/plugins/latex/index.d.ts +8 -0
  249. package/dist/plugins/latex/parser.d.ts +6 -0
  250. package/dist/plugins/latex/renderer.d.ts +6 -0
  251. package/dist/plugins/latex/symbols.d.ts +28 -0
  252. package/dist/plugins/latex/types.d.ts +88 -0
  253. package/dist/plugins/lazy-load/exports.d.ts +6 -0
  254. package/dist/plugins/lazy-load/index.d.ts +6 -0
  255. package/dist/plugins/lazy-load/types.d.ts +121 -0
  256. package/dist/plugins/loading/index.d.ts +15 -0
  257. package/dist/plugins/loading.d.ts +3 -0
  258. package/dist/plugins/loading.js +7 -0
  259. package/dist/plugins/loading.js.map +1 -0
  260. package/dist/plugins/ml-integration/exports.d.ts +11 -0
  261. package/dist/plugins/ml-integration/index.d.ts +6 -0
  262. package/dist/plugins/ml-integration/native-algorithms.d.ts +69 -0
  263. package/dist/plugins/ml-integration/types.d.ts +74 -0
  264. package/dist/plugins/offscreen/exports.d.ts +6 -0
  265. package/dist/plugins/offscreen/index.d.ts +6 -0
  266. package/dist/plugins/offscreen/pool.d.ts +32 -0
  267. package/dist/plugins/offscreen/types.d.ts +35 -0
  268. package/dist/plugins/pattern-recognition/index.d.ts +6 -0
  269. package/dist/plugins/pattern-recognition/patterns.d.ts +3 -0
  270. package/dist/plugins/pattern-recognition/types.d.ts +245 -0
  271. package/dist/plugins/radar/index.d.ts +6 -0
  272. package/dist/plugins/radar/types.d.ts +40 -0
  273. package/dist/plugins/regression/algorithms.d.ts +6 -0
  274. package/dist/plugins/regression/index.d.ts +6 -0
  275. package/dist/plugins/regression/types.d.ts +261 -0
  276. package/dist/plugins/roi/exports.d.ts +6 -0
  277. package/dist/plugins/roi/index.d.ts +49 -0
  278. package/dist/plugins/roi/types.d.ts +60 -0
  279. package/dist/plugins/snapshot/index.d.ts +11 -0
  280. package/dist/plugins/snapshot/types.d.ts +38 -0
  281. package/dist/plugins/streaming/index.d.ts +32 -0
  282. package/dist/plugins/streaming.d.ts +3 -0
  283. package/dist/plugins/streaming.js +13 -0
  284. package/dist/plugins/streaming.js.map +1 -0
  285. package/dist/plugins/sync/index.d.ts +22 -0
  286. package/dist/plugins/sync.d.ts +3 -0
  287. package/dist/plugins/sync.js +261 -0
  288. package/dist/plugins/sync.js.map +1 -0
  289. package/dist/plugins/theme-editor/index.d.ts +18 -0
  290. package/dist/plugins/theme-editor.d.ts +3 -0
  291. package/dist/plugins/theme-editor.js +7 -0
  292. package/dist/plugins/theme-editor.js.map +1 -0
  293. package/dist/plugins/tools/delta-tool/index.d.ts +159 -0
  294. package/dist/plugins/tools/index.d.ts +21 -0
  295. package/dist/plugins/tools/peak-tool/index.d.ts +159 -0
  296. package/dist/plugins/tools/tooltip/TooltipManager.d.ts +213 -0
  297. package/dist/plugins/tools/tooltip/TooltipPositioner.d.ts +83 -0
  298. package/dist/plugins/tools/tooltip/TooltipRenderer.d.ts +64 -0
  299. package/dist/plugins/tools/tooltip/index.d.ts +18 -0
  300. package/dist/plugins/tools/tooltip/templates/AnnotationTemplate.d.ts +18 -0
  301. package/dist/plugins/tools/tooltip/templates/CrosshairTemplate.d.ts +39 -0
  302. package/dist/plugins/tools/tooltip/templates/DefaultTemplate.d.ts +30 -0
  303. package/dist/plugins/tools/tooltip/templates/HeatmapTemplate.d.ts +34 -0
  304. package/dist/plugins/tools/tooltip/templates/MinimalTemplate.d.ts +26 -0
  305. package/dist/plugins/tools/tooltip/templates/RangeTemplate.d.ts +18 -0
  306. package/dist/plugins/tools/tooltip/templates/ScientificTemplate.d.ts +34 -0
  307. package/dist/plugins/tools/tooltip/templates/index.d.ts +27 -0
  308. package/dist/plugins/tools/tooltip/themes.d.ts +48 -0
  309. package/dist/plugins/tools/tooltip/types.d.ts +396 -0
  310. package/dist/plugins/tools.d.ts +3 -0
  311. package/dist/plugins/tools.js +9 -0
  312. package/dist/plugins/tools.js.map +1 -0
  313. package/dist/plugins/types.d.ts +451 -0
  314. package/dist/plugins/video-recorder/exports.d.ts +6 -0
  315. package/dist/plugins/video-recorder/index.d.ts +6 -0
  316. package/dist/plugins/video-recorder/types.d.ts +55 -0
  317. package/dist/plugins/virtualization/exports.d.ts +6 -0
  318. package/dist/plugins/virtualization/index.d.ts +6 -0
  319. package/dist/plugins/virtualization/types.d.ts +48 -0
  320. package/dist/react/SciPlot.d.ts +60 -0
  321. package/dist/react/index.d.ts +5 -0
  322. package/dist/react/useSciPlot.d.ts +56 -0
  323. package/dist/renderer/BarRenderer.d.ts +14 -0
  324. package/dist/renderer/CandlestickRenderer.d.ts +12 -0
  325. package/dist/renderer/GaugeRenderer.d.ts +3 -0
  326. package/dist/renderer/HeatmapRenderer.d.ts +15 -0
  327. package/dist/renderer/NativeWebGLRenderer.d.ts +16 -0
  328. package/dist/renderer/PolarRenderer.d.ts +64 -0
  329. package/dist/renderer/RendererInterface.d.ts +70 -0
  330. package/dist/renderer/SankeyRenderer.d.ts +3 -0
  331. package/dist/renderer/WebGPURenderer.d.ts +16 -0
  332. package/dist/renderer/index.d.ts +13 -0
  333. package/dist/renderer/native/NativeWebGLRenderer.d.ts +31 -0
  334. package/dist/renderer/native/bufferStore.d.ts +11 -0
  335. package/dist/renderer/native/draw.d.ts +47 -0
  336. package/dist/renderer/native/programFactory.d.ts +3 -0
  337. package/dist/renderer/native/renderFrame.d.ts +3 -0
  338. package/dist/renderer/native/shaderSources.d.ts +6 -0
  339. package/dist/renderer/native/textureStore.d.ts +8 -0
  340. package/dist/renderer/native/types.d.ts +77 -0
  341. package/dist/renderer/native/utils.d.ts +31 -0
  342. package/dist/renderer/radar/RadarRenderer.d.ts +71 -0
  343. package/dist/renderer/radar/index.d.ts +10 -0
  344. package/dist/renderer/shaders.d.ts +77 -0
  345. package/dist/renderer/ternary/TernaryRenderer.d.ts +39 -0
  346. package/dist/renderer/ternary/index.d.ts +6 -0
  347. package/dist/renderer/ternary/types.d.ts +56 -0
  348. package/dist/scales/index.d.ts +54 -0
  349. package/dist/serialization/index.d.ts +153 -0
  350. package/dist/streaming/backpressure.d.ts +179 -0
  351. package/dist/streaming/index.d.ts +7 -0
  352. package/dist/streaming/mock.d.ts +12 -0
  353. package/dist/streaming/types.d.ts +57 -0
  354. package/dist/streaming/utils.d.ts +19 -0
  355. package/dist/streaming/websocket.d.ts +6 -0
  356. package/dist/testing/index.d.ts +225 -0
  357. package/dist/theme/colorSchemes.d.ts +56 -0
  358. package/dist/theme/index.d.ts +138 -0
  359. package/dist/types.d.ts +753 -0
  360. package/dist/utils-Dbro9-qM.js +254 -0
  361. package/dist/utils-Dbro9-qM.js.map +1 -0
  362. package/dist/velo-plot.d.ts +1 -0
  363. package/dist/velo-plot.full.d.ts +1 -0
  364. package/dist/velo-plot.full.js +5804 -0
  365. package/dist/velo-plot.full.js.map +1 -0
  366. package/dist/velo-plot.js +31 -0
  367. package/dist/velo-plot.js.map +1 -0
  368. package/dist/workers/downsample.d.ts +34 -0
  369. package/dist/workers/downsample.worker.d.ts +46 -0
  370. package/package.json +185 -0
@@ -0,0 +1,463 @@
1
+ const D = {
2
+ csv: {
3
+ mimeType: "text/csv",
4
+ extension: ".csv"
5
+ },
6
+ tsv: {
7
+ mimeType: "text/tab-separated-values",
8
+ extension: ".tsv"
9
+ },
10
+ json: {
11
+ mimeType: "application/json",
12
+ extension: ".json"
13
+ },
14
+ matlab: {
15
+ mimeType: "application/json",
16
+ extension: ".mat.json"
17
+ },
18
+ python: {
19
+ mimeType: "application/json",
20
+ extension: ".npy.json"
21
+ },
22
+ xlsx: {
23
+ mimeType: "text/csv;charset=utf-8",
24
+ extension: ".csv",
25
+ bom: "\uFEFF"
26
+ // UTF-8 BOM for Excel
27
+ },
28
+ binary: {
29
+ mimeType: "application/octet-stream",
30
+ extension: ".bin",
31
+ binary: !0
32
+ }
33
+ };
34
+ function _(r, s) {
35
+ const {
36
+ delimiter: u = s.format === "tsv" ? " " : ",",
37
+ lineEnding: a = `
38
+ `,
39
+ includeHeaders: i = !0,
40
+ includeTimestamp: n = !1,
41
+ includeMetadata: f = !1,
42
+ metadata: l = {},
43
+ precision: e = 6,
44
+ scientificThreshold: p = 1e6
45
+ } = s, v = [], O = s.format === "xlsx" ? D.xlsx.bom : "";
46
+ if (f && Object.keys(l).length > 0 && (v.push("# Sci Plot Data Export"), n && v.push(`# Timestamp: ${(/* @__PURE__ */ new Date()).toISOString()}`), Object.entries(l).forEach(([d, x]) => {
47
+ v.push(`# ${d}: ${x}`);
48
+ }), v.push("")), i) {
49
+ const d = [];
50
+ r.forEach((x) => {
51
+ const t = r.length > 1 ? `${x.name || x.id}_` : "";
52
+ d.push(`${t}x`, `${t}y`), x.data.y2 && d.push(`${t}y2`), x.data.yError && d.push(`${t}yError`), x.data.open && d.push(`${t}open`, `${t}high`, `${t}low`, `${t}close`);
53
+ }), v.push(d.join(u));
54
+ }
55
+ const y = Math.max(...r.map((d) => d.data.x.length));
56
+ for (let d = 0; d < y; d++) {
57
+ const x = [];
58
+ r.forEach((t) => {
59
+ const { x: m, y: g, y2: o, yError: c, open: h, high: S, low: $, close: b } = t.data;
60
+ d < m.length ? (x.push(
61
+ j(m[d], e, p),
62
+ j(g[d], e, p)
63
+ ), o && x.push(j(o[d], e, p)), c && x.push(j(c[d], e, p)), h && S && $ && b && x.push(
64
+ j(h[d], e, p),
65
+ j(S[d], e, p),
66
+ j($[d], e, p),
67
+ j(b[d], e, p)
68
+ )) : (x.push("", ""), t.data.y2 && x.push(""), t.data.yError && x.push(""), t.data.open && x.push("", "", "", ""));
69
+ }), v.push(x.join(u));
70
+ }
71
+ return O + v.join(a);
72
+ }
73
+ function N(r, s, u) {
74
+ const {
75
+ precision: a = 6,
76
+ prettyPrint: i = !0,
77
+ includeMetadata: n = !0,
78
+ metadata: f = {}
79
+ } = s, l = {
80
+ version: "1.0",
81
+ exportDate: (/* @__PURE__ */ new Date()).toISOString(),
82
+ format: "velo-plot-json"
83
+ };
84
+ return n && (l.metadata = {
85
+ ...f,
86
+ seriesCount: r.length,
87
+ totalPoints: r.reduce((e, p) => e + p.pointCount, 0)
88
+ }), u && (l.viewBounds = u), l.series = r.map((e) => ({
89
+ id: e.id,
90
+ name: e.name || e.id,
91
+ type: e.type,
92
+ pointCount: e.pointCount,
93
+ yAxisId: e.yAxisId,
94
+ style: e.style,
95
+ data: {
96
+ x: A(Array.from(e.data.x), a),
97
+ y: A(Array.from(e.data.y), a),
98
+ ...e.data.y2 && { y2: A(Array.from(e.data.y2), a) },
99
+ ...e.data.yError && { yError: A(Array.from(e.data.yError), a) },
100
+ ...e.data.open && {
101
+ open: A(Array.from(e.data.open), a),
102
+ high: A(Array.from(e.data.high), a),
103
+ low: A(Array.from(e.data.low), a),
104
+ close: A(Array.from(e.data.close), a)
105
+ }
106
+ }
107
+ })), JSON.stringify(l, null, i ? 2 : void 0);
108
+ }
109
+ function M(r, s) {
110
+ const { precision: u = 6, prettyPrint: a = !0 } = s, i = {
111
+ format: "matlab-compatible-json",
112
+ version: "1.0",
113
+ created: (/* @__PURE__ */ new Date()).toISOString(),
114
+ variables: []
115
+ };
116
+ return r.forEach((n) => {
117
+ const f = A(Array.from(n.data.x), u), l = A(Array.from(n.data.y), u), e = P(n.name || n.id);
118
+ i.variables.push({
119
+ name: `${e}_x`,
120
+ type: "double",
121
+ size: [f.length, 1],
122
+ data: f
123
+ }), i.variables.push({
124
+ name: `${e}_y`,
125
+ type: "double",
126
+ size: [l.length, 1],
127
+ data: l
128
+ }), i.variables.push({
129
+ name: e,
130
+ type: "double",
131
+ size: [f.length, 2],
132
+ data: I(f, l)
133
+ });
134
+ }), JSON.stringify(i, null, a ? 2 : void 0);
135
+ }
136
+ function U(r, s) {
137
+ const { precision: u = 6, prettyPrint: a = !0 } = s, i = {
138
+ format: "numpy-compatible-json",
139
+ version: "1.0",
140
+ created: (/* @__PURE__ */ new Date()).toISOString(),
141
+ import_code: `
142
+ # Load data in Python:
143
+ import json
144
+ import numpy as np
145
+
146
+ with open('data.npy.json', 'r') as f:
147
+ data = json.load(f)
148
+
149
+ # Access arrays:
150
+ # x = np.array(data['arrays']['series_name']['x']['data'], dtype=np.float32)
151
+ # y = np.array(data['arrays']['series_name']['y']['data'], dtype=np.float32)
152
+ `.trim(),
153
+ arrays: {}
154
+ };
155
+ return r.forEach((n) => {
156
+ const f = P(n.name || n.id), l = A(Array.from(n.data.x), u), e = A(Array.from(n.data.y), u);
157
+ i.arrays[f] = {
158
+ dtype: "float32",
159
+ shape: [l.length, 2],
160
+ data: I(l, e),
161
+ name: f
162
+ }, i.arrays[`${f}_x`] = {
163
+ dtype: "float32",
164
+ shape: [l.length],
165
+ data: l,
166
+ name: `${f}_x`
167
+ }, i.arrays[`${f}_y`] = {
168
+ dtype: "float32",
169
+ shape: [e.length],
170
+ data: e,
171
+ name: `${f}_y`
172
+ };
173
+ }), JSON.stringify(i, null, a ? 2 : void 0);
174
+ }
175
+ function B(r) {
176
+ let s = 32;
177
+ r.forEach((l) => {
178
+ const e = new TextEncoder().encode(l.name || l.id);
179
+ s += 4 + e.length, s += 4, s += l.data.x.length * 4 * 2;
180
+ });
181
+ const u = new ArrayBuffer(s), a = new DataView(u), i = new TextEncoder();
182
+ let n = 0;
183
+ a.setUint8(n++, 83), a.setUint8(n++, 67), a.setUint8(n++, 69), a.setUint8(n++, 49), a.setUint32(n, 1, !0), n += 4, a.setUint32(n, r.length, !0), n += 4;
184
+ const f = Math.floor(Date.now() / 1e3);
185
+ return a.setUint32(n, f, !0), n += 4, n += 16, r.forEach((l) => {
186
+ const e = i.encode(l.name || l.id);
187
+ a.setUint32(n, e.length, !0), n += 4, new Uint8Array(u, n, e.length).set(e), n += e.length;
188
+ const p = l.data.x.length;
189
+ a.setUint32(n, p, !0), n += 4;
190
+ const v = new Float32Array(u, n, p);
191
+ for (let y = 0; y < p; y++)
192
+ v[y] = l.data.x[y];
193
+ n += p * 4;
194
+ const O = new Float32Array(u, n, p);
195
+ for (let y = 0; y < p; y++)
196
+ O[y] = l.data.y[y];
197
+ n += p * 4;
198
+ }), u;
199
+ }
200
+ function j(r, s, u) {
201
+ if (!isFinite(r))
202
+ return isNaN(r) ? "NaN" : r > 0 ? "Inf" : "-Inf";
203
+ const a = Math.abs(r);
204
+ return a !== 0 && (a >= u || a < 1e-4) ? r.toExponential(s) : r.toFixed(s);
205
+ }
206
+ function A(r, s) {
207
+ const u = Math.pow(10, s);
208
+ return r.map((a) => Math.round(a * u) / u);
209
+ }
210
+ function P(r) {
211
+ return r.replace(/[^a-zA-Z0-9_]/g, "_").replace(/^[0-9]/, "_$&").substring(0, 63);
212
+ }
213
+ function I(r, s) {
214
+ const u = [], a = Math.max(r.length, s.length);
215
+ for (let i = 0; i < a; i++)
216
+ i < r.length && u.push(r[i]), i < s.length && u.push(s[i]);
217
+ return u;
218
+ }
219
+ const k = {
220
+ name: "velo-plot-data-export",
221
+ version: "1.0.0",
222
+ description: "Advanced data export capabilities for velo-plot",
223
+ author: "Sci Plot Team",
224
+ provides: ["export"],
225
+ tags: ["export", "csv", "json", "matlab", "python", "data"]
226
+ };
227
+ function H(r = {}) {
228
+ const {
229
+ formats: s = ["csv", "tsv", "json", "matlab", "python", "xlsx", "binary"],
230
+ defaultFormat: u = "csv",
231
+ defaultPrecision: a = 6,
232
+ includeMetadata: i = !0,
233
+ autoDownload: n = !1,
234
+ filenameGenerator: f,
235
+ beforeExport: l,
236
+ afterExport: e
237
+ } = r;
238
+ let p = null;
239
+ function v(t, m) {
240
+ if (!p) return [];
241
+ const g = p.data.getAllSeries();
242
+ return (t ? g.filter((c) => t.includes(c.getId())) : g).map((c) => {
243
+ var S, $;
244
+ let h = c.getData();
245
+ if (m === "visible" && h) {
246
+ const b = p.data.getViewBounds(), E = [];
247
+ for (let T = 0; T < h.x.length; T++)
248
+ h.x[T] >= b.xMin && h.x[T] <= b.xMax && E.push(T);
249
+ if (E.length > 0 && E.length < h.x.length) {
250
+ const T = new Float32Array(E.length), w = new Float32Array(E.length);
251
+ E.forEach((C, F) => {
252
+ T[F] = h.x[C], w[F] = h.y[C];
253
+ }), h = { ...h, x: T, y: w };
254
+ }
255
+ }
256
+ return {
257
+ id: c.getId(),
258
+ name: ((S = c.getName) == null ? void 0 : S.call(c)) ?? c.getId(),
259
+ type: c.getType(),
260
+ data: h || { x: new Float32Array(0), y: new Float32Array(0) },
261
+ pointCount: (h == null ? void 0 : h.x.length) ?? 0,
262
+ style: c.getStyle(),
263
+ yAxisId: ($ = c.getYAxisId) == null ? void 0 : $.call(c)
264
+ };
265
+ });
266
+ }
267
+ function O(t, m) {
268
+ if (f)
269
+ return f(t, m);
270
+ const g = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").substring(0, 19), o = m.length <= 3 ? m.join("_") : `${m.length}_series`, c = D[t];
271
+ return `velo-plot_${o}_${g}${c.extension}`;
272
+ }
273
+ function y(t) {
274
+ const m = t.format ?? u, g = [];
275
+ if (!s.includes(m))
276
+ return {
277
+ success: !1,
278
+ error: `Format '${m}' is not enabled. Available: ${s.join(", ")}`,
279
+ contentType: "text/plain",
280
+ filename: "error.txt",
281
+ seriesCount: 0,
282
+ pointCount: 0,
283
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
284
+ };
285
+ let o = { ...t, precision: t.precision ?? a };
286
+ if (l) {
287
+ const w = l(o);
288
+ if (w === !1)
289
+ return {
290
+ success: !1,
291
+ error: "Export cancelled by beforeExport hook",
292
+ contentType: "text/plain",
293
+ filename: "cancelled.txt",
294
+ seriesCount: 0,
295
+ pointCount: 0,
296
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
297
+ };
298
+ o = w;
299
+ }
300
+ const c = v(o.seriesIds, o.range);
301
+ c.length === 0 && g.push("No series data found to export");
302
+ const h = c.reduce((w, C) => w + C.pointCount, 0), S = D[m], $ = o.filename ?? O(m, c.map((w) => w.id));
303
+ let b, E;
304
+ try {
305
+ switch (m) {
306
+ case "csv":
307
+ case "tsv":
308
+ case "xlsx":
309
+ b = _(c, { ...o, format: m });
310
+ break;
311
+ case "json":
312
+ b = N(
313
+ c,
314
+ o,
315
+ p == null ? void 0 : p.data.getViewBounds()
316
+ );
317
+ break;
318
+ case "matlab":
319
+ b = M(c, o);
320
+ break;
321
+ case "python":
322
+ b = U(c, o);
323
+ break;
324
+ case "binary":
325
+ const w = B(c);
326
+ E = new Blob([w], { type: S.mimeType });
327
+ break;
328
+ }
329
+ b && !E && (E = new Blob([b], { type: S.mimeType }));
330
+ } catch (w) {
331
+ return {
332
+ success: !1,
333
+ error: `Export failed: ${w.message}`,
334
+ contentType: "text/plain",
335
+ filename: "error.txt",
336
+ seriesCount: c.length,
337
+ pointCount: h,
338
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
339
+ };
340
+ }
341
+ const T = {
342
+ success: !0,
343
+ content: b,
344
+ blob: E,
345
+ contentType: S.mimeType,
346
+ filename: $,
347
+ seriesCount: c.length,
348
+ pointCount: h,
349
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
350
+ warnings: g.length > 0 ? g : void 0
351
+ };
352
+ return e && e(T), T;
353
+ }
354
+ function d(t, m) {
355
+ const g = URL.createObjectURL(t), o = document.createElement("a");
356
+ o.href = g, o.download = m, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(g);
357
+ }
358
+ return {
359
+ manifest: k,
360
+ onInit(t) {
361
+ p = t, t.log.info(`DataExport plugin initialized with formats: ${s.join(", ")}`);
362
+ },
363
+ onDestroy() {
364
+ p = null;
365
+ },
366
+ api: {
367
+ /**
368
+ * Export chart data to specified format
369
+ *
370
+ * @param format - Export format
371
+ * @param options - Export options
372
+ * @returns Export result with content/blob
373
+ */
374
+ export(t, m = {}) {
375
+ const g = {
376
+ format: t,
377
+ includeHeaders: !0,
378
+ includeTimestamp: !0,
379
+ includeMetadata: i,
380
+ prettyPrint: !0,
381
+ ...m
382
+ }, o = y(g);
383
+ return n && o.success && o.blob && d(o.blob, o.filename), o;
384
+ },
385
+ /**
386
+ * Export and immediately download
387
+ *
388
+ * @param format - Export format
389
+ * @param options - Export options
390
+ */
391
+ download(t, m = {}) {
392
+ const g = {
393
+ format: t,
394
+ includeHeaders: !0,
395
+ includeTimestamp: !0,
396
+ includeMetadata: i,
397
+ prettyPrint: !0,
398
+ ...m
399
+ }, o = y(g);
400
+ return o.success && o.blob && d(o.blob, o.filename), o;
401
+ },
402
+ /**
403
+ * Export to CSV format
404
+ */
405
+ toCSV(t = {}) {
406
+ return y({ format: "csv", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
407
+ },
408
+ /**
409
+ * Export to JSON format
410
+ */
411
+ toJSON(t = {}) {
412
+ return y({ format: "json", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
413
+ },
414
+ /**
415
+ * Export to MATLAB format
416
+ */
417
+ toMATLAB(t = {}) {
418
+ return y({ format: "matlab", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
419
+ },
420
+ /**
421
+ * Export to Python/NumPy format
422
+ */
423
+ toPython(t = {}) {
424
+ return y({ format: "python", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
425
+ },
426
+ /**
427
+ * Export to Excel-compatible CSV
428
+ */
429
+ toExcel(t = {}) {
430
+ return y({ format: "xlsx", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
431
+ },
432
+ /**
433
+ * Export to binary format
434
+ */
435
+ toBinary(t = {}) {
436
+ return y({ format: "binary", includeHeaders: !0, includeTimestamp: !0, includeMetadata: i, prettyPrint: !0, ...t });
437
+ },
438
+ /**
439
+ * Get available export formats
440
+ */
441
+ getFormats() {
442
+ return [...s];
443
+ },
444
+ /**
445
+ * Check if a format is supported
446
+ */
447
+ supportsFormat(t) {
448
+ return s.includes(t);
449
+ },
450
+ /**
451
+ * Get format configuration
452
+ */
453
+ getFormatConfig(t) {
454
+ return D[t];
455
+ }
456
+ }
457
+ };
458
+ }
459
+ export {
460
+ H as PluginDataExport,
461
+ H as default
462
+ };
463
+ //# sourceMappingURL=data-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-export.js","sources":["../../src/plugins/data-export/formatters.ts","../../src/plugins/data-export/index.ts"],"sourcesContent":["/**\n * Data Export Formatters\n * \n * Handles conversion of chart data to various output formats.\n * \n * @module plugins/data-export/formatters\n */\n\nimport type { \n DataExportOptions, \n ExportFormat, \n FormatConfig,\n SeriesExportInfo,\n MatlabExportData,\n NumpyExportData\n} from \"./types\";\n\n// ============================================\n// Format Configurations\n// ============================================\n\nexport const FORMAT_CONFIGS: Record<ExportFormat, FormatConfig> = {\n csv: {\n mimeType: 'text/csv',\n extension: '.csv'\n },\n tsv: {\n mimeType: 'text/tab-separated-values',\n extension: '.tsv'\n },\n json: {\n mimeType: 'application/json',\n extension: '.json'\n },\n matlab: {\n mimeType: 'application/json',\n extension: '.mat.json'\n },\n python: {\n mimeType: 'application/json',\n extension: '.npy.json'\n },\n xlsx: {\n mimeType: 'text/csv;charset=utf-8',\n extension: '.csv',\n bom: '\\uFEFF' // UTF-8 BOM for Excel\n },\n binary: {\n mimeType: 'application/octet-stream',\n extension: '.bin',\n binary: true\n }\n};\n\n// ============================================\n// CSV/TSV Formatter\n// ============================================\n\n/**\n * Format data as CSV or TSV\n */\nexport function formatCSV(\n seriesData: SeriesExportInfo[],\n options: DataExportOptions\n): string {\n const {\n delimiter = options.format === 'tsv' ? '\\t' : ',',\n lineEnding = '\\n',\n includeHeaders = true,\n includeTimestamp = false,\n includeMetadata = false,\n metadata = {},\n precision = 6,\n scientificThreshold = 1e6\n } = options;\n\n const lines: string[] = [];\n const bom = options.format === 'xlsx' ? FORMAT_CONFIGS.xlsx.bom : '';\n\n // Add metadata as comments (if supported)\n if (includeMetadata && Object.keys(metadata).length > 0) {\n lines.push(`# Sci Plot Data Export`);\n if (includeTimestamp) {\n lines.push(`# Timestamp: ${new Date().toISOString()}`);\n }\n Object.entries(metadata).forEach(([key, value]) => {\n lines.push(`# ${key}: ${value}`);\n });\n lines.push('');\n }\n\n // Generate headers\n if (includeHeaders) {\n const headers: string[] = [];\n seriesData.forEach(s => {\n const prefix = seriesData.length > 1 ? `${s.name || s.id}_` : '';\n headers.push(`${prefix}x`, `${prefix}y`);\n \n // Add additional columns if present\n if (s.data.y2) headers.push(`${prefix}y2`);\n if (s.data.yError) headers.push(`${prefix}yError`);\n if (s.data.open) headers.push(`${prefix}open`, `${prefix}high`, `${prefix}low`, `${prefix}close`);\n });\n lines.push(headers.join(delimiter));\n }\n\n // Find max length\n const maxLength = Math.max(...seriesData.map(s => s.data.x.length));\n\n // Generate data rows\n for (let i = 0; i < maxLength; i++) {\n const row: string[] = [];\n \n seriesData.forEach(s => {\n const { x, y, y2, yError, open, high, low, close } = s.data;\n \n if (i < x.length) {\n row.push(\n formatNumber(x[i], precision, scientificThreshold),\n formatNumber(y[i], precision, scientificThreshold)\n );\n if (y2) row.push(formatNumber(y2[i], precision, scientificThreshold));\n if (yError) row.push(formatNumber(yError[i], precision, scientificThreshold));\n if (open && high && low && close) {\n row.push(\n formatNumber(open[i], precision, scientificThreshold),\n formatNumber(high[i], precision, scientificThreshold),\n formatNumber(low[i], precision, scientificThreshold),\n formatNumber(close[i], precision, scientificThreshold)\n );\n }\n } else {\n row.push('', '');\n if (s.data.y2) row.push('');\n if (s.data.yError) row.push('');\n if (s.data.open) row.push('', '', '', '');\n }\n });\n \n lines.push(row.join(delimiter));\n }\n\n return bom + lines.join(lineEnding);\n}\n\n// ============================================\n// JSON Formatter\n// ============================================\n\n/**\n * Format data as JSON\n */\nexport function formatJSON(\n seriesData: SeriesExportInfo[],\n options: DataExportOptions,\n viewBounds?: { xMin: number; xMax: number; yMin: number; yMax: number }\n): string {\n const {\n precision = 6,\n prettyPrint = true,\n includeMetadata = true,\n metadata = {}\n } = options;\n\n const exportData: Record<string, unknown> = {\n version: '1.0',\n exportDate: new Date().toISOString(),\n format: 'velo-plot-json'\n };\n\n if (includeMetadata) {\n exportData.metadata = {\n ...metadata,\n seriesCount: seriesData.length,\n totalPoints: seriesData.reduce((sum, s) => sum + s.pointCount, 0)\n };\n }\n\n if (viewBounds) {\n exportData.viewBounds = viewBounds;\n }\n\n exportData.series = seriesData.map(s => ({\n id: s.id,\n name: s.name || s.id,\n type: s.type,\n pointCount: s.pointCount,\n yAxisId: s.yAxisId,\n style: s.style,\n data: {\n x: roundArray(Array.from(s.data.x), precision),\n y: roundArray(Array.from(s.data.y), precision),\n ...(s.data.y2 && { y2: roundArray(Array.from(s.data.y2), precision) }),\n ...(s.data.yError && { yError: roundArray(Array.from(s.data.yError), precision) }),\n ...(s.data.open && { \n open: roundArray(Array.from(s.data.open), precision),\n high: roundArray(Array.from(s.data.high!), precision),\n low: roundArray(Array.from(s.data.low!), precision),\n close: roundArray(Array.from(s.data.close!), precision)\n })\n }\n }));\n\n return JSON.stringify(exportData, null, prettyPrint ? 2 : undefined);\n}\n\n// ============================================\n// MATLAB Format\n// ============================================\n\n/**\n * Format data for MATLAB compatibility\n * Outputs JSON that can be easily loaded in MATLAB using jsondecode()\n */\nexport function formatMATLAB(\n seriesData: SeriesExportInfo[],\n options: DataExportOptions\n): string {\n const { precision = 6, prettyPrint = true } = options;\n\n const matlabData: {\n format: string;\n version: string;\n created: string;\n variables: MatlabExportData[];\n } = {\n format: 'matlab-compatible-json',\n version: '1.0',\n created: new Date().toISOString(),\n variables: []\n };\n\n seriesData.forEach(s => {\n const xData = roundArray(Array.from(s.data.x), precision);\n const yData = roundArray(Array.from(s.data.y), precision);\n const safeName = sanitizeVariableName(s.name || s.id);\n\n // Create x variable\n matlabData.variables.push({\n name: `${safeName}_x`,\n type: 'double',\n size: [xData.length, 1],\n data: xData\n });\n\n // Create y variable\n matlabData.variables.push({\n name: `${safeName}_y`,\n type: 'double',\n size: [yData.length, 1],\n data: yData\n });\n\n // Create combined matrix variable\n matlabData.variables.push({\n name: safeName,\n type: 'double',\n size: [xData.length, 2],\n data: interleaveArrays(xData, yData)\n });\n });\n\n return JSON.stringify(matlabData, null, prettyPrint ? 2 : undefined);\n}\n\n// ============================================\n// Python/NumPy Format\n// ============================================\n\n/**\n * Format data for Python/NumPy compatibility\n * Outputs JSON that can be easily loaded in Python\n */\nexport function formatPython(\n seriesData: SeriesExportInfo[],\n options: DataExportOptions\n): string {\n const { precision = 6, prettyPrint = true } = options;\n\n const pythonData: {\n format: string;\n version: string;\n created: string;\n import_code: string;\n arrays: Record<string, NumpyExportData>;\n } = {\n format: 'numpy-compatible-json',\n version: '1.0',\n created: new Date().toISOString(),\n import_code: `\n# Load data in Python:\nimport json\nimport numpy as np\n\nwith open('data.npy.json', 'r') as f:\n data = json.load(f)\n\n# Access arrays:\n# x = np.array(data['arrays']['series_name']['x']['data'], dtype=np.float32)\n# y = np.array(data['arrays']['series_name']['y']['data'], dtype=np.float32)\n`.trim(),\n arrays: {}\n };\n\n seriesData.forEach(s => {\n const safeName = sanitizeVariableName(s.name || s.id);\n const xData = roundArray(Array.from(s.data.x), precision);\n const yData = roundArray(Array.from(s.data.y), precision);\n\n pythonData.arrays[safeName] = {\n dtype: 'float32',\n shape: [xData.length, 2],\n data: interleaveArrays(xData, yData),\n name: safeName\n };\n\n // Also provide separate x and y arrays\n pythonData.arrays[`${safeName}_x`] = {\n dtype: 'float32',\n shape: [xData.length],\n data: xData,\n name: `${safeName}_x`\n };\n\n pythonData.arrays[`${safeName}_y`] = {\n dtype: 'float32',\n shape: [yData.length],\n data: yData,\n name: `${safeName}_y`\n };\n });\n\n return JSON.stringify(pythonData, null, prettyPrint ? 2 : undefined);\n}\n\n// ============================================\n// Binary Format\n// ============================================\n\n/**\n * Format data as binary Float32Array\n * \n * Binary format structure:\n * - Header (32 bytes): magic number, version, series count, reserved\n * - Per series: name length (4 bytes), name (UTF-8), point count (4 bytes), x data, y data\n */\nexport function formatBinary(\n seriesData: SeriesExportInfo[]\n): ArrayBuffer {\n // Calculate total size\n let totalSize = 32; // Header\n \n seriesData.forEach(s => {\n const nameBytes = new TextEncoder().encode(s.name || s.id);\n totalSize += 4 + nameBytes.length; // name length + name\n totalSize += 4; // point count\n totalSize += s.data.x.length * 4 * 2; // x and y as Float32\n });\n \n const buffer = new ArrayBuffer(totalSize);\n const view = new DataView(buffer);\n const encoder = new TextEncoder();\n \n let offset = 0;\n \n // Header\n // Magic number: \"SCE1\" (Sci Plot v1)\n view.setUint8(offset++, 0x53); // S\n view.setUint8(offset++, 0x43); // C\n view.setUint8(offset++, 0x45); // E\n view.setUint8(offset++, 0x31); // 1\n \n // Version\n view.setUint32(offset, 1, true); offset += 4;\n \n // Series count\n view.setUint32(offset, seriesData.length, true); offset += 4;\n \n // Timestamp (milliseconds since epoch)\n const timestamp = Math.floor(Date.now() / 1000);\n view.setUint32(offset, timestamp, true); offset += 4;\n \n // Reserved (16 bytes)\n offset += 16;\n \n // Series data\n seriesData.forEach(s => {\n const nameBytes = encoder.encode(s.name || s.id);\n \n // Name length\n view.setUint32(offset, nameBytes.length, true); offset += 4;\n \n // Name\n new Uint8Array(buffer, offset, nameBytes.length).set(nameBytes);\n offset += nameBytes.length;\n \n // Point count\n const pointCount = s.data.x.length;\n view.setUint32(offset, pointCount, true); offset += 4;\n \n // X data\n const xFloat32 = new Float32Array(buffer, offset, pointCount);\n for (let i = 0; i < pointCount; i++) {\n xFloat32[i] = s.data.x[i];\n }\n offset += pointCount * 4;\n \n // Y data\n const yFloat32 = new Float32Array(buffer, offset, pointCount);\n for (let i = 0; i < pointCount; i++) {\n yFloat32[i] = s.data.y[i];\n }\n offset += pointCount * 4;\n });\n \n return buffer;\n}\n\n// ============================================\n// Utility Functions\n// ============================================\n\n/**\n * Format a number with appropriate precision\n */\nfunction formatNumber(value: number, precision: number, scientificThreshold: number): string {\n if (!isFinite(value)) {\n return isNaN(value) ? 'NaN' : (value > 0 ? 'Inf' : '-Inf');\n }\n \n const absValue = Math.abs(value);\n if (absValue !== 0 && (absValue >= scientificThreshold || absValue < 1e-4)) {\n return value.toExponential(precision);\n }\n \n return value.toFixed(precision);\n}\n\n/**\n * Round array values to specified precision\n */\nfunction roundArray(arr: number[], precision: number): number[] {\n const factor = Math.pow(10, precision);\n return arr.map(v => Math.round(v * factor) / factor);\n}\n\n/**\n * Sanitize string for use as variable name\n */\nfunction sanitizeVariableName(name: string): string {\n return name\n .replace(/[^a-zA-Z0-9_]/g, '_')\n .replace(/^[0-9]/, '_$&')\n .substring(0, 63);\n}\n\n/**\n * Interleave two arrays [a0, b0, a1, b1, ...]\n */\nfunction interleaveArrays(a: number[], b: number[]): number[] {\n const result: number[] = [];\n const len = Math.max(a.length, b.length);\n for (let i = 0; i < len; i++) {\n if (i < a.length) result.push(a[i]);\n if (i < b.length) result.push(b[i]);\n }\n return result;\n}\n","/**\n * Sci Plot - Data Export Plugin\n * \n * Advanced data export capabilities for scientific chart data.\n * Supports multiple formats including CSV, JSON, MATLAB, and Python.\n * \n * @module plugins/data-export\n * \n * @example\n * ```typescript\n * import { createChart } from 'velo-plot';\n * import { PluginDataExport } from 'velo-plot/plugins/data-export';\n * \n * const chart = createChart({ container });\n * chart.use(PluginDataExport({\n * defaultFormat: 'csv',\n * autoDownload: true\n * }));\n * \n * // Export visible data\n * const result = await chart.export('csv', { range: 'visible' });\n * \n * // Export all data to MATLAB format\n * await chart.export('matlab', { \n * seriesIds: ['voltage', 'current'],\n * includeMetadata: true \n * });\n * ```\n */\n\nimport type { PluginManifest, ChartPlugin, PluginContext } from \"../types\";\nimport type { \n PluginDataExportConfig, \n DataExportOptions, \n ExportResult,\n ExportFormat,\n SeriesExportInfo,\n ExportRange\n} from \"./types\";\nimport { \n FORMAT_CONFIGS,\n formatCSV, \n formatJSON, \n formatMATLAB, \n formatPython,\n formatBinary\n} from \"./formatters\";\n\n// Re-export types\nexport * from \"./types\";\n\n// ============================================\n// Plugin Definition\n// ============================================\n\nconst manifestDataExport: PluginManifest = {\n name: \"velo-plot-data-export\",\n version: \"1.0.0\",\n description: \"Advanced data export capabilities for velo-plot\",\n author: \"Sci Plot Team\",\n provides: [\"export\"],\n tags: [\"export\", \"csv\", \"json\", \"matlab\", \"python\", \"data\"],\n};\n\n/**\n * Sci Plot Data Export Plugin\n * \n * Provides comprehensive data export functionality with support for\n * multiple scientific and standard data formats.\n * \n * @param config - Plugin configuration options\n * @returns ChartPlugin instance\n */\nexport function PluginDataExport(\n config: PluginDataExportConfig = {}\n): ChartPlugin<PluginDataExportConfig> {\n \n const {\n formats = ['csv', 'tsv', 'json', 'matlab', 'python', 'xlsx', 'binary'],\n defaultFormat = 'csv',\n defaultPrecision = 6,\n includeMetadata = true,\n autoDownload = false,\n filenameGenerator,\n beforeExport,\n afterExport\n } = config;\n\n let _ctx: PluginContext | null = null;\n\n // ============================================\n // Internal Helpers\n // ============================================\n\n /**\n * Collect series data for export\n */\n function collectSeriesData(\n seriesIds?: string[],\n range?: ExportRange\n ): SeriesExportInfo[] {\n if (!_ctx) return [];\n\n const allSeries = _ctx.data.getAllSeries();\n const seriesToExport = seriesIds \n ? allSeries.filter(s => seriesIds.includes(s.getId()))\n : allSeries;\n\n return seriesToExport.map(s => {\n let data = s.getData();\n \n // Filter by range if specified\n if (range === 'visible' && data) {\n const bounds = _ctx!.data.getViewBounds();\n const filteredIndices: number[] = [];\n \n for (let i = 0; i < data.x.length; i++) {\n if (data.x[i] >= bounds.xMin && data.x[i] <= bounds.xMax) {\n filteredIndices.push(i);\n }\n }\n \n if (filteredIndices.length > 0 && filteredIndices.length < data.x.length) {\n const newX = new Float32Array(filteredIndices.length);\n const newY = new Float32Array(filteredIndices.length);\n \n filteredIndices.forEach((idx, i) => {\n newX[i] = data!.x[idx];\n newY[i] = data!.y[idx];\n });\n \n data = { ...data, x: newX, y: newY };\n }\n }\n\n return {\n id: s.getId(),\n name: s.getName?.() ?? s.getId(),\n type: s.getType(),\n data: data || { x: new Float32Array(0), y: new Float32Array(0) },\n pointCount: data?.x.length ?? 0,\n style: s.getStyle() as Record<string, unknown>,\n yAxisId: s.getYAxisId?.()\n };\n });\n }\n\n /**\n * Generate filename based on format and content\n */\n function generateFilename(format: ExportFormat, seriesIds: string[]): string {\n if (filenameGenerator) {\n return filenameGenerator(format, seriesIds);\n }\n \n const timestamp = new Date().toISOString().replace(/[:.]/g, '-').substring(0, 19);\n const seriesPart = seriesIds.length <= 3 \n ? seriesIds.join('_') \n : `${seriesIds.length}_series`;\n \n const config = FORMAT_CONFIGS[format];\n return `velo-plot_${seriesPart}_${timestamp}${config.extension}`;\n }\n\n /**\n * Execute export operation\n */\n function doExport(options: DataExportOptions): ExportResult {\n const format = options.format ?? defaultFormat;\n const warnings: string[] = [];\n\n // Validate format\n if (!formats.includes(format)) {\n return {\n success: false,\n error: `Format '${format}' is not enabled. Available: ${formats.join(', ')}`,\n contentType: 'text/plain',\n filename: 'error.txt',\n seriesCount: 0,\n pointCount: 0,\n timestamp: new Date().toISOString()\n };\n }\n\n // Apply beforeExport hook\n let finalOptions: DataExportOptions = { ...options, precision: options.precision ?? defaultPrecision };\n if (beforeExport) {\n const hookResult = beforeExport(finalOptions);\n if (hookResult === false) {\n return {\n success: false,\n error: 'Export cancelled by beforeExport hook',\n contentType: 'text/plain',\n filename: 'cancelled.txt',\n seriesCount: 0,\n pointCount: 0,\n timestamp: new Date().toISOString()\n };\n }\n finalOptions = hookResult;\n }\n\n // Collect data\n const seriesData = collectSeriesData(finalOptions.seriesIds, finalOptions.range);\n \n if (seriesData.length === 0) {\n warnings.push('No series data found to export');\n }\n\n const totalPoints = seriesData.reduce((sum, s) => sum + s.pointCount, 0);\n const formatConfig = FORMAT_CONFIGS[format];\n const filename = finalOptions.filename ?? generateFilename(format, seriesData.map(s => s.id));\n\n let content: string | undefined;\n let blob: Blob | undefined;\n\n try {\n // Format data\n switch (format) {\n case 'csv':\n case 'tsv':\n case 'xlsx':\n content = formatCSV(seriesData, { ...finalOptions, format });\n break;\n \n case 'json':\n content = formatJSON(\n seriesData, \n finalOptions,\n _ctx?.data.getViewBounds()\n );\n break;\n \n case 'matlab':\n content = formatMATLAB(seriesData, finalOptions);\n break;\n \n case 'python':\n content = formatPython(seriesData, finalOptions);\n break;\n \n case 'binary':\n const buffer = formatBinary(seriesData);\n blob = new Blob([buffer], { type: formatConfig.mimeType });\n break;\n }\n\n // Create blob for string content\n if (content && !blob) {\n blob = new Blob([content], { type: formatConfig.mimeType });\n }\n\n } catch (error) {\n return {\n success: false,\n error: `Export failed: ${(error as Error).message}`,\n contentType: 'text/plain',\n filename: 'error.txt',\n seriesCount: seriesData.length,\n pointCount: totalPoints,\n timestamp: new Date().toISOString()\n };\n }\n\n const result: ExportResult = {\n success: true,\n content,\n blob,\n contentType: formatConfig.mimeType,\n filename,\n seriesCount: seriesData.length,\n pointCount: totalPoints,\n timestamp: new Date().toISOString(),\n warnings: warnings.length > 0 ? warnings : undefined\n };\n\n // Apply afterExport hook\n if (afterExport) {\n afterExport(result);\n }\n\n return result;\n }\n\n /**\n * Download a blob as a file\n */\n function downloadBlob(blob: Blob, filename: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n }\n\n // ============================================\n // Plugin Implementation\n // ============================================\n\n const pluginApi: any = {\n /**\n * Export chart data to specified format\n * \n * @param format - Export format\n * @param options - Export options\n * @returns Export result with content/blob\n */\n export(format: ExportFormat, options: Partial<DataExportOptions> = {}): ExportResult {\n const fullOptions: DataExportOptions = {\n format,\n includeHeaders: true,\n includeTimestamp: true,\n includeMetadata,\n prettyPrint: true,\n ...options\n };\n\n const result = doExport(fullOptions);\n\n // Auto download if enabled and successful\n if (autoDownload && result.success && result.blob) {\n downloadBlob(result.blob, result.filename);\n }\n\n return result;\n },\n\n /**\n * Export and immediately download\n * \n * @param format - Export format\n * @param options - Export options\n */\n download(format: ExportFormat, options: Partial<DataExportOptions> = {}): ExportResult {\n const fullOptions: DataExportOptions = {\n format,\n includeHeaders: true,\n includeTimestamp: true,\n includeMetadata,\n prettyPrint: true,\n ...options\n };\n const result = doExport(fullOptions);\n \n if (result.success && result.blob) {\n downloadBlob(result.blob, result.filename);\n }\n \n return result;\n },\n\n /**\n * Export to CSV format\n */\n toCSV(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'csv', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Export to JSON format\n */\n toJSON(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'json', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Export to MATLAB format\n */\n toMATLAB(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'matlab', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Export to Python/NumPy format\n */\n toPython(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'python', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Export to Excel-compatible CSV\n */\n toExcel(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'xlsx', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Export to binary format\n */\n toBinary(options: Partial<DataExportOptions> = {}): ExportResult {\n return doExport({ format: 'binary', includeHeaders: true, includeTimestamp: true, includeMetadata, prettyPrint: true, ...options });\n },\n\n /**\n * Get available export formats\n */\n getFormats(): ExportFormat[] {\n return [...formats];\n },\n\n /**\n * Check if a format is supported\n */\n supportsFormat(format: ExportFormat): boolean {\n return formats.includes(format);\n },\n\n /**\n * Get format configuration\n */\n getFormatConfig(format: ExportFormat) {\n return FORMAT_CONFIGS[format];\n }\n };\n\n return {\n manifest: manifestDataExport,\n\n onInit(ctx: PluginContext) {\n _ctx = ctx;\n ctx.log.info(`DataExport plugin initialized with formats: ${formats.join(', ')}`);\n },\n\n onDestroy() {\n _ctx = null;\n },\n\n api: pluginApi\n };\n}\n\nexport default PluginDataExport;\n"],"names":["FORMAT_CONFIGS","formatCSV","seriesData","options","delimiter","lineEnding","includeHeaders","includeTimestamp","includeMetadata","metadata","precision","scientificThreshold","lines","bom","key","value","headers","s","prefix","maxLength","i","row","x","y","y2","yError","open","high","low","close","formatNumber","formatJSON","viewBounds","prettyPrint","exportData","sum","roundArray","formatMATLAB","matlabData","xData","yData","safeName","sanitizeVariableName","interleaveArrays","formatPython","pythonData","formatBinary","totalSize","nameBytes","buffer","view","encoder","offset","timestamp","pointCount","xFloat32","yFloat32","absValue","arr","factor","v","name","a","b","result","len","manifestDataExport","PluginDataExport","config","formats","defaultFormat","defaultPrecision","autoDownload","filenameGenerator","beforeExport","afterExport","_ctx","collectSeriesData","seriesIds","range","allSeries","_a","_b","data","bounds","filteredIndices","newX","newY","idx","generateFilename","format","seriesPart","doExport","warnings","finalOptions","hookResult","totalPoints","formatConfig","filename","content","blob","error","downloadBlob","url","link","ctx","fullOptions"],"mappings":"AAqBO,MAAMA,IAAqD;AAAA,EAChE,KAAK;AAAA,IACH,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,KAAK;AAAA,IACH,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,WAAW;A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eAAOyF,EAAS,EAAE,QAAQ,QAAQ,gBAAgB,IAAM,kBAAkB,IAAM,iBAAApF,GAAiB,aAAa,IAAM,GAAGL,GAAS;AAAA,MAClI;AAAA;AAAA;AAAA;AAAA,MAKA,SAASA,IAAsC,IAAkB;AAC/D,eAAOyF,EAAS,EAAE,QAAQ,UAAU,gBAAgB,IAAM,kBAAkB,IAAM,iBAAApF,GAAiB,aAAa,IAAM,GAAGL,GAAS;AAAA,MACpI;AAAA;AAAA;AAAA;AAAA,MAKA,SAASA,IAAsC,IAAkB;AAC/D,eAAOyF,EAAS,EAAE,QAAQ,UAAU,gBAAgB,IAAM,kBAAkB,IAAM,iBAAApF,GAAiB,aAAa,IAAM,GAAGL,GAAS;AAAA,MACpI;AAAA;AAAA;AAAA;AAAA,MAKA,QAAQA,IAAsC,IAAkB;AAC9D,eAAOyF,EAAS,EAAE,QAAQ,QAAQ,gBAAgB,IAAM,kBAAkB,IAAM,iBAAApF,GAAiB,aAAa,IAAM,GAAGL,GAAS;AAAA,MAClI;AAAA;AAAA;AAAA;AAAA,MAKA,SAASA,IAAsC,IAAkB;AAC/D,eAAOyF,EAAS,EAAE,QAAQ,UAAU,gBAAgB,IAAM,kBAAkB,IAAM,iBAAApF,GAAiB,aAAa,IAAM,GAAGL,GAAS;AAAA,MACpI;AAAA;AAAA;AAAA;AAAA,MAKA,aAA6B;AAC3B,eAAO,CAAC,GAAGkE,CAAO;AAAA,MACpB;AAAA;AAAA;AAAA;AAAA,MAKA,eAAeqB,GAA+B;AAC5C,eAAOrB,EAAQ,SAASqB,CAAM;AAAA,MAChC;AAAA;AAAA;AAAA;AAAA,MAKA,gBAAgBA,GAAsB;AACpC,eAAO1F,EAAe0F,CAAM;AAAA,MAC9B;AAAA,IAAA;AAAA,EAeK;AAET;"}
@@ -0,0 +1,6 @@
1
+ import { ChartPlugin } from '../types';
2
+ import { PluginDataTransformConfig } from './types';
3
+
4
+ export declare function PluginDataTransform(userConfig?: Partial<PluginDataTransformConfig>): ChartPlugin<PluginDataTransformConfig>;
5
+ export default PluginDataTransform;
6
+ export type { TransformType, TransformOp, PluginDataTransformConfig, DataTransformAPI } from './types';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * PluginDataTransform - Types
3
+ */
4
+ export type TransformType = 'normalize' | 'smooth' | 'resample' | 'derivative' | 'integral' | 'moving-average' | 'baseline-removal' | 'scale-offset' | 'decimate' | 'abs' | 'log' | 'power';
5
+ export interface TransformOp {
6
+ type: TransformType;
7
+ parameters?: Record<string, any>;
8
+ [key: string]: any;
9
+ }
10
+ export interface PluginDataTransformConfig {
11
+ /** Auto-apply transforms on data update */
12
+ autoApply?: boolean;
13
+ /** Whether to create a new series instead of modifying the existing one */
14
+ createDerivativeSeries?: boolean;
15
+ /** Default precision for calculations */
16
+ precision?: number;
17
+ }
18
+ export interface DataTransformAPI {
19
+ /**
20
+ * Apply a pipeline of transformations to a series
21
+ */
22
+ transform(seriesId: string, pipeline: TransformOp[]): Promise<void>;
23
+ /**
24
+ * Reset transformations for a series (restore original data)
25
+ */
26
+ resetTransform(seriesId: string): void;
27
+ /**
28
+ * Get the original data for a series
29
+ */
30
+ getOriginalData(seriesId: string): {
31
+ x: Float32Array;
32
+ y: Float32Array;
33
+ } | null;
34
+ }
@@ -0,0 +1,24 @@
1
+ import { ChartPlugin } from '../types';
2
+ import { DebugOverlay, DebugOverlayOptions } from '../../core/debug';
3
+ /**
4
+ * SciPlot Engine - Debug Overlay Plugin
5
+ *
6
+ * Provides performance metrics and debugging information.
7
+ *
8
+ * @module plugins/debug
9
+ */
10
+ export * from '../../core/debug';
11
+ export interface PluginDebugConfig extends Partial<DebugOverlayOptions> {
12
+ /** Show FPS counter */
13
+ showFPS?: boolean;
14
+ /** Show data stats */
15
+ showDataStats?: boolean;
16
+ }
17
+ /**
18
+ * SciPlot Debug Plugin
19
+ *
20
+ * Adds a useful overlay with real-time performance metrics and debugging info.
21
+ */
22
+ export declare function PluginDebug(config?: PluginDebugConfig): ChartPlugin<PluginDebugConfig>;
23
+ export { DebugOverlay };
24
+ export default PluginDebug;
@@ -0,0 +1,3 @@
1
+ export * from './debug/index'
2
+ import SciPlot from './debug/index'
3
+ export default SciPlot