uplot-webgpu 0.1.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 (50) hide show
  1. package/CANVAS_PROXY.md +602 -0
  2. package/README.md +854 -0
  3. package/favicon.ico +0 -0
  4. package/index.html +14 -0
  5. package/index.js +21 -0
  6. package/original/paths.canvas2d/bars.js +252 -0
  7. package/original/paths.canvas2d/catmullRomCentrip.js +125 -0
  8. package/original/paths.canvas2d/linear.js +170 -0
  9. package/original/paths.canvas2d/monotoneCubic.js +68 -0
  10. package/original/paths.canvas2d/points.js +66 -0
  11. package/original/paths.canvas2d/spline.js +103 -0
  12. package/original/paths.canvas2d/stepped.js +124 -0
  13. package/original/paths.canvas2d/utils.js +301 -0
  14. package/original/uPlot.canvas2d.js +3548 -0
  15. package/package.json +110 -0
  16. package/paths/bars.js +253 -0
  17. package/paths/catmullRomCentrip.js +126 -0
  18. package/paths/linear.js +171 -0
  19. package/paths/monotoneCubic.js +69 -0
  20. package/paths/points.js +67 -0
  21. package/paths/spline.js +104 -0
  22. package/paths/stepped.js +125 -0
  23. package/paths/utils.js +301 -0
  24. package/scripts/uPlot.css +168 -0
  25. package/scripts/uPlot.d.ts +26 -0
  26. package/scripts/uPlot.js +3687 -0
  27. package/scripts/utils/dom.js +124 -0
  28. package/scripts/utils/domClasses.js +22 -0
  29. package/scripts/utils/feats.js +13 -0
  30. package/scripts/utils/fmtDate.js +398 -0
  31. package/scripts/utils/opts.js +844 -0
  32. package/scripts/utils/strings.js +22 -0
  33. package/scripts/utils/sync.js +27 -0
  34. package/scripts/utils/utils.js +692 -0
  35. package/scripts/webgpu/GPUPath.d.ts +46 -0
  36. package/scripts/webgpu/GPUPath.js +633 -0
  37. package/scripts/webgpu/GPUPath.ts +634 -0
  38. package/scripts/webgpu/WebGPURenderer.d.ts +176 -0
  39. package/scripts/webgpu/WebGPURenderer.js +4256 -0
  40. package/scripts/webgpu/WebGPURenderer.ts +4257 -0
  41. package/scripts/webgpu/browserSmokeHarness.js +105 -0
  42. package/scripts/webgpu/exporters.d.ts +8 -0
  43. package/scripts/webgpu/exporters.js +212 -0
  44. package/scripts/webgpu/shaders.d.ts +2 -0
  45. package/scripts/webgpu/shaders.js +76 -0
  46. package/scripts/webgpu/shaders.ts +77 -0
  47. package/scripts/webgpu/smokeTest.d.ts +2 -0
  48. package/scripts/webgpu/smokeTest.js +144 -0
  49. package/scripts/webgpu/webgpu-ambient.d.ts +41 -0
  50. package/tinybuild.config.js +109 -0
