Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
feat: basic flow layer implementation (#3386)
Igor Dykhta62056d35be3b
diff --git a/babel-register.js b/babel-register.jsindex c2e096eaf..ec92a1e97 100644--- a/babel-register.js+++ b/babel-register.js@@ -5,6 +5,10 @@ const forceTranspile = [// ESM libraries that require transpilation/@deck.gl\/layers/,/@loaders.gl\/polyfills/,+ /@flowmap\.gl\//,+ /@math\.gl\//,+ /\/node_modules\/d3-/,+ /\/node_modules\/kdbush\//,// For some reason babel crashes even before trying to transpile this library// Instead we force transpile @deck.gl/layers which includes it, and alias to a transpiled version in babel.config.js/@mapbox\/tiny-sdf/diff --git a/docs/user-guides/c-types-of-layers/README.md b/docs/user-guides/c-types-of-layers/README.mdindex e25b51e99..6864a7d6f 100644--- a/docs/user-guides/c-types-of-layers/README.md+++ b/docs/user-guides/c-types-of-layers/README.md@@ -160,6 +160,18 @@ Examples of supported WMS Tiles:For step-by-step instructions, see [WMS Layer — How to add](./o-wms-layer.md).+## Flow Layer (experimental)++Flow layers visualize movement between locations as aggregated origin-destination flows. They are useful for displaying migration patterns, commute data, trade routes, and any dataset that represents movement between geographic points.++The layer automatically clusters nearby locations at different zoom levels, draws flow lines proportional to magnitude, and renders location totals as circles. It supports two column modes: **Lat/Lng** (source/target coordinates) and **H3** (source/target H3 hexagonal indices). An optional count column controls flow magnitude.++- This feature is experimental and currently enabled by default via `enableFlowLayer: true` in the application configuration.++Layer Attributes: Color Range, Opacity, Animation, Curved Lines, Adaptive Scales, Fade, Fade Amount, Clustering, Location Totals, Max Top Flows, Dark Base Map++For detailed instructions, see [Flow Layer](./q-flow-layer.md).+## 3D Tile Layer (experimental)3D Tile layers render photogrammetry meshes, buildings, terrain and other 3D content served as OGC 3D Tiles or I3S tilesets. The layer streams and renders tiles based on the current viewport and camera position, loading detail on demand.diff --git a/docs/user-guides/c-types-of-layers/q-flow-layer.md b/docs/user-guides/c-types-of-layers/q-flow-layer.mdnew file mode 100644index 000000000..3119e8dc0--- /dev/null+++ b/docs/user-guides/c-types-of-layers/q-flow-layer.md@@ -0,0 +1,100 @@+# Flow Layer (experimental)++Flow layers visualize movement between locations as aggregated origin-destination flows. They are useful for displaying migration patterns, commute data, trade routes, supply chains, and any dataset that represents movement between geographic points.++The layer automatically clusters nearby locations at different zoom levels, draws flow lines proportional to magnitude, and renders location totals as circles sized by incoming/outgoing volume.++Flow layers are powered by [flowmap.gl](https://github.com/FlowmapBlue/flowmap.gl).++## Enabling the layer++The flow layer is experimental and enabled by default. You can disable the layer by setting `enableFlowLayer: false` in the application configuration:++```js+import KeplerGl from '@kepler.gl/components';+import {initApplicationConfig} from '@kepler.gl/utils';++initApplicationConfig({enableFlowLayer: false});+```++## Data format++Your dataset must contain origin and destination coordinates for each flow. The layer supports two column modes:++### Lat/Lng mode++Requires four columns for source and target coordinates:++| Column | Required | Description |+| ------------ | -------- | ------------------------------ |+| source lat | Yes | Latitude of the origin |+| source lng | Yes | Longitude of the origin |+| target lat | Yes | Latitude of the destination |+| target lng | Yes | Longitude of the destination |+| count | No | Flow magnitude (defaults to 1) |+| source name | No | Label for the origin location |+| target name | No | Label for the destination |++### H3 mode++Uses H3 hexagonal indices instead of explicit coordinates:++| Column | Required | Description |+| --------- | -------- | ------------------------------------- |+| source H3 | Yes | H3 index of the origin hexagon |+| target H3 | Yes | H3 index of the destination hexagon |+| count | No | Flow magnitude (defaults to 1) |+| source name | No | Label for the origin location |+| target name | No | Label for the destination |++### Sample CSV (Lat/Lng)++```csv+source_lat,source_lng,target_lat,target_lng,count,source_name,target_name+37.7749,-122.4194,34.0522,-118.2437,150,San Francisco,Los Angeles+34.0522,-118.2437,37.7749,-122.4194,90,Los Angeles,San Francisco+37.7749,-122.4194,47.6062,-122.3321,200,San Francisco,Seattle+47.6062,-122.3321,34.0522,-118.2437,75,Seattle,Los Angeles+```++## Layer attributes++- **Color Range** — color scheme applied to flows based on magnitude.++- **Opacity** — overall layer opacity.++- **Line Style** — controls how flow lines are rendered. Options:+ - *Straight* (default) — simple straight lines between origin and destination.+ - *Curved* — renders flows as curved arcs.+ - *Animated* — animates flow lines to show direction of movement.++- **Line Thickness** — scales the width of all flow lines (0.1–5×).++- **Curviness** — controls the arc curvature of curved flow lines (0–2). Only visible when Line Style is set to Curved.++- **Adaptive Scales** — automatically adjusts flow line widths relative to the current zoom level and visible data range.++- **Fade** — reduces visual prominence of smaller flows. The fade amount slider (0–100) controls how aggressively minor flows are dimmed.++- **Clustering** — groups nearby locations into clusters at lower zoom levels and expands them as you zoom in.++- **Location Totals** — shows circles at each location sized by total incoming and outgoing flow volume.++- **Max Top Flows** — limits the number of rendered flow lines to the N largest flows (up to 10,000) for performance.++- **Dark Base Map** — toggles the color scheme between light and dark map backgrounds.++## Tooltips++Hovering over a **location** shows:+- Location name+- Incoming count+- Outgoing count+- Internal count++Hovering over a **flow line** shows:+- Origin name+- Destination name+- Flow count++[Back to layer overview](./README.md)diff --git a/examples/demo-app/src/app.tsx b/examples/demo-app/src/app.tsxindex 436c8bb9b..1b181e4b6 100644--- a/examples/demo-app/src/app.tsx+++ b/examples/demo-app/src/app.tsx@@ -71,6 +71,7 @@ import sampleAnimateTrip, {import sampleIconCsv from './data/sample-icon-csv';import sampleGpsData from './data/sample-gps-data';import sampleRowData, {config as rowDataConfig} from './data/sample-row-data';+import {sampleFlowData, config as flowDataConfig} from './data/sample-flow-data';import {processCsvData, processGeojson, processRowObject} from '@kepler.gl/processors';/* eslint-enable no-unused-vars */@@ -598,6 +599,26 @@ const App = props => {);}, [dispatch]);+ const _loadFlowData = useCallback(() => {+ dispatch(+ addDataToMap({+ datasets: [+ {+ info: {+ label: 'NYC Flow Data',+ id: 'flow_data'+ },+ data: processCsvData(sampleFlowData)+ }+ ],+ config: flowDataConfig,+ options: {+ keepExistingConfig: true+ }+ })+ );+ }, [dispatch]);+const _loadSampleData = useCallback(() => {// _loadPointData();// _loadGeojsonData();@@ -609,6 +630,7 @@ const App = props => {// _loadGpsData();// _loadRowData();// _loadVectorTileData();+ // _loadFlowData();// _loadSyncedFilterWTripLayer();// _replaceSyncedFilterWTripLayer();// eslint-disable-next-line react-hooks/exhaustive-deps@@ -624,6 +646,7 @@ const App = props => {_loadRowData,_replaceData,_loadVectorTileData,+ _loadFlowData,_loadSyncedFilterWTripLayer,_replaceSyncedFilterWTripLayer]);diff --git a/examples/demo-app/src/data/flowmap-example.csv b/examples/demo-app/src/data/flowmap-example.csvnew file mode 100644index 000000000..0ea9df7ea--- /dev/null+++ b/examples/demo-app/src/data/flowmap-example.csv@@ -0,0 +1,51 @@+source_lat,source_lng,target_lat,target_lng,count,source_name,target_name+37.7749,-122.4194,34.0522,-118.2437,4200,San Francisco,Los Angeles+34.0522,-118.2437,37.7749,-122.4194,3800,Los Angeles,San Francisco+37.7749,-122.4194,47.6062,-122.3321,2100,San Francisco,Seattle+47.6062,-122.3321,37.7749,-122.4194,1950,Seattle,San Francisco+37.7749,-122.4194,40.7128,-74.0060,5300,San Francisco,New York+40.7128,-74.0060,37.7749,-122.4194,5100,New York,San Francisco+34.0522,-118.2437,40.7128,-74.0060,6200,Los Angeles,New York+40.7128,-74.0060,34.0522,-118.2437,5900,New York,Los Angeles+40.7128,-74.0060,41.8781,-87.6298,4800,New York,Chicago+41.8781,-87.6298,40.7128,-74.0060,4500,Chicago,New York+40.7128,-74.0060,25.7617,-80.1918,3600,New York,Miami+25.7617,-80.1918,40.7128,-74.0060,3400,Miami,New York+34.0522,-118.2437,47.6062,-122.3321,1800,Los Angeles,Seattle+47.6062,-122.3321,34.0522,-118.2437,1650,Seattle,Los Angeles+34.0522,-118.2437,41.8781,-87.6298,3100,Los Angeles,Chicago+41.8781,-87.6298,34.0522,-118.2437,2900,Chicago,Los Angeles+41.8781,-87.6298,25.7617,-80.1918,2200,Chicago,Miami+25.7617,-80.1918,41.8781,-87.6298,2050,Miami,Chicago+47.6062,-122.3321,40.7128,-74.0060,2700,Seattle,New York+40.7128,-74.0060,47.6062,-122.3321,2500,New York,Seattle+25.7617,-80.1918,34.0522,-118.2437,1900,Miami,Los Angeles+34.0522,-118.2437,25.7617,-80.1918,2100,Los Angeles,Miami+37.7749,-122.4194,41.8781,-87.6298,2800,San Francisco,Chicago+41.8781,-87.6298,37.7749,-122.4194,2600,Chicago,San Francisco+37.7749,-122.4194,25.7617,-80.1918,1500,San Francisco,Miami+25.7617,-80.1918,37.7749,-122.4194,1350,Miami,San Francisco+47.6062,-122.3321,41.8781,-87.6298,1400,Seattle,Chicago+41.8781,-87.6298,47.6062,-122.3321,1300,Chicago,Seattle+47.6062,-122.3321,25.7617,-80.1918,800,Seattle,Miami+25.7617,-80.1918,47.6062,-122.3321,750,Miami,Seattle+40.7128,-74.0060,42.3601,-71.0589,3200,New York,Boston+42.3601,-71.0589,40.7128,-74.0060,3050,Boston,New York+40.7128,-74.0060,38.9072,-77.0369,3900,New York,Washington DC+38.9072,-77.0369,40.7128,-74.0060,3700,Washington DC,New York+34.0522,-118.2437,33.4484,-112.0740,1600,Los Angeles,Phoenix+33.4484,-112.0740,34.0522,-118.2437,1450,Phoenix,Los Angeles+34.0522,-118.2437,36.1699,-115.1398,2400,Los Angeles,Las Vegas+36.1699,-115.1398,34.0522,-118.2437,2300,Las Vegas,Los Angeles+37.7749,-122.4194,36.1699,-115.1398,1700,San Francisco,Las Vegas+36.1699,-115.1398,37.7749,-122.4194,1550,Las Vegas,San Francisco+41.8781,-87.6298,38.9072,-77.0369,2000,Chicago,Washington DC+38.9072,-77.0369,41.8781,-87.6298,1850,Washington DC,Chicago+25.7617,-80.1918,33.7490,-84.3880,1300,Miami,Atlanta+33.7490,-84.3880,25.7617,-80.1918,1200,Atlanta,Miami+40.7128,-74.0060,33.7490,-84.3880,2800,New York,Atlanta+33.7490,-84.3880,40.7128,-74.0060,2600,Atlanta,New York+34.0522,-118.2437,29.7604,-95.3698,2500,Los Angeles,Houston+29.7604,-95.3698,34.0522,-118.2437,2300,Houston,Los Angeles+41.8781,-87.6298,29.7604,-95.3698,1800,Chicago,Houston+29.7604,-95.3698,41.8781,-87.6298,1650,Houston,Chicagodiff --git a/examples/demo-app/src/data/sample-flow-data.js b/examples/demo-app/src/data/sample-flow-data.jsnew file mode 100644index 000000000..65cbbbefe--- /dev/null+++ b/examples/demo-app/src/data/sample-flow-data.js@@ -0,0 +1,68 @@+// SPDX-License-Identifier: MIT+// Copyright contributors to the kepler.gl project++export const sampleFlowData = `source_lat,source_lng,target_lat,target_lng,count,source_name,target_name+40.7128,-74.0060,40.7580,-73.9855,320,Lower Manhattan,Midtown+40.7580,-73.9855,40.7831,-73.9712,185,Midtown,Upper East Side+40.7831,-73.9712,40.7128,-74.0060,210,Upper East Side,Lower Manhattan+40.7580,-73.9855,40.7282,-73.7949,450,Midtown,JFK Airport+40.7282,-73.7949,40.7580,-73.9855,430,JFK Airport,Midtown+40.7128,-74.0060,40.6501,-73.9496,175,Lower Manhattan,Brooklyn Downtown+40.6501,-73.9496,40.7128,-74.0060,160,Brooklyn Downtown,Lower Manhattan+40.7580,-73.9855,40.7484,-73.9857,95,Midtown,Times Square+40.7484,-73.9857,40.7580,-73.9855,90,Times Square,Midtown+40.7831,-73.9712,40.7282,-73.7949,280,Upper East Side,JFK Airport+40.7282,-73.7949,40.7831,-73.9712,265,JFK Airport,Upper East Side+40.6501,-73.9496,40.6782,-73.9442,140,Brooklyn Downtown,Prospect Park+40.6782,-73.9442,40.6501,-73.9496,130,Prospect Park,Brooklyn Downtown+40.7128,-74.0060,40.7282,-73.7949,390,Lower Manhattan,JFK Airport+40.7282,-73.7949,40.7128,-74.0060,375,JFK Airport,Lower Manhattan+40.7580,-73.9855,40.6501,-73.9496,220,Midtown,Brooklyn Downtown+40.6501,-73.9496,40.7580,-73.9855,205,Brooklyn Downtown,Midtown+40.7831,-73.9712,40.6501,-73.9496,115,Upper East Side,Brooklyn Downtown+40.6501,-73.9496,40.7831,-73.9712,105,Brooklyn Downtown,Upper East Side+40.7484,-73.9857,40.7128,-74.0060,150,Times Square,Lower Manhattan+40.7128,-74.0060,40.7484,-73.9857,155,Lower Manhattan,Times Square+40.7484,-73.9857,40.7282,-73.7949,340,Times Square,JFK Airport+40.7282,-73.7949,40.7484,-73.9857,330,JFK Airport,Times Square+40.6782,-73.9442,40.7128,-74.0060,100,Prospect Park,Lower Manhattan+40.7128,-74.0060,40.6782,-73.9442,95,Lower Manhattan,Prospect Park+`;++export const config = {+ version: 'v1',+ config: {+ visState: {+ layers: [+ {+ type: 'flow',+ config: {+ dataId: 'flow_data',+ label: 'NYC Flow',+ columns: {+ lat0: 'source_lat',+ lng0: 'source_lng',+ lat1: 'target_lat',+ lng1: 'target_lng',+ count: 'count',+ sourceName: 'source_name',+ targetName: 'target_name'+ },+ isVisible: true,+ visConfig: {+ opacity: 0.8,+ flowClusteringEnabled: true,+ flowLocationTotalsEnabled: true,+ flowFadeEnabled: true+ }+ }+ }+ ]+ },+ mapState: {+ latitude: 40.72,+ longitude: -73.95,+ zoom: 10+ }+ }+};diff --git a/jest.config.js b/jest.config.jsindex 5783d9c27..c5a321258 100644--- a/jest.config.js+++ b/jest.config.js@@ -22,7 +22,7 @@ const config = {// Some libraries (even if transitive) are transitioning to ESM and need additional transpilation. Relevant issues:// - tiny-sdf: https://github.com/visgl/deck.gl/issues/7735transformIgnorePatterns: [- '/node_modules\\/(?!(.*@mapbox\\/tiny-sdf\\.*|@loaders\\.gl|@deck\\.gl|@deck\\.gl-community|@luma\\.gl|@hubble\\.gl|preact|maplibregl-mapbox-request-transformer))',+ '/node_modules\\/(?!(.*@mapbox\\/tiny-sdf\\.*|@loaders\\.gl|@deck\\.gl|@deck\\.gl-community|@luma\\.gl|@hubble\\.gl|@flowmap\\.gl|@math\\.gl|d3-.*|kdbush|preact|maplibregl-mapbox-request-transformer))','\\.pnp\\.[^\\/]+$']};diff --git a/src/components/src/side-panel/layer-manager.tsx b/src/components/src/side-panel/layer-manager.tsxindex 7b0fad30d..5567504a4 100644--- a/src/components/src/side-panel/layer-manager.tsx+++ b/src/components/src/side-panel/layer-manager.tsx@@ -195,6 +195,8 @@ function LayerManagerFactory(// temp patch to hide layers that are in developmentconst enableRasterTileLayer = getApplicationConfig().enableRasterTileLayer;const enableWMSLayer = getApplicationConfig().enableWMSLayer;+ const enableFlowLayer = getApplicationConfig().enableFlowLayer;+const filteredLayerClasses = useMemo(() => {let filteredClasses = layerClasses;if (!enableRasterTileLayer) {@@ -205,8 +207,12 @@ function LayerManagerFactory(const {wms: _wms, ...rest} = filteredClasses;filteredClasses = rest as LayerClassesType;}+ if (!enableFlowLayer) {+ const {flow: _flow, ...rest} = filteredClasses;+ filteredClasses = rest as LayerClassesType;+ }return filteredClasses as LayerClassesType;- }, [enableRasterTileLayer, enableWMSLayer, layerClasses]);+ }, [enableRasterTileLayer, enableWMSLayer, enableFlowLayer, layerClasses]);return (<div className="layer-manager">diff --git a/src/components/src/side-panel/layer-panel/dataset-layer-section.tsx b/src/components/src/side-panel/layer-panel/dataset-layer-section.tsxindex 85465754c..1d5039d85 100644--- a/src/components/src/side-panel/layer-panel/dataset-layer-section.tsx+++ b/src/components/src/side-panel/layer-panel/dataset-layer-section.tsx@@ -61,6 +61,8 @@ function DatasetLayerSectionFactory(// temp patch to hide layers that are in developmentconst enableRasterTileLayer = getApplicationConfig().enableRasterTileLayer;const enableWMSLayer = getApplicationConfig().enableWMSLayer;+ const enableFlowLayer = getApplicationConfig().enableFlowLayer;+const filteredLayerClasses = useMemo(() => {let filteredClasses = layerClasses;if (!enableRasterTileLayer) {@@ -71,8 +73,12 @@ function DatasetLayerSectionFactory(const {wms: _wms, ...rest} = filteredClasses;filteredClasses = rest as LayerClassesType;}+ if (!enableFlowLayer) {+ const {flow: _flow, ...rest} = filteredClasses;+ filteredClasses = rest as LayerClassesType;+ }return filteredClasses as LayerClassesType;- }, [enableRasterTileLayer, enableWMSLayer, layerClasses]);+ }, [enableRasterTileLayer, enableWMSLayer, enableFlowLayer, layerClasses]);return (<DatasetLayerSectionWrapper>diff --git a/src/components/src/side-panel/layer-panel/layer-configurator.tsx b/src/components/src/side-panel/layer-panel/layer-configurator.tsxindex e2e6edd3b..9bbf2b94a 100644--- a/src/components/src/side-panel/layer-panel/layer-configurator.tsx+++ b/src/components/src/side-panel/layer-panel/layer-configurator.tsx@@ -37,6 +37,12 @@ import {matchDatasetType, Datasets} from '@kepler.gl/table';import {ColorUI, LayerVisConfig, NestedPartial} from '@kepler.gl/types';import {capitalizeFirstLetter} from '@kepler.gl/utils';+const FLOW_RENDERING_MODE_LABELS: Record<string, string> = {+ straight: 'Straight',+ curved: 'Curved',+ 'animated-straight': 'Animated'+};+type LayerConfiguratorProps = {layer: Layer;datasets: Datasets;@@ -1124,6 +1130,92 @@ export default function LayerConfiguratorFactory();}+ _renderFlowLayerConfig({layer, visConfiguratorProps}) {+ const {visConfig} = layer.config;+ const renderingModeOptions = (layer.visConfigSettings.flowLinesRenderingMode?.options || []).map(+ mode => ({+ id: mode,+ label: FLOW_RENDERING_MODE_LABELS[mode] || mode+ })+ );+ const selectedRenderingMode = renderingModeOptions.find(+ ({id}) => id === visConfig.flowLinesRenderingMode+ );++ return (+ <StyledLayerVisualConfigurator>+ <LayerConfigGroup label={'layer.color'} collapsible>+ <LayerColorRangeSelector {...visConfiguratorProps} property="colorRange" />+ <VisConfigSwitch+ {...layer.visConfigSettings.darkBaseMapEnabled}+ {...visConfiguratorProps}+ />+ <ConfigGroupCollapsibleContent>+ <VisConfigSlider {...layer.visConfigSettings.opacity} {...visConfiguratorProps} />+ </ConfigGroupCollapsibleContent>+ </LayerConfigGroup>+ <LayerConfigGroup+ {...visConfiguratorProps}+ label={'layerVisConfigs.flow.fade'}+ collapsible={false}+ property="flowFadeEnabled"+ >+ <VisConfigSlider+ {...layer.visConfigSettings.flowFadeAmount}+ {...visConfiguratorProps}+ disabled={!layer.config.visConfig.flowFadeEnabled}+ label={false}+ />+ </LayerConfigGroup>+ <LayerConfigGroup label={'layerVisConfigs.flow.display'} collapsible>+ <SidePanelSection>+ <PanelLabel>+ <FormattedMessage id={'layerVisConfigs.flow.renderingMode'} />+ </PanelLabel>+ <ItemSelector+ selectedItems={selectedRenderingMode}+ options={renderingModeOptions}+ displayOption="label"+ getOptionValue="id"+ multiSelect={false}+ searchable={false}+ onChange={value => visConfiguratorProps.onChange({flowLinesRenderingMode: value})}+ />+ </SidePanelSection>+ <VisConfigSlider+ {...layer.visConfigSettings.flowLineThicknessScale}+ {...visConfiguratorProps}+ />+ {visConfig.flowLinesRenderingMode === 'curved' ? (+ <VisConfigSlider+ {...layer.visConfigSettings.flowLineCurviness}+ {...visConfiguratorProps}+ />+ ) : null}+ <VisConfigSwitch+ {...layer.visConfigSettings.flowClusteringEnabled}+ {...visConfiguratorProps}+ />+ <ConfigGroupCollapsibleContent>+ <VisConfigSwitch+ {...layer.visConfigSettings.flowLocationTotalsEnabled}+ {...visConfiguratorProps}+ />+ <VisConfigSwitch+ {...layer.visConfigSettings.flowAdaptiveScalesEnabled}+ {...visConfiguratorProps}+ />+ <VisConfigSlider+ {...layer.visConfigSettings.maxTopFlowsDisplayNum}+ {...visConfiguratorProps}+ label={'layerVisConfigs.flow.maxTopFlowsDisplayNum'}+ />+ </ConfigGroupCollapsibleContent>+ </LayerConfigGroup>+ </StyledLayerVisualConfigurator>+ );+ }+handleSelectColumnMode = (key: string) => {const {updateLayerConfig} = this.props;updateLayerConfig({columnMode: key});diff --git a/src/constants/src/layers.ts b/src/constants/src/layers.tsindex 93acd164a..73ae934d6 100644--- a/src/constants/src/layers.ts+++ b/src/constants/src/layers.ts@@ -554,6 +554,7 @@ export const LAYER_TYPES = keyMirror({'3D': null,trip: null,s2: null,+ flow: null,vectorTile: null,rasterTile: null,wms: null,diff --git a/src/layers/package.json b/src/layers/package.jsonindex c8c550d41..126dd167b 100644--- a/src/layers/package.json+++ b/src/layers/package.json@@ -37,6 +37,8 @@"@deck.gl/geo-layers": "^9.3.1","@deck.gl/layers": "^9.3.1","@deck.gl/mesh-layers": "^9.3.1",+ "@flowmap.gl/data": "^9.2.0",+ "@flowmap.gl/layers": "^9.2.0","@kepler.gl/common-utils": "3.3.0-alpha.0","@kepler.gl/constants": "3.3.0-alpha.0","@kepler.gl/deckgl-arrow-layers": "3.3.0-alpha.0",@@ -71,6 +73,7 @@"apache-arrow": ">=15.0.0","buffer": "6.0.3","d3-array": "^2.8.0",+ "d3-format": "^3.1.0","d3-shape": "^1.2.0","global": "^4.3.0","keymirror": "^0.1.1",diff --git a/src/layers/src/flow-layer/flow-layer-icon.tsx b/src/layers/src/flow-layer/flow-layer-icon.tsxnew file mode 100644index 000000000..4cbaea64b--- /dev/null+++ b/src/layers/src/flow-layer/flow-layer-icon.tsx@@ -0,0 +1,49 @@+// SPDX-License-Identifier: MIT+// Copyright contributors to the kepler.gl project++import React, {Component} from 'react';+import PropTypes from 'prop-types';+import {Base} from '../base';++class FlowLayerIcon extends Component {+ static propTypes = {+ height: PropTypes.string,+ colors: PropTypes.arrayOf(PropTypes.string)+ };++ static defaultProps = {+ height: '16px',+ predefinedClassName: 'flow-layer-icon',+ totalColor: 3+ };++ render() {+ return (+ <Base {...this.props} viewBox="0 0 64 64">+ {/* Left point */}+ <circle cx="10" cy="42" r="4.5" className="cr1" />+ {/* Right point */}+ <circle cx="54" cy="42" r="4.5" className="cr2" />+ {/* Top point */}+ <circle cx="36" cy="10" r="4.5" className="cr3" />++ {/* Arrow left -> right: gentle upper arc, thick band */}+ <path d="M17,38 C26,26 42,26 49,36 L48,32 C42,23 24,23 16,34 Z" className="cr1" />+ {/* Arrowhead right */}+ <path d="M47,30 L52,38 L45,37 Z" className="cr1" />++ {/* Arrow right -> left: gentle lower arc, thick band */}+ <path d="M47,46 C38,58 22,58 15,48 L16,52 C22,61 40,61 48,50 Z" className="cr2" />+ {/* Arrowhead left */}+ <path d="M17,54 L12,46 L19,47 Z" className="cr2" />++ {/* Arrow left -> top: gentle curve */}+ <path d="M13,37 C12,24 20,15 32,11 L30,14 C20,18 15,26 15,36 Z" className="cr3" />+ {/* Arrowhead top */}+ <path d="M29,9 L35,12 L29,16 Z" className="cr3" />+ </Base>+ );+ }+}++export default FlowLayerIcon;diff --git a/src/layers/src/flow-layer/flow-layer.ts b/src/layers/src/flow-layer/flow-layer.tsnew file mode 100644index 000000000..f485efce8--- /dev/null+++ b/src/layers/src/flow-layer/flow-layer.ts@@ -0,0 +1,599 @@+// SPDX-License-Identifier: MIT+// Copyright contributors to the kepler.gl project++import {+ ClusterLevel,+ clusterLocations,+ LocalFlowmapDataProvider,+ makeLocationWeightGetter+} from '@flowmap.gl/data';+import {FlowmapLayer, PickingType} from '@flowmap.gl/layers';+import {format as d3Format} from 'd3-format';++import {TOOLTIP_FORMATS, LAYER_VIS_CONFIGS} from '@kepler.gl/constants';+import {DataContainerInterface, maybeHexToGeo, getPositionFromHexValue} from '@kepler.gl/utils';+import {Datasets, KeplerTable} from '@kepler.gl/table';+import {+ ColumnLabels,+ ColumnPairs,+ SupportedColumnMode,+ VisConfigBoolean,+ VisConfigNumber,+ VisConfigSelection,+ MapState+} from '@kepler.gl/types';++import Layer, {LayerBaseConfig, LayerBaseConfigPartial} from '../base-layer';+import {getFilterDataFunc} from '../aggregation-layer';+import {diffUpdateTriggers} from '../layer-update';+import {FindDefaultLayerPropsReturnValue} from '../layer-utils';+import FlowLayerIcon from './flow-layer-icon';++const MAX_CLUSTER_ZOOM_LEVEL = 20;++export type LocationDatum = {+ id: number;+ name: string;+ lon: number;+ lat: number;+};++export type FlowDatum = {+ index: number;+ sourceId: number;+ targetId: number;+ count: number;+};++export type FlowLayerData = {+ locations: LocationDatum[];+ flows: FlowDatum[];+ clusterLevels: ClusterLevel[];+};++const flowmapDataAccessors = {+ getLocationId: (loc: LocationDatum) => loc.id,+ getLocationLon: (loc: LocationDatum) => loc.lon,+ getLocationLat: (loc: LocationDatum) => loc.lat,+ getLocationName: (loc: LocationDatum) => loc.name,+ getFlowOriginId: (flow: FlowDatum) => flow.sourceId,+ getFlowDestId: (flow: FlowDatum) => flow.targetId,+ getFlowMagnitude: (flow: FlowDatum) => flow.count+};++export enum FlowLayerColumnMode {+ LAT_LNG = 'LAT_LNG',+ H3 = 'H3'+}++const flowPosAccessor =+ (+ {lat0, lng0, lat1, lng1, sourceH3, targetH3}: Record<string, any>,+ columnMode?: FlowLayerColumnMode | null+ ) =>+ (dataContainer: DataContainerInterface): ((d: {index: number}) => number[]) => {+ if (columnMode === FlowLayerColumnMode.H3) {+ return (d: {index: number}): number[] => {+ const startPos = getPositionFromHexValue(dataContainer.valueAt(d.index, sourceH3.fieldIdx));+ const endPos = getPositionFromHexValue(dataContainer.valueAt(d.index, targetH3.fieldIdx));+ return [+ startPos?.[0] ?? Number.NaN,+ startPos?.[1] ?? Number.NaN,+ 0,+ endPos?.[0] ?? Number.NaN,+ endPos?.[1] ?? Number.NaN,+ 0+ ];+ };+ }+ return (d: {index: number}): number[] => {+ const startPos = maybeHexToGeo(dataContainer, d, lat0, lng0);+ const endPos = maybeHexToGeo(dataContainer, d, lat1, lng1);+ return [+ startPos ? startPos[0] : dataContainer.valueAt(d.index, lng0.fieldIdx),+ startPos ? startPos[1] : dataContainer.valueAt(d.index, lat0.fieldIdx),+ 0,+ endPos ? endPos[0] : dataContainer.valueAt(d.index, lng1.fieldIdx),+ endPos ? endPos[1] : dataContainer.valueAt(d.index, lat1.fieldIdx),+ 0+ ];+ };+ };++const COLUMN_LABELS: ColumnLabels = {+ lat0: 'flow.source.lat',+ lng0: 'flow.source.lng',+ lat1: 'flow.target.lat',+ lng1: 'flow.target.lng',+ sourceName: 'flow.source.name',+ targetName: 'flow.target.name',+ count: 'flow.count',+ sourceH3: 'flow.source.h3',+ targetH3: 'flow.target.h3'+};++const SUPPORTED_COLUMN_MODES: SupportedColumnMode[] = [+ {+ key: FlowLayerColumnMode.LAT_LNG,+ label: 'Lat/Lng',+ requiredColumns: ['lat0', 'lng0', 'lat1', 'lng1'],+ optionalColumns: ['count', 'sourceName', 'targetName']+ },+ {+ key: FlowLayerColumnMode.H3,+ label: 'H3 hexagons',+ requiredColumns: ['sourceH3', 'targetH3'],+ optionalColumns: ['count', 'sourceName', 'targetName']+ }+];++const DEFAULT_COLUMN_MODE = FlowLayerColumnMode.LAT_LNG;++export const FLOW_LINES_RENDERING_MODES = ['straight', 'curved', 'animated-straight'] as const;+export type FlowLinesRenderingMode = (typeof FLOW_LINES_RENDERING_MODES)[number];++export const flowVisConfigs = {+ colorRange: 'colorRange' as const,+ opacity: {+ ...LAYER_VIS_CONFIGS.opacity,+ defaultValue: 1.0+ },+ flowLinesRenderingMode: {+ defaultValue: 'straight',+ type: 'select',+ label: 'layerVisConfigs.flow.renderingMode',+ property: 'flowLinesRenderingMode',+ options: FLOW_LINES_RENDERING_MODES as unknown as string[]+ } as VisConfigSelection,+ flowAdaptiveScalesEnabled: {+ defaultValue: true,+ type: 'boolean',+ label: 'layerVisConfigs.flow.adaptiveScalesEnabled',+ property: 'flowAdaptiveScalesEnabled'+ } as VisConfigBoolean,+ flowFadeEnabled: {+ defaultValue: true,+ type: 'boolean',+ label: 'layerVisConfigs.flow.fadeEnabled',+ property: 'flowFadeEnabled'+ } as VisConfigBoolean,+ flowFadeAmount: {+ defaultValue: 50,+ type: 'number',+ label: 'layerVisConfigs.flow.fadeAmount',+ property: 'flowFadeAmount',+ isRanged: false,+ range: [0, 100],+ step: 1.0+ } as VisConfigNumber,+ maxTopFlowsDisplayNum: {+ defaultValue: 5000,+ type: 'number',+ label: 'layerVisConfigs.flow.maxTopFlowsDisplayNum',+ property: 'maxTopFlowsDisplayNum',+ isRanged: false,+ range: [0, 10000],+ step: 1+ } as VisConfigNumber,+ flowLocationTotalsEnabled: {+ defaultValue: true,+ type: 'boolean',+ label: 'layerVisConfigs.flow.locationTotalsEnabled',+ property: 'flowLocationTotalsEnabled'+ } as VisConfigBoolean,+ flowClusteringEnabled: {+ defaultValue: true,+ type: 'boolean',+ label: 'layerVisConfigs.flow.clusteringEnabled',+ property: 'flowClusteringEnabled'+ } as VisConfigBoolean,+ flowLineThicknessScale: {+ defaultValue: 1,+ type: 'number',+ label: 'layerVisConfigs.flow.lineThicknessScale',+ property: 'flowLineThicknessScale',+ isRanged: false,+ range: [0.1, 5],+ step: 0.1+ } as VisConfigNumber,+ flowLineCurviness: {+ defaultValue: 1,+ type: 'number',+ label: 'layerVisConfigs.flow.lineCurviness',+ property: 'flowLineCurviness',+ isRanged: false,+ range: [0, 2],+ step: 0.1+ } as VisConfigNumber,+ darkBaseMapEnabled: 'darkBaseMapEnabled' as const+};++type Props = ConstructorParameters<typeof Layer>[0];++export default class FlowLayer extends Layer {+ _locationsByLatLon: Record<string, LocationDatum> | null = null;+ _dataProvider: LocalFlowmapDataProvider<LocationDatum, FlowDatum>;+ _lastLayerData: FlowLayerData | null = null;+ _dataVersion = 0;++ constructor(props: Props) {+ super(props);+ this.registerVisConfig(flowVisConfigs);+ this._dataProvider = new LocalFlowmapDataProvider<LocationDatum, FlowDatum>(+ flowmapDataAccessors+ );+ }++ get type(): string {+ return 'flow';+ }++ get isAggregated(): boolean {+ return true;+ }++ get layerIcon() {+ return FlowLayerIcon;+ }++ get columnLabels(): ColumnLabels {+ return COLUMN_LABELS;+ }++ get columnPairs(): ColumnPairs {+ return this.defaultLinkColumnPairs;+ }++ get supportedColumnModes(): SupportedColumnMode[] {+ return SUPPORTED_COLUMN_MODES;+ }++ static findDefaultLayerProps(): FindDefaultLayerPropsReturnValue {+ return {props: []};+ }++ getDefaultLayerConfig(config: {[key: string]: any}): LayerBaseConfig {+ const defaultLayerConfig = super.getDefaultLayerConfig(config as LayerBaseConfigPartial);++ return {+ ...defaultLayerConfig,+ columnMode: config?.columnMode ?? DEFAULT_COLUMN_MODE+ };+ }++ /**+ * Migrate legacy flowAnimationEnabled/flowCurvedLinesEnabled booleans+ * to the new flowLinesRenderingMode select.+ */+ updateLayerConfig(newConfig: any): FlowLayer {+ if (newConfig?.visConfig) {+ const {flowAnimationEnabled, flowCurvedLinesEnabled, flowLinesRenderingMode, ...rest} =+ newConfig.visConfig;+ if (flowLinesRenderingMode === undefined && (flowAnimationEnabled || flowCurvedLinesEnabled)) {+ newConfig = {+ ...newConfig,+ visConfig: {+ ...rest,+ flowLinesRenderingMode: flowCurvedLinesEnabled+ ? 'curved'+ : flowAnimationEnabled+ ? 'animated-straight'+ : 'straight'+ }+ };+ }+ }+ super.updateLayerConfig(newConfig);+ return this;+ }++ getDataProvider(): LocalFlowmapDataProvider<LocationDatum, FlowDatum> {+ return this._dataProvider;+ }++ getPositionAccessor = (dataContainer: DataContainerInterface): ((d: any) => number[]) =>+ flowPosAccessor(+ this.config.columns,+ this.config.columnMode+ ? FlowLayerColumnMode[this.config.columnMode as keyof typeof FlowLayerColumnMode]+ : null+ )(dataContainer);++ private getSourcePosition = (dataContainer: DataContainerInterface) => (d: any) =>+ this.getPositionAccessor(dataContainer)(d).slice(0, 2);++ private getTargetPosition = (dataContainer: DataContainerInterface) => (d: any) =>+ this.getPositionAccessor(dataContainer)(d).slice(3, 5);++ private static getLatLonKey = ([lon, lat]: number[]) => `${lat}:${lon}`;++ private getLocationFromPosition = (pos: number[]) =>+ this._locationsByLatLon?.[FlowLayer.getLatLonKey(pos)];++ private getMagnitude = (dataContainer: DataContainerInterface) => (rowIndex: number) => {+ const fieldIdx = this.config.columns.count?.fieldIdx;+ return fieldIdx != null && fieldIdx >= 0 ? dataContainer.valueAt(rowIndex, fieldIdx) : 1;+ };++ private getSourceName = (dataContainer: DataContainerInterface, d: {index: number}) => {+ const {fieldIdx} = this.config.columns.sourceName ?? {};+ return fieldIdx != null && fieldIdx >= 0 ? dataContainer.valueAt(d.index, fieldIdx) : null;+ };++ private getTargetName = (dataContainer: DataContainerInterface, d: {index: number}) => {+ const {fieldIdx} = this.config.columns.targetName ?? {};+ return fieldIdx != null && fieldIdx >= 0 ? dataContainer.valueAt(d.index, fieldIdx) : null;+ };++ updateLayerMeta(dataset: KeplerTable): void {+ const {dataContainer} = dataset;++ const sourceBounds = this.getPointsBounds(dataContainer, this.getSourcePosition(dataContainer));+ const targetBounds = this.getPointsBounds(dataContainer, this.getTargetPosition(dataContainer));++ const bounds =+ targetBounds && sourceBounds+ ? [+ Math.min(sourceBounds[0], targetBounds[0]),+ Math.min(sourceBounds[1], targetBounds[1]),+ Math.max(sourceBounds[2], targetBounds[2]),+ Math.max(sourceBounds[3], targetBounds[3])+ ]+ : sourceBounds || targetBounds;++ this._locationsByLatLon = {};+ let nextId = 1;+ const maybeAddLocation = ([lon, lat]: number[], name: string | null) => {+ if (!this._locationsByLatLon) return;+ if (!Number.isFinite(lat) || !Number.isFinite(lon)) return;+ const latLon = `${lat}:${lon}`;+ const loc = this._locationsByLatLon[latLon];+ if (!loc) {+ const id = nextId++;+ this._locationsByLatLon[latLon] = {+ id,+ name: name ?? `Location#${id}`,+ lat,+ lon+ };+ }+ };++ const getSource = this.getSourcePosition(dataContainer);+ const getTarget = this.getTargetPosition(dataContainer);++ const numRows = dataContainer.numRows();+ for (let i = 0; i < numRows; ++i) {+ const datum = {index: i};+ const sourcePos = getSource(datum);+ const targetPos = getTarget(datum);+ maybeAddLocation(sourcePos, this.getSourceName(dataContainer, datum));+ maybeAddLocation(targetPos, this.getTargetName(dataContainer, datum));+ }++ const locations = Object.values(this._locationsByLatLon);++ const getFlowOriginId = (index: number) =>+ this.getLocationFromPosition(getSource({index}))?.id || 0;+ const getFlowDestId = (index: number) =>+ this.getLocationFromPosition(getTarget({index}))?.id || 0;++ const flowIndices = dataContainer.getPlainIndex();+ const getLocationWeight = makeLocationWeightGetter(flowIndices, {+ getFlowOriginId,+ getFlowDestId,+ getFlowMagnitude: this.getMagnitude(dataContainer)+ });++ const clusterLevels = clusterLocations(locations, flowmapDataAccessors, getLocationWeight, {+ maxZoom: MAX_CLUSTER_ZOOM_LEVEL+ });++ this.updateMeta({bounds, locations, clusterLevels});+ }++ calculateDataAttribute(+ {dataContainer, filteredIndex}: KeplerTable,+ getPosition: (d: any) => number[]+ ): FlowDatum[] {+ const data: FlowDatum[] = [];+ const datum = {index: 0};+ const getSource = this.getSourcePosition(dataContainer);+ const getTarget = this.getTargetPosition(dataContainer);+ const getMag = this.getMagnitude(dataContainer);+ for (let i = 0; i < filteredIndex.length; i++) {+ const index = filteredIndex[i];+ datum.index = index;+ const pos = getPosition(datum);++ if (pos.every(Number.isFinite)) {+ const source = this.getLocationFromPosition(getSource(datum));+ const target = this.getLocationFromPosition(getTarget(datum));+ if (source && target) {+ data.push({+ index,+ sourceId: source.id,+ targetId: target.id,+ count: getMag(datum.index)+ });+ }+ }+ }++ return data;+ }++ private _oldFilterUpdateTriggers: Record<string, any> | null = null;++ formatLayerData(datasets: Datasets, oldLayerData: Record<string, any>): Record<string, any> {+ const {dataId} = this.config;+ if (!dataId) {+ return {};+ }+ const dataset = datasets[dataId];+ const {gpuFilter, dataContainer} = dataset;++ const {data, triggerChanged} = this.updateData(datasets, oldLayerData) as {+ data?: FlowDatum[];+ triggerChanged?: boolean | Record<string, any>;+ };+ const accessors = this.getAttributeAccessors({dataContainer});+ const {filterRange} = gpuFilter;+ const hasFilter = Object.values(filterRange).some(arr => (arr as number[]).some(v => v !== 0));+ let resultingFlows = data || [];+ if (hasFilter) {+ const filterUpdateTriggers = {+ filterRange: gpuFilter.filterRange,+ ...gpuFilter.filterValueUpdateTriggers+ };+ const dataChanged =+ triggerChanged && typeof triggerChanged === 'object' && triggerChanged.getData;+ const filterChanged =+ this._oldFilterUpdateTriggers === null ||+ diffUpdateTriggers(filterUpdateTriggers, this._oldFilterUpdateTriggers);+ if (filterChanged || dataChanged) {+ const indexAccessor = (d: FlowDatum) => d.index;+ const valueAccessor = (+ dc: DataContainerInterface,+ d: {index: number},+ fieldIndex: number+ ) => dc.valueAt(d.index, fieldIndex);+ const getFilterValue = gpuFilter.filterValueAccessor(dataContainer)(+ indexAccessor,+ valueAccessor+ );+ resultingFlows = resultingFlows.filter(getFilterDataFunc(filterRange, getFilterValue));+ }+ this._oldFilterUpdateTriggers = filterUpdateTriggers;+ }++ const layerData: FlowLayerData = {+ locations: this.meta.locations,+ clusterLevels: this.meta.clusterLevels,+ flows: resultingFlows+ };++ return {+ data,+ layerData,+ ...accessors+ };+ }++ renderLayer(opts: {+ data: any;+ gpuFilter: any;+ objectHovered: any;+ mapState: MapState;+ layerCallbacks: any;+ idx: number;+ visible: boolean;+ }): any[] {+ const {+ layerCallbacks,+ data: {layerData}+ } = opts;++ if (!layerData) {+ return [];+ }++ const dataContentChanged =+ !this._lastLayerData ||+ layerData.locations !== this._lastLayerData.locations ||+ layerData.flows !== this._lastLayerData.flows ||+ layerData.clusterLevels !== this._lastLayerData.clusterLevels;+ if (dataContentChanged) {+ this._dataProvider.setFlowmapData(layerData);+ this._lastLayerData = layerData;+ this._dataVersion++;+ }+ const defaultLayerProps = this.getDefaultDeckLayerProps(opts);++ // FlowmapLayer doesn't support GPU filtering+ const {extensions: _extensions, filterRange: _filterRange, onFilteredItemsChange: _onFilteredItemsChange, ...cleanProps} =+ defaultLayerProps as any;++ const {visConfig} = this.config;+ const flowLinesRenderingMode = visConfig.flowLinesRenderingMode || 'straight';+ return [+ new FlowmapLayer<LocationDatum, FlowDatum>({+ ...cleanProps,+ dataProvider: this._dataProvider,+ data: this._dataVersion as any,+ ...flowmapDataAccessors,+ pickable: true,+ darkMode: visConfig.darkBaseMapEnabled,+ colorScheme: visConfig.colorRange?.colors,+ fadeAmount: visConfig.flowFadeAmount,+ fadeEnabled: visConfig.flowFadeEnabled,+ fadeOpacityEnabled: false,+ opacity: visConfig.opacity,+ locationTotalsEnabled: visConfig.flowLocationTotalsEnabled,+ flowLinesRenderingMode,+ flowLineThicknessScale: visConfig.flowLineThicknessScale,+ flowLineCurviness: visConfig.flowLineCurviness,+ clusteringEnabled: visConfig.flowClusteringEnabled,+ maxTopFlowsDisplayNum: visConfig.maxTopFlowsDisplayNum,+ clusteringAuto: true,+ adaptiveScalesEnabled: visConfig.flowAdaptiveScalesEnabled,+ onHover: layerCallbacks.onLayerHover,+ parameters: {+ ...(cleanProps.parameters || {}),+ cull: false+ }+ })+ ];+ }++ getHoverData(object: Record<string, any>): {+ object: Record<string, any>;+ fieldValues: Array<{labelMessage: string; value: any}>;+ } | null {+ const fmt = d3Format(TOOLTIP_FORMATS.DECIMAL_COMMA.format);+ switch (object?.type) {+ case PickingType.LOCATION:+ return {+ object,+ fieldValues: [+ {+ labelMessage: 'flow.tooltip.location.name',+ value: object.location.name+ },+ {+ labelMessage: 'flow.tooltip.location.incomingCount',+ value: fmt(object.totals.incomingCount)+ },+ {+ labelMessage: 'flow.tooltip.location.outgoingCount',+ value: fmt(object.totals.outgoingCount)+ },+ {+ labelMessage: 'flow.tooltip.location.internalCount',+ value: fmt(object.totals.internalCount)+ }+ ]+ };+ case PickingType.FLOW:+ return {+ object,+ fieldValues: [+ {+ labelMessage: 'flow.tooltip.flow.sourceName',+ value: object.origin.name+ },+ {+ labelMessage: 'flow.tooltip.flow.targetName',+ value: object.dest.name+ },+ {+ labelMessage: 'flow.tooltip.flow.count',+ value: fmt(object.count)+ }+ ]+ };+ default:+ return null;+ }+ }+}diff --git a/src/layers/src/index.ts b/src/layers/src/index.tsindex 9e6fcd168..5ee108a76 100644--- a/src/layers/src/index.ts+++ b/src/layers/src/index.ts@@ -38,6 +38,7 @@ export {} from './trip-layer/trip-utils';import {default as S2GeometryLayer} from './s2-geometry-layer/s2-geometry-layer';export {defaultElevation as s2DefaultElevation} from './s2-geometry-layer/s2-geometry-layer';+import {default as FlowLayer} from './flow-layer/flow-layer';export {getS2Center} from './s2-geometry-layer/s2-utils';export {default as AggregationLayer} from './aggregation-layer';import {default as VectorTileLayer} from './vector-tile/vector-tile-layer';@@ -96,6 +97,7 @@ export const KeplerGlLayers = {ScenegraphLayer,TripLayer,S2GeometryLayer,+ FlowLayer,VectorTileLayer,RasterTileLayer,WMSLayer,@@ -117,6 +119,7 @@ export const LayerClasses = {[LAYER_TYPES['3D']]: ScenegraphLayer,[LAYER_TYPES.trip]: TripLayer,[LAYER_TYPES.s2]: S2GeometryLayer,+ [LAYER_TYPES.flow]: FlowLayer,[LAYER_TYPES['vectorTile']]: VectorTileLayer,[LAYER_TYPES['rasterTile']]: RasterTileLayer,[LAYER_TYPES.wms]: WMSLayer,diff --git a/src/localization/src/translations/ca.ts b/src/localization/src/translations/ca.tsindex 4c2f77a85..aae88d186 100644--- a/src/localization/src/translations/ca.ts+++ b/src/localization/src/translations/ca.ts@@ -116,6 +116,7 @@ export default {trip: 'viatge',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'mosaic vectorial',rastertile: 'mosaic ràster',wms: 'WMS',@@ -183,6 +184,24 @@ export default {allowHover: "Mostra informació d'eina",allowHoverDescription:"Mostra o oculta la informació d'eina en passar el cursor per sobre de les característiques de la capa",+ flow: {+ fade: 'Esvaïment',+ fadeEnabled: 'Esvaïment',+ fadeAmount: "Quantitat d'esvaïment",+ display: 'Visualització',+ renderingMode: 'Estil de línia',+ renderingModes: {+ straight: 'Recta',+ curved: 'Corba',+ 'animated-straight': 'Animada'+ },+ adaptiveScalesEnabled: 'Escales adaptatives',+ clusteringEnabled: 'Agrupació',+ lineThicknessScale: 'Gruix de línia',+ lineCurviness: 'Curvatura',+ locationTotalsEnabled: 'Totals de localització',+ maxTopFlowsDisplayNum: 'Màxim de fluxos principals'+ },showNeighborOnHover: 'Ressalta veïns en passar el cursor',showHighlightColor: 'Mostra color de ressaltat',darkModeEnabled: 'Mapa base fosc',@@ -583,7 +602,22 @@ export default {hexagon: {worldUnitSize: "Radi d'hexàgon (km)"},- hex_id: 'id hex'+ hex_id: 'id hex',+ flow: {+ source: {+ lat: 'lat origen',+ lng: 'lng origen',+ name: 'nom origen',+ h3: 'H3 origen'+ },+ target: {+ lat: 'lat destinació',+ lng: 'lng destinació',+ name: 'nom destinació',+ h3: 'H3 destinació'+ },+ count: 'recompte'+ }},color: {customPalette: 'Paleta personalitzada',@@ -644,6 +678,21 @@ export default {'User Guide': "Guia d'usuari",Save: 'Desa',Share: 'Comparteix',+ flow: {+ tooltip: {+ location: {+ name: 'Nom',+ incomingCount: 'Entrants',+ outgoingCount: 'Sortints',+ internalCount: 'Interns'+ },+ flow: {+ sourceName: 'Origen',+ targetName: 'Destinació',+ count: 'Recompte'+ }+ }+ },mapLegend: {layers: {line: {diff --git a/src/localization/src/translations/cn.ts b/src/localization/src/translations/cn.tsindex a1d29b228..ef1f38e7d 100644--- a/src/localization/src/translations/cn.ts+++ b/src/localization/src/translations/cn.ts@@ -116,6 +116,7 @@ export default {trip: 'trip',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'vector tile',rastertile: 'raster tile',wms: 'WMS',@@ -181,6 +182,24 @@ export default {fixedHeightDescription: '使用未修改的高度',allowHover: '显示工具提示',allowHoverDescription: '悬停在图层要素上时显示或隐藏工具提示',+ flow: {+ fade: '渐隐',+ fadeEnabled: '渐隐',+ fadeAmount: '渐隐量',+ display: '显示',+ renderingMode: '线条样式',+ renderingModes: {+ straight: '直线',+ curved: '曲线',+ 'animated-straight': '动画'+ },+ adaptiveScalesEnabled: '自适应比例',+ clusteringEnabled: '聚类',+ lineThicknessScale: '线条粗细',+ lineCurviness: '弯曲度',+ locationTotalsEnabled: '位置总量',+ maxTopFlowsDisplayNum: '最大显示流量数'+ },showNeighborOnHover: '悬停时高亮邻居',showHighlightColor: '显示高亮颜色',darkModeEnabled: '深色底图',@@ -581,7 +600,22 @@ export default {hexagon: {worldUnitSize: '六边形半径 (km)'},- hex_id: 'hex id'+ hex_id: 'hex id',+ flow: {+ source: {+ lat: '起点纬度',+ lng: '起点经度',+ name: '起点名称',+ h3: '起点 H3'+ },+ target: {+ lat: '终点纬度',+ lng: '终点经度',+ name: '终点名称',+ h3: '终点 H3'+ },+ count: '数量'+ }},color: {customPalette: '自定义调色板',@@ -642,6 +676,21 @@ export default {'User Guide': '用户指南',Save: '保存',Share: '分享',+ flow: {+ tooltip: {+ location: {+ name: '名称',+ incomingCount: '流入',+ outgoingCount: '流出',+ internalCount: '内部'+ },+ flow: {+ sourceName: '起点',+ targetName: '终点',+ count: '数量'+ }+ }+ },mapLegend: {layers: {line: {diff --git a/src/localization/src/translations/en.ts b/src/localization/src/translations/en.tsindex 6d7f8e710..0b0108480 100644--- a/src/localization/src/translations/en.ts+++ b/src/localization/src/translations/en.ts@@ -116,6 +116,7 @@ export default {trip: 'trip',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'vector tile',rastertile: 'raster tile',wms: 'WMS',@@ -184,7 +185,25 @@ export default {showNeighborOnHover: 'Highlight Neighbors On Hover',showHighlightColor: 'Show highlight Color',darkModeEnabled: 'Dark base map',- transparentBackground: 'Transparent Background'+ transparentBackground: 'Transparent Background',+ flow: {+ fade: 'Fade',+ fadeEnabled: 'Fade',+ fadeAmount: 'Fade Amount',+ display: 'Display',+ renderingMode: 'Line Style',+ renderingModes: {+ straight: 'Straight',+ curved: 'Curved',+ 'animated-straight': 'Animated'+ },+ adaptiveScalesEnabled: 'Adaptive Scales',+ clusteringEnabled: 'Clustering',+ lineThicknessScale: 'Line Thickness',+ lineCurviness: 'Curviness',+ locationTotalsEnabled: 'Location Totals',+ maxTopFlowsDisplayNum: 'Max Top Flows'+ }},layerManager: {addData: 'Add Data',@@ -643,7 +662,22 @@ ${'```'}hexagon: {worldUnitSize: 'Hexagon Radius (km)'},- hex_id: 'hex id'+ hex_id: 'hex id',+ flow: {+ source: {+ lat: 'source lat',+ lng: 'source lng',+ name: 'source name',+ h3: 'source H3'+ },+ target: {+ lat: 'target lat',+ lng: 'target lng',+ name: 'target name',+ h3: 'target H3'+ },+ count: 'count'+ }},color: {customPalette: 'Custom Palette',@@ -725,5 +759,20 @@ ${'```'}}}}+ },+ flow: {+ tooltip: {+ location: {+ name: 'Name',+ incomingCount: 'Incoming',+ outgoingCount: 'Outgoing',+ internalCount: 'Internal'+ },+ flow: {+ sourceName: 'Origin',+ targetName: 'Destination',+ count: 'Count'+ }+ }}};diff --git a/src/localization/src/translations/es.ts b/src/localization/src/translations/es.tsindex 3f74d2b09..970779a34 100644--- a/src/localization/src/translations/es.ts+++ b/src/localization/src/translations/es.ts@@ -116,6 +116,7 @@ export default {trip: 'viaje',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'mosaico vectorial',rastertile: 'mosaico ráster',wms: 'WMS',@@ -184,6 +185,24 @@ export default {allowHover: 'Mostrar descripción emergente',allowHoverDescription:'Mostrar u ocultar información emergente al pasar el cursor sobre las características de la capa',+ flow: {+ fade: 'Desvanecimiento',+ fadeEnabled: 'Desvanecimiento',+ fadeAmount: 'Cantidad de desvanecimiento',+ display: 'Visualización',+ renderingMode: 'Estilo de línea',+ renderingModes: {+ straight: 'Recta',+ curved: 'Curva',+ 'animated-straight': 'Animada'+ },+ adaptiveScalesEnabled: 'Escalas adaptativas',+ clusteringEnabled: 'Agrupación',+ lineThicknessScale: 'Grosor de línea',+ lineCurviness: 'Curvatura',+ locationTotalsEnabled: 'Totales de ubicación',+ maxTopFlowsDisplayNum: 'Máx. flujos principales'+ },showNeighborOnHover: 'Resaltar vecinos al pasar el cursor',showHighlightColor: 'Mostrar color de resaltado',darkModeEnabled: 'Mapa base oscuro',@@ -584,7 +603,22 @@ export default {hexagon: {worldUnitSize: 'Radio de hexágono (km)'},- hex_id: 'id hex'+ hex_id: 'id hex',+ flow: {+ source: {+ lat: 'lat origen',+ lng: 'lng origen',+ name: 'nombre origen',+ h3: 'H3 origen'+ },+ target: {+ lat: 'lat destino',+ lng: 'lng destino',+ name: 'nombre destino',+ h3: 'H3 destino'+ },+ count: 'cantidad'+ }},color: {customPalette: 'Paleta personalizada',@@ -645,6 +679,21 @@ export default {'User Guide': 'Guía de usuario',Save: 'Guadar',Share: 'Compartir',+ flow: {+ tooltip: {+ location: {+ name: 'Nombre',+ incomingCount: 'Entrantes',+ outgoingCount: 'Salientes',+ internalCount: 'Internos'+ },+ flow: {+ sourceName: 'Origen',+ targetName: 'Destino',+ count: 'Cantidad'+ }+ }+ },mapLegend: {layers: {line: {diff --git a/src/localization/src/translations/fi.ts b/src/localization/src/translations/fi.tsindex 23bb17d75..b4ccb73f2 100644--- a/src/localization/src/translations/fi.ts+++ b/src/localization/src/translations/fi.ts@@ -115,6 +115,7 @@ export default {trip: 'matka',s2: 'S2','3d': '3D',+ flow: 'virtaus',vectortile: 'vektoritiili',rastertile: 'rasteritiili',wms: 'WMS',@@ -182,6 +183,24 @@ export default {allowHover: 'Näytä työkaluvihje',allowHoverDescription:'Näytä tai piilota työkaluvihje, kun osoitin on tason ominaisuuksien päällä',+ flow: {+ fade: 'Häivytys',+ fadeEnabled: 'Häivytys',+ fadeAmount: 'Häivytyksen määrä',+ display: 'Näyttö',+ renderingMode: 'Viivatyyli',+ renderingModes: {+ straight: 'Suora',+ curved: 'Kaareva',+ 'animated-straight': 'Animoitu'+ },+ adaptiveScalesEnabled: 'Mukautuvat skaalat',+ clusteringEnabled: 'Klusterointi',+ lineThicknessScale: 'Viivan paksuus',+ lineCurviness: 'Kaarevuus',+ locationTotalsEnabled: 'Sijaintien kokonaismäärät',+ maxTopFlowsDisplayNum: 'Suurin virtausten lukumäärä'+ },showNeighborOnHover: 'Korosta naapurit osoittaessa',showHighlightColor: 'Näytä korostusväri',darkModeEnabled: 'Tumma taustakartta',@@ -582,6 +601,21 @@ export default {hexagon: {worldUnitSize: 'Hexagonien säde (km)'},+ flow: {+ source: {+ lat: 'lähteen lat',+ lng: 'lähteen lng',+ name: 'lähteen nimi',+ h3: 'lähteen H3'+ },+ target: {+ lat: 'kohteen lat',+ lng: 'kohteen lng',+ name: 'kohteen nimi',+ h3: 'kohteen H3'+ },+ count: 'lukumäärä'+ },hex_id: 'hex id'},color: {@@ -620,6 +654,21 @@ export default {'User Guide': 'Opas',Save: 'Tallenna',Share: 'Jaa',+ flow: {+ tooltip: {+ location: {+ name: 'Nimi',+ incomingCount: 'Saapuvat',+ outgoingCount: 'Lähtevät',+ internalCount: 'Sisäiset'+ },+ flow: {+ sourceName: 'Lähtöpaikka',+ targetName: 'Määränpää',+ count: 'Lukumäärä'+ }+ }+ },tilesetSetup: {header: 'Vektoritiilien asetukset',rasterTileHeader: 'Rasteritiilien asetukset',diff --git a/src/localization/src/translations/ja.ts b/src/localization/src/translations/ja.tsindex d988a0b64..1258ff19f 100644--- a/src/localization/src/translations/ja.ts+++ b/src/localization/src/translations/ja.ts@@ -116,6 +116,7 @@ export default {trip: 'trip',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'vector tile',rastertile: 'raster tile',wms: 'WMS',@@ -180,6 +181,24 @@ export default {fixedHeightDescription: '高さを変更せずに使用する',allowHover: 'ツールチップを表示',allowHoverDescription: 'レイヤー要素にホバーしたときにツールチップを表示または非表示にする',+ flow: {+ fade: 'フェード',+ fadeEnabled: 'フェード',+ fadeAmount: 'フェード量',+ display: '表示',+ renderingMode: 'ラインスタイル',+ renderingModes: {+ straight: 'ストレート',+ curved: 'カーブ',+ 'animated-straight': 'アニメーション'+ },+ adaptiveScalesEnabled: 'アダプティブスケール',+ clusteringEnabled: 'クラスタリング',+ lineThicknessScale: '線の太さ',+ lineCurviness: '曲がり具合',+ locationTotalsEnabled: 'ロケーション合計',+ maxTopFlowsDisplayNum: '最大表示フロー数'+ },showNeighborOnHover: 'ホバー時に隣接要素をハイライト',showHighlightColor: 'ハイライトカラーを表示',darkModeEnabled: 'ダークベースマップ',@@ -581,7 +600,22 @@ export default {hexagon: {worldUnitSize: '六角形の半径 (km)'},- hex_id: 'hex id'+ hex_id: 'hex id',+ flow: {+ source: {+ lat: '出発 緯度',+ lng: '出発 経度',+ name: '出発名',+ h3: '出発 H3'+ },+ target: {+ lat: '到着 緯度',+ lng: '到着 経度',+ name: '到着名',+ h3: '到着 H3'+ },+ count: '件数'+ }},color: {customPalette: 'カスタムパレット',@@ -637,6 +671,21 @@ export default {'User Guide': 'ユーザーガイド',Save: '保存',Share: '共有',+ flow: {+ tooltip: {+ location: {+ name: '名称',+ incomingCount: '流入',+ outgoingCount: '流出',+ internalCount: '内部'+ },+ flow: {+ sourceName: '出発地',+ targetName: '目的地',+ count: '件数'+ }+ }+ },tilesetSetup: {header: 'ベクタータイルの設定',rasterTileHeader: 'ラスタータイルの設定',diff --git a/src/localization/src/translations/pt.ts b/src/localization/src/translations/pt.tsindex e230e8e7c..7d39763fd 100644--- a/src/localization/src/translations/pt.ts+++ b/src/localization/src/translations/pt.ts@@ -116,6 +116,7 @@ export default {trip: 'viagem',s2: 'S2','3d': '3D',+ flow: 'flow',vectortile: 'mosaico vetorial',rastertile: 'mosaico raster',wms: 'WMS',@@ -184,6 +185,24 @@ export default {allowHover: 'Mostrar dica de ferramenta',allowHoverDescription:'Mostrar ou ocultar dica de ferramenta ao passar o cursor sobre os recursos da camada',+ flow: {+ fade: 'Esmaecimento',+ fadeEnabled: 'Esmaecimento',+ fadeAmount: 'Quantidade de esmaecimento',+ display: 'Exibição',+ renderingMode: 'Estilo de linha',+ renderingModes: {+ straight: 'Reta',+ curved: 'Curva',+ 'animated-straight': 'Animada'+ },+ adaptiveScalesEnabled: 'Escalas adaptativas',+ clusteringEnabled: 'Agrupamento',+ lineThicknessScale: 'Espessura da linha',+ lineCurviness: 'Curvatura',+ locationTotalsEnabled: 'Totais de localização',+ maxTopFlowsDisplayNum: 'Máx. fluxos principais'+ },showNeighborOnHover: 'Destacar vizinhos ao passar o cursor',showHighlightColor: 'Mostrar cor de destaque',darkModeEnabled: 'Mapa base escuro',@@ -585,6 +604,21 @@ export default {hexagon: {worldUnitSize: 'Raio do Hexágono (km)'},+ flow: {+ source: {+ lat: 'origem lat',+ lng: 'origem lng',+ name: 'nome origem',+ h3: 'H3 origem'+ },+ target: {+ lat: 'destino lat',+ lng: 'destino lng',+ name: 'nome destino',+ h3: 'H3 destino'+ },+ count: 'contagem'+ },hex_id: 'hex id'},color: {@@ -646,6 +680,21 @@ export default {'User Guide': 'Guia do Usuário',Save: 'Salvar',Share: 'Compartilhar',+ flow: {+ tooltip: {+ location: {+ name: 'Nome',+ incomingCount: 'Entrada',+ outgoingCount: 'Saída',+ internalCount: 'Interno'+ },+ flow: {+ sourceName: 'Origem',+ targetName: 'Destino',+ count: 'Contagem'+ }+ }+ },mapLegend: {layers: {line: {diff --git a/src/localization/src/translations/ru.ts b/src/localization/src/translations/ru.tsindex 2b1e8e1c5..305f9dfc5 100644--- a/src/localization/src/translations/ru.ts+++ b/src/localization/src/translations/ru.ts@@ -116,6 +116,7 @@ export default {trip: 'пути',s2: 'S2','3d': '3D',+ flow: 'поток',vectortile: 'векторный тайл',rastertile: 'растровый тайл',wms: 'WMS',@@ -183,6 +184,24 @@ export default {fixedHeightDescription: 'Использовать высоту без изменений',allowHover: 'Показать подсказку',allowHoverDescription: 'Показать или скрыть подсказку при наведении на элементы слоя',+ flow: {+ fade: 'Затухание',+ fadeEnabled: 'Затухание',+ fadeAmount: 'Степень затухания',+ display: 'Отображение',+ renderingMode: 'Стиль линий',+ renderingModes: {+ straight: 'Прямые',+ curved: 'Изогнутые',+ 'animated-straight': 'Анимированные'+ },+ adaptiveScalesEnabled: 'Адаптивные масштабы',+ clusteringEnabled: 'Кластеризация',+ lineThicknessScale: 'Толщина линий',+ lineCurviness: 'Кривизна',+ locationTotalsEnabled: 'Итоги по локациям',+ maxTopFlowsDisplayNum: 'Макс. число потоков'+ },showNeighborOnHover: 'Выделять соседей при наведении',showHighlightColor: 'Показать цвет выделения',darkModeEnabled: 'Темная базовая карта',@@ -586,7 +605,22 @@ export default {hexagon: {worldUnitSize: 'Hexagon радиус (km)'},- hex_id: 'hex id'+ hex_id: 'hex id',+ flow: {+ source: {+ lat: 'lat источника',+ lng: 'lng источника',+ name: 'имя источника',+ h3: 'H3 источника'+ },+ target: {+ lat: 'lat цели',+ lng: 'lng цели',+ name: 'имя цели',+ h3: 'H3 цели'+ },+ count: 'количество'+ }},color: {customPalette: 'Ваша палитра',@@ -647,6 +681,21 @@ export default {'User Guide': 'Инструкции',Save: 'Сохранить',Share: 'Поделиться',+ flow: {+ tooltip: {+ location: {+ name: 'Название',+ incomingCount: 'Входящие',+ outgoingCount: 'Исходящие',+ internalCount: 'Внутренние'+ },+ flow: {+ sourceName: 'Источник',+ targetName: 'Назначение',+ count: 'Количество'+ }+ }+ },mapLegend: {layers: {line: {diff --git a/src/utils/src/application-config.ts b/src/utils/src/application-config.tsindex e2cf2c303..0e3c173b9 100644--- a/src/utils/src/application-config.ts+++ b/src/utils/src/application-config.ts@@ -83,6 +83,9 @@ export type KeplerApplicationConfig = {// WMS layer is under development and not ready for production use. Disabled by default.enableWMSLayer?: boolean;+ // Flow layer config+ enableFlowLayer?: boolean;+/** Whether to show example URLs in tileset setup forms (vector tile, raster tile, WMS, 3D tile) */showInlineTilesetExamples?: boolean;@@ -147,6 +150,9 @@ const DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig> = {// WMS layer configenableWMSLayer: true,+ // Flow layer config+ enableFlowLayer: true,+showInlineTilesetExamples: true,// Image export configdiff --git a/test/browser/layer-tests/flow-layer-specs.js b/test/browser/layer-tests/flow-layer-specs.jsnew file mode 100644index 000000000..c9bd5bf71--- /dev/null+++ b/test/browser/layer-tests/flow-layer-specs.js@@ -0,0 +1,289 @@+// SPDX-License-Identifier: MIT+// Copyright contributors to the kepler.gl project++import test from 'tape';++import {testCreateCases, dataId, preparedDataset} from 'test/helpers/layer-utils';+import {KeplerGlLayers} from '@kepler.gl/layers';+import {copyTableAndUpdate} from '@kepler.gl/table';++const {FlowLayer} = KeplerGlLayers;++test('#FlowLayer -> constructor', t => {+ const TEST_CASES = {+ CREATE: [+ {+ props: {+ dataId: 'smoothie',+ isVisible: true,+ label: 'test flow layer'+ },+ test: layer => {+ t.ok(layer.config.dataId === 'smoothie', 'FlowLayer dataId should be correct');+ t.ok(layer.type === 'flow', 'type should be flow');+ t.ok(layer.isAggregated === true, 'FlowLayer is aggregated');+ t.ok(layer.config.label === 'test flow layer', 'label should be correct');+ t.ok(Object.keys(layer.columnPairs).length, 'should have columnPairs');+ }+ }+ ]+ };++ testCreateCases(t, FlowLayer, TEST_CASES.CREATE);+ t.end();+});++test('#FlowLayer -> constructor defaults', t => {+ const layer = new FlowLayer({dataId: 'test'});++ t.deepEqual(+ layer.supportedColumnModes.map(m => m.key),+ ['LAT_LNG', 'H3'],+ 'should support LAT_LNG and H3 column modes'+ );++ t.deepEqual(+ Object.keys(layer.visConfigSettings),+ [+ 'colorRange',+ 'opacity',+ 'flowLinesRenderingMode',+ 'flowAdaptiveScalesEnabled',+ 'flowFadeEnabled',+ 'flowFadeAmount',+ 'maxTopFlowsDisplayNum',+ 'flowLocationTotalsEnabled',+ 'flowClusteringEnabled',+ 'flowLineThicknessScale',+ 'flowLineCurviness',+ 'darkBaseMapEnabled'+ ],+ 'should provide the correct visConfigSettings properties'+ );++ const {visConfig} = layer.config;+ t.equal(visConfig.opacity, 1.0, 'default opacity should be 1.0');+ t.equal(visConfig.flowLinesRenderingMode, 'straight', 'rendering mode should default to straight');+ t.equal(visConfig.flowAdaptiveScalesEnabled, true, 'adaptive scales should be on by default');+ t.equal(visConfig.flowFadeEnabled, true, 'fade should be on by default');+ t.equal(visConfig.flowFadeAmount, 50, 'fade amount should default to 50');+ t.equal(visConfig.maxTopFlowsDisplayNum, 5000, 'max top flows should default to 5000');+ t.equal(visConfig.flowLocationTotalsEnabled, true, 'location totals should be on by default');+ t.equal(visConfig.flowClusteringEnabled, true, 'clustering should be on by default');+ t.equal(visConfig.flowLineThicknessScale, 1, 'line thickness scale should default to 1');+ t.equal(visConfig.flowLineCurviness, 1, 'line curviness should default to 1');++ t.end();+});++test('#FlowLayer -> findDefaultLayerProps', t => {+ const result = FlowLayer.findDefaultLayerProps();+ t.deepEqual(result, {props: []}, 'should return empty props (no auto-detection)');+ t.end();+});++test('#FlowLayer -> updateLayerMeta', t => {+ const columns = {+ lat0: {value: 'lat', fieldIdx: 1},+ lng0: {value: 'lng', fieldIdx: 2},+ lat1: {value: 'lat_1', fieldIdx: 3},+ lng1: {value: 'lng_1', fieldIdx: 4}+ };++ const layer = new FlowLayer({+ dataId,+ label: 'test flow'+ });++ layer.updateLayerConfig({+ columns,+ columnMode: 'LAT_LNG'+ });++ const filteredIndex = [0, 1, 3, 4, 5, 7, 8];+ const dataset = copyTableAndUpdate(preparedDataset, {filteredIndex});++ t.doesNotThrow(() => {+ layer.updateLayerMeta(dataset);+ }, 'updateLayerMeta should not throw');++ const {meta} = layer;+ t.ok(meta.bounds, 'should have bounds');+ t.equal(meta.bounds.length, 4, 'bounds should have 4 values');+ t.ok(Array.isArray(meta.locations), 'should have locations array');+ t.ok(meta.locations.length > 0, 'should have extracted unique locations');+ t.ok(Array.isArray(meta.clusterLevels), 'should have clusterLevels array');+ t.ok(meta.clusterLevels.length > 0, 'should have at least one cluster level');++ meta.locations.forEach(loc => {+ t.ok(typeof loc.id === 'number', 'location id should be a number');+ t.ok(typeof loc.lat === 'number', 'location lat should be a number');+ t.ok(typeof loc.lon === 'number', 'location lon should be a number');+ t.ok(typeof loc.name === 'string', 'location name should be a string');+ });++ t.end();+});++test('#FlowLayer -> formatLayerData', t => {+ const columns = {+ lat0: {value: 'lat', fieldIdx: 1},+ lng0: {value: 'lng', fieldIdx: 2},+ lat1: {value: 'lat_1', fieldIdx: 3},+ lng1: {value: 'lng_1', fieldIdx: 4}+ };++ const layer = new FlowLayer({+ dataId,+ label: 'test flow format'+ });++ layer.updateLayerConfig({+ columns,+ columnMode: 'LAT_LNG'+ });++ const filteredIndex = [0, 1, 3, 4, 5, 7, 8];+ const dataset = copyTableAndUpdate(preparedDataset, {filteredIndex});++ layer.updateLayerMeta(dataset);+ layer.updateLayerDomain({[dataId]: dataset});++ let result;+ t.doesNotThrow(() => {+ result = layer.formatLayerData({[dataId]: dataset}, {});+ }, 'formatLayerData should not throw');++ t.ok(result, 'should return format result');+ t.ok(result.layerData, 'should have layerData');+ t.ok(Array.isArray(result.layerData.locations), 'layerData should have locations');+ t.ok(Array.isArray(result.layerData.flows), 'layerData should have flows');+ t.ok(Array.isArray(result.layerData.clusterLevels), 'layerData should have clusterLevels');++ t.ok(result.layerData.flows.length > 0, 'should have at least one flow');+ t.ok(result.layerData.locations.length > 0, 'should have at least one location');++ result.layerData.flows.forEach(flow => {+ t.ok(typeof flow.index === 'number', 'flow should have numeric index');+ t.ok(typeof flow.sourceId === 'number', 'flow should have numeric sourceId');+ t.ok(typeof flow.targetId === 'number', 'flow should have numeric targetId');+ t.ok(typeof flow.count === 'number', 'flow should have numeric count');+ t.equal(flow.count, 1, 'count should default to 1 when no count column');+ });++ t.end();+});++test('#FlowLayer -> getHoverData location', t => {+ const layer = new FlowLayer({+ dataId,+ label: 'test flow hover'+ });++ const locationHoverObject = {+ type: 'location',+ location: {name: 'San Francisco'},+ totals: {incomingCount: 100, outgoingCount: 200, internalCount: 10}+ };++ const result = layer.getHoverData(locationHoverObject);+ t.ok(result, 'should return hover data for location');+ t.equal(result.fieldValues.length, 4, 'should have 4 field values for location');+ t.equal(+ result.fieldValues[0].labelMessage,+ 'flow.tooltip.location.name',+ 'should have name label'+ );+ t.equal(result.fieldValues[0].value, 'San Francisco', 'name value should be correct');+ t.equal(+ result.fieldValues[1].labelMessage,+ 'flow.tooltip.location.incomingCount',+ 'should have incoming count label'+ );+ t.equal(+ result.fieldValues[2].labelMessage,+ 'flow.tooltip.location.outgoingCount',+ 'should have outgoing count label'+ );+ t.equal(+ result.fieldValues[3].labelMessage,+ 'flow.tooltip.location.internalCount',+ 'should have internal count label'+ );++ t.end();+});++test('#FlowLayer -> getHoverData flow', t => {+ const layer = new FlowLayer({+ dataId,+ label: 'test flow hover'+ });++ const flowHoverObject = {+ type: 'flow',+ origin: {name: 'San Francisco'},+ dest: {name: 'Los Angeles'},+ count: 150+ };++ const result = layer.getHoverData(flowHoverObject);+ t.ok(result, 'should return hover data for flow');+ t.equal(result.fieldValues.length, 3, 'should have 3 field values for flow');+ t.equal(+ result.fieldValues[0].labelMessage,+ 'flow.tooltip.flow.sourceName',+ 'should have source name label'+ );+ t.equal(result.fieldValues[0].value, 'San Francisco', 'source name value should be correct');+ t.equal(+ result.fieldValues[1].labelMessage,+ 'flow.tooltip.flow.targetName',+ 'should have target name label'+ );+ t.equal(result.fieldValues[1].value, 'Los Angeles', 'target name value should be correct');+ t.equal(+ result.fieldValues[2].labelMessage,+ 'flow.tooltip.flow.count',+ 'should have count label'+ );++ t.end();+});++test('#FlowLayer -> getHoverData unknown type', t => {+ const layer = new FlowLayer({+ dataId,+ label: 'test flow hover'+ });++ const result = layer.getHoverData({type: 'unknown'});+ t.equal(result, null, 'should return null for unknown picking type');++ const resultNull = layer.getHoverData(null);+ t.equal(resultNull, null, 'should return null for null input');++ t.end();+});++test('#FlowLayer -> renderLayer returns empty when no data', t => {+ const layer = new FlowLayer({+ dataId,+ label: 'test flow render'+ });++ const result = layer.renderLayer({+ data: {layerData: null},+ gpuFilter: {},+ objectHovered: null,+ mapState: {},+ layerCallbacks: {onLayerHover: () => {}},+ idx: 0,+ visible: true+ });++ t.ok(Array.isArray(result), 'should return an array');+ t.equal(result.length, 0, 'should return empty array when no layerData');++ t.end();+});diff --git a/test/browser/layer-tests/index.js b/test/browser/layer-tests/index.jsindex 94d6e64aa..40a01b109 100644--- a/test/browser/layer-tests/index.js+++ b/test/browser/layer-tests/index.js@@ -17,3 +17,4 @@ import './scenegraph-layer-specs';import './trip-layer-specs';import './s2-geometry-layer-specs';import './wms-layer-specs';+import './flow-layer-specs';diff --git a/yarn.lock b/yarn.lockindex 7d41ffebf..3936c159a 100644--- a/yarn.lock+++ b/yarn.lock@@ -2801,6 +2801,40 @@ __metadata:languageName: nodelinkType: hard+"@flowmap.gl/data@npm:^9.2.0":+ version: 9.2.0+ resolution: "@flowmap.gl/data@npm:9.2.0"+ dependencies:+ d3-array: "npm:^3.2.4"+ d3-color: "npm:^3.1.0"+ d3-geo: "npm:^3.1.1"+ d3-interpolate: "npm:^3.0.1"+ d3-scale: "npm:^4.0.2"+ d3-scale-chromatic: "npm:^3.1.0"+ d3-time: "npm:^3.1.0"+ d3-time-format: "npm:^4.1.0"+ kdbush: "npm:^4.0.2"+ reselect: "npm:^5.1.1"+ seedrandom: "npm:^3.0.5"+ checksum: 10c0/9ca2d80cb174dceafe0f351a7bde8fa12ee933f944361bb4e830fb3dc313b12cab9eb6f04f736d59d8deada5b57d248d936d5b345f34a5cbf8b222af12d2b83d+ languageName: node+ linkType: hard++"@flowmap.gl/layers@npm:^9.2.0":+ version: 9.2.0+ resolution: "@flowmap.gl/layers@npm:9.2.0"+ dependencies:+ "@flowmap.gl/data": "npm:^9.2.0"+ "@luma.gl/core": "npm:9.2.6"+ "@luma.gl/engine": "npm:9.2.6"+ "@luma.gl/shadertools": "npm:9.2.6"+ peerDependencies:+ "@deck.gl/core": ^9.0.0+ "@deck.gl/layers": ^9.0.0+ checksum: 10c0/69dc796d963b8860d5b6646a558b9e75a01d938f80c6e2300a518f864dd05e1cc636e42fa988126f8d82cec01ea6c450dddba41103d17df056759f83940d34f8+ languageName: node+ linkType: hard+"@formatjs/ecma402-abstract@npm:2.0.0":version: 2.0.0resolution: "@formatjs/ecma402-abstract@npm:2.0.0"@@ -5250,6 +5284,8 @@ __metadata:"@deck.gl/geo-layers": "npm:^9.3.1""@deck.gl/layers": "npm:^9.3.1""@deck.gl/mesh-layers": "npm:^9.3.1"+ "@flowmap.gl/data": "npm:^9.2.0"+ "@flowmap.gl/layers": "npm:^9.2.0""@kepler.gl/common-utils": "npm:3.3.0-alpha.0""@kepler.gl/constants": "npm:3.3.0-alpha.0""@kepler.gl/deckgl-arrow-layers": "npm:3.3.0-alpha.0"@@ -5284,6 +5320,7 @@ __metadata:apache-arrow: "npm:>=15.0.0"buffer: "npm:6.0.3"d3-array: "npm:^2.8.0"+ d3-format: "npm:^3.1.0"d3-shape: "npm:^1.2.0"global: "npm:^4.3.0"keymirror: "npm:^0.1.1"@@ -12107,14 +12144,9 @@ __metadata:linkType: hard"b4a@npm:^1.6.4":- version: 1.8.0- resolution: "b4a@npm:1.8.0"- peerDependencies:- react-native-b4a: "*"- peerDependenciesMeta:- react-native-b4a:- optional: true- checksum: 10c0/27eab5c50ea1f1314f36256f160d2e6d6950f55f02ee4942732ecafd8bcc4b3a2ed209fab532b288770d41df2befa97a2745175c06471875b716eb87abf31519+ version: 1.6.6+ resolution: "b4a@npm:1.6.6"+ checksum: 10c0/56f30277666cb511a15829e38d369b114df7dc8cec4cedc09cc5d685bc0f27cb63c7bcfb58e09a19a1b3c4f2541069ab078b5328542e85d74a39620327709a38languageName: nodelinkType: hard@@ -12424,6 +12456,13 @@ __metadata:languageName: nodelinkType: hard+"bare-events@npm:^2.2.0":+ version: 2.4.2+ resolution: "bare-events@npm:2.4.2"+ checksum: 10c0/09fa923061f31f815e83504e2ed4a8ba87732a01db40a7fae703dbb7eef7f05d99264b5e186074cbe9698213990d1af564c62cca07a5ff88baea8099ad9a6303+ languageName: node+ linkType: hard+"bare-events@npm:^2.5.4, bare-events@npm:^2.7.0":version: 2.8.2resolution: "bare-events@npm:2.8.2"@@ -12436,7 +12475,7 @@ __metadata:languageName: nodelinkType: hard-"bare-fs@npm:^4.0.1, bare-fs@npm:^4.5.5":+"bare-fs@npm:^4.0.1":version: 4.7.1resolution: "bare-fs@npm:4.7.1"dependencies:@@ -12537,9 +12576,9 @@ __metadata:linkType: hard"basic-ftp@npm:^5.0.2":- version: 5.3.1- resolution: "basic-ftp@npm:5.3.1"- checksum: 10c0/03511b488cd292abfa82a8c0ea3b9573b40d12d2f1518d6f41a9461b012b3376d3e6d50679b38d9b2b4f48fd6e8e0418ac196312ee7e2da13cb801169940d1c3+ version: 5.0.5+ resolution: "basic-ftp@npm:5.0.5"+ checksum: 10c0/be983a3997749856da87b839ffce6b8ed6c7dbf91ea991d5c980d8add275f9f2926c19f80217ac3e7f353815be879371d636407ca72b038cea8cab30e53928a6languageName: nodelinkType: hard@@ -14246,8 +14285,8 @@ __metadata:linkType: hard"cosmiconfig@npm:^9.0.0":- version: 9.0.1- resolution: "cosmiconfig@npm:9.0.1"+ version: 9.0.0+ resolution: "cosmiconfig@npm:9.0.0"dependencies:env-paths: "npm:^2.2.1"import-fresh: "npm:^3.3.0"@@ -14258,7 +14297,7 @@ __metadata:peerDependenciesMeta:typescript:optional: true- checksum: 10c0/a5d4d95599687532ee072bca60170133c24d4e08cd795529e0f22c6ce5fde9409eaf4f26e36e3d671f43270ef858fc68f3c7b0ec28e58fac7ddebda5b7725306+ checksum: 10c0/1c1703be4f02a250b1d6ca3267e408ce16abfe8364193891afc94c2d5c060b69611fdc8d97af74b7e6d5d1aac0ab2fb94d6b079573146bc2d756c2484ce5f0eelanguageName: nodelinkType: hard@@ -14586,6 +14625,13 @@ __metadata:languageName: nodelinkType: hard+"d3-color@npm:1 - 3, d3-color@npm:^3.1.0":+ version: 3.1.0+ resolution: "d3-color@npm:3.1.0"+ checksum: 10c0/a4e20e1115fa696fce041fbe13fbc80dc4c19150fa72027a7c128ade980bc0eeeba4bcf28c9e21f0bce0e0dbfe7ca5869ef67746541dcfda053e4802ad19783c+ languageName: node+ linkType: hard+"d3-color@npm:1, d3-color@npm:^1.0.3":version: 1.4.1resolution: "d3-color@npm:1.4.1"@@ -14682,6 +14728,13 @@ __metadata:languageName: nodelinkType: hard+"d3-format@npm:^3.1.0":+ version: 3.1.2+ resolution: "d3-format@npm:3.1.2"+ checksum: 10c0/0de452ae07585238e7f01607a7e0066665c34609652188b6ac7dc9f424f69465a425e07d16d79bd0e5955202ac7f241c66d0c76f68a79fc6f4857c94cf420652+ languageName: node+ linkType: hard+"d3-geo@npm:1.7.1":version: 1.7.1resolution: "d3-geo@npm:1.7.1"@@ -14700,6 +14753,15 @@ __metadata:languageName: nodelinkType: hard+"d3-geo@npm:^3.1.1":+ version: 3.1.1+ resolution: "d3-geo@npm:3.1.1"+ dependencies:+ d3-array: "npm:2.5.0 - 3"+ checksum: 10c0/d32270dd2dc8ac3ea63e8805d63239c4c8ec6c0d339d73b5e5a30a87f8f54db22a78fb434369799465eae169503b25f9a107c642c8a16c32a3285bc0e6d8e8c1+ languageName: node+ linkType: hard+"d3-hexbin@npm:^0.2.1, d3-hexbin@npm:^0.2.2":version: 0.2.2resolution: "d3-hexbin@npm:0.2.2"@@ -14723,6 +14785,15 @@ __metadata:languageName: nodelinkType: hard+"d3-interpolate@npm:1 - 3, d3-interpolate@npm:^3.0.1":+ version: 3.0.1+ resolution: "d3-interpolate@npm:3.0.1"+ dependencies:+ d3-color: "npm:1 - 3"+ checksum: 10c0/19f4b4daa8d733906671afff7767c19488f51a43d251f8b7f484d5d3cfc36c663f0a66c38fe91eee30f40327443d799be17169f55a293a3ba949e84e57a33e6a+ languageName: node+ linkType: hard+"d3-interpolate@npm:^1.1.4":version: 1.4.0resolution: "d3-interpolate@npm:1.4.0"@@ -14760,6 +14831,16 @@ __metadata:languageName: nodelinkType: hard+"d3-scale-chromatic@npm:^3.1.0":+ version: 3.1.0+ resolution: "d3-scale-chromatic@npm:3.1.0"+ dependencies:+ d3-color: "npm:1 - 3"+ d3-interpolate: "npm:1 - 3"+ checksum: 10c0/9a3f4671ab0b971f4a411b42180d7cf92bfe8e8584e637ce7e698d705e18d6d38efbd20ec64f60cc0dfe966c20d40fc172565bc28aaa2990c0a006360eed91af+ languageName: node+ linkType: hard+"d3-scale@npm:^3.2.3":version: 3.3.0resolution: "d3-scale@npm:3.3.0"@@ -14798,6 +14879,15 @@ __metadata:languageName: nodelinkType: hard+"d3-time-format@npm:^4.1.0":+ version: 4.1.0+ resolution: "d3-time-format@npm:4.1.0"+ dependencies:+ d3-time: "npm:1 - 3"+ checksum: 10c0/735e00fb25a7fd5d418fac350018713ae394eefddb0d745fab12bbff0517f9cdb5f807c7bbe87bb6eeb06249662f8ea84fec075f7d0cd68609735b2ceb29d206+ languageName: node+ linkType: hard+"d3-time@npm:1 - 2, d3-time@npm:^2.0.0, d3-time@npm:^2.1.1":version: 2.1.1resolution: "d3-time@npm:2.1.1"@@ -14807,6 +14897,15 @@ __metadata:languageName: nodelinkType: hard+"d3-time@npm:1 - 3, d3-time@npm:^3.1.0":+ version: 3.1.0+ resolution: "d3-time@npm:3.1.0"+ dependencies:+ d3-array: "npm:2 - 3"+ checksum: 10c0/a984f77e1aaeaa182679b46fbf57eceb6ebdb5f67d7578d6f68ef933f8eeb63737c0949991618a8d29472dbf43736c7d7f17c452b2770f8c1271191cba724ca1+ languageName: node+ linkType: hard+"d3-timer@npm:1 - 2":version: 2.0.0resolution: "d3-timer@npm:2.0.0"@@ -17766,6 +17865,17 @@ __metadata:languageName: nodelinkType: hard+"fs-extra@npm:^11.2.0":+ version: 11.2.0+ resolution: "fs-extra@npm:11.2.0"+ dependencies:+ graceful-fs: "npm:^4.2.0"+ jsonfile: "npm:^6.0.1"+ universalify: "npm:^2.0.0"+ checksum: 10c0/d77a9a9efe60532d2e790e938c81a02c1b24904ef7a3efb3990b835514465ba720e99a6ea56fd5e2db53b4695319b644d76d5a0e9988a2beef80aa7b1da63398+ languageName: node+ linkType: hard+"fs-extra@npm:^9.0.1":version: 9.1.0resolution: "fs-extra@npm:9.1.0"@@ -18053,13 +18163,14 @@ __metadata:linkType: hard"get-uri@npm:^6.0.1":- version: 6.0.5- resolution: "get-uri@npm:6.0.5"+ version: 6.0.3+ resolution: "get-uri@npm:6.0.3"dependencies:basic-ftp: "npm:^5.0.2"data-uri-to-buffer: "npm:^6.0.2"debug: "npm:^4.3.4"- checksum: 10c0/c7ff5d5d55de53d23ecce7c5108cc3ed0db1174db43c9aa15506d640283d36ee0956fd8ba1fc50b06a718466cc85794ae9d8860193f91318afe846e3e7010f3a+ fs-extra: "npm:^11.2.0"+ checksum: 10c0/8d801c462cd5b9c171d4d9e5f17afce3d9ebfbbfb006a88e3e768ce0071a8e2e59ee1ce822915fc43b9d6b83fde7b8d1c9648330ae89778fa41ad774df8ee0aclanguageName: nodelinkType: hard@@ -19286,7 +19397,7 @@ __metadata:languageName: nodelinkType: hard-"import-fresh@npm:^3.2.1":+"import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.0":version: 3.3.0resolution: "import-fresh@npm:3.3.0"dependencies:@@ -19296,16 +19407,6 @@ __metadata:languageName: nodelinkType: hard-"import-fresh@npm:^3.3.0":- version: 3.3.1- resolution: "import-fresh@npm:3.3.1"- dependencies:- parent-module: "npm:^1.0.0"- resolve-from: "npm:^4.0.0"- checksum: 10c0/bf8cc494872fef783249709385ae883b447e3eb09db0ebd15dcead7d9afe7224dad7bd7591c6b73b0b19b3c0f9640eb8ee884f01cfaf2887ab995b0b36a0cbec- languageName: node- linkType: hard-"import-lazy@npm:^4.0.0":version: 4.0.0resolution: "import-lazy@npm:4.0.0"@@ -23682,9 +23783,9 @@ __metadata:linkType: hard"netmask@npm:^2.0.2":- version: 2.1.1- resolution: "netmask@npm:2.1.1"- checksum: 10c0/c78e31869b0578fb0a9874a0c0fdf0e1f8b3492392d1043355fb11d9ea42ef94e0216c6aee7d8e15db39d1a8caf331f9b144ae3ee43fd951b73a66837711fb09+ version: 2.0.2+ resolution: "netmask@npm:2.0.2"+ checksum: 10c0/cafd28388e698e1138ace947929f842944d0f1c0b87d3fa2601a61b38dc89397d33c0ce2c8e7b99e968584b91d15f6810b91bef3f3826adf71b1833b61d4bf4flanguageName: nodelinkType: hard@@ -25900,6 +26001,13 @@ __metadata:languageName: nodelinkType: hard+"queue-tick@npm:^1.0.1":+ version: 1.0.1+ resolution: "queue-tick@npm:1.0.1"+ checksum: 10c0/0db998e2c9b15215317dbcf801e9b23e6bcde4044e115155dae34f8e7454b9a783f737c9a725528d677b7a66c775eb7a955cf144fe0b87f62b575ce5bfd515a9+ languageName: node+ linkType: hard+"quick-lru@npm:^4.0.1":version: 4.0.1resolution: "quick-lru@npm:4.0.1"@@ -27348,6 +27456,13 @@ __metadata:languageName: nodelinkType: hard+"reselect@npm:^5.1.1":+ version: 5.1.1+ resolution: "reselect@npm:5.1.1"+ checksum: 10c0/219c30da122980f61853db3aebd173524a2accd4b3baec770e3d51941426c87648a125ca08d8c57daa6b8b086f2fdd2703cb035dd6231db98cdbe1176a71f489+ languageName: node+ linkType: hard+"resize-observer-polyfill@npm:^1.5.1":version: 1.5.1resolution: "resize-observer-polyfill@npm:1.5.1"@@ -27803,6 +27918,13 @@ __metadata:languageName: nodelinkType: hard+"seedrandom@npm:^3.0.5":+ version: 3.0.5+ resolution: "seedrandom@npm:3.0.5"+ checksum: 10c0/929752ac098ff4990b3f8e0ac39136534916e72879d6eb625230141d20db26e2f44c4d03d153d457682e8cbaab0fb7d58a1e7267a157cf23fd8cf34e25044e88+ languageName: node+ linkType: hard+"select-hose@npm:^2.0.0":version: 2.0.0resolution: "select-hose@npm:2.0.0"@@ -28778,7 +28900,7 @@ __metadata:languageName: nodelinkType: hard-"streamx@npm:^2.12.5, streamx@npm:^2.15.0, streamx@npm:^2.25.0":+"streamx@npm:^2.12.5, streamx@npm:^2.25.0":version: 2.25.0resolution: "streamx@npm:2.25.0"dependencies:@@ -28789,6 +28911,21 @@ __metadata:languageName: nodelinkType: hard+"streamx@npm:^2.15.0":+ version: 2.18.0+ resolution: "streamx@npm:2.18.0"+ dependencies:+ bare-events: "npm:^2.2.0"+ fast-fifo: "npm:^1.3.2"+ queue-tick: "npm:^1.0.1"+ text-decoder: "npm:^1.1.0"+ dependenciesMeta:+ bare-events:+ optional: true+ checksum: 10c0/ef50f419252a73dd35abcde72329eafbf5ad9cd2e27f0cc3abebeff6e0dbea124ac6d3e16acbdf081cce41b4125393ac22f9848fcfa19e640830734883e622ba+ languageName: node+ linkType: hard+"strict-uri-encode@npm:^1.0.0":version: 1.1.0resolution: "strict-uri-encode@npm:1.1.0"@@ -29612,14 +29749,13 @@ __metadata:linkType: hard"tar-stream@npm:^3.1.5":- version: 3.1.8- resolution: "tar-stream@npm:3.1.8"+ version: 3.1.7+ resolution: "tar-stream@npm:3.1.7"dependencies:b4a: "npm:^1.6.4"- bare-fs: "npm:^4.5.5"fast-fifo: "npm:^1.2.0"streamx: "npm:^2.15.0"- checksum: 10c0/c4bf369de2302fcf30218d091167a5372ee79b69a1b5bb493ddb7714193ca805719558966334bab1f2775c8142826865f24e25459ff1c5f0a096bc3a3d5c5ce2+ checksum: 10c0/a09199d21f8714bd729993ac49b6c8efcb808b544b89f23378ad6ffff6d1cb540878614ba9d4cfec11a64ef39e1a6f009a5398371491eb1fda606ffc7f70f718languageName: nodelinkType: hard@@ -29690,11 +29826,11 @@ __metadata:linkType: hard"text-decoder@npm:^1.1.0":- version: 1.2.7- resolution: "text-decoder@npm:1.2.7"+ version: 1.1.1+ resolution: "text-decoder@npm:1.1.1"dependencies:b4a: "npm:^1.6.4"- checksum: 10c0/929938ed154fbadb660a7f3d1aca30b7e53649a731af7583168fcfba0c158046325d35d945926e2a512bb62d1a49a7818151c987ea38b48853f01e1615722fc5+ checksum: 10c0/e527d05454b59c0fa77456495de68c88e560a122de3dd28b3ebdbf81828aabeaa7e9bb8054b9eb52bc5029ccb5899ad04f466cbba3c53b2685270599d1710ceelanguageName: nodelinkType: hard@@ -30140,7 +30276,7 @@ __metadata:languageName: nodelinkType: hard-"tslib@npm:2, tslib@npm:^2.0.1, tslib@npm:^2.8.0, tslib@npm:^2.8.1":+"tslib@npm:2, tslib@npm:^2.8.0, tslib@npm:^2.8.1":version: 2.8.1resolution: "tslib@npm:2.8.1"checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62@@ -30168,7 +30304,7 @@ __metadata:languageName: nodelinkType: hard-"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.4.0, tslib@npm:^2.6.2":+"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.4.0, tslib@npm:^2.6.2":version: 2.6.3resolution: "tslib@npm:2.6.3"checksum: 10c0/2598aef53d9dbe711af75522464b2104724d6467b26a60f2bdac8297d2b5f1f6b86a71f61717384aa8fd897240467aaa7bcc36a0700a0faf751293d1331db39a