@deck.gl-community/infovis-layers 9.2.0-beta.6 → 9.2.0-beta.8
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/dist/index.cjs +11 -471
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -6
- 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/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/src/layers/horizon-graph-layer/horizon-graph-layer-uniforms.ts +0 -47
- package/src/layers/horizon-graph-layer/horizon-graph-layer.fs.ts +0 -53
- package/src/layers/horizon-graph-layer/horizon-graph-layer.ts +0 -202
- package/src/layers/horizon-graph-layer/horizon-graph-layer.vs.ts +0 -24
- package/src/layers/horizon-graph-layer/multi-horizon-graph-layer.ts +0 -164
- package/src/layers/time-axis-layer.ts +0 -102
- package/src/layers/vertical-grid-layer.ts +0 -69
- package/src/utils/tick-utils.ts +0 -41
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
export default `#version 300 es
|
|
5
|
-
#define SHADER_NAME horizon-graph-layer-vertex-shader
|
|
6
|
-
|
|
7
|
-
in vec3 positions;
|
|
8
|
-
in vec2 uv;
|
|
9
|
-
|
|
10
|
-
out vec2 v_uv;
|
|
11
|
-
|
|
12
|
-
void main(void) {
|
|
13
|
-
geometry.worldPosition = positions;
|
|
14
|
-
|
|
15
|
-
vec4 position_commonspace = project_position(vec4(positions.xy, 0.0, 1.0));
|
|
16
|
-
gl_Position = project_common_position_to_clipspace(position_commonspace);
|
|
17
|
-
geometry.position = position_commonspace;
|
|
18
|
-
|
|
19
|
-
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
20
|
-
|
|
21
|
-
v_uv = uv;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
//# sourceMappingURL=horizon-graph-layer.vs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"horizon-graph-layer.vs.js","sourceRoot":"","sources":["../../../src/layers/horizon-graph-layer/horizon-graph-layer.vs.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,eAAe;;;;;;;;;;;;;;;;;;;CAmBd,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DefaultProps, LayerProps, Color, LayerDataSource, Accessor } from '@deck.gl/core';
|
|
2
|
-
import { CompositeLayer } from '@deck.gl/core';
|
|
3
|
-
export type _MultiHorizonGraphLayerProps<DataT> = {
|
|
4
|
-
data: LayerDataSource<DataT>;
|
|
5
|
-
getSeries: Accessor<DataT, number[] | Float32Array>;
|
|
6
|
-
getScale: Accessor<DataT, number>;
|
|
7
|
-
bands?: number;
|
|
8
|
-
positiveColor?: Color;
|
|
9
|
-
negativeColor?: Color;
|
|
10
|
-
dividerColor?: Color;
|
|
11
|
-
dividerWidth?: number;
|
|
12
|
-
x?: number;
|
|
13
|
-
y?: number;
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
};
|
|
17
|
-
export type MultiHorizonGraphLayerProps<DataT = unknown> = _MultiHorizonGraphLayerProps<DataT> & LayerProps;
|
|
18
|
-
export declare class MultiHorizonGraphLayer<DataT = any, ExtraProps extends {} = {}> extends CompositeLayer<ExtraProps & Required<_MultiHorizonGraphLayerProps<DataT>>> {
|
|
19
|
-
static layerName: string;
|
|
20
|
-
static defaultProps: DefaultProps<MultiHorizonGraphLayerProps<unknown>>;
|
|
21
|
-
renderLayers(): any[];
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=multi-horizon-graph-layer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-horizon-graph-layer.d.ts","sourceRoot":"","sources":["../../../src/layers/horizon-graph-layer/multi-horizon-graph-layer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAI7C,MAAM,MAAM,4BAA4B,CAAC,KAAK,IAAI;IAChD,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7B,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC;IACpD,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAElC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,aAAa,CAAC,EAAE,KAAK,CAAC;IAEtB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,KAAK,GAAG,OAAO,IAAI,4BAA4B,CAAC,KAAK,CAAC,GAC5F,UAAU,CAAC;AAoBb,qBAAa,sBAAsB,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,cAAc,CACjG,UAAU,GAAG,QAAQ,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,CAC3D;IACC,MAAM,CAAC,SAAS,SAA4B;IAC5C,MAAM,CAAC,YAAY,qDAAgB;IAEnC,YAAY;CA4Gb"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { CompositeLayer } from '@deck.gl/core';
|
|
5
|
-
import { SolidPolygonLayer } from '@deck.gl/layers';
|
|
6
|
-
import { HorizonGraphLayer } from "./horizon-graph-layer.js";
|
|
7
|
-
const defaultProps = {
|
|
8
|
-
getSeries: { type: 'accessor', value: (series) => series.values },
|
|
9
|
-
getScale: { type: 'accessor', value: (series) => series.scale },
|
|
10
|
-
bands: { type: 'number', value: 2 },
|
|
11
|
-
positiveColor: { type: 'color', value: [0, 128, 0] },
|
|
12
|
-
negativeColor: { type: 'color', value: [0, 0, 255] },
|
|
13
|
-
dividerColor: { type: 'color', value: [0, 0, 0] },
|
|
14
|
-
dividerWidth: { type: 'number', value: 2 },
|
|
15
|
-
x: { type: 'number', value: 0 },
|
|
16
|
-
y: { type: 'number', value: 0 },
|
|
17
|
-
width: { type: 'number', value: 800 },
|
|
18
|
-
height: { type: 'number', value: 300 }
|
|
19
|
-
};
|
|
20
|
-
export class MultiHorizonGraphLayer extends CompositeLayer {
|
|
21
|
-
static layerName = 'MultiHorizonGraphLayer';
|
|
22
|
-
static defaultProps = defaultProps;
|
|
23
|
-
renderLayers() {
|
|
24
|
-
const { data, getSeries, getScale, bands, positiveColor, negativeColor, dividerColor, dividerWidth, x, y, width, height } = this.props;
|
|
25
|
-
const seriesCount = data.length;
|
|
26
|
-
if (!seriesCount) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
// Calculate layout dimensions
|
|
30
|
-
const totalDividerSpace = dividerWidth * (seriesCount + 1);
|
|
31
|
-
const availableHeight = height - totalDividerSpace;
|
|
32
|
-
const seriesHeight = availableHeight / seriesCount;
|
|
33
|
-
const layers = [];
|
|
34
|
-
// Create divider rectangles
|
|
35
|
-
if (dividerWidth > 0) {
|
|
36
|
-
const dividerData = [];
|
|
37
|
-
// Top divider
|
|
38
|
-
dividerData.push({
|
|
39
|
-
polygon: [
|
|
40
|
-
[x, y],
|
|
41
|
-
[x + width, y],
|
|
42
|
-
[x + width, y + dividerWidth],
|
|
43
|
-
[x, y + dividerWidth]
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
// Dividers between series
|
|
47
|
-
for (let i = 0; i < seriesCount - 1; i++) {
|
|
48
|
-
const dividerY = y + dividerWidth + (i + 1) * seriesHeight + i * dividerWidth;
|
|
49
|
-
dividerData.push({
|
|
50
|
-
polygon: [
|
|
51
|
-
[x, dividerY],
|
|
52
|
-
[x + width, dividerY],
|
|
53
|
-
[x + width, dividerY + dividerWidth],
|
|
54
|
-
[x, dividerY + dividerWidth]
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
// Bottom divider
|
|
59
|
-
const bottomDividerY = y + height - dividerWidth;
|
|
60
|
-
dividerData.push({
|
|
61
|
-
polygon: [
|
|
62
|
-
[x, bottomDividerY],
|
|
63
|
-
[x + width, bottomDividerY],
|
|
64
|
-
[x + width, y + height],
|
|
65
|
-
[x, y + height]
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
layers.push(new SolidPolygonLayer({
|
|
69
|
-
id: `${this.props.id}-dividers`,
|
|
70
|
-
data: dividerData,
|
|
71
|
-
getPolygon: (d) => d.polygon,
|
|
72
|
-
getFillColor: dividerColor,
|
|
73
|
-
pickable: false
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
// Create horizon graph layers for each series
|
|
77
|
-
data.forEach((series, index) => {
|
|
78
|
-
const seriesData = getSeries(series);
|
|
79
|
-
if (!seriesData || seriesData.length === 0) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const seriesY = y + dividerWidth + index * (seriesHeight + dividerWidth);
|
|
83
|
-
const yAxisScale = getScale(series);
|
|
84
|
-
layers.push(new HorizonGraphLayer({
|
|
85
|
-
id: `${this.props.id}-series-${index}`,
|
|
86
|
-
data: seriesData,
|
|
87
|
-
yAxisScale,
|
|
88
|
-
bands,
|
|
89
|
-
positiveColor,
|
|
90
|
-
negativeColor,
|
|
91
|
-
x,
|
|
92
|
-
y: seriesY,
|
|
93
|
-
width,
|
|
94
|
-
height: seriesHeight
|
|
95
|
-
}));
|
|
96
|
-
});
|
|
97
|
-
return layers;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=multi-horizon-graph-layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-horizon-graph-layer.js","sourceRoot":"","sources":["../../../src/layers/horizon-graph-layer/multi-horizon-graph-layer.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAwBxD,MAAM,YAAY,GAA8C;IAC9D,SAAS,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAC;IACpE,QAAQ,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAC;IAElE,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAC;IAEjC,aAAa,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC;IAClD,aAAa,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAC;IAElD,YAAY,EAAE,EAAC,IAAI,EAAE,OAA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EAAE,WAAW;gBAC/B,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO;gBACjC,YAAY,EAAE,YAAY;gBAC1B,QAAQ,EAAE,KAAK;aAChB,CAAC,CACH,CAAC;QACJ,CAAC;QAED,8CAA8C;QAC7C,IAAY,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACtC,MAAM,UAAU,GAAI,SAAiB,CAAC,MAAM,CAAC,CAAC;YAE9C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3C,OAAO;YACT,CAAC;YAED,MAAM,OAAO,GAAG,CAAC,GAAG,YAAY,GAAG,KAAK,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC;YAEzE,MAAM,UAAU,GAAI,QAAgB,CAAC,MAAM,CAAC,CAAC;YAE7C,MAAM,CAAC,IAAI,CACT,IAAI,iBAAiB,CAAC;gBACpB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,KAAK,EAAE;gBACtC,IAAI,EAAE,UAAU;gBAChB,UAAU;gBACV,KAAK;gBACL,aAAa;gBACb,aAAa;gBACb,CAAC;gBACD,CAAC,EAAE,OAAO;gBACV,KAAK;gBACL,MAAM,EAAE,YAAY;aACrB,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { CompositeLayer, type CompositeLayerProps, type UpdateParameters } from '@deck.gl/core';
|
|
2
|
-
import { LineLayer, TextLayer } from '@deck.gl/layers';
|
|
3
|
-
export type TimeAxisLayerProps = CompositeLayerProps & {
|
|
4
|
-
unit: 'timestamp' | 'milliseconds';
|
|
5
|
-
/** Start time in milliseconds since epoch */
|
|
6
|
-
startTimeMs: number;
|
|
7
|
-
/** End time in milliseconds since epoch */
|
|
8
|
-
endTimeMs: number;
|
|
9
|
-
/** Optional: Number of tick marks (default: 5) */
|
|
10
|
-
tickCount?: number;
|
|
11
|
-
/** Optional: Y-coordinate for the axis line (default: 0) */
|
|
12
|
-
y?: number;
|
|
13
|
-
/** Optional: RGBA color for axis and ticks (default: [0, 0, 0, 255]) */
|
|
14
|
-
color?: [number, number, number, number];
|
|
15
|
-
/** Optional: Bounds for the axis line (default: viewport bounds) */
|
|
16
|
-
bounds?: [number, number, number, number];
|
|
17
|
-
};
|
|
18
|
-
export declare class TimeAxisLayer extends CompositeLayer<TimeAxisLayerProps> {
|
|
19
|
-
static layerName: string;
|
|
20
|
-
static defaultProps: Required<Omit<TimeAxisLayerProps, keyof CompositeLayerProps>>;
|
|
21
|
-
shouldUpdateState(params: UpdateParameters<TimeAxisLayer>): boolean;
|
|
22
|
-
renderLayers(): (LineLayer<any, {
|
|
23
|
-
id: "axis-line";
|
|
24
|
-
data: {
|
|
25
|
-
sourcePosition: number[];
|
|
26
|
-
targetPosition: number[];
|
|
27
|
-
}[];
|
|
28
|
-
getSourcePosition: (d: any) => any;
|
|
29
|
-
getTargetPosition: (d: any) => any;
|
|
30
|
-
getColor: [number, number, number, number];
|
|
31
|
-
getWidth: 2;
|
|
32
|
-
}> | LineLayer<any, {
|
|
33
|
-
id: "tick-marks";
|
|
34
|
-
data: {
|
|
35
|
-
sourcePosition: any[];
|
|
36
|
-
targetPosition: any[];
|
|
37
|
-
}[];
|
|
38
|
-
getSourcePosition: (d: any) => any;
|
|
39
|
-
getTargetPosition: (d: any) => any;
|
|
40
|
-
getColor: [number, number, number, number];
|
|
41
|
-
getWidth: 1;
|
|
42
|
-
}> | TextLayer<any, {
|
|
43
|
-
id: "tick-labels";
|
|
44
|
-
data: {
|
|
45
|
-
position: any[];
|
|
46
|
-
text: string;
|
|
47
|
-
}[];
|
|
48
|
-
getPosition: (d: any) => any;
|
|
49
|
-
getText: (d: any) => any;
|
|
50
|
-
getSize: 12;
|
|
51
|
-
getColor: [number, number, number, number];
|
|
52
|
-
getTextAnchor: "middle";
|
|
53
|
-
getAlignmentBaseline: "top";
|
|
54
|
-
}>)[];
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=time-axis-layer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time-axis-layer.d.ts","sourceRoot":"","sources":["../../src/layers/time-axis-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAKrD,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAAG;IACrD,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC;IACnC,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,oEAAoE;IACpE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C,CAAC;AAEF,qBAAa,aAAc,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IACnE,OAAgB,SAAS,SAAmB;IAC5C,OAAgB,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,mBAAmB,CAAC,CAAC,CAQzF;IAGO,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,OAAO;IAInE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DtB"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { CompositeLayer } from '@deck.gl/core';
|
|
5
|
-
import { LineLayer, TextLayer } from '@deck.gl/layers';
|
|
6
|
-
import { formatTimeMs } from "../utils/format-utils.js";
|
|
7
|
-
import { getPrettyTicks, getZoomedRange } from "../utils/tick-utils.js";
|
|
8
|
-
export class TimeAxisLayer extends CompositeLayer {
|
|
9
|
-
static layerName = 'TimeAxisLayer';
|
|
10
|
-
static defaultProps = {
|
|
11
|
-
startTimeMs: 0,
|
|
12
|
-
endTimeMs: 100,
|
|
13
|
-
tickCount: 5,
|
|
14
|
-
y: 0,
|
|
15
|
-
color: [0, 0, 0, 255],
|
|
16
|
-
unit: 'timestamp',
|
|
17
|
-
bounds: undefined
|
|
18
|
-
};
|
|
19
|
-
// Called whenever props/data/viewports change
|
|
20
|
-
shouldUpdateState(params) {
|
|
21
|
-
return params.changeFlags.viewportChanged || super.shouldUpdateState(params);
|
|
22
|
-
}
|
|
23
|
-
renderLayers() {
|
|
24
|
-
const { startTimeMs, endTimeMs, tickCount = 10, y = 0, color = [0, 0, 0, 255] } = this.props;
|
|
25
|
-
let bounds;
|
|
26
|
-
try {
|
|
27
|
-
bounds = this.context.viewport.getBounds();
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
// eslint-disable-next-line no-console
|
|
31
|
-
console.log('Error getting bounds from viewport:', error);
|
|
32
|
-
throw error;
|
|
33
|
-
}
|
|
34
|
-
const [startTimeZoomed, endTimeZoomed] = getZoomedRange(startTimeMs, endTimeMs, bounds);
|
|
35
|
-
// Generate tick positions and labels
|
|
36
|
-
const ticks = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);
|
|
37
|
-
const tickLines = ticks.map((x) => ({
|
|
38
|
-
sourcePosition: [x, y - 5],
|
|
39
|
-
targetPosition: [x, y + 5]
|
|
40
|
-
}));
|
|
41
|
-
const tickLabels = ticks.map((x) => ({
|
|
42
|
-
position: [x, y - 10],
|
|
43
|
-
text: this.props.unit === 'timestamp' ? new Date(x).toLocaleTimeString() : formatTimeMs(x, false)
|
|
44
|
-
}));
|
|
45
|
-
return [
|
|
46
|
-
// Axis line
|
|
47
|
-
new LineLayer({
|
|
48
|
-
id: 'axis-line',
|
|
49
|
-
data: [{ sourcePosition: [startTimeZoomed, y], targetPosition: [endTimeZoomed, y] }],
|
|
50
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
51
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
52
|
-
getColor: color,
|
|
53
|
-
getWidth: 2
|
|
54
|
-
}),
|
|
55
|
-
// Tick marks
|
|
56
|
-
new LineLayer({
|
|
57
|
-
id: 'tick-marks',
|
|
58
|
-
data: tickLines,
|
|
59
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
60
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
61
|
-
getColor: color,
|
|
62
|
-
getWidth: 1
|
|
63
|
-
}),
|
|
64
|
-
// Tick labels
|
|
65
|
-
new TextLayer({
|
|
66
|
-
id: 'tick-labels',
|
|
67
|
-
data: tickLabels,
|
|
68
|
-
getPosition: (d) => d.position,
|
|
69
|
-
getText: (d) => d.text,
|
|
70
|
-
getSize: 12,
|
|
71
|
-
getColor: color,
|
|
72
|
-
getTextAnchor: 'middle',
|
|
73
|
-
getAlignmentBaseline: 'top'
|
|
74
|
-
})
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=time-axis-layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time-axis-layer.js","sourceRoot":"","sources":["../../src/layers/time-axis-layer.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,cAAc,EAAkD,MAAM,eAAe,CAAC;AAC9F,OAAO,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AiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc;gBAC1C,QAAQ,EAAE,KAAK;gBACf,QAAQ,EAAE,CAAC;aACZ,CAAC;YACF,cAAc;YACd,IAAI,SAAS,CAAC;gBACZ,EAAE,EAAE,aAAa;gBACjB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ;gBAC9B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI;gBACtB,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,QAAQ;gBACvB,oBAAoB,EAAE,KAAK;aAC5B,CAAC;SACH,CAAC;IACJ,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CompositeLayer, type CompositeLayerProps, type UpdateParameters } from '@deck.gl/core';
|
|
2
|
-
import { LineLayer } from '@deck.gl/layers';
|
|
3
|
-
export type VerticalGridLayerProps = CompositeLayerProps & {
|
|
4
|
-
/** Start time in milliseconds since epoch */
|
|
5
|
-
xMin: number;
|
|
6
|
-
/** End time in milliseconds since epoch */
|
|
7
|
-
xMax: number;
|
|
8
|
-
/** Optional: Number of tick marks (default: 5) */
|
|
9
|
-
tickCount?: number;
|
|
10
|
-
/** Minimum Y-coordinate for grid lines */
|
|
11
|
-
yMin?: number;
|
|
12
|
-
/** Maximum Y-coordinate for grid lines */
|
|
13
|
-
yMax?: number;
|
|
14
|
-
/** Optional: Width of the grid lines (default: 1) */
|
|
15
|
-
width?: number;
|
|
16
|
-
/** Optional: RGBA color for grid lines (default: [200, 200, 200, 255]) */
|
|
17
|
-
color?: [number, number, number, number];
|
|
18
|
-
};
|
|
19
|
-
export declare class VerticalGridLayer extends CompositeLayer<VerticalGridLayerProps> {
|
|
20
|
-
static layerName: string;
|
|
21
|
-
static defaultProps: {
|
|
22
|
-
yMin: number;
|
|
23
|
-
yMax: number;
|
|
24
|
-
tickCount: number;
|
|
25
|
-
width: number;
|
|
26
|
-
color: number[];
|
|
27
|
-
};
|
|
28
|
-
shouldUpdateState(params: UpdateParameters<VerticalGridLayer>): boolean;
|
|
29
|
-
renderLayers(): LineLayer<any, {
|
|
30
|
-
id: `${string}-lines`;
|
|
31
|
-
data: {
|
|
32
|
-
sourcePosition: any[];
|
|
33
|
-
targetPosition: any[];
|
|
34
|
-
}[];
|
|
35
|
-
getSourcePosition: (d: any) => any;
|
|
36
|
-
getTargetPosition: (d: any) => any;
|
|
37
|
-
getColor: [number, number, number, number];
|
|
38
|
-
getWidth: 1;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=vertical-grid-layer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-grid-layer.d.ts","sourceRoot":"","sources":["../../src/layers/vertical-grid-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI1C,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG;IACzD,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,sBAAsB,CAAC;IAC3E,OAAgB,SAAS,SAAuB;IAChD,OAAgB,YAAY;;;;;;MAM1B;IAEO,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,OAAO;IAIvE,YAAY;;;;;;;;;;;CA4BtB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { CompositeLayer } from '@deck.gl/core';
|
|
5
|
-
import { LineLayer } from '@deck.gl/layers';
|
|
6
|
-
import { getPrettyTicks, getZoomedRange } from "../utils/tick-utils.js";
|
|
7
|
-
export class VerticalGridLayer extends CompositeLayer {
|
|
8
|
-
static layerName = 'VerticalGridLayer';
|
|
9
|
-
static defaultProps = {
|
|
10
|
-
yMin: -1e6,
|
|
11
|
-
yMax: 1e6,
|
|
12
|
-
tickCount: 5,
|
|
13
|
-
width: 1,
|
|
14
|
-
color: [200, 200, 200, 255]
|
|
15
|
-
};
|
|
16
|
-
shouldUpdateState(params) {
|
|
17
|
-
return params.changeFlags.viewportChanged || super.shouldUpdateState(params);
|
|
18
|
-
}
|
|
19
|
-
renderLayers() {
|
|
20
|
-
const { xMin, xMax, tickCount = 5, yMin, yMax, color } = this.props;
|
|
21
|
-
// Access the current viewport
|
|
22
|
-
const viewport = this.context.viewport;
|
|
23
|
-
const bounds = viewport.getBounds(); // Returns [minX, minY, maxX, maxY]
|
|
24
|
-
// Calculate the visible time range based on the viewport bounds
|
|
25
|
-
const [startTimeZoomed, endTimeZoomed] = getZoomedRange(xMin, xMax, bounds);
|
|
26
|
-
// Generate tick positions
|
|
27
|
-
const tickPositions = getPrettyTicks(startTimeZoomed, endTimeZoomed, tickCount);
|
|
28
|
-
// Create vertical grid lines at each tick position
|
|
29
|
-
const gridLines = tickPositions.map((x) => ({
|
|
30
|
-
sourcePosition: [x, yMin],
|
|
31
|
-
targetPosition: [x, yMax]
|
|
32
|
-
}));
|
|
33
|
-
return new LineLayer({
|
|
34
|
-
id: `${this.props.id}-lines`,
|
|
35
|
-
data: gridLines,
|
|
36
|
-
getSourcePosition: (d) => d.sourcePosition,
|
|
37
|
-
getTargetPosition: (d) => d.targetPosition,
|
|
38
|
-
getColor: color,
|
|
39
|
-
getWidth: 1
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=vertical-grid-layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-grid-layer.js","sourceRoot":"","sources":["../../src/layers/vertical-grid-layer.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,cAAc,EAAkD,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,+BAA4B;AAmBnE,MAAM,OAAO,iBAAkB,SAAQ,cAAsC;IAC3E,MAAM,CAAU,SAAS,GAAG,mBAAmB,CAAC;IAChD,MAAM,CAAU,YAAY,GAAG;QAC7B,IAAI,EAAE,CAAC,GAAG;QACV,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAC5B,CAAC;IAEO,iBAAiB,CAAC,MAA2C;QACpE,OAAO,MAAM,CAAC,WAAW,CAAC,eAAe,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC/E,CAAC;IAEQ,YAAY;QACnB,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAElE,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,mCAAmC;QAExE,gEAAgE;QAChE,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAE5E,0BAA0B;QAC1B,MAAM,aAAa,GAAG,cAAc,CAAC,eAAe,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QAEhF,mDAAmD;QACnD,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1C,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;YACzB,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;SAC1B,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,SAAS,CAAC;YACnB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ;YAC5B,IAAI,EAAE,SAAS;YACf,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc;YAC1C,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc;YAC1C,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,CAAC;SACZ,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function getZoomedRange(startTime: number, endTime: number, bounds: [number, number, number, number]): number[];
|
|
2
|
-
/**
|
|
3
|
-
* Get nicely rounded tick close to the natural spacing
|
|
4
|
-
* @param startTime
|
|
5
|
-
* @param endTime
|
|
6
|
-
* @param tickCount
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function getPrettyTicks(startTime: number, endTime: number, tickCount?: number): any[];
|
|
10
|
-
//# sourceMappingURL=tick-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tick-utils.d.ts","sourceRoot":"","sources":["../../src/utils/tick-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,YAKzC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAU,SAmBvF"}
|
package/dist/utils/tick-utils.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
export function getZoomedRange(startTime, endTime, bounds) {
|
|
5
|
-
const [startTimeZoomed, , endTimeZoomed] = bounds;
|
|
6
|
-
// console.log(`startTimeZoomed: ${startTimeZoomed}, endTimeZoomed: ${endTimeZoomed}, tickInterval: ${tickInterval} tickCountZoomed: ${tickCountZoomed}`);
|
|
7
|
-
return [Math.max(startTime, startTimeZoomed), Math.min(endTime, endTimeZoomed)];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Get nicely rounded tick close to the natural spacing
|
|
11
|
-
* @param startTime
|
|
12
|
-
* @param endTime
|
|
13
|
-
* @param tickCount
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export function getPrettyTicks(startTime, endTime, tickCount = 5) {
|
|
17
|
-
const range = endTime - startTime;
|
|
18
|
-
const roughStep = range / (tickCount - 1);
|
|
19
|
-
const exponent = Math.floor(Math.log10(roughStep));
|
|
20
|
-
const base = Math.pow(10, exponent);
|
|
21
|
-
const multiples = [1, 2, 5, 10];
|
|
22
|
-
// Find the smallest multiple that is greater than or equal to roughStep
|
|
23
|
-
const niceStep = multiples.find((m) => base * m >= roughStep) * base;
|
|
24
|
-
const niceStart = Math.ceil(startTime / niceStep) * niceStep;
|
|
25
|
-
const niceEnd = Math.floor(endTime / niceStep) * niceStep;
|
|
26
|
-
const ticks = [];
|
|
27
|
-
for (let t = niceStart; t <= niceEnd; t += niceStep) {
|
|
28
|
-
ticks.push(t);
|
|
29
|
-
}
|
|
30
|
-
return ticks;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=tick-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tick-utils.js","sourceRoot":"","sources":["../../src/utils/tick-utils.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,UAAU,cAAc,CAC5B,SAAiB,EACjB,OAAe,EACf,MAAwC;IAExC,MAAM,CAAC,eAAe,EAAE,AAAD,EAAG,aAAa,CAAC,GAAG,MAAM,CAAC;IAClD,0JAA0J;IAC1J,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AAClF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,OAAe,EAAE,YAAoB,CAAC;IACtF,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;IAClC,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEhC,wEAAwE;IACxE,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC;IAErE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAE1D,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// deck.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
6
|
-
import {Texture} from '@luma.gl/core';
|
|
7
|
-
|
|
8
|
-
const uniformBlock = `\
|
|
9
|
-
layout(std140) uniform horizonLayerUniforms {
|
|
10
|
-
float dataTextureSize; // width = height of the POT texture
|
|
11
|
-
float dataTextureSizeInv;
|
|
12
|
-
float dataTextureCount; // actual number of data points
|
|
13
|
-
|
|
14
|
-
float bands;
|
|
15
|
-
float bandsInv;
|
|
16
|
-
float yAxisScaleInv;
|
|
17
|
-
|
|
18
|
-
vec3 positiveColor;
|
|
19
|
-
vec3 negativeColor;
|
|
20
|
-
} horizonLayer;
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
type HorizonLayerBindingProps = {
|
|
24
|
-
dataTexture: Texture;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
type HorizonLayerUniformProps = {};
|
|
28
|
-
|
|
29
|
-
export type HorizonLayerProps = HorizonLayerBindingProps & HorizonLayerUniformProps;
|
|
30
|
-
|
|
31
|
-
export const horizonLayerUniforms = {
|
|
32
|
-
name: 'horizonLayer',
|
|
33
|
-
vs: uniformBlock,
|
|
34
|
-
fs: uniformBlock,
|
|
35
|
-
uniformTypes: {
|
|
36
|
-
dataTextureSize: 'f32',
|
|
37
|
-
dataTextureSizeInv: 'f32',
|
|
38
|
-
dataTextureCount: 'f32',
|
|
39
|
-
|
|
40
|
-
bands: 'f32',
|
|
41
|
-
bandsInv: 'f32',
|
|
42
|
-
yAxisScaleInv: 'f32',
|
|
43
|
-
|
|
44
|
-
positiveColor: 'vec3<f32>',
|
|
45
|
-
negativeColor: 'vec3<f32>'
|
|
46
|
-
}
|
|
47
|
-
} as const satisfies ShaderModule<HorizonLayerProps>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// deck.gl-community
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
export default `#version 300 es
|
|
6
|
-
#define SHADER_NAME horizon-graph-layer-fragment-shader
|
|
7
|
-
|
|
8
|
-
precision highp float;
|
|
9
|
-
precision highp int;
|
|
10
|
-
|
|
11
|
-
/******* UNIFORM *******/
|
|
12
|
-
|
|
13
|
-
uniform sampler2D dataTexture;
|
|
14
|
-
|
|
15
|
-
/******* IN *******/
|
|
16
|
-
|
|
17
|
-
in vec2 v_uv;
|
|
18
|
-
|
|
19
|
-
/******* OUT *******/
|
|
20
|
-
|
|
21
|
-
out vec4 fragColor;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/******* MAIN *******/
|
|
25
|
-
|
|
26
|
-
void main(void) {
|
|
27
|
-
// horizontal position to sample index
|
|
28
|
-
float idx = v_uv.x * horizonLayer.dataTextureCount;
|
|
29
|
-
// idx = clamp(idx, 0.0, horizonLayer.dataTextureCount - 1.0); // NEEDED???
|
|
30
|
-
|
|
31
|
-
// fetch single data point & normalize (-1,+1)
|
|
32
|
-
float fy = floor(idx * horizonLayer.dataTextureSizeInv);
|
|
33
|
-
float fx = idx - fy * horizonLayer.dataTextureSize;
|
|
34
|
-
float val = texelFetch(dataTexture, ivec2(int(fx), int(fy)), 0).r;
|
|
35
|
-
val *= horizonLayer.yAxisScaleInv;
|
|
36
|
-
|
|
37
|
-
// band layering
|
|
38
|
-
float fband = abs(val) * horizonLayer.bands;
|
|
39
|
-
float bandIdx = clamp(floor(fband), 0.0, horizonLayer.bands - 1.0);
|
|
40
|
-
float bandFrac = fract(fband);
|
|
41
|
-
|
|
42
|
-
// calc our position value and find out color (using mix+step instead of if...else)
|
|
43
|
-
float positive = step(0.0, val); // 1 if pos, else 0
|
|
44
|
-
vec3 baseCol = mix(horizonLayer.negativeColor, horizonLayer.positiveColor, positive);
|
|
45
|
-
float curPos = mix(v_uv.y, 1.0 - v_uv.y, positive);
|
|
46
|
-
float addOne = step(curPos, bandFrac);
|
|
47
|
-
|
|
48
|
-
float band = bandIdx + addOne;
|
|
49
|
-
float whiten = 1.0 - band * horizonLayer.bandsInv;
|
|
50
|
-
|
|
51
|
-
fragColor = vec4(mix(baseCol, vec3(1.0), whiten), 1.0);
|
|
52
|
-
}
|
|
53
|
-
`;
|