@deck.gl/aggregation-layers 9.0.0-beta.5 → 9.0.0-beta.7
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/contour-layer/contour-layer.d.ts.map +1 -1
- package/dist/contour-layer/contour-layer.js +2 -3
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.js +1 -2
- package/dist/dist.dev.js +228 -314
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +2 -6
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +50 -79
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +4 -4
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +1 -1
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -1
- package/dist/gpu-grid-layer/gpu-grid-layer.js +4 -4
- package/dist/grid-aggregation-layer.js +1 -1
- package/dist/heatmap-layer/heatmap-layer.d.ts +0 -1
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer.js +4 -20
- package/dist/heatmap-layer/max-fs.glsl.js +2 -2
- package/dist/heatmap-layer/max-vs.glsl.js +6 -10
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +15 -25
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +11 -16
- package/dist/heatmap-layer/weights-fs.glsl.js +7 -11
- package/dist/heatmap-layer/weights-vs.glsl.js +7 -12
- package/dist/hexagon-layer/hexagon-layer.d.ts +1 -1
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/dist/hexagon-layer/hexagon-layer.js +1 -2
- package/dist/index.cjs +223 -390
- package/dist/index.cjs.map +3 -3
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +1 -2
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +0 -3
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +5 -10
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +30 -42
- package/dist/screen-grid-layer/screen-grid-layer.d.ts +0 -3
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer.js +1 -8
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +6 -9
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +14 -25
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +2 -6
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +25 -42
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +8 -8
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +13 -24
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +4 -9
- package/dist.min.js +298 -450
- package/package.json +8 -10
- package/src/contour-layer/contour-layer.ts +2 -3
- package/src/cpu-grid-layer/cpu-grid-layer.ts +1 -2
- package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +1 -1
- package/src/gpu-grid-layer/gpu-grid-layer.ts +2 -2
- package/src/heatmap-layer/heatmap-layer.ts +5 -23
- package/src/hexagon-layer/hexagon-layer.ts +2 -3
- package/src/screen-grid-layer/screen-grid-cell-layer.ts +0 -4
- package/src/screen-grid-layer/screen-grid-layer.ts +1 -11
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +4 -15
|
@@ -20,15 +20,11 @@
|
|
|
20
20
|
export default `\
|
|
21
21
|
#version 300 es
|
|
22
22
|
#define SHADER_NAME gpu-grid-cell-layer-fragment-shader
|
|
23
|
-
|
|
24
23
|
precision highp float;
|
|
25
|
-
|
|
26
24
|
in vec4 vColor;
|
|
27
|
-
|
|
28
25
|
out vec4 fragColor;
|
|
29
|
-
|
|
30
26
|
void main(void) {
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
fragColor = vColor;
|
|
28
|
+
fragColor = picking_filterColor(fragColor);
|
|
33
29
|
}
|
|
34
30
|
`;
|
|
@@ -22,22 +22,17 @@ export default `\
|
|
|
22
22
|
#version 300 es
|
|
23
23
|
#define SHADER_NAME gpu-grid-cell-layer-vertex-shader
|
|
24
24
|
#define RANGE_COUNT 6
|
|
25
|
-
|
|
26
25
|
in vec3 positions;
|
|
27
26
|
in vec3 normals;
|
|
28
|
-
|
|
29
27
|
in vec4 colors;
|
|
30
28
|
in vec4 elevations;
|
|
31
29
|
in vec3 instancePickingColors;
|
|
32
|
-
|
|
33
|
-
// Custom uniforms
|
|
34
30
|
uniform vec2 offset;
|
|
35
31
|
uniform bool extruded;
|
|
36
32
|
uniform float cellSize;
|
|
37
33
|
uniform float coverage;
|
|
38
34
|
uniform float opacity;
|
|
39
35
|
uniform float elevationScale;
|
|
40
|
-
|
|
41
36
|
uniform ivec2 gridSize;
|
|
42
37
|
uniform vec2 gridOrigin;
|
|
43
38
|
uniform vec2 gridOriginLow;
|
|
@@ -45,97 +40,73 @@ uniform vec2 gridOffset;
|
|
|
45
40
|
uniform vec2 gridOffsetLow;
|
|
46
41
|
uniform vec4 colorRange[RANGE_COUNT];
|
|
47
42
|
uniform vec2 elevationRange;
|
|
48
|
-
|
|
49
|
-
// Domain uniforms
|
|
50
43
|
uniform vec2 colorDomain;
|
|
51
44
|
uniform bool colorDomainValid;
|
|
52
45
|
uniform vec2 elevationDomain;
|
|
53
46
|
uniform bool elevationDomainValid;
|
|
54
|
-
|
|
55
47
|
layout(std140) uniform;
|
|
56
48
|
uniform ColorData
|
|
57
49
|
{
|
|
58
|
-
|
|
50
|
+
vec4 maxMinCount;
|
|
59
51
|
} colorData;
|
|
60
52
|
uniform ElevationData
|
|
61
53
|
{
|
|
62
|
-
|
|
54
|
+
vec4 maxMinCount;
|
|
63
55
|
} elevationData;
|
|
64
|
-
|
|
65
56
|
#define EPSILON 0.00001
|
|
66
|
-
|
|
67
|
-
// Result
|
|
68
57
|
out vec4 vColor;
|
|
69
|
-
|
|
70
58
|
vec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
59
|
+
vec4 outColor = vec4(0., 0., 0., 0.);
|
|
60
|
+
if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
|
|
61
|
+
float domainRange = domain.y - domain.x;
|
|
62
|
+
if (domainRange <= 0.) {
|
|
63
|
+
outColor = colorRange[0];
|
|
64
|
+
} else {
|
|
65
|
+
float rangeCount = float(RANGE_COUNT);
|
|
66
|
+
float rangeStep = domainRange / rangeCount;
|
|
67
|
+
float idx = floor((value - domain.x) / rangeStep);
|
|
68
|
+
idx = clamp(idx, 0., rangeCount - 1.);
|
|
69
|
+
int intIdx = int(idx);
|
|
70
|
+
outColor = colorRange[intIdx];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return outColor;
|
|
86
74
|
}
|
|
87
|
-
|
|
88
75
|
float linearScale(vec2 domain, vec2 range, float value) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
|
|
77
|
+
return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;
|
|
78
|
+
}
|
|
79
|
+
return -1.;
|
|
93
80
|
}
|
|
94
|
-
|
|
95
81
|
void main(void) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
picking_setPickingColor(instancePickingColors);
|
|
126
|
-
|
|
127
|
-
gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
|
|
128
|
-
|
|
129
|
-
// Light calculations
|
|
130
|
-
// Worldspace is the linear space after Mercator projection
|
|
131
|
-
|
|
132
|
-
vec3 normals_commonspace = project_normal(normals);
|
|
133
|
-
|
|
134
|
-
if (extruded) {
|
|
135
|
-
vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);
|
|
136
|
-
vColor = vec4(lightColor, color.a * opacity) / 255.;
|
|
137
|
-
} else {
|
|
138
|
-
vColor = vec4(color.rgb, color.a * opacity) / 255.;
|
|
139
|
-
}
|
|
82
|
+
vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);
|
|
83
|
+
vec4 color = quantizeScale(clrDomain, colorRange, colors.r);
|
|
84
|
+
float elevation = 0.0;
|
|
85
|
+
if (extruded) {
|
|
86
|
+
vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);
|
|
87
|
+
elevation = linearScale(elvDomain, elevationRange, elevations.r);
|
|
88
|
+
elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;
|
|
89
|
+
}
|
|
90
|
+
float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);
|
|
91
|
+
float dotRadius = cellSize / 2. * coverage * shouldRender;
|
|
92
|
+
int yIndex = (gl_InstanceID / gridSize[0]);
|
|
93
|
+
int xIndex = gl_InstanceID - (yIndex * gridSize[0]);
|
|
94
|
+
vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));
|
|
95
|
+
instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));
|
|
96
|
+
vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));
|
|
97
|
+
instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));
|
|
98
|
+
vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);
|
|
99
|
+
vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);
|
|
100
|
+
geometry.worldPosition = centroidPosition;
|
|
101
|
+
vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);
|
|
102
|
+
picking_setPickingColor(instancePickingColors);
|
|
103
|
+
gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
|
|
104
|
+
vec3 normals_commonspace = project_normal(normals);
|
|
105
|
+
if (extruded) {
|
|
106
|
+
vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);
|
|
107
|
+
vColor = vec4(lightColor, color.a * opacity) / 255.;
|
|
108
|
+
} else {
|
|
109
|
+
vColor = vec4(color.rgb, color.a * opacity) / 255.;
|
|
110
|
+
}
|
|
140
111
|
}
|
|
141
112
|
`;
|
|
@@ -107,12 +107,12 @@ export default class GPUGridCellLayer extends Layer {
|
|
|
107
107
|
this.unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer);
|
|
108
108
|
}
|
|
109
109
|
bindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {
|
|
110
|
-
colorMaxMinBuffer.bind({ target:
|
|
111
|
-
elevationMaxMinBuffer.bind({ target:
|
|
110
|
+
colorMaxMinBuffer.bind({ target: 35345, index: COLOR_DATA_UBO_INDEX });
|
|
111
|
+
elevationMaxMinBuffer.bind({ target: 35345, index: ELEVATION_DATA_UBO_INDEX });
|
|
112
112
|
}
|
|
113
113
|
unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {
|
|
114
|
-
colorMaxMinBuffer.unbind({ target:
|
|
115
|
-
elevationMaxMinBuffer.unbind({ target:
|
|
114
|
+
colorMaxMinBuffer.unbind({ target: 35345, index: COLOR_DATA_UBO_INDEX });
|
|
115
|
+
elevationMaxMinBuffer.unbind({ target: 35345, index: ELEVATION_DATA_UBO_INDEX });
|
|
116
116
|
}
|
|
117
117
|
getDomainUniforms() {
|
|
118
118
|
const { colorDomain, elevationDomain } = this.props;
|
|
@@ -78,7 +78,7 @@ export type _GPUGridLayerProps<DataT> = {
|
|
|
78
78
|
*/
|
|
79
79
|
getElevationWeight?: Accessor<DataT, number>;
|
|
80
80
|
};
|
|
81
|
-
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU
|
|
81
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU. */
|
|
82
82
|
export default class GPUGridLayer<DataT = any, ExtraPropsT extends {} = {}> extends GridAggregationLayer<DataT, ExtraPropsT & Required<_GPUGridLayerProps<DataT>>> {
|
|
83
83
|
static layerName: string;
|
|
84
84
|
static defaultProps: DefaultProps<GPUGridLayerProps<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-grid-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-layer.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,oBAAoB,EACpB,YAAY,EAEZ,WAAW,EACX,QAAQ,EACR,YAAY,EACb,MAAM,eAAe,CAAC;AAKvB,OAAO,gBAAgB,iCAA8B;AACrD,OAAO,EAA4B,QAAQ,EAAC,+CAA4C;AACxF,OAAO,oBAAoB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
|
// rest of the changes are detected by `state.attributesChanged`
|
|
56
56
|
};
|
|
57
57
|
const POSITION_ATTRIBUTE_NAME = 'positions';
|
|
58
|
-
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU
|
|
58
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU. */
|
|
59
59
|
export default class GPUGridLayer extends GridAggregationLayer {
|
|
60
60
|
static { this.layerName = 'GPUGridLayer'; }
|
|
61
61
|
static { this.defaultProps = defaultProps; }
|
|
@@ -79,7 +79,7 @@ export default class GPUGridLayer extends GridAggregationLayer {
|
|
|
79
79
|
maxMinBuffer: device.createBuffer({
|
|
80
80
|
byteLength: 4 * 4,
|
|
81
81
|
// @ts-expect-error webgl-legacy
|
|
82
|
-
accessor: { size: 4, type:
|
|
82
|
+
accessor: { size: 4, type: 5126, divisor: 1 }
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
85
|
elevation: {
|
|
@@ -89,7 +89,7 @@ export default class GPUGridLayer extends GridAggregationLayer {
|
|
|
89
89
|
maxMinBuffer: device.createBuffer({
|
|
90
90
|
byteLength: 4 * 4,
|
|
91
91
|
// @ts-expect-error
|
|
92
|
-
accessor: { size: 4, type:
|
|
92
|
+
accessor: { size: 4, type: 5126, divisor: 1 }
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
},
|
|
@@ -100,7 +100,7 @@ export default class GPUGridLayer extends GridAggregationLayer {
|
|
|
100
100
|
[POSITION_ATTRIBUTE_NAME]: {
|
|
101
101
|
size: 3,
|
|
102
102
|
accessor: 'getPosition',
|
|
103
|
-
type:
|
|
103
|
+
type: 'float64',
|
|
104
104
|
fp64: this.use64bitPositions()
|
|
105
105
|
},
|
|
106
106
|
color: { size: 3, accessor: 'getColorWeight' },
|
|
@@ -74,7 +74,6 @@ export default class HeatmapLayer<DataT = any, ExtraPropsT extends {} = {}> exte
|
|
|
74
74
|
static layerName: string;
|
|
75
75
|
static defaultProps: DefaultProps<HeatmapLayerProps<unknown>>;
|
|
76
76
|
state: AggregationLayer<DataT>['state'] & {
|
|
77
|
-
supported: boolean;
|
|
78
77
|
colorDomain?: number[];
|
|
79
78
|
isWeightMapDirty?: boolean;
|
|
80
79
|
weightsTexture?: Texture;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAC,MAAM,EAAiB,OAAO,EAAgB,aAAa,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAC,MAAM,EAAiB,OAAO,EAAgB,aAAa,EAAC,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,gBAAgB,EAAwB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,gCAA6B;AAiD7E,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACxE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,KAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,M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gB,CAAC;QACtC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,aAAa,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC7B,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC;KAC7B,CAAC;IAEF,eAAe;IAQf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAMvD,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAKxC,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8BhD,YAAY,IAAI,UAAU,GAAG,KAAK;IAwClC,aAAa,CAAC,OAAO,EAAE,YAAY;IA2BnC,oBAAoB;IAOpB,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;;IAuB5C,eAAe;IAmBf,gBAAgB;IAShB,mBAAmB;IAgBnB,uBAAuB,CAAC,OAAO,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAC;IA0B1D,eAAe;IA0Cf,aAAa,CAAC,aAAa,KAAA;IAS3B,qBAAqB;IAUrB,aAAa,CAAC,WAAW,GAAE,GAAW,GAAG,OAAO;IAkDhD,6BAA6B;IAe7B,mBAAmB,CAAC,IAAI,KAAA;IAoBxB,gBAAgB;IAwChB,yBAAyB,CAAC,SAAS,UAAQ;IAsB3C,oBAAoB,CAAC,WAAW,KAAA,EAAE,IAAI,GAAE;QAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;KAAM;IA0CjF,oBAAoB,CAAC,YAAY,KAAA;CAQlC"}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
// THE SOFTWARE.
|
|
20
20
|
/* global setTimeout clearTimeout */
|
|
21
21
|
import { getBounds, boundsContain, packVertices, scaleToAspectRatio, getTextureCoordinates } from "./heatmap-layer-utils.js";
|
|
22
|
-
import { GL } from '@luma.gl/constants';
|
|
23
22
|
import { TextureTransform } from '@luma.gl/engine';
|
|
24
23
|
import { AttributeManager, COORDINATE_SYSTEM, log } from '@deck.gl/core';
|
|
25
24
|
import TriangleLayer from "./triangle-layer.js";
|
|
@@ -58,13 +57,9 @@ const defaultProps = {
|
|
|
58
57
|
weightsTextureSize: { type: 'number', min: 128, max: 2048, value: 2048 },
|
|
59
58
|
debounceTimeout: { type: 'number', min: 0, max: 1000, value: 500 }
|
|
60
59
|
};
|
|
61
|
-
const REQUIRED_FEATURES = [
|
|
62
|
-
'blend-minmax-webgl1', // max weight calculation
|
|
63
|
-
'texture-formats-float32-webgl1' // weight-map as texture
|
|
64
|
-
];
|
|
65
60
|
const FLOAT_TARGET_FEATURES = [
|
|
66
|
-
'
|
|
67
|
-
'texture-blend-float-
|
|
61
|
+
'float32-renderable-webgl', // ability to render to float texture
|
|
62
|
+
'texture-blend-float-webgl' // ability to blend when rendering to float texture
|
|
68
63
|
];
|
|
69
64
|
const DIMENSIONS = {
|
|
70
65
|
data: {
|
|
@@ -76,13 +71,8 @@ export default class HeatmapLayer extends AggregationLayer {
|
|
|
76
71
|
static { this.layerName = 'HeatmapLayer'; }
|
|
77
72
|
static { this.defaultProps = defaultProps; }
|
|
78
73
|
initializeState() {
|
|
79
|
-
if (!REQUIRED_FEATURES.every(feature => this.context.device.features.has(feature))) {
|
|
80
|
-
this.setState({ supported: false });
|
|
81
|
-
log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
74
|
super.initializeAggregationLayer(DIMENSIONS);
|
|
85
|
-
this.setState({
|
|
75
|
+
this.setState({ colorDomain: DEFAULT_COLOR_DOMAIN });
|
|
86
76
|
this._setupTextureParams();
|
|
87
77
|
this._setupAttributes();
|
|
88
78
|
this._setupResources();
|
|
@@ -93,9 +83,6 @@ export default class HeatmapLayer extends AggregationLayer {
|
|
|
93
83
|
}
|
|
94
84
|
/* eslint-disable max-statements,complexity */
|
|
95
85
|
updateState(opts) {
|
|
96
|
-
if (!this.state.supported) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
86
|
super.updateState(opts);
|
|
100
87
|
this._updateHeatmapState(opts);
|
|
101
88
|
}
|
|
@@ -125,9 +112,6 @@ export default class HeatmapLayer extends AggregationLayer {
|
|
|
125
112
|
this.setState({ zoom: opts.context.viewport.zoom });
|
|
126
113
|
}
|
|
127
114
|
renderLayers() {
|
|
128
|
-
if (!this.state.supported) {
|
|
129
|
-
return [];
|
|
130
|
-
}
|
|
131
115
|
const { weightsTexture, triPositionBuffer, triTexCoordBuffer, maxWeightsTexture, colorTexture, colorDomain } = this.state;
|
|
132
116
|
const { updateTriggers, intensity, threshold, aggregation } = this.props;
|
|
133
117
|
const TriangleLayerClass = this.getSubLayerClass('triangle', TriangleLayer);
|
|
@@ -213,7 +197,7 @@ export default class HeatmapLayer extends AggregationLayer {
|
|
|
213
197
|
_setupAttributes() {
|
|
214
198
|
const attributeManager = this.getAttributeManager();
|
|
215
199
|
attributeManager.add({
|
|
216
|
-
positions: { size: 3, type:
|
|
200
|
+
positions: { size: 3, type: 'float64', accessor: 'getPosition' },
|
|
217
201
|
weights: { size: 1, accessor: 'getWeight' }
|
|
218
202
|
});
|
|
219
203
|
this.setState({ positionAttributeName: 'positions' });
|
|
@@ -3,17 +3,13 @@ export default `\
|
|
|
3
3
|
uniform sampler2D inTexture;
|
|
4
4
|
uniform float textureSize;
|
|
5
5
|
out vec4 outTexture;
|
|
6
|
-
|
|
7
6
|
void main()
|
|
8
7
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
16
|
-
// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
|
|
17
|
-
gl_PointSize = 1.0;
|
|
8
|
+
int yIndex = gl_VertexID / int(textureSize);
|
|
9
|
+
int xIndex = gl_VertexID - (yIndex * int(textureSize));
|
|
10
|
+
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
|
|
11
|
+
outTexture = texture(inTexture, uv);
|
|
12
|
+
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
13
|
+
gl_PointSize = 1.0;
|
|
18
14
|
}
|
|
19
15
|
`;
|
|
@@ -20,42 +20,32 @@
|
|
|
20
20
|
export default `\
|
|
21
21
|
#version 300 es
|
|
22
22
|
#define SHADER_NAME triangle-layer-fragment-shader
|
|
23
|
-
|
|
24
23
|
precision highp float;
|
|
25
|
-
|
|
26
24
|
uniform float opacity;
|
|
27
25
|
uniform sampler2D weightsTexture;
|
|
28
26
|
uniform sampler2D colorTexture;
|
|
29
27
|
uniform float aggregationMode;
|
|
30
|
-
|
|
31
28
|
in vec2 vTexCoords;
|
|
32
29
|
in float vIntensityMin;
|
|
33
30
|
in float vIntensityMax;
|
|
34
|
-
|
|
35
31
|
out vec4 fragColor;
|
|
36
|
-
|
|
37
32
|
vec4 getLinearColor(float value) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
float factor = clamp(value * vIntensityMax, 0., 1.);
|
|
34
|
+
vec4 color = texture(colorTexture, vec2(factor, 0.5));
|
|
35
|
+
color.a *= min(value * vIntensityMin, 1.0);
|
|
36
|
+
return color;
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
void main(void) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
vec4 linearColor = getLinearColor(weight);
|
|
58
|
-
linearColor.a *= opacity;
|
|
59
|
-
fragColor = linearColor;
|
|
39
|
+
vec4 weights = texture(weightsTexture, vTexCoords);
|
|
40
|
+
float weight = weights.r;
|
|
41
|
+
if (aggregationMode > 0.5) {
|
|
42
|
+
weight /= max(1.0, weights.a);
|
|
43
|
+
}
|
|
44
|
+
if (weight <= 0.) {
|
|
45
|
+
discard;
|
|
46
|
+
}
|
|
47
|
+
vec4 linearColor = getLinearColor(weight);
|
|
48
|
+
linearColor.a *= opacity;
|
|
49
|
+
fragColor = linearColor;
|
|
60
50
|
}
|
|
61
51
|
`;
|
|
@@ -21,32 +21,27 @@
|
|
|
21
21
|
export default `\
|
|
22
22
|
#version 300 es
|
|
23
23
|
#define SHADER_NAME heatp-map-layer-vertex-shader
|
|
24
|
-
|
|
25
24
|
uniform sampler2D maxTexture;
|
|
26
25
|
uniform float intensity;
|
|
27
26
|
uniform vec2 colorDomain;
|
|
28
27
|
uniform float threshold;
|
|
29
28
|
uniform float aggregationMode;
|
|
30
|
-
|
|
31
29
|
in vec3 positions;
|
|
32
30
|
in vec2 texCoords;
|
|
33
|
-
|
|
34
31
|
out vec2 vTexCoords;
|
|
35
32
|
out float vIntensityMin;
|
|
36
33
|
out float vIntensityMax;
|
|
37
|
-
|
|
38
34
|
void main(void) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
vIntensityMin = intensity / minValue;
|
|
35
|
+
gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
|
|
36
|
+
vTexCoords = texCoords;
|
|
37
|
+
vec4 maxTexture = texture(maxTexture, vec2(0.5));
|
|
38
|
+
float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
39
|
+
float minValue = maxValue * threshold;
|
|
40
|
+
if (colorDomain[1] > 0.) {
|
|
41
|
+
maxValue = colorDomain[1];
|
|
42
|
+
minValue = colorDomain[0];
|
|
43
|
+
}
|
|
44
|
+
vIntensityMax = intensity / maxValue;
|
|
45
|
+
vIntensityMin = intensity / minValue;
|
|
51
46
|
}
|
|
52
47
|
`;
|
|
@@ -2,20 +2,16 @@ export default `\
|
|
|
2
2
|
#version 300 es
|
|
3
3
|
in vec4 weightsTexture;
|
|
4
4
|
out vec4 fragColor;
|
|
5
|
-
// Epanechnikov function, keeping for reference
|
|
6
|
-
// float epanechnikovKDE(float u) {
|
|
7
|
-
// return 0.75 * (1.0 - u * u);
|
|
8
|
-
// }
|
|
9
5
|
float gaussianKDE(float u){
|
|
10
|
-
|
|
6
|
+
return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);
|
|
11
7
|
}
|
|
12
8
|
void main()
|
|
13
9
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
float dist = length(gl_PointCoord - vec2(0.5, 0.5));
|
|
11
|
+
if (dist > 0.5) {
|
|
12
|
+
discard;
|
|
13
|
+
}
|
|
14
|
+
fragColor = weightsTexture * gaussianKDE(2. * dist);
|
|
15
|
+
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
20
16
|
}
|
|
21
17
|
`;
|
|
@@ -8,19 +8,14 @@ uniform float radiusPixels;
|
|
|
8
8
|
uniform float textureWidth;
|
|
9
9
|
uniform vec4 commonBounds;
|
|
10
10
|
uniform float weightsScale;
|
|
11
|
-
|
|
12
11
|
void main()
|
|
13
12
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// // map xy from commonBounds to [-1, 1]
|
|
22
|
-
gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
|
|
23
|
-
gl_Position.xy = (gl_Position.xy * 2.) - (1.);
|
|
24
|
-
gl_Position.w = 1.0;
|
|
13
|
+
weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
|
|
14
|
+
float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
|
|
15
|
+
gl_PointSize = radiusTexels * 2.;
|
|
16
|
+
vec3 commonPosition = project_position(positions, positions64Low);
|
|
17
|
+
gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
|
|
18
|
+
gl_Position.xy = (gl_Position.xy * 2.) - (1.);
|
|
19
|
+
gl_Position.w = 1.0;
|
|
25
20
|
}
|
|
26
21
|
`;
|
|
@@ -144,7 +144,7 @@ type _HexagonLayerProps<DataT = unknown> = {
|
|
|
144
144
|
_filterData: null | ((d: DataT) => boolean);
|
|
145
145
|
};
|
|
146
146
|
/** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */
|
|
147
|
-
export default class HexagonLayer<DataT, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_HexagonLayerProps
|
|
147
|
+
export default class HexagonLayer<DataT, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_HexagonLayerProps<DataT>>> {
|
|
148
148
|
static layerName: string;
|
|
149
149
|
static defaultProps: DefaultProps<HexagonLayerProps<unknown>>;
|
|
150
150
|
state: AggregationLayer<DataT>['state'] & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,M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AAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAClD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,2CAAgB;IAEnC,KAAK,EAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG;QACzC,aAAa,EAAE,aAAa,CAAC;QAC7B,eAAe,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QACxC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC;KAC7B,CAAC;IACF,eAAe;IAmBf,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAyBxC,0BAA0B,CAAC,eAAe,KAAA;IA6B1C,cAAc,CAAC,EAAC,IAAI,EAAC;;KAAA;IAKrB,mBAAmB,CAAC,IAAI,KAAA;IAKxB,uBAAuB,CAAC,IAAI,KAAA;IAI5B,0BAA0B;IAI1B,YAAY;CAyCb"}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
// THE SOFTWARE.
|
|
20
20
|
import { log } from '@deck.gl/core';
|
|
21
21
|
import { ColumnLayer } from '@deck.gl/layers';
|
|
22
|
-
import { GL } from '@luma.gl/constants';
|
|
23
22
|
import { defaultColorRange } from "../utils/color-utils.js";
|
|
24
23
|
import { pointToHexbin } from "./hexagon-aggregator.js";
|
|
25
24
|
import CPUAggregator from "../utils/cpu-aggregator.js";
|
|
@@ -74,7 +73,7 @@ export default class HexagonLayer extends AggregationLayer {
|
|
|
74
73
|
};
|
|
75
74
|
const attributeManager = this.getAttributeManager();
|
|
76
75
|
attributeManager.add({
|
|
77
|
-
positions: { size: 3, type:
|
|
76
|
+
positions: { size: 3, type: 'float64', accessor: 'getPosition' }
|
|
78
77
|
});
|
|
79
78
|
// color and elevation attributes can't be added as attributes
|
|
80
79
|
// they are calculated using 'getValue' accessor that takes an array of pints.
|