@@ -0,0 +1,168 @@
1
+ :root {
2
+ color-scheme: only light;
3
+ }
4
+
5
+ html,
6
+ body,
7
+ .uplot,
8
+ .uplot *,
9
+ .uplot *::before,
10
+ .uplot *::after {
11
+ forced-color-adjust: none;
12
+ }
13
+
14
+ .uplot,
15
+ .uplot *,
16
+ .uplot *::before,
17
+ .uplot *::after {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ .uplot {
22
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
23
+ line-height: 1.5;
24
+ width: min-content;
25
+ }
26
+
27
+ .u-title {
28
+ text-align: center;
29
+ font-size: 18px;
30
+ font-weight: bold;
31
+ }
32
+
33
+ .u-wrap {
34
+ position: relative;
35
+ user-select: none;
36
+ }
37
+
38
+ .u-over,
39
+ .u-under {
40
+ position: absolute;
41
+ }
42
+
43
+ .u-under {
44
+ overflow: hidden;
45
+ }
46
+
47
+ .uplot canvas {
48
+ display: block;
49
+ position: relative;
50
+ width: 100%;
51
+ height: 100%;
52
+ }
53
+
54
+ .u-axis {
55
+ position: absolute;
56
+ }
57
+
58
+ .u-legend {
59
+ font-size: 14px;
60
+ margin: auto;
61
+ text-align: center;
62
+ }
63
+
64
+ .u-inline {
65
+ display: block;
66
+ }
67
+
68
+ .u-inline * {
69
+ display: inline-block;
70
+ }
71
+
72
+ .u-inline tr {
73
+ margin-right: 16px;
74
+ }
75
+
76
+ .u-legend th {
77
+ font-weight: 600;
78
+ }
79
+
80
+ .u-legend th > * {
81
+ vertical-align: middle;
82
+ display: inline-block;
83
+ }
84
+
85
+ .u-legend .u-marker {
86
+ width: 1em;
87
+ height: 1em;
88
+ margin-right: 4px;
89
+ background-clip: padding-box !important;
90
+ }
91
+
92
+ .u-inline.u-live th::after {
93
+ content: ":";
94
+ vertical-align: middle;
95
+ }
96
+
97
+ .u-inline:not(.u-live) .u-value {
98
+ display: none;
99
+ }
100
+
101
+ .u-series > * {
102
+ padding: 4px;
103
+ }
104
+
105
+ .u-series th {
106
+ cursor: pointer;
107
+ }
108
+
109
+ .u-legend .u-off > * {
110
+ opacity: 0.3;
111
+ }
112
+
113
+ .u-select {
114
+ background: rgba(0,0,0,0.07);
115
+ position: absolute;
116
+ pointer-events: none;
117
+ }
118
+
119
+ .u-cursor-x,
120
+ .u-cursor-y {
121
+ position: absolute;
122
+ left: 0;
123
+ top: 0;
124
+ pointer-events: none;
125
+ will-change: transform;
126
+ }
127
+
128
+ .u-hz .u-cursor-x,
129
+ .u-vt .u-cursor-y {
130
+ height: 100%;
131
+ border-right: 1px dashed #607D8B;
132
+ }
133
+
134
+ .u-hz .u-cursor-y,
135
+ .u-vt .u-cursor-x {
136
+ width: 100%;
137
+ border-bottom: 1px dashed #607D8B;
138
+ }
139
+
140
+ .u-cursor-pt {
141
+ position: absolute;
142
+ top: 0;
143
+ left: 0;
144
+ border-radius: 50%;
145
+ border: 0 solid;
146
+ pointer-events: none;
147
+ will-change: transform;
148
+ /* this has to be !important since we set inline "background" shorthand */
149
+ background-clip: padding-box !important;
150
+ }
151
+
152
+ .u-axis.u-off,
153
+ .u-select.u-off,
154
+ .u-cursor-x.u-off,
155
+ .u-cursor-y.u-off,
156
+ .u-cursor-pt.u-off {
157
+ display: none;
158
+ }
159
+ .u-webgpu-text {
160
+ position: absolute;
161
+ inset: 0;
162
+ pointer-events: none;
163
+ overflow: hidden;
164
+ }
165
+
166
+ .u-over {
167
+ z-index: 2;
168
+ }
@@ -0,0 +1,26 @@
1
+ export interface UPlotLike {
2
+ root: HTMLElement;
3
+ ctx?: unknown;
4
+ series: unknown[];
5
+ scales: Record<string, unknown>;
6
+ destroy(): void;
7
+ setData(data: unknown[], resetScales?: boolean): void;
8
+ setSize(size: {width: number; height: number}): void;
9
+ redraw(rebuildPaths?: boolean, recalcAxes?: boolean): void;
10
+ setScale(key: string, range: {min?: number; max?: number}): void;
11
+ setSelect(select: {left: number; top: number; width: number; height: number}, fireHook?: boolean): void;
12
+ addSeries(series: unknown, index?: number): void;
13
+ delSeries(index: number): void;
14
+ }
15
+
16
+ export interface UPlotConstructor {
17
+ new (opts: unknown, data: unknown[], then?: HTMLElement | ((u: UPlotLike) => void)): UPlotLike;
18
+ configure?(opts: Record<string, unknown>): UPlotConstructor;
19
+ destroyDetached?(): number;
20
+ destroyAll?(): number;
21
+ getLivePlots?(): UPlotLike[];
22
+ [key: string]: unknown;
23
+ }
24
+
25
+ declare const uPlot: UPlotConstructor;
26
+ export default uPlot;