blazeplot 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +11 -2
  2. package/dist/Chart-BW9JaHs6.js +2903 -0
  3. package/dist/Chart-BW9JaHs6.js.map +1 -0
  4. package/dist/OverlayUtils-Cw1o8UH-.js +35 -0
  5. package/dist/OverlayUtils-Cw1o8UH-.js.map +1 -0
  6. package/dist/core/SeriesStore.d.ts +9 -0
  7. package/dist/core/SeriesStore.d.ts.map +1 -1
  8. package/dist/core/UniformRingBuffer.d.ts +67 -0
  9. package/dist/core/UniformRingBuffer.d.ts.map +1 -0
  10. package/dist/core/index.d.ts +3 -1
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/core/types.d.ts +13 -1
  13. package/dist/core/types.d.ts.map +1 -1
  14. package/dist/index.d.ts +5 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +153 -2185
  17. package/dist/index.js.map +1 -1
  18. package/dist/interaction/AxisController.d.ts +45 -3
  19. package/dist/interaction/AxisController.d.ts.map +1 -1
  20. package/dist/interaction/index.d.ts +1 -0
  21. package/dist/interaction/index.d.ts.map +1 -1
  22. package/dist/linked.d.ts +3 -0
  23. package/dist/linked.d.ts.map +1 -0
  24. package/dist/linked.js +64 -0
  25. package/dist/linked.js.map +1 -0
  26. package/dist/plugins/annotations.d.ts +3 -0
  27. package/dist/plugins/annotations.d.ts.map +1 -0
  28. package/dist/plugins/annotations.js +163 -0
  29. package/dist/plugins/annotations.js.map +1 -0
  30. package/dist/plugins/crosshair.d.ts +3 -0
  31. package/dist/plugins/crosshair.d.ts.map +1 -0
  32. package/dist/plugins/crosshair.js +192 -0
  33. package/dist/plugins/crosshair.js.map +1 -0
  34. package/dist/plugins/interactions.js +87 -65
  35. package/dist/plugins/interactions.js.map +1 -1
  36. package/dist/plugins/navigator.d.ts +3 -0
  37. package/dist/plugins/navigator.d.ts.map +1 -0
  38. package/dist/plugins/navigator.js +147 -0
  39. package/dist/plugins/navigator.js.map +1 -0
  40. package/dist/plugins/selection.d.ts +3 -0
  41. package/dist/plugins/selection.d.ts.map +1 -0
  42. package/dist/plugins/selection.js +144 -0
  43. package/dist/plugins/selection.js.map +1 -0
  44. package/dist/plugins/tooltip.js +29 -45
  45. package/dist/plugins/tooltip.js.map +1 -1
  46. package/dist/react.d.ts +14 -0
  47. package/dist/react.d.ts.map +1 -0
  48. package/dist/react.js +30 -0
  49. package/dist/react.js.map +1 -0
  50. package/dist/render/ReglBackend.d.ts +1 -0
  51. package/dist/render/ReglBackend.d.ts.map +1 -1
  52. package/dist/render/Renderer.d.ts +1 -0
  53. package/dist/render/Renderer.d.ts.map +1 -1
  54. package/dist/render/types.d.ts +1 -0
  55. package/dist/render/types.d.ts.map +1 -1
  56. package/dist/ui/Annotations.d.ts +94 -0
  57. package/dist/ui/Annotations.d.ts.map +1 -0
  58. package/dist/ui/Chart.d.ts +83 -1
  59. package/dist/ui/Chart.d.ts.map +1 -1
  60. package/dist/ui/ChartLayout.d.ts +10 -0
  61. package/dist/ui/ChartLayout.d.ts.map +1 -1
  62. package/dist/ui/Crosshair.d.ts +60 -0
  63. package/dist/ui/Crosshair.d.ts.map +1 -0
  64. package/dist/ui/Interactions.d.ts.map +1 -1
  65. package/dist/ui/LinkedCharts.d.ts +23 -0
  66. package/dist/ui/LinkedCharts.d.ts.map +1 -0
  67. package/dist/ui/Navigator.d.ts +32 -0
  68. package/dist/ui/Navigator.d.ts.map +1 -0
  69. package/dist/ui/OverlayUtils.d.ts +17 -0
  70. package/dist/ui/OverlayUtils.d.ts.map +1 -0
  71. package/dist/ui/Selection.d.ts +64 -0
  72. package/dist/ui/Selection.d.ts.map +1 -0
  73. package/dist/ui/Tooltip.d.ts.map +1 -1
  74. package/dist/ui/theme.d.ts +12 -0
  75. package/dist/ui/theme.d.ts.map +1 -1
  76. package/package.json +35 -1
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  <img src="assets/blazeplot.png" alt="BlazePlot" width="720" />
3
3
  </p>
