@deck.gl-community/timeline-layers 9.2.5 → 9.3.0-beta.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.
- package/README.md +2 -0
- package/package.json +9 -9
- package/src/index.ts +42 -0
- package/src/layers/timeline-layer/timeline-collision.ts +51 -0
- package/src/layers/timeline-layer/timeline-layer.ts +868 -0
- package/src/layers/timeline-layer/timeline-layout.ts +80 -0
- package/src/layers/timeline-layer/timeline-types.ts +146 -0
- package/src/layers/timeline-layer/timeline-utils.ts +85 -0
- package/dist/index.cjs +0 -538
- package/dist/index.cjs.map +0 -7
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer-uniforms.d.ts +0 -23
- package/dist/layers/horizon-graph-layer/horizon-graph-layer-uniforms.d.ts.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer-uniforms.js +0 -33
- package/dist/layers/horizon-graph-layer/horizon-graph-layer-uniforms.js.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.d.ts +0 -38
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.d.ts.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.fs.d.ts +0 -3
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.fs.d.ts.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.fs.js +0 -53
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.fs.js.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.js +0 -138
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.js.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.vs.d.ts +0 -3
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.vs.d.ts.map +0 -1
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.vs.js +0 -24
- package/dist/layers/horizon-graph-layer/horizon-graph-layer.vs.js.map +0 -1
- package/dist/layers/horizon-graph-layer/multi-horizon-graph-layer.d.ts +0 -23
- package/dist/layers/horizon-graph-layer/multi-horizon-graph-layer.d.ts.map +0 -1
- package/dist/layers/horizon-graph-layer/multi-horizon-graph-layer.js +0 -100
- package/dist/layers/horizon-graph-layer/multi-horizon-graph-layer.js.map +0 -1
- package/dist/layers/time-axis-layer.d.ts +0 -56
- package/dist/layers/time-axis-layer.d.ts.map +0 -1
- package/dist/layers/time-axis-layer.js +0 -78
- package/dist/layers/time-axis-layer.js.map +0 -1
- package/dist/layers/vertical-grid-layer.d.ts +0 -41
- package/dist/layers/vertical-grid-layer.d.ts.map +0 -1
- package/dist/layers/vertical-grid-layer.js +0 -43
- package/dist/layers/vertical-grid-layer.js.map +0 -1
- package/dist/utils/format-utils.d.ts +0 -7
- package/dist/utils/format-utils.d.ts.map +0 -1
- package/dist/utils/format-utils.js +0 -75
- package/dist/utils/format-utils.js.map +0 -1
- package/dist/utils/tick-utils.d.ts +0 -10
- package/dist/utils/tick-utils.d.ts.map +0 -1
- package/dist/utils/tick-utils.js +0 -32
- package/dist/utils/tick-utils.js.map +0 -1
package/dist/index.cjs
DELETED
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __publicField = (obj, key, value) => {
|
|
20
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// dist/index.js
|
|
25
|
-
var dist_exports = {};
|
|
26
|
-
__export(dist_exports, {
|
|
27
|
-
HorizonGraphLayer: () => HorizonGraphLayer,
|
|
28
|
-
MultiHorizonGraphLayer: () => MultiHorizonGraphLayer,
|
|
29
|
-
TimeAxisLayer: () => TimeAxisLayer,
|
|
30
|
-
VerticalGridLayer: () => VerticalGridLayer,
|
|
31
|
-
formatTimeMs: () => formatTimeMs,
|
|
32
|
-
formatTimeRangeMs: () => formatTimeRangeMs
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(dist_exports);
|
|
35
|
-
|
|
36
|
-
// dist/layers/horizon-graph-layer/horizon-graph-layer.js
|
|
37
|
-
var import_core = require("@deck.gl/core");
|
|
38
|
-
var import_engine = require("@luma.gl/engine");
|
|
39
|
-
|
|
40
|
-
// dist/layers/horizon-graph-layer/horizon-graph-layer.vs.js
|
|
41
|
-
var horizon_graph_layer_vs_default = `#version 300 es
|
|
42
|
-
#define SHADER_NAME horizon-graph-layer-vertex-shader
|
|
43
|
-
|
|
44
|
-
in vec3 positions;
|
|
45
|
-
in vec2 uv;
|
|
46
|
-
|
|
47
|
-
out vec2 v_uv;
|
|
48
|
-
|
|
49
|
-
void main(void) {
|
|
50
|
-
geometry.worldPosition = positions;
|
|
51
|
-
|
|
52
|
-
vec4 position_commonspace = project_position(vec4(positions.xy, 0.0, 1.0));
|
|
53
|
-
gl_Position = project_common_position_to_clipspace(position_commonspace);
|
|
54
|
-
geometry.position = position_commonspace;
|
|
55
|
-
|
|
56
|
-
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
57
|
-
|
|
58
|
-
v_uv = uv;
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
// dist/layers/horizon-graph-layer/horizon-graph-layer.fs.js
|
|
63
|
-
var horizon_graph_layer_fs_default = `#version 300 es
|
|
64
|
-
#define SHADER_NAME horizon-graph-layer-fragment-shader
|
|
65
|
-
|
|
66
|
-
precision highp float;
|
|
67
|
-
precision highp int;
|
|
68
|
-
|
|
69
|
-
/******* UNIFORM *******/
|
|
70
|
-
|
|
71
|
-
uniform sampler2D dataTexture;
|
|
72
|
-
|
|
73
|
-
/******* IN *******/
|
|
74
|
-
|
|
75
|
-
in vec2 v_uv;
|
|
76
|
-
|
|
77
|
-
/******* OUT *******/
|
|
78
|
-
|
|
79
|
-
out vec4 fragColor;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/******* MAIN *******/
|
|
83
|
-
|
|
84
|
-
void main(void) {
|
|
85
|
-
// horizontal position to sample index
|
|
86
|
-
float idx = v_uv.x * horizonLayer.dataTextureCount;
|
|
87
|
-
// idx = clamp(idx, 0.0, horizonLayer.dataTextureCount - 1.0); // NEEDED???
|
|
88
|
-
|
|
89
|
-
// fetch single data point & normalize (-1,+1)
|
|
90
|
-
float fy = floor(idx * horizonLayer.dataTextureSizeInv);
|
|
91
|
-
float fx = idx - fy * horizonLayer.dataTextureSize;
|
|
92
|
-
float val = texelFetch(dataTexture, ivec2(int(fx), int(fy)), 0).r;
|
|
93
|
-
val *= horizonLayer.yAxisScaleInv;
|
|
94
|
-
|
|
95
|
-
// band layering
|
|
96
|
-
float fband = abs(val) * horizonLayer.bands;
|
|
97
|
-
float bandIdx = clamp(floor(fband), 0.0, horizonLayer.bands - 1.0);
|
|
98
|
-
float bandFrac = fract(fband);
|
|
99
|
-
|
|
100
|
-
// calc our position value and find out color (using mix+step instead of if...else)
|
|
101
|
-
float positive = step(0.0, val); // 1 if pos, else 0
|
|
102
|
-
vec3 baseCol = mix(horizonLayer.negativeColor, horizonLayer.positiveColor, positive);
|
|
103
|
-
float curPos = mix(v_uv.y, 1.0 - v_uv.y, positive);
|
|
104
|
-
float addOne = step(curPos, bandFrac);
|
|
105
|
-
|
|
106
|
-
float band = bandIdx + addOne;
|
|
107
|
-
float whiten = 1.0 - band * horizonLayer.bandsInv;
|
|
108
|
-
|
|
109
|
-
fragColor = vec4(mix(baseCol, vec3(1.0), whiten), 1.0);
|
|
110
|
-
}
|
|
111
|
-
`;
|
|
112
|
-
|
|
113
|
-
// dist/layers/horizon-graph-layer/horizon-graph-layer-uniforms.js
|
|
114
|
-
var uniformBlock = `layout(std140) uniform horizonLayerUniforms {
|
|
115
|
-
float dataTextureSize; // width = height of the POT texture
|
|
116
|
-
float dataTextureSizeInv;
|
|
117
|
-
float dataTextureCount; // actual number of data points
|
|
118
|
-
|
|
119
|
-
float bands;
|
|
120
|
-
float bandsInv;
|
|
121
|
-
float yAxisScaleInv;
|
|
122
|
-
|
|
123
|
-
vec3 positiveColor;
|
|
124
|
-
vec3 negativeColor;
|
|
125
|
-
} horizonLayer;
|
|
126
|
-
`;
|
|
127
|
-
var horizonLayerUniforms = {
|
|
128
|
-
name: "horizonLayer",
|
|
129
|
-
vs: uniformBlock,
|
|
130
|
-
fs: uniformBlock,
|
|
131
|
-
uniformTypes: {
|
|
132
|
-
dataTextureSize: "f32",
|
|
133
|
-
dataTextureSizeInv: "f32",
|
|
134
|
-
dataTextureCount: "f32",
|
|
135
|
-
bands: "f32",
|
|
136
|
-
bandsInv: "f32",
|
|
137
|
-
yAxisScaleInv: "f32",
|
|
138
|
-
positiveColor: "vec3<f32>",
|
|
139
|
-
negativeColor: "vec3<f32>"
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// dist/layers/horizon-graph-layer/horizon-graph-layer.js
|
|
144
|
-
var defaultProps = {
|
|
145
|
-
yAxisScale: { type: "number", value: 1e3 },
|
|
146
|
-
bands: { type: "number", value: 2 },
|
|
147
|
-
positiveColor: { type: "color", value: [0, 128, 0] },
|
|
148
|
-
negativeColor: { type: "color", value: [0, 0, 255] },
|
|
149
|
-
x: { type: "number", value: 0 },
|
|
150
|
-
y: { type: "number", value: 0 },
|
|
151
|
-
width: { type: "number", value: 800 },
|
|
152
|
-
height: { type: "number", value: 300 }
|
|
153
|
-
};
|
|
154
|
-
var HorizonGraphLayer = class extends import_core.Layer {
|
|
155
|
-
state = {};
|
|
156
|
-
initializeState() {
|
|
157
|
-
this.state = {};
|
|
158
|
-
}
|
|
159
|
-
getShaders() {
|
|
160
|
-
return super.getShaders({
|
|
161
|
-
vs: horizon_graph_layer_vs_default,
|
|
162
|
-
fs: horizon_graph_layer_fs_default,
|
|
163
|
-
modules: [import_core.project32, horizonLayerUniforms]
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
_createDataTexture(seriesData) {
|
|
167
|
-
const _data = seriesData instanceof Float32Array ? seriesData : new Float32Array(seriesData);
|
|
168
|
-
const { device } = this.context;
|
|
169
|
-
const count = _data.length;
|
|
170
|
-
let dataTextureSize = 32;
|
|
171
|
-
while (count > dataTextureSize * dataTextureSize) {
|
|
172
|
-
dataTextureSize *= 2;
|
|
173
|
-
}
|
|
174
|
-
const data = new Float32Array(dataTextureSize * dataTextureSize);
|
|
175
|
-
data.set(_data, 0);
|
|
176
|
-
return {
|
|
177
|
-
dataTexture: device.createTexture({
|
|
178
|
-
data,
|
|
179
|
-
format: "r32float",
|
|
180
|
-
dimension: "2d",
|
|
181
|
-
width: dataTextureSize,
|
|
182
|
-
height: dataTextureSize,
|
|
183
|
-
sampler: {
|
|
184
|
-
minFilter: "nearest",
|
|
185
|
-
magFilter: "nearest",
|
|
186
|
-
addressModeU: "clamp-to-edge",
|
|
187
|
-
addressModeV: "clamp-to-edge"
|
|
188
|
-
}
|
|
189
|
-
}),
|
|
190
|
-
dataTextureSize,
|
|
191
|
-
dataTextureCount: count
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
_createModel() {
|
|
195
|
-
const { x, y, width, height } = this.props;
|
|
196
|
-
const positions = [
|
|
197
|
-
x,
|
|
198
|
-
y,
|
|
199
|
-
0,
|
|
200
|
-
x + width,
|
|
201
|
-
y,
|
|
202
|
-
0,
|
|
203
|
-
x,
|
|
204
|
-
y + height,
|
|
205
|
-
0,
|
|
206
|
-
x + width,
|
|
207
|
-
y + height,
|
|
208
|
-
0
|
|
209
|
-
];
|
|
210
|
-
const uv = [0, 0, 1, 0, 0, 1, 1, 1];
|
|
211
|
-
const geometry = new import_engine.Geometry({
|
|
212
|
-
topology: "triangle-strip",
|
|
213
|
-
attributes: {
|
|
214
|
-
positions: { value: new Float32Array(positions), size: 3 },
|
|
215
|
-
uv: { value: new Float32Array(uv), size: 2 }
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
return new import_engine.Model(this.context.device, {
|
|
219
|
-
...this.getShaders(),
|
|
220
|
-
geometry,
|
|
221
|
-
bufferLayout: this.getAttributeManager().getBufferLayouts()
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
updateState(params) {
|
|
225
|
-
var _a, _b;
|
|
226
|
-
super.updateState(params);
|
|
227
|
-
const { changeFlags } = params;
|
|
228
|
-
if (changeFlags.dataChanged) {
|
|
229
|
-
(_a = this.state.dataTexture) == null ? void 0 : _a.destroy();
|
|
230
|
-
this.setState(this._createDataTexture(this.props.data));
|
|
231
|
-
}
|
|
232
|
-
if (changeFlags.extensionsChanged || changeFlags.propsChanged) {
|
|
233
|
-
(_b = this.state.model) == null ? void 0 : _b.destroy();
|
|
234
|
-
this.setState({ model: this._createModel() });
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
draw() {
|
|
238
|
-
const { model, dataTexture } = this.state;
|
|
239
|
-
if (!model) {
|
|
240
|
-
this.setState({ model: this._createModel() });
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (!dataTexture) {
|
|
244
|
-
this.setState(this._createDataTexture(this.props.data));
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const { bands, yAxisScale, positiveColor, negativeColor } = this.props;
|
|
248
|
-
model.shaderInputs.setProps({
|
|
249
|
-
horizonLayer: {
|
|
250
|
-
dataTexture: this.state.dataTexture,
|
|
251
|
-
dataTextureSize: this.state.dataTextureSize,
|
|
252
|
-
dataTextureSizeInv: 1 / this.state.dataTextureSize,
|
|
253
|
-
dataTextureCount: this.state.dataTextureCount,
|
|
254
|
-
bands,
|
|
255
|
-
bandsInv: 1 / bands,
|
|
256
|
-
yAxisScaleInv: 1 / yAxisScale,
|
|
257
|
-
positiveColor: positiveColor.map((c) => c / 255),
|
|
258
|
-
negativeColor: negativeColor.map((c) => c / 255)
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
model.draw(this.context.renderPass);
|
|
262
|
-
}
|
|
263
|
-
finalizeState(context) {
|
|
264
|
-
var _a, _b;
|
|
265
|
-
(_a = this.state.model) == null ? void 0 : _a.destroy();
|
|
266
|
-
(_b = this.state.dataTexture) == null ? void 0 : _b.destroy();
|
|
267
|
-
super.finalizeState(context);
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
__publicField(HorizonGraphLayer, "layerName", "HorizonGraphLayer");
|
|
271
|
-
__publicField(HorizonGraphLayer, "defaultProps", defaultProps);
|
|
272
|
-
|
|
273
|
-
// dist/layers/horizon-graph-layer/multi-horizon-graph-layer.js
|
|
274
|
-
var import_core2 = require("@deck.gl/core");
|
|
275
|
-
var import_layers = require("@deck.gl/layers");
|
|
276
|
-
var defaultProps2 = {
|
|
277
|
-
getSeries: { type: "accessor", value: (series) => series.values },
|
|
278
|
-
getScale: { type: "accessor", value: (series) => series.scale },
|
|
279
|
-
bands: { type: "number", value: 2 },
|
|
280
|
-
positiveColor: { type: "color", value: [0, 128, 0] },
|
|
281
|
-
negativeColor: { type: "color", value: [0, 0, 255] },
|
|
282
|
-
dividerColor: { type: "color", value: [0, 0, 0] },
|
|
283
|
-
dividerWidth: { type: "number", value: 2 },
|
|
284
|
-
x: { type: "number", value: 0 },
|
|
285
|
-
y: { type: "number", value: 0 },
|
|
286
|
-
width: { type: "number", value: 800 },
|
|
287
|
-
height: { type: "number", value: 300 }
|
|
288
|
-
};
|
|
289
|
-
var MultiHorizonGraphLayer = class extends import_core2.CompositeLayer {
|
|
290
|
-
renderLayers() {
|
|
291
|
-
const { data, getSeries, getScale, bands, positiveColor, negativeColor, dividerColor, dividerWidth, x, y, width, height } = this.props;
|
|
292
|
-
const seriesCount = data.length;
|
|
293
|
-
if (!seriesCount) {
|
|
294
|
-
return [];
|
|
295
|
-
}
|
|
296
|
-
const totalDividerSpace = dividerWidth * (seriesCount + 1);
|
|
297
|
-
const availableHeight = height - totalDividerSpace;
|
|
298
|
-
const seriesHeight = availableHeight / seriesCount;
|
|
299
|
-
const layers = [];
|
|
300
|
-
if (dividerWidth > 0) {
|
|
301
|
-
const dividerData = [];
|
|
302
|
-
dividerData.push({
|
|
303
|
-
polygon: [
|
|
304
|
-
[x, y],
|
|
305
|
-
[x + width, y],
|
|
306
|
-
[x + width, y + dividerWidth],
|
|
307
|
-
[x, y + dividerWidth]
|
|
308
|
-
]
|
|
309
|
-
});
|
|
310
|
-
for (let i = 0; i < seriesCount - 1; i++) {
|
|
311
|
-
const dividerY = y + dividerWidth + (i + 1) * seriesHeight + i * dividerWidth;
|
|
312
|
-
dividerData.push({
|
|
313
|
-
polygon: [
|
|
314
|
-
[x, dividerY],
|
|
315
|
-
[x + width, dividerY],
|
|
316
|
-
[x + width, dividerY + dividerWidth],
|
|
317
|
-
[x, dividerY + dividerWidth]
|
|
318
|
-
]
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
const bottomDividerY = y + height - dividerWidth;
|
|
322
|
-
dividerData.push({
|
|
323
|
-
polygon: [
|
|
324
|
-
[x, bottomDividerY],
|
|
325
|
-
[x + width, bottomDividerY],
|
|
326
|
-
[x + width, y + height],
|
|
327
|
-
[x, y + height]
|
|
328
|
-
]
|
|
329
|
-
});
|
|
330
|
-
layers.push(new import_layers.SolidPolygonLayer({
|
|
331
|
-
id: `${this.props.id}-dividers`,
|
|
332
|
-
data: dividerData,
|
|
333
|
-
getPolygon: (d) => d.polygon,
|
|
334
|
-
getFillColor: dividerColor,
|
|
335
|
-
pickable: false
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
data.forEach((series, index) => {
|
|
339
|
-
const seriesData = getSeries(series);
|
|
340
|
-
if (!seriesData || seriesData.length === 0) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
const seriesY = y + dividerWidth + index * (seriesHeight + dividerWidth);
|
|
344
|
-
const yAxisScale = getScale(series);
|
|
345
|
-
layers.push(new HorizonGraphLayer({
|
|
346
|
-
id: `${this.props.id}-series-${index}`,
|
|
347
|
-
data: seriesData,
|
|
348
|
-
yAxisScale,
|
|
349
|
-
bands,
|
|
350
|
-
positiveColor,
|
|
351
|
-
negativeColor,
|
|
352
|
-
x,
|
|
353
|
-
y: seriesY,
|
|
354
|
-
width,
|
|
355
|
-
height: seriesHeight
|
|
356
|
-
}));
|
|
357
|
-
});
|
|
358
|
-
return layers;
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
__publicField(MultiHorizonGraphLayer, "layerName", "MultiHorizonGraphLayer");
|
|
362
|
-
__publicField(MultiHorizonGraphLayer, "defaultProps", defaultProps2);
|
|
363
|
-
|
|
364
|
-
// dist/layers/time-axis-layer.js
|
|
365
|
-
var import_core3 = require("@deck.gl/core");
|
|
366
|
-
var import_layers2 = require("@deck.gl/layers");
|
|
367
|
-
|
|
368
|
-
// dist/utils/format-utils.js
|
|
369
|
-
function formatTimeMs(timeMs, space = true) {
|
|
370
|
-
const sep = space ? " " : "";
|
|
371
|
-
const us = timeMs * 1e3;
|
|
372
|
-
if (us === 0) {
|
|
373
|
-
return "0s";
|
|
374
|
-
}
|
|
375
|
-
if (Math.abs(us) < 1e3) {
|
|
376
|
-
return `${floatToStr(us)}${sep}\xB5s`;
|
|
377
|
-
}
|
|
378
|
-
const ms = us / 1e3;
|
|
379
|
-
if (Math.abs(ms) < 1e3) {
|
|
380
|
-
return `${floatToStr(ms)}${sep} ms`;
|
|
381
|
-
}
|
|
382
|
-
const s = ms / 1e3;
|
|
383
|
-
if (Math.abs(s) < 60) {
|
|
384
|
-
return `${floatToStr(s)}${sep} s`;
|
|
385
|
-
}
|
|
386
|
-
const m = s / 60;
|
|
387
|
-
if (Math.abs(m) < 60) {
|
|
388
|
-
return `${floatToStr(m)}${sep} min`;
|
|
389
|
-
}
|
|
390
|
-
const h = m / 60;
|
|
391
|
-
if (Math.abs(h) < 24) {
|
|
392
|
-
return `${floatToStr(h)}${sep} hrs`;
|
|
393
|
-
}
|
|
394
|
-
const d = h / 24;
|
|
395
|
-
return `${floatToStr(d)}${sep} days`;
|
|
396
|
-
}
|
|
397
|
-
function formatTimeRangeMs(startMs, endMs) {
|
|
398
|
-
return `${formatTimeMs(startMs)} - ${formatTimeMs(endMs)}`;
|
|
399
|
-
}
|
|
400
|
-
function floatToStr(f, roundDigits = 5) {
|
|
401
|
-
if (Number.isInteger(f)) {
|
|
402
|
-
return f.toString();
|
|
403
|
-
}
|
|
404
|
-
for (let i = 1; i < roundDigits - 1; i++) {
|
|
405
|
-
const rounded = parseFloat(f.toPrecision(i));
|
|
406
|
-
if (rounded === f) {
|
|
407
|
-
return rounded.toPrecision(i);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
return f.toPrecision(roundDigits);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// dist/utils/tick-utils.js
|
|
414
|
-
function getZoomedRange(startTime, endTime, bounds) {
|
|
415
|
-
const [startTimeZoomed, , endTimeZoomed] = bounds;
|
|
416
|
-
return [Math.max(startTime, startTimeZoomed), Math.min(endTime, endTimeZoomed)];
|
|
417
|
-
}
|
|
418
|
-
function getPrettyTicks(startTime, endTime, tickCount = 5) {
|
|
419
|
-
const range = endTime - startTime;
|
|
420
|
-
const roughStep = range / (tickCount - 1);
|
|
421
|
-
const exponent = Math.floor(Math.log10(roughStep));
|
|
422
|
-
const base = Math.pow(10, exponent);
|
|
423
|
-
const multiples = [1, 2, 5, 10];
|
|
424
|
-
const niceStep = multiples.find((m) => base * m >= roughStep) * base;
|
|
425
|
-
const niceStart = Math.ceil(startTime / niceStep) * niceStep;
|
|
426
|
-
const niceEnd = Math.floor(endTime / niceStep) * niceStep;
|
|
427
|
-
const ticks = [];
|
|
428
|
-
for (let t = niceStart; t <= niceEnd; t += niceStep) {
|
|
429
|
-
ticks.push(t);
|
|
430
|
-
}
|
|
431
|
-
return ticks;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// dist/layers/time-axis-layer.js
|
|
435
|
-
var TimeAxisLayer = class extends import_core3.CompositeLayer {
|
|
436
|
-
// Called whenever props/data/viewports change
|
|
437
|
-
shouldUpdateState(params) {
|
|
438
|
-
return params.changeFlags.viewportChanged || super.shouldUpdateState(params);
|
|
439
|
-
}
|
|
440
|
-
renderLayers() {
|
|
441
|
-
const { startTimeMs, endTimeMs, tickCount = 10, y = 0, color = [0, 0, 0, 255] } = this.props;
|
|
442
|
-
let bounds;
|
|
443
|
-
try {
|
|
444
|
-
bounds = this.context.viewport.getBounds();
|
|
445
|
-
} catch (error) {
|
|
446
|
-
console.log("Error getting bounds from viewport:", error);
|
|
447
|
-
throw error;
|
|
448
|
-
}
|
|
449
|
-
const [startTimeZoomed, endTimeZoomed] = getZoomedRange(startTimeMs, endTimeMs, bounds);
|
|
450
|
-
const ticks = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);
|
|
451
|
-
const tickLines = ticks.map((x) => ({
|
|
452
|
-
sourcePosition: [x, y - 5],
|
|
453
|
-
targetPosition: [x, y + 5]
|
|
454
|
-
}));
|
|
455
|
-
const tickLabels = ticks.map((x) => ({
|
|
456
|
-
position: [x, y - 10],
|
|
457
|
-
text: this.props.unit === "timestamp" ? new Date(x).toLocaleTimeString() : formatTimeMs(x, false)
|
|
458
|
-
}));
|
|
459
|
-
return [
|
|
460
|
-
// Axis line
|
|
461
|
-
new import_layers2.LineLayer({
|
|
462
|
-
id: "axis-line",
|
|
463
|
-
data: [{ sourcePosition: [startTimeZoomed, y], targetPosition: [endTimeZoomed, y] }],
|
|
464
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
465
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
466
|
-
getColor: color,
|
|
467
|
-
getWidth: 2
|
|
468
|
-
}),
|
|
469
|
-
// Tick marks
|
|
470
|
-
new import_layers2.LineLayer({
|
|
471
|
-
id: "tick-marks",
|
|
472
|
-
data: tickLines,
|
|
473
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
474
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
475
|
-
getColor: color,
|
|
476
|
-
getWidth: 1
|
|
477
|
-
}),
|
|
478
|
-
// Tick labels
|
|
479
|
-
new import_layers2.TextLayer({
|
|
480
|
-
id: "tick-labels",
|
|
481
|
-
data: tickLabels,
|
|
482
|
-
getPosition: (d) => d.position,
|
|
483
|
-
getText: (d) => d.text,
|
|
484
|
-
getSize: 12,
|
|
485
|
-
getColor: color,
|
|
486
|
-
getTextAnchor: "middle",
|
|
487
|
-
getAlignmentBaseline: "top"
|
|
488
|
-
})
|
|
489
|
-
];
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
__publicField(TimeAxisLayer, "layerName", "TimeAxisLayer");
|
|
493
|
-
__publicField(TimeAxisLayer, "defaultProps", {
|
|
494
|
-
startTimeMs: 0,
|
|
495
|
-
endTimeMs: 100,
|
|
496
|
-
tickCount: 5,
|
|
497
|
-
y: 0,
|
|
498
|
-
color: [0, 0, 0, 255],
|
|
499
|
-
unit: "timestamp",
|
|
500
|
-
bounds: void 0
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
// dist/layers/vertical-grid-layer.js
|
|
504
|
-
var import_core4 = require("@deck.gl/core");
|
|
505
|
-
var import_layers3 = require("@deck.gl/layers");
|
|
506
|
-
var VerticalGridLayer = class extends import_core4.CompositeLayer {
|
|
507
|
-
shouldUpdateState(params) {
|
|
508
|
-
return params.changeFlags.viewportChanged || super.shouldUpdateState(params);
|
|
509
|
-
}
|
|
510
|
-
renderLayers() {
|
|
511
|
-
const { xMin, xMax, tickCount = 5, yMin, yMax, color } = this.props;
|
|
512
|
-
const viewport = this.context.viewport;
|
|
513
|
-
const bounds = viewport.getBounds();
|
|
514
|
-
const [startTimeZoomed, endTimeZoomed] = getZoomedRange(xMin, xMax, bounds);
|
|
515
|
-
const tickPositions = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);
|
|
516
|
-
const gridLines = tickPositions.map((x) => ({
|
|
517
|
-
sourcePosition: [x, yMin],
|
|
518
|
-
targetPosition: [x, yMax]
|
|
519
|
-
}));
|
|
520
|
-
return new import_layers3.LineLayer({
|
|
521
|
-
id: `${this.props.id}-lines`,
|
|
522
|
-
data: gridLines,
|
|
523
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
524
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
525
|
-
getColor: color,
|
|
526
|
-
getWidth: 1
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
__publicField(VerticalGridLayer, "layerName", "VerticalGridLayer");
|
|
531
|
-
__publicField(VerticalGridLayer, "defaultProps", {
|
|
532
|
-
yMin: -1e6,
|
|
533
|
-
yMax: 1e6,
|
|
534
|
-
tickCount: 5,
|
|
535
|
-
width: 1,
|
|
536
|
-
color: [200, 200, 200, 255]
|
|
537
|
-
});
|
|
538
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/layers/horizon-graph-layer/horizon-graph-layer.ts", "../src/layers/horizon-graph-layer/horizon-graph-layer.vs.ts", "../src/layers/horizon-graph-layer/horizon-graph-layer.fs.ts", "../src/layers/horizon-graph-layer/horizon-graph-layer-uniforms.ts", "../src/layers/horizon-graph-layer/multi-horizon-graph-layer.ts", "../src/layers/time-axis-layer.ts", "../src/utils/format-utils.ts", "../src/utils/tick-utils.ts", "../src/layers/vertical-grid-layer.ts"],
|
|
4
|
-
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type {HorizonGraphLayerProps} from './layers/horizon-graph-layer/horizon-graph-layer';\nexport {HorizonGraphLayer} from './layers/horizon-graph-layer/horizon-graph-layer';\nexport type {MultiHorizonGraphLayerProps} from './layers/horizon-graph-layer/multi-horizon-graph-layer';\nexport {MultiHorizonGraphLayer} from './layers/horizon-graph-layer/multi-horizon-graph-layer';\nexport type {TimeAxisLayerProps} from './layers/time-axis-layer';\nexport {TimeAxisLayer} from './layers/time-axis-layer';\nexport type {VerticalGridLayerProps} from './layers/vertical-grid-layer';\nexport {VerticalGridLayer} from './layers/vertical-grid-layer';\nexport {formatTimeMs, formatTimeRangeMs} from './utils/format-utils';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {DefaultProps, LayerProps, Color, LayerContext, UpdateParameters} from '@deck.gl/core';\nimport {Layer, project32} from '@deck.gl/core';\nimport {Model, Geometry} from '@luma.gl/engine';\nimport vs from './horizon-graph-layer.vs';\nimport fs from './horizon-graph-layer.fs';\nimport {Texture} from '@luma.gl/core';\nimport {horizonLayerUniforms} from './horizon-graph-layer-uniforms';\n\nexport type _HorizonGraphLayerProps = {\n data: number[] | Float32Array;\n\n yAxisScale?: number;\n\n bands?: number;\n\n positiveColor?: Color;\n negativeColor?: Color;\n\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n};\n\nexport type HorizonGraphLayerProps = _HorizonGraphLayerProps & LayerProps;\n\nconst defaultProps: DefaultProps<HorizonGraphLayerProps> = {\n yAxisScale: {type: 'number', value: 1000},\n\n bands: {type: 'number', value: 2},\n\n positiveColor: {type: 'color', value: [0, 128, 0]},\n negativeColor: {type: 'color', value: [0, 0, 255]},\n\n x: {type: 'number', value: 0},\n y: {type: 'number', value: 0},\n width: {type: 'number', value: 800},\n height: {type: 'number', value: 300}\n};\n\nexport class HorizonGraphLayer<ExtraProps extends {} = {}> extends Layer<\n ExtraProps & Required<_HorizonGraphLayerProps>\n> {\n static layerName = 'HorizonGraphLayer';\n static defaultProps = defaultProps;\n\n state: {\n model?: Model;\n dataTexture?: Texture;\n dataTextureSize?: number;\n dataTextureCount?: number;\n } = {};\n\n initializeState() {\n this.state = {};\n }\n\n getShaders() {\n return super.getShaders({\n vs,\n fs,\n modules: [project32, horizonLayerUniforms]\n });\n }\n\n _createDataTexture(seriesData: Float32Array | number[]): {\n dataTexture: Texture;\n dataTextureSize: number;\n dataTextureCount: number;\n } {\n const _data = seriesData instanceof Float32Array ? seriesData : new Float32Array(seriesData);\n\n const {device} = this.context;\n const count = _data.length;\n\n let dataTextureSize = 32;\n while (count > dataTextureSize * dataTextureSize) {\n dataTextureSize *= 2;\n }\n\n // TODO: use the right way to only submit the minimum amount of data\n const data = new Float32Array(dataTextureSize * dataTextureSize);\n data.set(_data, 0);\n\n return {\n dataTexture: device.createTexture({\n data,\n format: 'r32float',\n dimension: '2d',\n width: dataTextureSize,\n height: dataTextureSize,\n sampler: {\n minFilter: 'nearest',\n magFilter: 'nearest',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n }\n }),\n dataTextureSize,\n dataTextureCount: count\n };\n }\n\n _createModel() {\n const {x, y, width, height} = this.props;\n\n // Create a rectangle using triangle strip (4 vertices)\n // Order: bottom-left, bottom-right, top-left, top-right\n const positions = [\n x,\n y,\n 0.0,\n\n x + width,\n y,\n 0.0,\n\n x,\n y + height,\n 0.0,\n\n x + width,\n y + height,\n 0.0\n ];\n\n const uv = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0];\n\n const geometry = new Geometry({\n topology: 'triangle-strip',\n attributes: {\n positions: {value: new Float32Array(positions), size: 3},\n uv: {value: new Float32Array(uv), size: 2}\n }\n });\n\n return new Model(this.context.device, {\n ...this.getShaders(),\n geometry,\n bufferLayout: this.getAttributeManager().getBufferLayouts()\n });\n }\n\n updateState(params: UpdateParameters<Layer<ExtraProps & Required<_HorizonGraphLayerProps>>>) {\n super.updateState(params);\n\n const {changeFlags} = params;\n\n if (changeFlags.dataChanged) {\n this.state.dataTexture?.destroy();\n this.setState(this._createDataTexture(this.props.data));\n }\n\n if (changeFlags.extensionsChanged || changeFlags.propsChanged) {\n this.state.model?.destroy();\n this.setState({model: this._createModel()});\n }\n }\n\n draw() {\n const {model, dataTexture} = this.state;\n\n if (!model) {\n this.setState({model: this._createModel()});\n return;\n }\n\n if (!dataTexture) {\n this.setState(this._createDataTexture(this.props.data));\n return;\n }\n\n const {bands, yAxisScale, positiveColor, negativeColor} = this.props;\n\n model.shaderInputs.setProps({\n horizonLayer: {\n dataTexture: this.state.dataTexture,\n dataTextureSize: this.state.dataTextureSize,\n dataTextureSizeInv: 1.0 / this.state.dataTextureSize,\n dataTextureCount: this.state.dataTextureCount,\n\n bands,\n bandsInv: 1.0 / bands,\n yAxisScaleInv: 1.0 / yAxisScale,\n\n positiveColor: positiveColor.map((c) => c / 255),\n negativeColor: negativeColor.map((c) => c / 255)\n }\n });\n model.draw(this.context.renderPass);\n }\n\n finalizeState(context: LayerContext): void {\n this.state.model?.destroy();\n this.state.dataTexture?.destroy();\n super.finalizeState(context);\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport default `#version 300 es\n#define SHADER_NAME horizon-graph-layer-vertex-shader\n\nin vec3 positions;\nin vec2 uv;\n\nout vec2 v_uv;\n\nvoid main(void) {\n geometry.worldPosition = positions;\n \n vec4 position_commonspace = project_position(vec4(positions.xy, 0.0, 1.0));\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n geometry.position = position_commonspace;\n \n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n \n v_uv = uv;\n}\n`;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport default `#version 300 es\n#define SHADER_NAME horizon-graph-layer-fragment-shader\n\nprecision highp float;\nprecision highp int;\n\n/******* UNIFORM *******/\n\nuniform sampler2D dataTexture;\n\n/******* IN *******/\n\nin vec2 v_uv;\n\n/******* OUT *******/\n\nout vec4 fragColor;\n\n\n/******* MAIN *******/\n\nvoid main(void) {\n // horizontal position to sample index\n float idx = v_uv.x * horizonLayer.dataTextureCount;\n // idx = clamp(idx, 0.0, horizonLayer.dataTextureCount - 1.0); // NEEDED???\n\n // fetch single data point & normalize (-1,+1)\n float fy = floor(idx * horizonLayer.dataTextureSizeInv);\n float fx = idx - fy * horizonLayer.dataTextureSize;\n float val = texelFetch(dataTexture, ivec2(int(fx), int(fy)), 0).r;\n val *= horizonLayer.yAxisScaleInv;\n\n // band layering\n float fband = abs(val) * horizonLayer.bands;\n float bandIdx = clamp(floor(fband), 0.0, horizonLayer.bands - 1.0);\n float bandFrac = fract(fband);\n\n // calc our position value and find out color (using mix+step instead of if...else)\n float positive = step(0.0, val); // 1 if pos, else 0\n vec3 baseCol = mix(horizonLayer.negativeColor, horizonLayer.positiveColor, positive);\n float curPos = mix(v_uv.y, 1.0 - v_uv.y, positive);\n float addOne = step(curPos, bandFrac);\n\n float band = bandIdx + addOne;\n float whiten = 1.0 - band * horizonLayer.bandsInv;\n\n fragColor = vec4(mix(baseCol, vec3(1.0), whiten), 1.0);\n}\n`;\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {ShaderModule} from '@luma.gl/shadertools';\nimport {Texture} from '@luma.gl/core';\n\nconst uniformBlock = `\\\nlayout(std140) uniform horizonLayerUniforms {\n float dataTextureSize; // width = height of the POT texture\n float dataTextureSizeInv;\n float dataTextureCount; // actual number of data points\n\n float bands;\n float bandsInv;\n float yAxisScaleInv;\n\n vec3 positiveColor;\n vec3 negativeColor;\n} horizonLayer;\n`;\n\ntype HorizonLayerBindingProps = {\n dataTexture: Texture;\n};\n\ntype HorizonLayerUniformProps = {};\n\nexport type HorizonLayerProps = HorizonLayerBindingProps & HorizonLayerUniformProps;\n\nexport const horizonLayerUniforms = {\n name: 'horizonLayer',\n vs: uniformBlock,\n fs: uniformBlock,\n uniformTypes: {\n dataTextureSize: 'f32',\n dataTextureSizeInv: 'f32',\n dataTextureCount: 'f32',\n\n bands: 'f32',\n bandsInv: 'f32',\n yAxisScaleInv: 'f32',\n\n positiveColor: 'vec3<f32>',\n negativeColor: 'vec3<f32>'\n }\n} as const satisfies ShaderModule<HorizonLayerProps>;\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {DefaultProps, LayerProps, Color, LayerDataSource, Accessor} from '@deck.gl/core';\nimport {CompositeLayer} from '@deck.gl/core';\nimport {SolidPolygonLayer} from '@deck.gl/layers';\nimport {HorizonGraphLayer} from './horizon-graph-layer';\n\nexport type _MultiHorizonGraphLayerProps<DataT> = {\n data: LayerDataSource<DataT>;\n getSeries: Accessor<DataT, number[] | Float32Array>;\n getScale: Accessor<DataT, number>;\n\n bands?: number;\n\n positiveColor?: Color;\n negativeColor?: Color;\n\n dividerColor?: Color;\n dividerWidth?: number;\n\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n};\n\nexport type MultiHorizonGraphLayerProps<DataT = unknown> = _MultiHorizonGraphLayerProps<DataT> &\n LayerProps;\n\nconst defaultProps: DefaultProps<MultiHorizonGraphLayerProps> = {\n getSeries: {type: 'accessor', value: (series: any) => series.values},\n getScale: {type: 'accessor', value: (series: any) => series.scale},\n\n bands: {type: 'number', value: 2},\n\n positiveColor: {type: 'color', value: [0, 128, 0]},\n negativeColor: {type: 'color', value: [0, 0, 255]},\n\n dividerColor: {type: 'color', value: [0, 0, 0]},\n dividerWidth: {type: 'number', value: 2},\n\n x: {type: 'number', value: 0},\n y: {type: 'number', value: 0},\n width: {type: 'number', value: 800},\n height: {type: 'number', value: 300}\n};\n\nexport class MultiHorizonGraphLayer<DataT = any, ExtraProps extends {} = {}> extends CompositeLayer<\n ExtraProps & Required<_MultiHorizonGraphLayerProps<DataT>>\n> {\n static layerName = 'MultiHorizonGraphLayer';\n static defaultProps = defaultProps;\n\n renderLayers() {\n const {\n data,\n getSeries,\n getScale,\n bands,\n positiveColor,\n negativeColor,\n dividerColor,\n dividerWidth,\n x,\n y,\n width,\n height\n } = this.props;\n\n const seriesCount = (data as any).length;\n\n if (!seriesCount) {\n return [];\n }\n\n // Calculate layout dimensions\n const totalDividerSpace = dividerWidth * (seriesCount + 1);\n const availableHeight = height - totalDividerSpace;\n const seriesHeight = availableHeight / seriesCount;\n\n const layers = [];\n\n // Create divider rectangles\n if (dividerWidth > 0) {\n const dividerData = [];\n\n // Top divider\n dividerData.push({\n polygon: [\n [x, y],\n [x + width, y],\n [x + width, y + dividerWidth],\n [x, y + dividerWidth]\n ]\n });\n\n // Dividers between series\n for (let i = 0; i < seriesCount - 1; i++) {\n const dividerY = y + dividerWidth + (i + 1) * seriesHeight + i * dividerWidth;\n dividerData.push({\n polygon: [\n [x, dividerY],\n [x + width, dividerY],\n [x + width, dividerY + dividerWidth],\n [x, dividerY + dividerWidth]\n ]\n });\n }\n\n // Bottom divider\n const bottomDividerY = y + height - dividerWidth;\n dividerData.push({\n polygon: [\n [x, bottomDividerY],\n [x + width, bottomDividerY],\n [x + width, y + height],\n [x, y + height]\n ]\n });\n\n layers.push(\n new SolidPolygonLayer({\n id: `${this.props.id}-dividers`,\n data: dividerData,\n getPolygon: (d: any) => d.polygon,\n getFillColor: dividerColor,\n pickable: false\n })\n );\n }\n\n // Create horizon graph layers for each series\n (data as any).forEach((series, index) => {\n const seriesData = (getSeries as any)(series);\n\n if (!seriesData || seriesData.length === 0) {\n return;\n }\n\n const seriesY = y + dividerWidth + index * (seriesHeight + dividerWidth);\n\n const yAxisScale = (getScale as any)(series);\n\n layers.push(\n new HorizonGraphLayer({\n id: `${this.props.id}-series-${index}`,\n data: seriesData,\n yAxisScale,\n bands,\n positiveColor,\n negativeColor,\n x,\n y: seriesY,\n width,\n height: seriesHeight\n })\n );\n });\n\n return layers;\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type CompositeLayerProps, type UpdateParameters} from '@deck.gl/core';\nimport {LineLayer, TextLayer} from '@deck.gl/layers';\n\nimport {formatTimeMs} from '../utils/format-utils';\nimport {getPrettyTicks, getZoomedRange} from '../utils/tick-utils';\n\nexport type TimeAxisLayerProps = CompositeLayerProps & {\n unit: 'timestamp' | 'milliseconds';\n /** Start time in milliseconds since epoch */\n startTimeMs: number;\n /** End time in milliseconds since epoch */\n endTimeMs: number;\n /** Optional: Number of tick marks (default: 5) */\n tickCount?: number;\n /** Optional: Y-coordinate for the axis line (default: 0) */\n y?: number;\n /** Optional: RGBA color for axis and ticks (default: [0, 0, 0, 255]) */\n color?: [number, number, number, number];\n /** Optional: Bounds for the axis line (default: viewport bounds) */\n bounds?: [number, number, number, number];\n};\n\nexport class TimeAxisLayer extends CompositeLayer<TimeAxisLayerProps> {\n static override layerName = 'TimeAxisLayer';\n static override defaultProps: Required<Omit<TimeAxisLayerProps, keyof CompositeLayerProps>> = {\n startTimeMs: 0,\n endTimeMs: 100,\n tickCount: 5,\n y: 0,\n color: [0, 0, 0, 255],\n unit: 'timestamp',\n bounds: undefined!\n };\n\n // Called whenever props/data/viewports change\n override shouldUpdateState(params: UpdateParameters<TimeAxisLayer>): boolean {\n return params.changeFlags.viewportChanged || super.shouldUpdateState(params);\n }\n\n override renderLayers() {\n const {startTimeMs, endTimeMs, tickCount = 10, y = 0, color = [0, 0, 0, 255]} = this.props;\n\n let bounds: [number, number, number, number];\n try {\n bounds = this.context.viewport.getBounds();\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log('Error getting bounds from viewport:', error);\n throw error;\n }\n const [startTimeZoomed, endTimeZoomed] = getZoomedRange(startTimeMs, endTimeMs, bounds);\n // Generate tick positions and labels\n const ticks = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);\n\n const tickLines = ticks.map((x) => ({\n sourcePosition: [x, y - 5],\n targetPosition: [x, y + 5]\n }));\n\n const tickLabels = ticks.map((x) => ({\n position: [x, y - 10],\n text:\n this.props.unit === 'timestamp' ? new Date(x).toLocaleTimeString() : formatTimeMs(x, false)\n }));\n\n return [\n // Axis line\n new LineLayer({\n id: 'axis-line',\n data: [{sourcePosition: [startTimeZoomed, y], targetPosition: [endTimeZoomed, y]}],\n getSourcePosition: (d) => d.sourcePosition,\n getTargetPosition: (d) => d.targetPosition,\n getColor: color,\n getWidth: 2\n }),\n // Tick marks\n new LineLayer({\n id: 'tick-marks',\n data: tickLines,\n getSourcePosition: (d) => d.sourcePosition,\n getTargetPosition: (d) => d.targetPosition,\n getColor: color,\n getWidth: 1\n }),\n // Tick labels\n new TextLayer({\n id: 'tick-labels',\n data: tickLabels,\n getPosition: (d) => d.position,\n getText: (d) => d.text,\n getSize: 12,\n getColor: color,\n getTextAnchor: 'middle',\n getAlignmentBaseline: 'top'\n })\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/**\n * Convert a time in microseconds to a human-readable string\n * @param us Time in microseconds\n */\nexport function formatTimeMs(timeMs: number, space: boolean = true): string {\n const sep = space ? ' ' : '';\n const us = timeMs * 1000;\n if (us === 0) {\n return '0s';\n }\n if (Math.abs(us) < 1000) {\n return `${floatToStr(us)}${sep}\u00B5s`;\n }\n const ms = us / 1000;\n if (Math.abs(ms) < 1000) {\n return `${floatToStr(ms)}${sep} ms`;\n }\n const s = ms / 1000;\n if (Math.abs(s) < 60) {\n return `${floatToStr(s)}${sep} s`;\n }\n const m = s / 60;\n if (Math.abs(m) < 60) {\n return `${floatToStr(m)}${sep} min`;\n }\n const h = m / 60;\n if (Math.abs(h) < 24) {\n return `${floatToStr(h)}${sep} hrs`;\n }\n const d = h / 24;\n return `${floatToStr(d)}${sep} days`;\n}\n\nexport function formatTimeRangeMs(startMs: number, endMs: number): string {\n return `${formatTimeMs(startMs)} - ${formatTimeMs(endMs)}`;\n}\n\n/**\n * Convert a float to a string\n */\nfunction floatToStr(f: number, roundDigits: number = 5): string {\n if (Number.isInteger(f)) {\n return f.toString();\n }\n\n for (let i = 1; i < roundDigits - 1; i++) {\n const rounded = parseFloat(f.toPrecision(i));\n if (rounded === f) {\n return rounded.toPrecision(i);\n }\n }\n\n return f.toPrecision(roundDigits);\n}\n\n// export function formatTimesUs(ticks: number[]): string {\n// // Try from 0 up to a reasonable max (e.g. 20)\n// for (let d = 0; d <= 20; d++) {\n// const seen = new Set<string>();\n// let allDistinct = true;\n// for (const t of ticks) {\n// // Format each tick with d decimals\n// const str = t.toFixed(d);\n// if (seen.has(str)) {\n// allDistinct = false;\n// break;\n// }\n// seen.add(str);\n// }\n// if (allDistinct) {\n// return d;\n// }\n// }\n// // Fallback if somehow not distinct even at 20 decimals\n// return 20;\n// }\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport function getZoomedRange(\n startTime: number,\n endTime: number,\n bounds: [number, number, number, number]\n) {\n const [startTimeZoomed, , endTimeZoomed] = bounds;\n // console.log(`startTimeZoomed: ${startTimeZoomed}, endTimeZoomed: ${endTimeZoomed}, tickInterval: ${tickInterval} tickCountZoomed: ${tickCountZoomed}`);\n return [Math.max(startTime, startTimeZoomed), Math.min(endTime, endTimeZoomed)];\n}\n\n/**\n * Get nicely rounded tick close to the natural spacing\n * @param startTime\n * @param endTime\n * @param tickCount\n * @returns\n */\nexport function getPrettyTicks(startTime: number, endTime: number, tickCount: number = 5) {\n const range = endTime - startTime;\n const roughStep = range / (tickCount - 1);\n const exponent = Math.floor(Math.log10(roughStep));\n const base = Math.pow(10, exponent);\n const multiples = [1, 2, 5, 10];\n\n // Find the smallest multiple that is greater than or equal to roughStep\n const niceStep = multiples.find((m) => base * m >= roughStep) * base;\n\n const niceStart = Math.ceil(startTime / niceStep) * niceStep;\n const niceEnd = Math.floor(endTime / niceStep) * niceStep;\n\n const ticks = [];\n for (let t = niceStart; t <= niceEnd; t += niceStep) {\n ticks.push(t);\n }\n\n return ticks;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CompositeLayer, type CompositeLayerProps, type UpdateParameters} from '@deck.gl/core';\nimport {LineLayer} from '@deck.gl/layers';\n\nimport {getPrettyTicks, getZoomedRange} from '../utils/tick-utils';\n\nexport type VerticalGridLayerProps = CompositeLayerProps & {\n /** Start time in milliseconds since epoch */\n xMin: number;\n /** End time in milliseconds since epoch */\n xMax: number;\n /** Optional: Number of tick marks (default: 5) */\n tickCount?: number;\n /** Minimum Y-coordinate for grid lines */\n yMin?: number;\n /** Maximum Y-coordinate for grid lines */\n yMax?: number;\n /** Optional: Width of the grid lines (default: 1) */\n width?: number;\n /** Optional: RGBA color for grid lines (default: [200, 200, 200, 255]) */\n color?: [number, number, number, number];\n};\n\nexport class VerticalGridLayer extends CompositeLayer<VerticalGridLayerProps> {\n static override layerName = 'VerticalGridLayer';\n static override defaultProps = {\n yMin: -1e6,\n yMax: 1e6,\n tickCount: 5,\n width: 1,\n color: [200, 200, 200, 255]\n };\n\n override shouldUpdateState(params: UpdateParameters<VerticalGridLayer>): boolean {\n return params.changeFlags.viewportChanged || super.shouldUpdateState(params);\n }\n\n override renderLayers() {\n const {xMin, xMax, tickCount = 5, yMin, yMax, color} = this.props;\n\n // Access the current viewport\n const viewport = this.context.viewport;\n const bounds = viewport.getBounds(); // Returns [minX, minY, maxX, maxY]\n\n // Calculate the visible time range based on the viewport bounds\n const [startTimeZoomed, endTimeZoomed] = getZoomedRange(xMin, xMax, bounds);\n\n // Generate tick positions\n const tickPositions = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);\n\n // Create vertical grid lines at each tick position\n const gridLines = tickPositions.map((x) => ({\n sourcePosition: [x, yMin],\n targetPosition: [x, yMax]\n }));\n\n return new LineLayer({\n id: `${this.props.id}-lines`,\n data: gridLines,\n getSourcePosition: (d) => d.sourcePosition,\n getTargetPosition: (d) => d.targetPosition,\n getColor: color,\n getWidth: 1\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACKA,kBAA+B;AAC/B,oBAA8B;;;ACF9B,IAAA,iCAAe;;;;;;;;;;;;;;;;;;;;;;ACAf,IAAA,iCAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGf,IAAM,eAAe;;;;;;;;;;;;;AAuBd,IAAM,uBAAuB;EAClC,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,cAAc;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,kBAAkB;IAElB,OAAO;IACP,UAAU;IACV,eAAe;IAEf,eAAe;IACf,eAAe;;;;;AHdnB,IAAM,eAAqD;EACzD,YAAY,EAAC,MAAM,UAAU,OAAO,IAAI;EAExC,OAAO,EAAC,MAAM,UAAU,OAAO,EAAC;EAEhC,eAAe,EAAC,MAAM,SAAS,OAAO,CAAC,GAAG,KAAK,CAAC,EAAC;EACjD,eAAe,EAAC,MAAM,SAAS,OAAO,CAAC,GAAG,GAAG,GAAG,EAAC;EAEjD,GAAG,EAAC,MAAM,UAAU,OAAO,EAAC;EAC5B,GAAG,EAAC,MAAM,UAAU,OAAO,EAAC;EAC5B,OAAO,EAAC,MAAM,UAAU,OAAO,IAAG;EAClC,QAAQ,EAAC,MAAM,UAAU,OAAO,IAAG;;AAG/B,IAAO,oBAAP,cAA6D,kBAElE;EAIC,QAKI,CAAA;EAEJ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Ae;EAC7B,MAAM;EACN,MAAM;EACN,WAAW;EACX,OAAO;EACP,OAAO,CAAC,KAAK,KAAK,KAAK,GAAG;;",
|
|
6
|
-
"names": ["import_core", "defaultProps", "import_core", "import_layers", "import_core", "import_layers"]
|
|
7
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type { HorizonGraphLayerProps } from "./layers/horizon-graph-layer/horizon-graph-layer.js";
|
|
2
|
-
export { HorizonGraphLayer } from "./layers/horizon-graph-layer/horizon-graph-layer.js";
|
|
3
|
-
export type { MultiHorizonGraphLayerProps } from "./layers/horizon-graph-layer/multi-horizon-graph-layer.js";
|
|
4
|
-
export { MultiHorizonGraphLayer } from "./layers/horizon-graph-layer/multi-horizon-graph-layer.js";
|
|
5
|
-
export type { TimeAxisLayerProps } from "./layers/time-axis-layer.js";
|
|
6
|
-
export { TimeAxisLayer } from "./layers/time-axis-layer.js";
|
|
7
|
-
export type { VerticalGridLayerProps } from "./layers/vertical-grid-layer.js";
|
|
8
|
-
export { VerticalGridLayer } from "./layers/vertical-grid-layer.js";
|
|
9
|
-
export { formatTimeMs, formatTimeRangeMs } from "./utils/format-utils.js";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,sBAAsB,EAAC,4DAAyD;AAC7F,OAAO,EAAC,iBAAiB,EAAC,4DAAyD;AACnF,YAAY,EAAC,2BAA2B,EAAC,kEAA+D;AACxG,OAAO,EAAC,sBAAsB,EAAC,kEAA+D;AAC9F,YAAY,EAAC,kBAAkB,EAAC,oCAAiC;AACjE,OAAO,EAAC,aAAa,EAAC,oCAAiC;AACvD,YAAY,EAAC,sBAAsB,EAAC,wCAAqC;AACzE,OAAO,EAAC,iBAAiB,EAAC,wCAAqC;AAC/D,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,gCAA6B"}
|
package/dist/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
export { HorizonGraphLayer } from "./layers/horizon-graph-layer/horizon-graph-layer.js";
|
|
5
|
-
export { MultiHorizonGraphLayer } from "./layers/horizon-graph-layer/multi-horizon-graph-layer.js";
|
|
6
|
-
export { TimeAxisLayer } from "./layers/time-axis-layer.js";
|
|
7
|
-
export { VerticalGridLayer } from "./layers/vertical-grid-layer.js";
|
|
8
|
-
export { formatTimeMs, formatTimeRangeMs } from "./utils/format-utils.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,iBAAiB,EAAC,4DAAyD;AAEnF,OAAO,EAAC,sBAAsB,EAAC,kEAA+D;AAE9F,OAAO,EAAC,aAAa,EAAC,oCAAiC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,wCAAqC;AAC/D,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,gCAA6B"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Texture } from '@luma.gl/core';
|
|
2
|
-
type HorizonLayerBindingProps = {
|
|
3
|
-
dataTexture: Texture;
|
|
4
|
-
};
|
|
5
|
-
type HorizonLayerUniformProps = {};
|
|
6
|
-
export type HorizonLayerProps = HorizonLayerBindingProps & HorizonLayerUniformProps;
|
|
7
|
-
export declare const horizonLayerUniforms: {
|
|
8
|
-
readonly name: "horizonLayer";
|
|
9
|
-
readonly vs: "layout(std140) uniform horizonLayerUniforms {\n float dataTextureSize; // width = height of the POT texture\n float dataTextureSizeInv;\n float dataTextureCount; // actual number of data points\n\n float bands;\n float bandsInv;\n float yAxisScaleInv;\n\n vec3 positiveColor;\n vec3 negativeColor;\n} horizonLayer;\n";
|
|
10
|
-
readonly fs: "layout(std140) uniform horizonLayerUniforms {\n float dataTextureSize; // width = height of the POT texture\n float dataTextureSizeInv;\n float dataTextureCount; // actual number of data points\n\n float bands;\n float bandsInv;\n float yAxisScaleInv;\n\n vec3 positiveColor;\n vec3 negativeColor;\n} horizonLayer;\n";
|
|
11
|
-
readonly uniformTypes: {
|
|
12
|
-
readonly dataTextureSize: "f32";
|
|
13
|
-
readonly dataTextureSizeInv: "f32";
|
|
14
|
-
readonly dataTextureCount: "f32";
|
|
15
|
-
readonly bands: "f32";
|
|
16
|
-
readonly bandsInv: "f32";
|
|
17
|
-
readonly yAxisScaleInv: "f32";
|
|
18
|
-
readonly positiveColor: "vec3<f32>";
|
|
19
|
-
readonly negativeColor: "vec3<f32>";
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=horizon-graph-layer-uniforms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"horizon-graph-layer-uniforms.d.ts","sourceRoot":"","sources":["../../../src/layers/horizon-graph-layer/horizon-graph-layer-uniforms.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAiBtC,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,wBAAwB,GAAG,EAAE,CAAC;AAEnC,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,GAAG,wBAAwB,CAAC;AAEpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;CAgBmB,CAAC"}
|