@flowmap.gl/layers 8.0.0-alpha.9 → 8.0.2
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/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-dev.log +26 -0
- package/LICENSE +2 -2
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.d.ts.map +1 -1
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.js +16 -22
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerFragment.glsl.d.ts.map +1 -1
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerFragment.glsl.js +4 -16
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerVertex.glsl.d.ts.map +1 -1
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerVertex.glsl.js +4 -16
- package/dist/AnimatedFlowLinesLayer/index.d.ts.map +1 -1
- package/dist/AnimatedFlowLinesLayer/index.js +6 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayer.d.ts +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayer.d.ts.map +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayer.js +9 -18
- package/dist/FlowCirclesLayer/FlowCirclesLayerFragment.glsl.d.ts +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayerFragment.glsl.d.ts.map +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayerFragment.glsl.js +5 -16
- package/dist/FlowCirclesLayer/FlowCirclesLayerVertex.glsl.d.ts.map +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayerVertex.glsl.js +4 -16
- package/dist/FlowCirclesLayer/index.d.ts.map +1 -1
- package/dist/FlowCirclesLayer/index.js +6 -1
- package/dist/FlowLinesLayer/FlowLinesLayer.d.ts.map +1 -1
- package/dist/FlowLinesLayer/FlowLinesLayer.js +79 -73
- package/dist/FlowLinesLayer/FlowLinesLayerFragment.glsl.d.ts.map +1 -1
- package/dist/FlowLinesLayer/FlowLinesLayerFragment.glsl.js +4 -16
- package/dist/FlowLinesLayer/FlowLinesLayerVertex.glsl.d.ts +1 -1
- package/dist/FlowLinesLayer/FlowLinesLayerVertex.glsl.d.ts.map +1 -1
- package/dist/FlowLinesLayer/FlowLinesLayerVertex.glsl.js +5 -21
- package/dist/FlowLinesLayer/index.d.ts.map +1 -1
- package/dist/FlowLinesLayer/index.js +6 -1
- package/dist/FlowmapLayer.d.ts +17 -9
- package/dist/FlowmapLayer.d.ts.map +1 -1
- package/dist/FlowmapLayer.js +241 -141
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/types.d.ts +12 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/package.json +7 -3
- package/src/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.ts +7 -19
- package/src/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerFragment.glsl.ts +3 -15
- package/src/AnimatedFlowLinesLayer/AnimatedFlowLinesLayerVertex.glsl.ts +3 -15
- package/src/AnimatedFlowLinesLayer/index.ts +6 -0
- package/src/FlowCirclesLayer/FlowCirclesLayer.ts +3 -15
- package/src/FlowCirclesLayer/FlowCirclesLayerFragment.glsl.ts +4 -15
- package/src/FlowCirclesLayer/FlowCirclesLayerVertex.glsl.ts +3 -15
- package/src/FlowCirclesLayer/index.ts +6 -0
- package/src/FlowLinesLayer/FlowLinesLayer.ts +74 -80
- package/src/FlowLinesLayer/FlowLinesLayerFragment.glsl.ts +3 -15
- package/src/FlowLinesLayer/FlowLinesLayerVertex.glsl.ts +4 -20
- package/src/FlowLinesLayer/index.ts +6 -0
- package/src/FlowmapLayer.ts +164 -78
- package/src/index.ts +6 -0
- package/src/types.ts +17 -4
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEtD,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
1
6
|
export { default as AnimatedFlowLinesLayer } from './AnimatedFlowLinesLayer';
|
|
2
7
|
export { default as FlowLinesLayer } from './FlowLinesLayer';
|
|
3
8
|
export { default as FlowCirclesLayer } from './FlowCirclesLayer';
|
|
4
9
|
export { default as FlowmapLayer } from './FlowmapLayer';
|
|
5
10
|
export * from './types';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUVILE9BQU8sRUFBQyxPQUFPLElBQUksc0JBQXNCLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUMzRSxPQUFPLEVBQUMsT0FBTyxJQUFJLGNBQWMsRUFBQyxNQUFNLGtCQUFrQixDQUFDO0FBQzNELE9BQU8sRUFBQyxPQUFPLElBQUksZ0JBQWdCLEVBQUMsTUFBTSxvQkFBb0IsQ0FBQztBQUMvRCxPQUFPLEVBQUMsT0FBTyxJQUFJLFlBQVksRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBR3ZELGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIENvcHlyaWdodCAoYykgRmxvd21hcC5nbCBjb250cmlidXRvcnNcbiAqIENvcHlyaWdodCAoYykgMjAxOC0yMDIwIFRlcmFseXRpY3NcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBBcGFjaGUtMi4wXG4gKi9cblxuZXhwb3J0IHtkZWZhdWx0IGFzIEFuaW1hdGVkRmxvd0xpbmVzTGF5ZXJ9IGZyb20gJy4vQW5pbWF0ZWRGbG93TGluZXNMYXllcic7XG5leHBvcnQge2RlZmF1bHQgYXMgRmxvd0xpbmVzTGF5ZXJ9IGZyb20gJy4vRmxvd0xpbmVzTGF5ZXInO1xuZXhwb3J0IHtkZWZhdWx0IGFzIEZsb3dDaXJjbGVzTGF5ZXJ9IGZyb20gJy4vRmxvd0NpcmNsZXNMYXllcic7XG5leHBvcnQge2RlZmF1bHQgYXMgRmxvd21hcExheWVyfSBmcm9tICcuL0Zsb3dtYXBMYXllcic7XG5leHBvcnQgdHlwZSB7Rmxvd21hcExheWVyUHJvcHN9IGZyb20gJy4vRmxvd21hcExheWVyJztcblxuZXhwb3J0ICogZnJvbSAnLi90eXBlcyc7XG4iXX0=
|
package/dist/types.d.ts
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { AggregateFlow, ClusterNode, LocationTotals } from '@flowmap.gl/data';
|
|
2
|
-
export
|
|
2
|
+
export type LayerProps = Record<string, unknown>;
|
|
3
3
|
export declare enum PickingType {
|
|
4
4
|
LOCATION = "location",
|
|
5
5
|
FLOW = "flow"
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type DeckGLLayer = Record<string, any>;
|
|
8
8
|
export interface PickingInfo<T> {
|
|
9
9
|
layer: DeckGLLayer;
|
|
10
10
|
index: number;
|
|
11
|
+
picked: boolean;
|
|
11
12
|
object: T | undefined;
|
|
12
13
|
x: number;
|
|
13
14
|
y: number;
|
|
14
15
|
coordinate: [number, number];
|
|
16
|
+
event: MouseEvent | undefined;
|
|
15
17
|
}
|
|
16
|
-
export interface
|
|
18
|
+
export interface LocationPickingInfoObject<L> {
|
|
19
|
+
id: string | number;
|
|
17
20
|
type: PickingType.LOCATION;
|
|
18
|
-
|
|
21
|
+
location: L | ClusterNode;
|
|
19
22
|
name: string;
|
|
20
23
|
totals: LocationTotals;
|
|
21
24
|
circleRadius: number;
|
|
22
|
-
event: MouseEvent | undefined;
|
|
23
25
|
}
|
|
24
|
-
export
|
|
26
|
+
export type LocationPickingInfo<L> = PickingInfo<LocationPickingInfoObject<L>>;
|
|
27
|
+
export interface FlowPickingInfoObject<L, F> {
|
|
25
28
|
type: PickingType.FLOW;
|
|
29
|
+
flow: F | AggregateFlow;
|
|
26
30
|
origin: L | ClusterNode;
|
|
27
31
|
dest: L | ClusterNode;
|
|
28
32
|
count: number;
|
|
29
33
|
}
|
|
30
|
-
export
|
|
34
|
+
export type FlowPickingInfo<L, F> = PickingInfo<FlowPickingInfoObject<L, F>>;
|
|
35
|
+
export type FlowmapLayerPickingInfo<L, F> = LocationPickingInfo<L> | FlowPickingInfo<L, F>;
|
|
31
36
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EAEb,WAAW,EACX,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA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,CAAC,CAAC,EAAE,CAAC,IACpC,mBAAmB,CAAC,CAAC,CAAC,GAEtB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
1
6
|
export var PickingType;
|
|
2
7
|
(function (PickingType) {
|
|
3
8
|
PickingType["LOCATION"] = "location";
|
|
@@ -17,4 +22,4 @@ export var PickingType;
|
|
|
17
22
|
// .type === 'FeatureCollection'
|
|
18
23
|
// );
|
|
19
24
|
// }
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQVdILE1BQU0sQ0FBTixJQUFZLFdBSVg7QUFKRCxXQUFZLFdBQVc7SUFDckIsb0NBQXFCLENBQUE7SUFDckIsNEJBQWEsQ0FBQTtJQUNiLG1DQUFtQztBQUNyQyxDQUFDLEVBSlcsV0FBVyxLQUFYLFdBQVcsUUFJdEI7QUE4Q0QsNkRBQTZEO0FBQzdELDREQUE0RDtBQUU1RCwwQkFBMEI7QUFDMUIsNERBQTREO0FBQzVELHNCQUFzQjtBQUV0Qix1Q0FBdUM7QUFDdkMsMEJBQTBCO0FBQzFCLDBFQUEwRTtBQUMxRSxhQUFhO0FBQ2IsMkVBQTJFO0FBQzNFLHNDQUFzQztBQUN0QyxPQUFPO0FBQ1AsSUFBSSIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBDb3B5cmlnaHQgKGMpIEZsb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cbi8vIGV4cG9ydCB0eXBlIExvY2F0aW9ucyA9XG4vLyAgIHwgRmVhdHVyZUNvbGxlY3Rpb248R2VvbWV0cnlPYmplY3QsIExvY2F0aW9uUHJvcGVydGllcz5cbi8vICAgfCBGbG93TG9jYXRpb25bXTtcblxuLy8gZXhwb3J0IGZ1bmN0aW9uIGlzRmVhdHVyZUNvbGxlY3Rpb24oXG4vLyAgIGxvY2F0aW9uczogTG9jYXRpb25zLFxuLy8gKTogbG9jYXRpb25zIGlzIEZlYXR1cmVDb2xsZWN0aW9uPEdlb21ldHJ5T2JqZWN0LCBMb2NhdGlvblByb3BlcnRpZXM+IHtcbi8vICAgcmV0dXJuIChcbi8vICAgICAobG9jYXRpb25zIGFzIEZlYXR1cmVDb2xsZWN0aW9uPEdlb21ldHJ5T2JqZWN0LCBMb2NhdGlvblByb3BlcnRpZXM+KVxuLy8gICAgICAgLnR5cGUgPT09ICdGZWF0dXJlQ29sbGVjdGlvbidcbi8vICAgKTtcbi8vIH1cbiJdfQ==
|
package/package.json
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowmap.gl/layers",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"repository": "git@github.com:
|
|
7
|
+
"repository": "git@github.com:visgl/flowmap.gl.git",
|
|
8
8
|
"author": "Ilya Boyandin <ilya@boyandin.me>",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
|
+
"type": "module",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"dev": "tsc --watch",
|
|
12
13
|
"build": "rm -rf dist && tsc",
|
|
13
14
|
"prepare": "yarn build"
|
|
14
15
|
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@flowmap.gl/data": "^8.0.2"
|
|
18
|
+
},
|
|
15
19
|
"peerDependencies": {
|
|
16
20
|
"@deck.gl/core": "^8.6.5",
|
|
17
21
|
"@deck.gl/layers": "^8.6.5",
|
|
18
22
|
"@luma.gl/constants": "^8.5.10",
|
|
19
23
|
"@luma.gl/core": "^8.5.10"
|
|
20
24
|
},
|
|
21
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "b55bad6919f236f7e38def565e27f231b9323e38",
|
|
22
26
|
"publishConfig": {
|
|
23
27
|
"access": "public"
|
|
24
28
|
}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
|
|
19
7
|
import {Layer, picking, project32} from '@deck.gl/core';
|
|
@@ -95,11 +83,13 @@ export default class AnimatedFlowLinesLayer<F> extends Layer {
|
|
|
95
83
|
attributeManager.addInstanced({
|
|
96
84
|
instanceSourcePositions: {
|
|
97
85
|
size: 3,
|
|
86
|
+
type: GL.DOUBLE,
|
|
98
87
|
transition: true,
|
|
99
88
|
accessor: 'getSourcePosition',
|
|
100
89
|
},
|
|
101
90
|
instanceTargetPositions: {
|
|
102
91
|
size: 3,
|
|
92
|
+
type: GL.DOUBLE,
|
|
103
93
|
transition: true,
|
|
104
94
|
accessor: 'getTargetPosition',
|
|
105
95
|
},
|
|
@@ -139,10 +129,8 @@ export default class AnimatedFlowLinesLayer<F> extends Layer {
|
|
|
139
129
|
|
|
140
130
|
if (changeFlags.extensionsChanged) {
|
|
141
131
|
const {gl} = this.context;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
this.setState({model: this._getModel(gl)});
|
|
132
|
+
this.state.model?.delete();
|
|
133
|
+
this.state.model = this._getModel(gl);
|
|
146
134
|
this.getAttributeManager().invalidateAll();
|
|
147
135
|
}
|
|
148
136
|
}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
|
|
19
7
|
export default `\
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
export default `\
|
|
19
7
|
#define SHADER_NAME animated-flow-lines-layer-vertex-shader
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
|
|
19
7
|
import {Layer, picking, project32} from '@deck.gl/core';
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
export default `\
|
|
19
7
|
#define SHADER_NAME flow-circles-layer-fragment-shader
|
|
@@ -69,6 +57,7 @@ void main(void) {
|
|
|
69
57
|
gl_FragColor = mix(gl_FragColor, ringColor, smoothstep(step3, step4, distToCenter));
|
|
70
58
|
gl_FragColor = mix(gl_FragColor, outlineColor, smoothstep(step5, step6, distToCenter));
|
|
71
59
|
// gl_FragColor = mix(gl_FragColor, emptyColor / 255., smoothstep(step6, 1.0, distToCenter));
|
|
60
|
+
gl_FragColor.a = vColor.a;
|
|
72
61
|
gl_FragColor.a *= smoothstep(0.0, SOFT_OUTLINE, 1.0 - distToCenter);
|
|
73
62
|
DECKGL_FILTER_COLOR(gl_FragColor, geometry);
|
|
74
63
|
}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
export default `\
|
|
19
7
|
#define SHADER_NAME flow-circles-layer-vertex-shader
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
|
|
19
7
|
import {Layer, picking, project32} from '@deck.gl/core';
|
|
@@ -45,6 +33,71 @@ export interface Props<F> extends LayerProps {
|
|
|
45
33
|
const DEFAULT_COLOR: RGBA = [0, 132, 193, 255];
|
|
46
34
|
const INNER_SIDE_OUTLINE_THICKNESS = 1;
|
|
47
35
|
|
|
36
|
+
// source_target_mix, perpendicular_offset_in_thickness_units, direction_of_travel_offset_in_thickness_units
|
|
37
|
+
// prettier-ignore
|
|
38
|
+
const POSITIONS = [
|
|
39
|
+
1, 0, 0, // 0
|
|
40
|
+
1, 2, -3, // 1
|
|
41
|
+
1, 1, -3, // 2
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
1, 0, 0, // 0
|
|
45
|
+
1, 1, -3, // 2
|
|
46
|
+
0, 1, 0, // 3
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
1, 0, 0, // 0
|
|
50
|
+
0, 1, 0, // 3
|
|
51
|
+
0, 0, 0, // 4
|
|
52
|
+
];
|
|
53
|
+
/**
|
|
54
|
+
1
|
|
55
|
+
··
|
|
56
|
+
· ··
|
|
57
|
+
· ··
|
|
58
|
+
3 2 · ··
|
|
59
|
+
······························· ··
|
|
60
|
+
· ······· ···· ··
|
|
61
|
+
· ········ ····· ··
|
|
62
|
+
· ··············· ····· ··
|
|
63
|
+
· ········ ········
|
|
64
|
+
· ················
|
|
65
|
+
4 ························································ 0
|
|
66
|
+
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
function getOutlinePixelOffsets(tout: number, tin: number) {
|
|
70
|
+
// perpendicular_offset_in_pixels, direction_of_travel_offset_in_pixels, fill_outline_color_mix
|
|
71
|
+
// prettier-ignore
|
|
72
|
+
return ([
|
|
73
|
+
|
|
74
|
+
-tin, 2*tout, 1, // 0
|
|
75
|
+
2*tout, -tout, 1, // 1
|
|
76
|
+
tout, -tout, 1, // 2
|
|
77
|
+
|
|
78
|
+
-tin, 2*tout, 1, // 0
|
|
79
|
+
tout, -tout, 1, // 2
|
|
80
|
+
tout, -tout, 1, // 3
|
|
81
|
+
|
|
82
|
+
-tin, 2*tout, 1, // 0
|
|
83
|
+
tout, -tout, 1, // 3
|
|
84
|
+
-tin, -tout, 1, // 4
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// prettier-ignore
|
|
89
|
+
const ZEROES = [
|
|
90
|
+
0, 0, 0,
|
|
91
|
+
0, 0, 0,
|
|
92
|
+
0, 0, 0,
|
|
93
|
+
0, 0, 0,
|
|
94
|
+
0, 0, 0,
|
|
95
|
+
0, 0, 0,
|
|
96
|
+
0, 0, 0,
|
|
97
|
+
0, 0, 0,
|
|
98
|
+
0, 0, 0,
|
|
99
|
+
];
|
|
100
|
+
|
|
48
101
|
class FlowLinesLayer<F> extends Layer {
|
|
49
102
|
static layerName = 'FlowLinesLayer';
|
|
50
103
|
static defaultProps = {
|
|
@@ -137,6 +190,7 @@ class FlowLinesLayer<F> extends Layer {
|
|
|
137
190
|
.setUniforms({
|
|
138
191
|
...uniforms,
|
|
139
192
|
outlineColor: outlineColor.map((x: number) => x / 255),
|
|
193
|
+
// outlineColor: [1, 0, 0, 1],
|
|
140
194
|
thicknessUnit: thicknessUnit * 2.0,
|
|
141
195
|
gap: 0.5,
|
|
142
196
|
})
|
|
@@ -150,80 +204,20 @@ class FlowLinesLayer<F> extends Layer {
|
|
|
150
204
|
const {drawOutline, outlineThickness} = this.props;
|
|
151
205
|
if (drawOutline) {
|
|
152
206
|
// source_target_mix, perpendicular_offset_in_thickness_units, direction_of_travel_offset_in_thickness_units
|
|
153
|
-
|
|
154
|
-
positions = positions.concat([
|
|
155
|
-
// Outline
|
|
156
|
-
0, 0, 0,
|
|
157
|
-
0, 1, 0,
|
|
158
|
-
1, 0, 0,
|
|
159
|
-
|
|
160
|
-
0, 1, 0,
|
|
161
|
-
1, 0, -3,
|
|
162
|
-
1, 1, -3,
|
|
163
|
-
|
|
164
|
-
1, 0, 0,
|
|
165
|
-
1, 2, -3,
|
|
166
|
-
1, 0, -3,
|
|
167
|
-
],
|
|
168
|
-
);
|
|
169
|
-
|
|
207
|
+
positions = positions.concat(POSITIONS);
|
|
170
208
|
const tout = outlineThickness;
|
|
171
209
|
const tin = INNER_SIDE_OUTLINE_THICKNESS; // the outline shouldn't cover the opposite arrow
|
|
172
|
-
|
|
173
|
-
// prettier-ignore
|
|
174
|
-
pixelOffsets = pixelOffsets.concat([
|
|
175
|
-
// Outline
|
|
176
|
-
-tin, -tout, 1,
|
|
177
|
-
tout, -tout, 1,
|
|
178
|
-
-tin, tout, 1,
|
|
179
|
-
|
|
180
|
-
tout, -tout, 1,
|
|
181
|
-
-tin, 0, 1,
|
|
182
|
-
tout, 0, 1,
|
|
183
|
-
|
|
184
|
-
-tin, 3 * tout, 1,
|
|
185
|
-
2 * tout, -tout, 1,
|
|
186
|
-
-tin, -tout, 1,
|
|
187
|
-
]);
|
|
210
|
+
pixelOffsets = pixelOffsets.concat(getOutlinePixelOffsets(tout, tin));
|
|
188
211
|
}
|
|
189
212
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// Fill
|
|
193
|
-
0, 0, 0,
|
|
194
|
-
0, 1, 0,
|
|
195
|
-
1, 0, 0,
|
|
196
|
-
|
|
197
|
-
0, 1, 0,
|
|
198
|
-
1, 0, -3,
|
|
199
|
-
1, 1, -3,
|
|
200
|
-
|
|
201
|
-
1, 0, 0,
|
|
202
|
-
1, 2, -3,
|
|
203
|
-
1, 0, -3,
|
|
204
|
-
]);
|
|
205
|
-
|
|
206
|
-
// prettier-ignore
|
|
207
|
-
pixelOffsets = pixelOffsets.concat([
|
|
208
|
-
// Fill
|
|
209
|
-
0, 0, 0,
|
|
210
|
-
0, 0, 0,
|
|
211
|
-
0, 0, 0,
|
|
212
|
-
|
|
213
|
-
0, 0, 0,
|
|
214
|
-
0, 0, 0,
|
|
215
|
-
0, 0, 0,
|
|
216
|
-
|
|
217
|
-
0, 0, 0,
|
|
218
|
-
0, 0, 0,
|
|
219
|
-
0, 0, 0,
|
|
220
|
-
]);
|
|
213
|
+
positions = positions.concat(POSITIONS);
|
|
214
|
+
pixelOffsets = pixelOffsets.concat(ZEROES);
|
|
221
215
|
|
|
222
216
|
return new Model(gl, {
|
|
223
217
|
id: this.props.id,
|
|
224
218
|
...this.getShaders(),
|
|
225
219
|
geometry: new Geometry({
|
|
226
|
-
|
|
220
|
+
drawMode: GL.TRIANGLES,
|
|
227
221
|
attributes: {
|
|
228
222
|
positions: new Float32Array(positions),
|
|
229
223
|
normals: new Float32Array(pixelOffsets),
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
export default `\
|
|
19
7
|
#define SHADER_NAME flow-line-layer-fragment-shader
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
* Copyright 2018-2020 Teralytics
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
5
|
*/
|
|
18
6
|
export default `\
|
|
19
7
|
#define SHADER_NAME flow-line-layer-vertex-shader
|
|
@@ -91,11 +79,7 @@ void main(void) {
|
|
|
91
79
|
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
92
80
|
|
|
93
81
|
vec4 fillColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.;
|
|
94
|
-
|
|
95
|
-
vColor = mix(fillColor, vec4(outlineColor.xyz, instanceThickness), normals.z);
|
|
96
|
-
} else {
|
|
97
|
-
vColor = mix(fillColor, vec4(outlineColor.xyz, outlineColor.w * fillColor.w), normals.z);
|
|
98
|
-
}
|
|
82
|
+
vColor = mix(fillColor, vec4(outlineColor.xyz, outlineColor.w * fillColor.w), normals.z);
|
|
99
83
|
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
100
84
|
}
|
|
101
85
|
`;
|