4
4
 
5
+ <noscript><a href="https://liberapay.com/cervelli/donate"><img src="https://img.shields.io/liberapay/patrons/cervelli.svg?logo=liberapay"></a></noscript>
5
6
  [![npm version](https://img.shields.io/npm/v/blazeplot.svg)](https://www.npmjs.com/package/blazeplot)
6
7
  [![npm downloads](https://img.shields.io/npm/dt/blazeplot.svg)](https://www.npmjs.com/package/blazeplot)
7
8
  [![license](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
@@ -158,18 +159,26 @@ import { Chart } from "blazeplot";
158
159
  import { interactionsPlugin } from "blazeplot/plugins/interactions";
159
160
  import { legendPlugin } from "blazeplot/plugins/legend";
160
161
  import { tooltipPlugin } from "blazeplot/plugins/tooltip";
162
+ import { annotationsPlugin } from "blazeplot/plugins/annotations";
161
163
 
162
164
  const chart = new Chart(container, {
163
165
  hover: { mode: "nearest-x", group: "x" },
164
166
  plugins: [
165
167
  interactionsPlugin({ axis: "xy" }),
168
+ annotationsPlugin({
169
+ annotations: [
170
+ { type: "y-line", y: 0, label: "baseline" },
171
+ { type: "x-range", xMin: 10, xMax: 20, label: "event" },
172
+ { type: "point", x: 42, y: 1.2, shape: "diamond", label: "marker" },
173
+ ],
174
+ }),
166
175
  legendPlugin(),
167
176
  tooltipPlugin({ mode: "nearest-point", group: "none", maxDistancePx: 24 }),
168
177
  ],
169
178
  });
170
179
  ```
171
180
 
172
- Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zoom, Shift+drag plot pan, wheel zoom, double-click reset, and `axis: "x" | "y" | "xy"`. When outside axes are visible, scrolling an axis zooms that axis and dragging an axis pans that axis; the plugin also applies a subtle axis hover color/filter configurable with `axisHover`, `axisHoverColor`, and `axisHoverFilter`. Legend/tooltip consume public APIs (`getSeriesState`, `setSeriesVisible`, `pick`, and `subscribe`) so custom UI can use the same contract. The default tooltip updates while the cursor is still on live charts and highlights the raw sample(s) it is reporting. For shared time-series tooltips, use `group: "x"`; for scatter/true point hover, use `group: "none"`.
181
+ Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zoom, Shift+drag plot pan, wheel zoom, double-click reset, and `axis: "x" | "y" | "xy"`. When outside axes are visible, scrolling an axis zooms that axis and dragging an axis pans that axis; the plugin also applies a subtle axis hover color/filter configurable with `axisHover`, `axisHoverColor`, and `axisHoverFilter`. `annotationsPlugin()` supports common plot annotations: vertical/horizontal lines, X/Y bands, boxes, point markers, and labels. Legend/tooltip consume public APIs (`getSeriesState`, `setSeriesVisible`, `pick`, and `subscribe`) so custom UI can use the same contract. The default tooltip updates while the cursor is still on live charts and highlights the raw sample(s) it is reporting. For shared time-series tooltips, use `group: "x"`; for scatter/true point hover, use `group: "none"`.
173
182
 
174
183
  ### `SeriesStore`
175
184
 
@@ -189,7 +198,7 @@ Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zo
189
198
  | `capacity` | Ring buffer capacity (samples). |
190
199
  | `id?` / `name?` | Optional metadata exposed to plugins, legend, and tooltip rows. |
191
200
  | `yAxis?` | `"left"` or `"right"`; selects the primary or secondary Y viewport/axis for this series. |
192
- | `downsample` | `"minmax"` or `"none"`. Min/max LOD applies to line and bar rendering; area/scatter skip LOD. |
201
+ | `downsample` | `"minmax"` or `"none"`. Min/max LOD applies to line/bar rendering. Scatter with LOD uses a 2D viewport-aware point sampler; scatter with `"none"` renders exact 2D-culled chunks. Area renders raw sampled strips. |
193
202
 
194
203
  ### `SeriesStyle`
195
204