@swiftplot/react 0.2.0 → 0.4.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.
- package/README.md +16 -15
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -60,20 +60,21 @@ chart.destroy();
|
|
|
60
60
|
|
|
61
61
|
- **Defaults:**
|
|
62
62
|
|
|
63
|
-
| Thing | Default | Override
|
|
64
|
-
| ------------------- | ------------------------------------------------------------------------- |
|
|
65
|
-
| Axis labels | the field's name; none for the row index, an accessor or several y fields | `xAxis.label`, `yAxis.label`
|
|
66
|
-
| Colours | `palette` in order, `paletteDark` on the dark theme | `colors`
|
|
67
|
-
| Tooltip | on; text in the y axis format, else two decimals at most | `tooltip: false`
|
|
68
|
-
| Legend | on with two or more series or named parts; a heatmap's strip of colours | `legend: false` or `legend()` options
|
|
69
|
-
| Zoom | off | `zoom: true` or `zoom()` options
|
|
70
|
-
| Animation |
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
| Several y on
|
|
75
|
-
|
|
|
76
|
-
|
|
|
63
|
+
| Thing | Default | Override |
|
|
64
|
+
| ------------------- | ------------------------------------------------------------------------- | --------------------------------------- |
|
|
65
|
+
| Axis labels | the field's name; none for the row index, an accessor or several y fields | `xAxis.label`, `yAxis.label` |
|
|
66
|
+
| Colours | `palette` in order, `paletteDark` on the dark theme | `colors` |
|
|
67
|
+
| Tooltip | on; text in the y axis format, else two decimals at most | `tooltip: false` |
|
|
68
|
+
| Legend | on with two or more series or named parts; a heatmap's strip of colours | `legend: false` or `legend()` options |
|
|
69
|
+
| Zoom | off | `zoom: true` or `zoom()` options |
|
|
70
|
+
| Animation | on: a reveal on the first paint, a move or a cross-fade on new data | `animate: false` or `animate()` options |
|
|
71
|
+
| Hover | everything else fades to 0.3 while one series or part is pointed at | `dim: false` or another opacity |
|
|
72
|
+
| Theme | follows the page | `theme: 'light' \| 'dark' \| Theme` |
|
|
73
|
+
| Size | follows the container | `width`, `height`, `margin` |
|
|
74
|
+
| Several y on areas | overlapping, half transparent | `stack: true` |
|
|
75
|
+
| Several y on bars | side by side | `stack: true` |
|
|
76
|
+
| Line and area shape | straight, with gaps | `curve`, `join` |
|
|
77
|
+
| Scatter radius | 4 px | `r`: a number or a field |
|
|
77
78
|
|
|
78
79
|
- **Marks added to a chart:** line, area, bar, scatter and combo charts take `rules` (`{ x }` or `{ y }`, with `text`, `dashed` and `color`), `zones` (`{ x: [from, to] }` or `{ y: [from, to] }`, with `text` and `color`) and `brush` (`true` or `{ axes }`; with `zoom` its release shows the range), whose range goes to `onBrush`. `errorBars: { low, high, cap, width }` on line, bar and scatter charts names two fields that are values on the y axis, not distances from y, for a chart of one unstacked `y`. A line takes `fill` (`true` or a gradient) and a scatter `alpha`, `ring` and `shape: 'tick'`.
|
|
79
80
|
- **Stacking** counts a missing value as zero, so a stacked area has no gap where an unstacked one would. Long series are stacked over the union of their x values.
|
|
@@ -225,7 +226,7 @@ chart.destroy();
|
|
|
225
226
|
|
|
226
227
|
## Why it is fast
|
|
227
228
|
|
|
228
|
-
Each point comes from profiling uPlot, the fastest of thirteen libraries in [chart-bench](https://github.com/gusevp/chart-bench), and timing the alternative
|
|
229
|
+
Each point comes from profiling uPlot, the fastest of thirteen libraries in [chart-bench](https://github.com/gusevp/chart-bench), and timing the alternative.
|
|
229
230
|
|
|
230
231
|
- **Axis text is DOM, not canvas text.** uPlot's axis drawing cost 17–21 ms at 4× CPU slowdown at every data size.
|
|
231
232
|
- **Each mark has its own x column.** No aligned table, so no join step.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftplot/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "React components for swiftplot charts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.3 || ^19",
|
|
24
|
-
"swiftplot": "^0.
|
|
24
|
+
"swiftplot": "^0.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24.19.2",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"react-dom": "^19.3.1",
|
|
34
34
|
"typescript": "^7.0.2",
|
|
35
35
|
"vitest": "^5.1.1",
|
|
36
|
-
"swiftplot": "0.
|
|
36
|
+
"swiftplot": "0.4.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -p tsconfig.build.json",
|