@flowmap.gl/layers 8.0.0-alpha.24 → 8.0.0-alpha.26
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/LICENSE +2 -2
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.d.ts.map +1 -1
- package/dist/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.js +13 -20
- 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.map +1 -1
- package/dist/FlowCirclesLayer/FlowCirclesLayerFragment.glsl.js +4 -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 +18 -20
- 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.map +1 -1
- package/dist/FlowLinesLayer/FlowLinesLayerVertex.glsl.js +4 -16
- package/dist/FlowLinesLayer/index.d.ts.map +1 -1
- package/dist/FlowLinesLayer/index.js +6 -1
- package/dist/FlowmapLayer.d.ts +12 -8
- package/dist/FlowmapLayer.d.ts.map +1 -1
- package/dist/FlowmapLayer.js +169 -123
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/types.d.ts +5 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/package.json +3 -3
- package/src/AnimatedFlowLinesLayer/AnimatedFlowLinesLayer.ts +3 -15
- 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 +3 -15
- package/src/FlowCirclesLayer/FlowCirclesLayerVertex.glsl.ts +3 -15
- package/src/FlowCirclesLayer/index.ts +6 -0
- package/src/FlowLinesLayer/FlowLinesLayer.ts +3 -15
- package/src/FlowLinesLayer/FlowLinesLayerFragment.glsl.ts +3 -15
- package/src/FlowLinesLayer/FlowLinesLayerVertex.glsl.ts +3 -15
- package/src/FlowLinesLayer/index.ts +6 -0
- package/src/FlowmapLayer.ts +47 -30
- package/src/index.ts +6 -0
- package/src/types.ts +6 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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;
|
|
@@ -23,7 +23,7 @@ export interface LocationPickingInfoObject<L> {
|
|
|
23
23
|
totals: LocationTotals;
|
|
24
24
|
circleRadius: number;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export type LocationPickingInfo<L> = PickingInfo<LocationPickingInfoObject<L>>;
|
|
27
27
|
export interface FlowPickingInfoObject<L, F> {
|
|
28
28
|
type: PickingType.FLOW;
|
|
29
29
|
flow: F | AggregateFlow;
|
|
@@ -31,6 +31,6 @@ export interface FlowPickingInfoObject<L, F> {
|
|
|
31
31
|
dest: L | ClusterNode;
|
|
32
32
|
count: number;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type FlowPickingInfo<L, F> = PickingInfo<FlowPickingInfoObject<L, F>>;
|
|
35
|
+
export type FlowmapLayerPickingInfo<L, F> = LocationPickingInfo<L> | FlowPickingInfo<L, F>;
|
|
36
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,CAAC,CAAC;AAEjD,oBAAY,WAAW;IACrB,QAAQ,aAAa;IACrB,IAAI,SAAS;CAEd;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE9C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE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018-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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQVdILE1BQU0sQ0FBTixJQUFZLFdBSVg7QUFKRCxXQUFZLFdBQVc7SUFDckIsb0NBQXFCLENBQUE7SUFDckIsNEJBQWEsQ0FBQTtJQUNiLG1DQUFtQztBQUNyQyxDQUFDLEVBSlcsV0FBVyxLQUFYLFdBQVcsUUFJdEI7QUE4Q0QsNkRBQTZEO0FBQzdELDREQUE0RDtBQUU1RCwwQkFBMEI7QUFDMUIsNERBQTREO0FBQzVELHNCQUFzQjtBQUV0Qix1Q0FBdUM7QUFDdkMsMEJBQTBCO0FBQzFCLDBFQUEwRTtBQUMxRSxhQUFhO0FBQ2IsMkVBQTJFO0FBQzNFLHNDQUFzQztBQUN0QyxPQUFPO0FBQ1AsSUFBSSIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBDb3B5cmlnaHQgKGMpIEZsb3dtYXAuZ2wgY29udHJpYnV0b3JzXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTgtMjAyMCBUZXJhbHl0aWNzXG4gKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQXBhY2hlLTIuMFxuICovXG5cbmltcG9ydCB7XG4gIEFnZ3JlZ2F0ZUZsb3csXG4gIENsdXN0ZXIs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lY3Rpb24oXG4vLyAgIGxvY2F0aW9uczogTG9jYXRpb25zLFxuLy8gKTogbG9jYXRpb25zIGlzIEZlYXR1cmVDb2xsZWN0aW9uPEdlb21ldHJ5T2JqZWN0LCBMb2NhdGlvblByb3BlcnRpZXM+IHtcbi8vICAgcmV0dXJuIChcbi8vICAgICAobG9jYXRpb25zIGFzIEZlYXR1cmVDb2xsZWN0aW9uPEdlb21ldHJ5T2JqZWN0LCBMb2NhdGlvblByb3BlcnRpZXM+KVxuLy8gICAgICAgLnR5cGUgPT09ICdGZWF0dXJlQ29sbGVjdGlvbidcbi8vICAgKTtcbi8vIH1cbiJdfQ==
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowmap.gl/layers",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.26",
|
|
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
10
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@luma.gl/constants": "^8.5.10",
|
|
19
19
|
"@luma.gl/core": "^8.5.10"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "fd9173f706b98d8013b014572e22263fc3175f45",
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
}
|
|
@@ -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
|
|
|
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
|
|
@@ -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';
|
|
@@ -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
|
package/src/FlowmapLayer.ts
CHANGED
|
@@ -1,38 +1,27 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16
5
|
*/
|
|
17
6
|
import {CompositeLayer} from '@deck.gl/core';
|
|
18
7
|
import {ScatterplotLayer, TextLayer} from '@deck.gl/layers';
|
|
19
8
|
import {
|
|
20
9
|
colorAsRgba,
|
|
10
|
+
FilterState,
|
|
21
11
|
FlowLinesLayerAttributes,
|
|
12
|
+
FlowmapAggregateAccessors,
|
|
22
13
|
FlowmapData,
|
|
23
14
|
FlowmapDataAccessors,
|
|
24
15
|
FlowmapDataProvider,
|
|
25
16
|
getFlowLineAttributesByIndex,
|
|
26
17
|
getFlowmapColors,
|
|
27
|
-
getOuterCircleRadiusByIndex,
|
|
28
18
|
getLocationCoordsByIndex,
|
|
19
|
+
getOuterCircleRadiusByIndex,
|
|
29
20
|
isFlowmapData,
|
|
30
21
|
isFlowmapDataProvider,
|
|
31
22
|
LayersData,
|
|
32
23
|
LocalFlowmapDataProvider,
|
|
33
24
|
ViewportProps,
|
|
34
|
-
FlowmapAggregateAccessors,
|
|
35
|
-
FilterState,
|
|
36
25
|
} from '@flowmap.gl/data';
|
|
37
26
|
import AnimatedFlowLinesLayer from './AnimatedFlowLinesLayer';
|
|
38
27
|
import FlowCirclesLayer from './FlowCirclesLayer';
|
|
@@ -44,10 +33,14 @@ import {
|
|
|
44
33
|
PickingType,
|
|
45
34
|
} from './types';
|
|
46
35
|
|
|
47
|
-
export type FlowmapLayerProps<
|
|
36
|
+
export type FlowmapLayerProps<
|
|
37
|
+
L extends Record<string, any>,
|
|
38
|
+
F extends Record<string, any>,
|
|
39
|
+
> = {
|
|
48
40
|
data?: FlowmapData<L, F>;
|
|
49
41
|
dataProvider?: FlowmapDataProvider<L, F>;
|
|
50
42
|
filter?: FilterState;
|
|
43
|
+
locationsEnabled?: boolean;
|
|
51
44
|
locationTotalsEnabled?: boolean;
|
|
52
45
|
locationLabelsEnabled?: boolean;
|
|
53
46
|
adaptiveScalesEnabled?: boolean;
|
|
@@ -72,6 +65,7 @@ export type FlowmapLayerProps<L, F> = {
|
|
|
72
65
|
|
|
73
66
|
const PROPS_TO_CAUSE_LAYER_DATA_UPDATE: string[] = [
|
|
74
67
|
'filter',
|
|
68
|
+
'locationsEnabled',
|
|
75
69
|
'locationTotalsEnabled',
|
|
76
70
|
'locationLabelsEnabled',
|
|
77
71
|
'adaptiveScalesEnabled',
|
|
@@ -106,20 +100,26 @@ type HighlightedFlowObject = {
|
|
|
106
100
|
|
|
107
101
|
type HighlightedObject = HighlightedLocationObject | HighlightedFlowObject;
|
|
108
102
|
|
|
109
|
-
type State<L, F
|
|
103
|
+
type State<L extends Record<string, any>, F extends Record<string, any>> = {
|
|
110
104
|
accessors: FlowmapAggregateAccessors<L, F>;
|
|
111
105
|
dataProvider: FlowmapDataProvider<L, F>;
|
|
112
106
|
layersData: LayersData | undefined;
|
|
113
107
|
highlightedObject: HighlightedObject | undefined;
|
|
114
108
|
pickingInfo: FlowmapLayerPickingInfo<L, F> | undefined;
|
|
109
|
+
lastHoverTime: number | undefined;
|
|
110
|
+
lastClickTime: number | undefined;
|
|
115
111
|
};
|
|
116
112
|
|
|
117
113
|
export type SourceEvent = {srcEvent: MouseEvent};
|
|
118
114
|
|
|
119
|
-
export default class FlowmapLayer<
|
|
115
|
+
export default class FlowmapLayer<
|
|
116
|
+
L extends Record<string, any>,
|
|
117
|
+
F extends Record<string, any>,
|
|
118
|
+
> extends CompositeLayer {
|
|
120
119
|
static defaultProps = {
|
|
121
120
|
darkMode: true,
|
|
122
121
|
fadeAmount: 50,
|
|
122
|
+
locationsEnabled: true,
|
|
123
123
|
locationTotalsEnabled: true,
|
|
124
124
|
locationLabelsEnabled: false,
|
|
125
125
|
animationEnabled: false,
|
|
@@ -139,26 +139,39 @@ export default class FlowmapLayer<L, F> extends CompositeLayer {
|
|
|
139
139
|
super({
|
|
140
140
|
...props,
|
|
141
141
|
onHover: (info: PickingInfo<any>, event: SourceEvent) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
const startTime = Date.now();
|
|
143
|
+
this.setState({
|
|
144
|
+
highlightedObject: this._getHighlightedObject(info),
|
|
145
|
+
lastHoverTime: startTime,
|
|
146
|
+
});
|
|
147
|
+
|
|
147
148
|
const {onHover} = props;
|
|
148
149
|
if (onHover) {
|
|
149
150
|
this._getFlowmapLayerPickingInfo(info).then((info) => {
|
|
150
|
-
this.
|
|
151
|
-
|
|
151
|
+
if ((this.state?.lastHoverTime ?? 0) <= startTime) {
|
|
152
|
+
this.setState({pickingInfo: info});
|
|
153
|
+
onHover(info, event);
|
|
154
|
+
} else {
|
|
155
|
+
// Skipping, because this is not the latest hover event
|
|
156
|
+
}
|
|
152
157
|
});
|
|
153
158
|
}
|
|
154
159
|
},
|
|
155
160
|
onClick: (info: PickingInfo<any>, event: SourceEvent) => {
|
|
156
161
|
const {onClick} = props;
|
|
162
|
+
const startTime = Date.now();
|
|
163
|
+
this.setState({
|
|
164
|
+
lastClickTime: startTime,
|
|
165
|
+
});
|
|
157
166
|
if (onClick) {
|
|
158
167
|
this._getFlowmapLayerPickingInfo(info).then((info) => {
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
|
|
168
|
+
if ((this.state?.lastClickTime ?? 0) <= startTime) {
|
|
169
|
+
this.setState({pickingInfo: info});
|
|
170
|
+
if (info) {
|
|
171
|
+
onClick(info, event);
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
// Skipping, because this is not the latest hover event
|
|
162
175
|
}
|
|
163
176
|
});
|
|
164
177
|
}
|
|
@@ -173,6 +186,8 @@ export default class FlowmapLayer<L, F> extends CompositeLayer {
|
|
|
173
186
|
layersData: undefined,
|
|
174
187
|
highlightedObject: undefined,
|
|
175
188
|
pickingInfo: undefined,
|
|
189
|
+
lastHoverTime: undefined,
|
|
190
|
+
lastClickTime: undefined,
|
|
176
191
|
};
|
|
177
192
|
}
|
|
178
193
|
|
|
@@ -258,6 +273,7 @@ export default class FlowmapLayer<L, F> extends CompositeLayer {
|
|
|
258
273
|
|
|
259
274
|
private _getSettingsState() {
|
|
260
275
|
const {
|
|
276
|
+
locationsEnabled,
|
|
261
277
|
locationTotalsEnabled,
|
|
262
278
|
locationLabelsEnabled,
|
|
263
279
|
adaptiveScalesEnabled,
|
|
@@ -274,6 +290,7 @@ export default class FlowmapLayer<L, F> extends CompositeLayer {
|
|
|
274
290
|
maxTopFlowsDisplayNum,
|
|
275
291
|
} = this.props;
|
|
276
292
|
return {
|
|
293
|
+
locationsEnabled,
|
|
277
294
|
locationTotalsEnabled,
|
|
278
295
|
locationLabelsEnabled,
|
|
279
296
|
adaptiveScalesEnabled,
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Flowmap.gl contributors
|
|
3
|
+
* Copyright (c) 2018-2020 Teralytics
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
export {default as AnimatedFlowLinesLayer} from './AnimatedFlowLinesLayer';
|
|
2
8
|
export {default as FlowLinesLayer} from './FlowLinesLayer';
|
|
3
9
|
export {default as FlowCirclesLayer} from './FlowCirclesLayer';
|