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.
- package/CANVAS_PROXY.md +602 -0
- package/README.md +854 -0
- package/favicon.ico +0 -0
- package/index.html +14 -0
- package/index.js +21 -0
- package/original/paths.canvas2d/bars.js +252 -0
- package/original/paths.canvas2d/catmullRomCentrip.js +125 -0
- package/original/paths.canvas2d/linear.js +170 -0
- package/original/paths.canvas2d/monotoneCubic.js +68 -0
- package/original/paths.canvas2d/points.js +66 -0
- package/original/paths.canvas2d/spline.js +103 -0
- package/original/paths.canvas2d/stepped.js +124 -0
- package/original/paths.canvas2d/utils.js +301 -0
- package/original/uPlot.canvas2d.js +3548 -0
- package/package.json +110 -0
- package/paths/bars.js +253 -0
- package/paths/catmullRomCentrip.js +126 -0
- package/paths/linear.js +171 -0
- package/paths/monotoneCubic.js +69 -0
- package/paths/points.js +67 -0
- package/paths/spline.js +104 -0
- package/paths/stepped.js +125 -0
- package/paths/utils.js +301 -0
- package/scripts/uPlot.css +168 -0
- package/scripts/uPlot.d.ts +26 -0
- package/scripts/uPlot.js +3687 -0
- package/scripts/utils/dom.js +124 -0
- package/scripts/utils/domClasses.js +22 -0
- package/scripts/utils/feats.js +13 -0
- package/scripts/utils/fmtDate.js +398 -0
- package/scripts/utils/opts.js +844 -0
- package/scripts/utils/strings.js +22 -0
- package/scripts/utils/sync.js +27 -0
- package/scripts/utils/utils.js +692 -0
- package/scripts/webgpu/GPUPath.d.ts +46 -0
- package/scripts/webgpu/GPUPath.js +633 -0
- package/scripts/webgpu/GPUPath.ts +634 -0
- package/scripts/webgpu/WebGPURenderer.d.ts +176 -0
- package/scripts/webgpu/WebGPURenderer.js +4256 -0
- package/scripts/webgpu/WebGPURenderer.ts +4257 -0
- package/scripts/webgpu/browserSmokeHarness.js +105 -0
- package/scripts/webgpu/exporters.d.ts +8 -0
- package/scripts/webgpu/exporters.js +212 -0
- package/scripts/webgpu/shaders.d.ts +2 -0
- package/scripts/webgpu/shaders.js +76 -0
- package/scripts/webgpu/shaders.ts +77 -0
- package/scripts/webgpu/smokeTest.d.ts +2 -0
- package/scripts/webgpu/smokeTest.js +144 -0
- package/scripts/webgpu/webgpu-ambient.d.ts +41 -0
- 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;
|