Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Feat] Upgrade deck.gl to 6.4 (#456)

Xiaoji Chend44114e8d252
diff --git a/examples/demo-app/src/app.js b/examples/demo-app/src/app.js
index 1d25ff606..c171d1644 100644
--- a/examples/demo-app/src/app.js
+++ b/examples/demo-app/src/app.js
@@ -21,7 +21,7 @@
import React, {Component} from 'react';
import {findDOMNode} from 'react-dom';
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
-import styled, {ThemeProvider} from 'styled-components';
+import styled, {ThemeProvider} from 'styled-components';
import window from 'global/window';
import {connect} from 'react-redux';
import {theme} from 'kepler.gl/styles';
@@ -96,7 +96,10 @@ class App extends Component {
componentWillMount() {
// if we pass an id as part of the url
// we ry to fetch along map configurations
- const {params: {id} = {}, location: {query = {}}} = this.props;
+ const {
+ params: {id} = {},
+ location: {query = {}}
+ } = this.props;
// Load sample using its id
if (id) {
@@ -115,10 +118,8 @@ class App extends Component {
// if (!window.localStorage.getItem(BannerKey)) {
// window.setTimeout(this._showBanner, 3000);
// }
-
// load sample data
// this._loadSampleData();
-
// Notifications
// this._loadMockNotifications();
}
@@ -159,8 +160,8 @@ class App extends Component {
}
_loadSampleData() {
- this._loadTripData();
- // this._loadGeojsonData();
+ // this._loadTripData();
+ this._loadGeojsonData();
// this._loadIconData();
// this._loadH3HexagonData();
}
@@ -217,13 +218,16 @@ class App extends Component {
// load geojson
this.props.dispatch(
addDataToMap({
- datasets: [{
- info: {label: 'Bart Stops Geo'},
- data: processGeojson(sampleGeojsonPoints)
- }, {
- info: {label: 'SF Zip Geo'},
- data: processGeojson(sampleGeojson)
- }]
+ datasets: [
+ {
+ info: {label: 'Bart Stops Geo'},
+ data: processGeojson(sampleGeojsonPoints)
+ },
+ {
+ info: {label: 'SF Zip Geo'},
+ data: processGeojson(sampleGeojson)
+ }
+ ]
})
);
}
@@ -291,7 +295,9 @@ class App extends Component {
// this is to apply the same modal style as kepler.gl core
// because styled-components doesn't always return a node
// https://github.com/styled-components/styled-components/issues/617
- ref={node => {node ? this.root = node : null}}
+ ref={node => {
+ node ? (this.root = node) : null;
+ }}
>
<Banner
show={this.state.showBanner}
@@ -299,7 +305,7 @@ class App extends Component {
bgColor="#82368c"
onClose={this._hideBanner}
>
- <Announcement onDisable={this._disableBanner}/>
+ <Announcement onDisable={this._disableBanner} />
</Banner>
{this._isCloudStorageEnabled() && rootNode && (
<ExportUrlModal
@@ -333,14 +339,15 @@ class App extends Component {
getState={state => state.demo.keplerGl}
width={width}
height={height - (showBanner ? BannerHeight : 0)}
- onSaveMap={this._isCloudStorageEnabled() && this._toggleCloudModal}
+ onSaveMap={
+ this._isCloudStorageEnabled() && this._toggleCloudModal
+ }
/>
)}
</AutoSizer>
</div>
</GlobalStyle>
</ThemeProvider>
-
);
}
}
diff --git a/jsconfig.json b/jsconfig.json
index 4dada2dd1..738e8a465 100644
--- a/jsconfig.json
+++ b/jsconfig.json
@@ -2,4 +2,4 @@
"compilerOptions": {
"baseUrl": "./src"
}
-}
\ No newline at end of file
+}
diff --git a/package.json b/package.json
index 1bc3a1630..9582910ec 100644
--- a/package.json
+++ b/package.json
@@ -67,7 +67,7 @@
"umd"
],
"dependencies": {
- "@deck.gl/experimental-layers": "6.3.0",
+ "@deck.gl/experimental-layers": "6.4.10",
"@mapbox/geo-viewport": "^0.2.2",
"@mapbox/geojson-extent": "^0.3.2",
"@mapbox/geojson-normalize": "0.0.1",
@@ -84,7 +84,7 @@
"d3-hexbin": "^0.2.2",
"d3-request": "^1.0.6",
"d3-scale": "^1.0.6",
- "deck.gl": "6.3.0",
+ "deck.gl": "^6.4.10",
"fuzzy": "^0.1.3",
"global": "^4.3.0",
"h3-js": "^3.1.0",
diff --git a/src/components/common/range-slider.js b/src/components/common/range-slider.js
index e9da2735c..9c2680a6a 100644
--- a/src/components/common/range-slider.js
+++ b/src/components/common/range-slider.js
@@ -155,7 +155,8 @@ export default class RangeSlider extends Component {
ref={comp => {
this[`input-${key}`] = comp;
}}
- id={`filter-${key}`}
+ id={`slider-input-${key}`}
+ key={key}
value={this.state[key]}
onChange={e => {
this.setState({[key]: e.target.value});
@@ -185,7 +186,8 @@ export default class RangeSlider extends Component {
onChange,
value0,
value1,
- sliderHandleWidth
+ sliderHandleWidth,
+ step
} = this.props;
const height = isRanged && showInput ? '16px' : '24px';
@@ -226,6 +228,7 @@ export default class RangeSlider extends Component {
maxValue={range[1]}
value0={value0}
value1={value1}
+ step={step}
handleWidth={sliderHandleWidth}
onSlider0Change={this._setRangeVal0}
onSlider1Change={this._setRangeVal1}
diff --git a/src/components/side-panel/layer-panel/layer-configurator.js b/src/components/side-panel/layer-panel/layer-configurator.js
index 09df17307..d62111534 100644
--- a/src/components/side-panel/layer-panel/layer-configurator.js
+++ b/src/components/side-panel/layer-panel/layer-configurator.js
@@ -17,7 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
+/* eslint-disable complexity */
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
@@ -37,7 +37,9 @@ import ColorSelector from './color-selector';
import SourceDataSelector from 'components/side-panel/source-data-selector';
import VisConfigSwitch from './vis-config-switch';
import VisConfigSlider from './vis-config-slider';
-import LayerConfigGroup, {ConfigGroupCollapsibleContent} from './layer-config-group';
+import LayerConfigGroup, {
+ ConfigGroupCollapsibleContent
+} from './layer-config-group';
import TextLabelPanel from './text-label-panel';
import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
@@ -90,8 +92,12 @@ export default class LayerConfigurator extends Component {
}) {
return (
<StyledLayerVisualConfigurator>
- {/* Color */}
- <LayerConfigGroup label={'color'} collapsible>
+ {/* Fill Color */}
+ <LayerConfigGroup
+ {...layer.visConfigSettings.filled}
+ {...visConfiguratorProps}
+ collapsible
+ >
{layer.config.colorField ? (
<ColorRangeConfig {...visConfiguratorProps} />
) : (
@@ -109,6 +115,40 @@ export default class LayerConfigurator extends Component {
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
+ {/* outline color */}
+ {layer.type === LAYER_TYPES.point ? (
+ <LayerConfigGroup
+ {...layer.visConfigSettings.outline}
+ {...visConfiguratorProps}
+ collapsible
+ >
+ {layer.config.strokeColorField ? (
+ <ColorRangeConfig
+ {...visConfiguratorProps}
+ property="strokeColorRange"
+ />
+ ) : (
+ <LayerColorSelector
+ {...visConfiguratorProps}
+ selectedColor={layer.config.visConfig.strokeColor}
+ property="strokeColor"
+ />
+ )}
+ <ConfigGroupCollapsibleContent>
+ <ChannelByValueSelector
+ channel={layer.visualChannels.strokeColor}
+ {...layerChannelConfigProps}
+ />
+ <VisConfigSlider
+ {...layer.visConfigSettings.thickness}
+ {...visConfiguratorProps}
+ label={false}
+ disabled={!layer.config.visConfig.outline}
+ />
+ </ConfigGroupCollapsibleContent>
+ </LayerConfigGroup>
+ ) : null}
+
{/* Radius */}
<LayerConfigGroup label={'radius'} collapsible>
{!layer.config.sizeField ? (
@@ -142,32 +182,12 @@ export default class LayerConfigurator extends Component {
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
- {/* outline */}
- {layer.type === LAYER_TYPES.point ? (
- <LayerConfigGroup
- {...LAYER_VIS_CONFIGS.outline}
- {...visConfiguratorProps}
- >
- <VisConfigSlider
- {...LAYER_VIS_CONFIGS.thickness}
- {...visConfiguratorProps}
- label={false}
- disabled={!layer.config.visConfig.outline}
- />
- </LayerConfigGroup>
- ) : null}
-
{/* text label */}
<TextLabelPanel
visConfiguratorProps={visConfiguratorProps}
layerConfiguratorProps={layerConfiguratorProps}
textLabel={layer.config.textLabel}
/>
- {/* high precision */}
- <LayerConfigGroup
- {...LAYER_VIS_CONFIGS['hi-precision']}
- {...visConfiguratorProps}
- />
</StyledLayerVisualConfigurator>
);
}
@@ -189,13 +209,15 @@ export default class LayerConfigurator extends Component {
channel={layer.visualChannels.color}
{...layerChannelConfigProps}
/>
- {layer.visConfigSettings.colorAggregation.condition(layer.config) ?
+ {layer.visConfigSettings.colorAggregation.condition(
+ layer.config
+ ) ? (
<AggregationTypeSelector
{...layer.visConfigSettings.colorAggregation}
{...layerChannelConfigProps}
channel={layer.visualChannels.color}
/>
- : null}
+ ) : null}
<VisConfigSlider
{...layer.visConfigSettings.opacity}
{...visConfiguratorProps}
@@ -290,7 +312,9 @@ export default class LayerConfigurator extends Component {
channel={layer.visualChannels.color}
{...layerChannelConfigProps}
/>
- {layer.visConfigSettings.colorAggregation.condition(layer.config) ? (
+ {layer.visConfigSettings.colorAggregation.condition(
+ layer.config
+ ) ? (
<AggregationTypeSelector
{...layer.visConfigSettings.colorAggregation}
{...layerChannelConfigProps}
@@ -298,7 +322,8 @@ export default class LayerConfigurator extends Component {
channel={layer.visualChannels.color}
/>
) : null}
- {layer.visConfigSettings.percentile && layer.visConfigSettings.percentile.condition(layer.config) ? (
+ {layer.visConfigSettings.percentile &&
+ layer.visConfigSettings.percentile.condition(layer.config) ? (
<VisConfigSlider
{...layer.visConfigSettings.percentile}
{...visConfiguratorProps}
@@ -326,7 +351,7 @@ export default class LayerConfigurator extends Component {
</LayerConfigGroup>
{/* Elevation */}
- {layer.visConfigSettings.enable3d ?
+ {layer.visConfigSettings.enable3d ? (
<LayerConfigGroup
{...layer.visConfigSettings.enable3d}
{...visConfiguratorProps}
@@ -343,7 +368,9 @@ export default class LayerConfigurator extends Component {
description={elevationByDescription}
disabled={!enable3d}
/>
- {layer.visConfigSettings.sizeAggregation.condition(layer.config) ? (
+ {layer.visConfigSettings.sizeAggregation.condition(
+ layer.config
+ ) ? (
<AggregationTypeSelector
{...layer.visConfigSettings.sizeAggregation}
{...layerChannelConfigProps}
@@ -359,13 +386,8 @@ export default class LayerConfigurator extends Component {
/>
) : null}
</ConfigGroupCollapsibleContent>
- </LayerConfigGroup> : null}
-
- {/* High Precision */}
- <LayerConfigGroup
- {...layer.visConfigSettings['hi-precision']}
- {...visConfiguratorProps}
- />
+ </LayerConfigGroup>
+ ) : null}
</StyledLayerVisualConfigurator>
);
}
@@ -439,11 +461,6 @@ export default class LayerConfigurator extends Component {
/>
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
- {/* high precision */}
- <LayerConfigGroup
- {...LAYER_VIS_CONFIGS['hi-precision']}
- {...visConfiguratorProps}
- />
</StyledLayerVisualConfigurator>
);
}
@@ -506,12 +523,6 @@ export default class LayerConfigurator extends Component {
/>
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
-
- {/* high precision */}
- <LayerConfigGroup
- {...LAYER_VIS_CONFIGS['hi-precision']}
- {...visConfiguratorProps}
- />
</StyledLayerVisualConfigurator>
);
}
@@ -529,63 +540,87 @@ export default class LayerConfigurator extends Component {
return (
<StyledLayerVisualConfigurator>
- {/* Color By */}
- <LayerConfigGroup label={'color'} collapsible>
- {layer.config.colorField ? (
- <ColorRangeConfig {...visConfiguratorProps} />
- ) : (
- <LayerColorSelector {...layerConfiguratorProps} />
- )}
- <ConfigGroupCollapsibleContent>
- <ChannelByValueSelector
- channel={layer.visualChannels.color}
- {...layerChannelConfigProps}
- />
- <VisConfigSlider
- {...LAYER_VIS_CONFIGS.opacity}
- {...visConfiguratorProps}
- />
- </ConfigGroupCollapsibleContent>
- </LayerConfigGroup>
-
- {/* Fill */}
- {featureTypes.polygon ? (
- <LayerConfigGroup label={'fill'}
- {...visConfiguratorProps}
- {...LAYER_VIS_CONFIGS.filled}
- />
- ) : null}
-
- {/* Stroke Width */}
- {featureTypes.line || featureTypes.polygon ? (
+ {/* Fill Color */}
+ {featureTypes.polygon || featureTypes.point ? (
<LayerConfigGroup
- label="stroke"
+ {...layer.visConfigSettings.filled}
{...visConfiguratorProps}
- {...(featureTypes.polygon ? LAYER_VIS_CONFIGS.stroked : {})}
+ label="Fill Color"
collapsible
>
- {layer.config.sizeField ? (
- <VisConfigSlider
- {...LAYER_VIS_CONFIGS.strokeWidthRange}
- {...visConfiguratorProps}
- label={false}
- />
+ {layer.config.colorField ? (
+ <ColorRangeConfig {...visConfiguratorProps} />
) : (
- <VisConfigSlider
- {...LAYER_VIS_CONFIGS.thickness}
- {...visConfiguratorProps}
- label={false}
- />
+ <LayerColorSelector {...layerConfiguratorProps} />
)}
<ConfigGroupCollapsibleContent>
<ChannelByValueSelector
- channel={layer.visualChannels.size}
+ channel={layer.visualChannels.color}
{...layerChannelConfigProps}
/>
+ <VisConfigSlider
+ {...LAYER_VIS_CONFIGS.opacity}
+ {...visConfiguratorProps}
+ />
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
) : null}
+ {/* stroke color */}
+ <LayerConfigGroup
+ {...layer.visConfigSettings.stroked}
+ {...visConfiguratorProps}
+ label="Stroke Color"
+ collapsible
+ >
+ {layer.config.strokeColorField ? (
+ <ColorRangeConfig
+ {...visConfiguratorProps}
+ property="strokeColorRange"
+ />
+ ) : (
+ <LayerColorSelector
+ {...visConfiguratorProps}
+ selectedColor={layer.config.visConfig.strokeColor}
+ property="strokeColor"
+ />
+ )}
+ <ConfigGroupCollapsibleContent>
+ <ChannelByValueSelector
+ channel={layer.visualChannels.strokeColor}
+ {...layerChannelConfigProps}
+ />
+ </ConfigGroupCollapsibleContent>
+ </LayerConfigGroup>
+
+ {/* Stroke Width */}
+ <LayerConfigGroup
+ {...visConfiguratorProps}
+ {...(featureTypes.polygon ? LAYER_VIS_CONFIGS.stroked : {})}
+ label="Stroke Width"
+ collapsible
+ >
+ {layer.config.sizeField ? (
+ <VisConfigSlider
+ {...LAYER_VIS_CONFIGS.strokeWidthRange}
+ {...visConfiguratorProps}
+ label={false}
+ />
+ ) : (
+ <VisConfigSlider
+ {...LAYER_VIS_CONFIGS.thickness}
+ {...visConfiguratorProps}
+ label={false}
+ />
+ )}
+ <ConfigGroupCollapsibleContent>
+ <ChannelByValueSelector
+ channel={layer.visualChannels.size}
+ {...layerChannelConfigProps}
+ />
+ </ConfigGroupCollapsibleContent>
+ </LayerConfigGroup>
+
{/* Elevation */}
{featureTypes.polygon && visConfig.filled ? (
<LayerConfigGroup
@@ -614,13 +649,14 @@ export default class LayerConfigurator extends Component {
{/* Radius */}
{featureTypes.point ? (
<LayerConfigGroup label={'radius'} collapsible>
- {!layer.config.radiusField ? (<VisConfigSlider
+ {!layer.config.radiusField ? (
+ <VisConfigSlider
{...LAYER_VIS_CONFIGS.radius}
{...visConfiguratorProps}
label={false}
disabled={Boolean(layer.config.radiusField)}
/>
- ) : (
+ ) : (
<VisConfigSlider
{...LAYER_VIS_CONFIGS.radiusRange}
{...visConfiguratorProps}
@@ -636,12 +672,6 @@ export default class LayerConfigurator extends Component {
</ConfigGroupCollapsibleContent>
</LayerConfigGroup>
) : null}
-
- {/* high precision */}
- <LayerConfigGroup
- {...LAYER_VIS_CONFIGS['hi-precision']}
- {...visConfiguratorProps}
- />
</StyledLayerVisualConfigurator>
);
}
@@ -684,8 +714,16 @@ export default class LayerConfigurator extends Component {
return (
<StyledLayerConfigurator>
- {layer.layerInfoModal ? <HowToButton onClick={() => this.props.openModal(layer.layerInfoModal)}/> : null}
- <LayerConfigGroup label={'basic'} collapsible expanded={!layer.hasAllColumns()}>
+ {layer.layerInfoModal ? (
+ <HowToButton
+ onClick={() => this.props.openModal(layer.layerInfoModal)}
+ />
+ ) : null}
+ <LayerConfigGroup
+ label={'basic'}
+ collapsible
+ expanded={!layer.hasAllColumns()}
+ >
<LayerTypeSelector
layer={layer}
layerTypeOptions={layerTypeOptions}
@@ -734,17 +772,25 @@ const StyledHowToButton = styled.div`
export const HowToButton = ({onClick}) => (
<StyledHowToButton>
- <Button link small onClick={onClick}>How to</Button>
+ <Button link small onClick={onClick}>
+ How to
+ </Button>
</StyledHowToButton>
);
-export const LayerColorSelector = ({layer, onChange, label}) => (
- <SidePanelSection disabled={layer.config.colorField}>
+export const LayerColorSelector = ({
+ layer,
+ onChange,
+ label,
+ selectedColor,
+ property = 'color'
+}) => (
+ <SidePanelSection>
<ColorSelector
colorSets={[
{
- selectedColor: layer.config.color,
- setColor: rgbValue => onChange({color: rgbValue})
+ selectedColor: selectedColor || layer.config.color,
+ setColor: rgbValue => onChange({[property]: rgbValue})
}
]}
/>
@@ -775,14 +821,18 @@ export const ArcLayerColorSelector = ({
</SidePanelSection>
);
-export const ColorRangeConfig = ({layer, onChange}) => (
+export const ColorRangeConfig = ({
+ layer,
+ onChange,
+ property = 'colorRange'
+}) => (
<SidePanelSection>
<ColorSelector
colorSets={[
{
- selectedColor: layer.config.visConfig.colorRange,
+ selectedColor: layer.config.visConfig[property],
isRange: true,
- setColor: colorRange => onChange({colorRange})
+ setColor: colorRange => onChange({[property]: colorRange})
}
]}
/>
@@ -807,12 +857,14 @@ export const ChannelByValueSelector = ({
defaultMeasure,
supportedFieldTypes
} = channel;
- const channelSupportedFieldTypes = supportedFieldTypes || CHANNEL_SCALE_SUPPORTED_FIELDS[channelScaleType];
+ const channelSupportedFieldTypes =
+ supportedFieldTypes || CHANNEL_SCALE_SUPPORTED_FIELDS[channelScaleType];
const supportedFields = fields.filter(({type}) =>
channelSupportedFieldTypes.includes(type)
);
const scaleOptions = layer.getScaleOptions(channel.key);
- const showScale = !layer.isAggregated && layer.config[scale] && scaleOptions.length > 1;
+ const showScale =
+ !layer.isAggregated && layer.config[scale] && scaleOptions.length > 1;
const defaultDescription = `Calculate ${property} based on selected field`;
return (
@@ -838,15 +890,14 @@ export const ChannelByValueSelector = ({
export const AggrColorScaleSelector = ({layer, onChange}) => {
const scaleOptions = layer.getScaleOptions('color');
- return (
- Array.isArray(scaleOptions) && scaleOptions.length > 1 ?
- <DimensionScaleSelector
- label="Color Scale"
- options={scaleOptions}
- scaleType={layer.config.colorScale}
- onSelect={val => onChange({colorScale: val}, 'color')}
- /> : null
- );
+ return Array.isArray(scaleOptions) && scaleOptions.length > 1 ? (
+ <DimensionScaleSelector
+ label="Color Scale"
+ options={scaleOptions}
+ scaleType={layer.config.colorScale}
+ onSelect={val => onChange({colorScale: val}, 'color')}
+ />
+ ) : null;
};
export const AggregationTypeSelector = ({layer, channel, onChange}) => {
diff --git a/src/constants/default-settings.js b/src/constants/default-settings.js
index 439a188f3..80bfab3a8 100644
--- a/src/constants/default-settings.js
+++ b/src/constants/default-settings.js
@@ -275,6 +275,8 @@ const BLUE3 = '0, 172, 237';
const GREEN = '106, 160, 56';
const RED = '237, 88, 106';
+export const HIGHLIGH_COLOR_3D = [255, 255, 255, 60];
+
export const FIELD_COLORS = {
default: RED
};
diff --git a/src/constants/user-guides.js b/src/constants/user-guides.js
index 13f846a5d..39b2f7740 100644
--- a/src/constants/user-guides.js
+++ b/src/constants/user-guides.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2019 keplergl Technologies, Inc.
+// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
diff --git a/src/deckgl-layers/geojson-layer/solid-polygon-layer.js b/src/deckgl-layers/geojson-layer/solid-polygon-layer.js
deleted file mode 100644
index 42ae988b0..000000000
--- a/src/deckgl-layers/geojson-layer/solid-polygon-layer.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2019 Uber Technologies, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-// TODO: a hack becaue solid-polygon-layer is not exported from @deck.gl/layers
-import {_SolidPolygonLayer} from '@deck.gl/layers';
-
-export default class HighlightSolidPolygonLayer extends _SolidPolygonLayer {
- draw(opts) {
- const {uniforms} = opts;
-
- super.draw({
- ...opts,
- uniforms: {
- ...uniforms,
- picking_uHighlightScale: this.props.extruded ? 1.4 : 0.0
- }
- })
- }
-}
-
-HighlightSolidPolygonLayer.layerName = 'HighlightSolidPolygonLayer';
diff --git a/src/deckgl-layers/grid-layer/enhanced-grid-cell-layer.js b/src/deckgl-layers/grid-layer/enhanced-grid-cell-layer.js
deleted file mode 100644
index 910a0b48b..000000000
--- a/src/deckgl-layers/grid-layer/enhanced-grid-cell-layer.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2019 Uber Technologies, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-import {GridCellLayer} from 'deck.gl';
-
-export default class EnhancedGridCellLayer extends GridCellLayer {
- draw(opts) {
- const {uniforms} = opts;
-
- super.draw({
- ...opts,
- uniforms: {
- ...uniforms,
- picking_uHighlightScale: this.props.extruded ? 1.4 : 0.0
- }
- })
- }
-}
-
-EnhancedGridCellLayer.layerName = 'EnhancedGridCellLayer';
diff --git a/src/deckgl-layers/grid-layer/enhanced-grid-layer.js b/src/deckgl-layers/grid-layer/enhanced-grid-layer.js
index f625e4171..778eea0e4 100644
--- a/src/deckgl-layers/grid-layer/enhanced-grid-layer.js
+++ b/src/deckgl-layers/grid-layer/enhanced-grid-layer.js
@@ -20,7 +20,6 @@
import {GridLayer} from 'deck.gl';
import {getColorValueDomain, getColorScaleFunction} from '../layer-utils/utils';
-import EnhancedGridCellLayer from './enhanced-grid-cell-layer';
const defaultProps = {
...GridLayer.defaultProps,
@@ -47,12 +46,6 @@ export default class EnhancedGridLayer extends GridLayer {
getColorScaleFunction(this);
}
- /*
- * override default getSubLayerClass to return customized cellLayer
- */
- getSubLayerClass() {
- return EnhancedGridCellLayer;
- }
}
EnhancedGridLayer.layerName = 'EnhancedGridLayer';
diff --git a/src/deckgl-layers/h3-hexagon-cell-layer/h3-hexagon-cell-layer.js b/src/deckgl-layers/h3-hexagon-cell-layer/h3-hexagon-cell-layer.js
index bb41424ae..ab3e4f485 100644
--- a/src/deckgl-layers/h3-hexagon-cell-layer/h3-hexagon-cell-layer.js
+++ b/src/deckgl-layers/h3-hexagon-cell-layer/h3-hexagon-cell-layer.js
@@ -114,18 +114,6 @@ export default class H3HexagonCellLayer extends HexagonCellLayer {
this.setState({angle, radius});
}
- draw(opts) {
- const {uniforms} = opts;
-
- super.draw({
- ...opts,
- uniforms: {
- ...uniforms,
- picking_uHighlightScale: this.props.extruded ? 1.4 : 0.0
- }
- })
- }
-
initializeState() {
super.initializeState();
diff --git a/src/deckgl-layers/hexagon-layer/enhanced-hexagon-cell-layer.js b/src/deckgl-layers/hexagon-layer/enhanced-hexagon-cell-layer.js
deleted file mode 100644
index 90a010014..000000000
--- a/src/deckgl-layers/hexagon-layer/enhanced-hexagon-cell-layer.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2019 Uber Technologies, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-import {HexagonCellLayer} from 'deck.gl';
-
-export default class EnhancedHexagonCellLayer extends HexagonCellLayer {
- draw(opts) {
- const {uniforms} = opts;
-
- super.draw({
- ...opts,
- uniforms: {
- ...uniforms,
- picking_uHighlightScale: this.props.extruded ? 1.4 : 0.0
- }
- })
- }
-}
-
-EnhancedHexagonCellLayer.layerName = 'EnhancedHexagonCellLayer';
diff --git a/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js b/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js
index 65cce1c83..0bf37ebef 100644
--- a/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js
+++ b/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js
@@ -22,7 +22,6 @@ import {HexagonLayer} from 'deck.gl';
import {pointToHexbin} from './hexagon-aggregator';
import {getColorValueDomain, getColorScaleFunction} from '../layer-utils/utils';
-import EnhancedHexagonCellLayer from './enhanced-hexagon-cell-layer';
const defaultProps = {
...HexagonLayer.defaultProps,
@@ -49,13 +48,6 @@ export default class EnhancedHexagonLayer extends HexagonLayer {
getColorScale() {
getColorScaleFunction(this);
}
-
- /*
- * override default getSubLayerClass to return customized cellLayer
- */
- getSubLayerClass() {
- return EnhancedHexagonCellLayer;
- }
}
EnhancedHexagonLayer.layerName = 'EnhancedHexagonLayer';
diff --git a/src/layers/arc-layer/arc-layer.js b/src/layers/arc-layer/arc-layer.js
index 61b98fc13..5e3c2e8ba 100644
--- a/src/layers/arc-layer/arc-layer.js
+++ b/src/layers/arc-layer/arc-layer.js
@@ -45,8 +45,7 @@ export const arctVisConfigs = {
thickness: 'thickness',
colorRange: 'colorRange',
sizeRange: 'strokeWidthRange',
- targetColor: 'targetColor',
- 'hi-precision': 'hi-precision'
+ targetColor: 'targetColor'
};
export default class ArcLayer extends Layer {
@@ -254,7 +253,6 @@ export default class ArcLayer extends Layer {
...layerInteraction,
id: this.id,
idx,
- fp64: this.config.visConfig['hi-precision'],
opacity: this.config.visConfig.opacity,
pickedColor: this.config.highlightColor,
strokeScale: this.config.visConfig.thickness,
diff --git a/src/layers/base-layer.js b/src/layers/base-layer.js
index 846225268..f82ce7162 100644
--- a/src/layers/base-layer.js
+++ b/src/layers/base-layer.js
@@ -62,7 +62,7 @@ export const OVERLAY_TYPE = keymirror({
mapboxgl: null
});
-const layerColors = Object.values(DataVizColors).map(hexToRgb);
+export const layerColors = Object.values(DataVizColors).map(hexToRgb);
function* generateColor() {
let index = 0;
while (index < layerColors.length + 1) {
@@ -73,7 +73,7 @@ function* generateColor() {
}
}
-const colorMaker = generateColor();
+export const colorMaker = generateColor();
const defaultGetFieldValue = (field, d) => d[field.tableFieldIndex - 1];
export default class Layer {
@@ -420,7 +420,7 @@ export default class Layer {
const notToDeepMerge = Object.values(this.visualChannels).map(v => v.field);
// don't deep merge color range, reversed: is not a key by default
- notToDeepMerge.push('colorRange');
+ notToDeepMerge.push('colorRange', 'strokeColorRange');
// don't copy over domain
const notToCopy = Object.values(this.visualChannels).map(v => v.domain);
diff --git a/src/layers/cluster-layer/cluster-layer.js b/src/layers/cluster-layer/cluster-layer.js
index a5bb6c223..3192eaf90 100644
--- a/src/layers/cluster-layer/cluster-layer.js
+++ b/src/layers/cluster-layer/cluster-layer.js
@@ -30,7 +30,6 @@ export const clusterVisConfigs = {
clusterRadius: 'clusterRadius',
colorRange: 'colorRange',
radiusRange: 'clusterRadiusRange',
- 'hi-precision': 'hi-precision',
colorAggregation: 'aggregation'
};
@@ -88,7 +87,6 @@ export default class ClusterLayer extends AggregationLayer {
autoHighlight: true,
highlightColor: this.config.highlightColor,
opacity: visConfig.opacity,
- fp64: visConfig['hi-precision'],
lightSettings: this.meta.lightSettings,
zoom: mapState.zoom,
diff --git a/src/layers/geojson-layer/geojson-layer.js b/src/layers/geojson-layer/geojson-layer.js
index 137019331..4a0bcccde 100644
--- a/src/layers/geojson-layer/geojson-layer.js
+++ b/src/layers/geojson-layer/geojson-layer.js
@@ -21,8 +21,7 @@
import memoize from 'lodash.memoize';
import uniq from 'lodash.uniq';
-import Layer from '../base-layer';
-import HighlightPolygonLayer from 'deckgl-layers/geojson-layer/solid-polygon-layer';
+import Layer, {colorMaker} from '../base-layer';
import {GeoJsonLayer as DeckGLGeoJsonLayer} from 'deck.gl';
import {hexToRgb} from 'utils/color-utils';
@@ -32,7 +31,7 @@ import {
featureToDeckGlGeoType
} from './geojson-utils';
import GeojsonLayerIcon from './geojson-layer-icon';
-import {GEOJSON_FIELDS} from 'constants/default-settings';
+import {GEOJSON_FIELDS, HIGHLIGH_COLOR_3D, CHANNEL_SCALES} from 'constants/default-settings';
export const geojsonVisConfigs = {
opacity: 'opacity',
@@ -46,15 +45,15 @@ export const geojsonVisConfigs = {
group: 'stroke',
property: 'thickness'
},
+ strokeColor: 'strokeColor',
colorRange: 'colorRange',
+ strokeColorRange: 'strokeColorRange',
radius: 'radius',
sizeRange: 'strokeWidthRange',
radiusRange: 'radiusRange',
heightRange: 'elevationRange',
elevationScale: 'elevationScale',
-
- 'hi-precision': 'hi-precision',
stroked: 'stroked',
filled: 'filled',
enable3d: 'enable3d',
@@ -93,6 +92,15 @@ export default class GeoJsonLayer extends Layer {
get visualChannels() {
return {
...super.visualChannels,
+ strokeColor: {
+ property: 'strokeColor',
+ field: 'strokeColorField',
+ scale: 'strokeColorScale',
+ domain: 'strokeColorDomain',
+ range: 'strokeColorRange',
+ key: 'strokeColor',
+ channelScaleType: CHANNEL_SCALES.color
+ },
size: {
...super.visualChannels.size,
property: 'stroke',
@@ -120,6 +128,10 @@ export default class GeoJsonLayer extends Layer {
};
}
+ getPositionAccessor() {
+ return this.getFeature(this.config.columns);
+ }
+
static findDefaultLayerProps({label, fields}) {
const geojsonColumns = fields
.filter(f => f.type === 'geojson')
@@ -153,7 +165,12 @@ export default class GeoJsonLayer extends Layer {
// add radius visual channel
radiusField: null,
radiusDomain: [0, 1],
- radiusScale: 'linear'
+ radiusScale: 'linear',
+
+ // add stroke color visual channel
+ strokeColorField: null,
+ strokeColorDomain: [0, 1],
+ strokeColorScale: 'quantile'
};
}
@@ -169,6 +186,9 @@ export default class GeoJsonLayer extends Layer {
colorScale,
colorField,
colorDomain,
+ strokeColorField,
+ strokeColorScale,
+ strokeColorDomain,
color,
sizeScale,
sizeDomain,
@@ -179,8 +199,7 @@ export default class GeoJsonLayer extends Layer {
radiusField,
radiusDomain,
radiusScale,
- visConfig,
- columns
+ visConfig
} = this.config;
const {
@@ -189,10 +208,12 @@ export default class GeoJsonLayer extends Layer {
colorRange,
heightRange,
sizeRange,
- radiusRange
+ radiusRange,
+ strokeColorRange,
+ strokeColor
} = visConfig;
- const getFeature = this.getFeature(columns);
+ const getFeature = this.getPositionAccessor(this.config.column);
// geojson feature are object, if doesn't exists
// create it and save to layer
@@ -218,6 +239,7 @@ export default class GeoJsonLayer extends Layer {
.filter(d => d);
}
+ // fill color
const cScale =
colorField &&
this.getVisChannelScale(
@@ -226,6 +248,14 @@ export default class GeoJsonLayer extends Layer {
colorRange.colors.map(hexToRgb)
);
+ // stroke color
+ const scScale =
+ strokeColorField &&
+ this.getVisChannelScale(
+ strokeColorScale,
+ strokeColorDomain,
+ strokeColorRange.colors.map(hexToRgb)
+ );
// calculate stroke scale - if stroked = true
const sScale =
sizeField &&
@@ -255,13 +285,13 @@ export default class GeoJsonLayer extends Layer {
)
: d.properties.fillColor || color,
getLineColor: d =>
- cScale
+ scScale
? this.getEncodedChannelValue(
- cScale,
+ scScale,
allData[d.properties.index],
- colorField
+ strokeColorField
)
- : d.properties.lineColor || color,
+ : d.properties.lineColor || strokeColor || color,
getLineWidth: d =>
sScale
? this.getEncodedChannelValue(
@@ -293,7 +323,8 @@ export default class GeoJsonLayer extends Layer {
}
/* eslint-enable complexity */
- updateLayerMeta(allData, getFeature) {
+ updateLayerMeta(allData) {
+ const getFeature = this.getPositionAccessor();
this.dataToFeature = getGeojsonDataMaps(allData, getFeature);
// calculate layer meta
@@ -305,10 +336,7 @@ export default class GeoJsonLayer extends Layer {
// get lightSettings from points
const lightSettings = this.getLightSettingsFromBounds(bounds);
- // if any of the feature has properties.hi-precision set to be true
- const fp64 = Boolean(
- allFeatures.find(d => d && d.properties && d.properties['hi-precision'])
- );
+ // if any of the feature has properties.radius set to be true
const fixedRadius = Boolean(
allFeatures.find(d => d && d.properties && d.properties.radius)
);
@@ -325,7 +353,26 @@ export default class GeoJsonLayer extends Layer {
return accu;
}, {});
- this.updateMeta({bounds, lightSettings, fp64, fixedRadius, featureTypes});
+ this.updateMeta({bounds, lightSettings, fixedRadius, featureTypes});
+ }
+
+ setInitialLayerConfig(allData) {
+ this.updateLayerMeta(allData);
+ const {featureTypes} = this.meta;
+ // default settings is stroke: true, filled: false
+ if (featureTypes && featureTypes.polygon) {
+ // set both fill and stroke to true
+ return this.updateLayerVisConfig({
+ filled: true,
+ stroked: true,
+ strokeColor: colorMaker.next().value
+ });
+ } else if (featureTypes && featureTypes.point) {
+ // set fill to true if detect point
+ return this.updateLayerVisConfig({filled: true, stroked: false});
+ }
+
+ return this;
}
renderLayer({
@@ -335,7 +382,7 @@ export default class GeoJsonLayer extends Layer {
mapState,
interactionConfig
}) {
- const {fp64, lightSettings, fixedRadius} = this.meta;
+ const {lightSettings, fixedRadius} = this.meta;
const radiusScale = this.getRadiusScaleByZoom(mapState, fixedRadius);
const zoomFactor = this.getZoomFactor(mapState);
const {visConfig} = this.config;
@@ -346,7 +393,6 @@ export default class GeoJsonLayer extends Layer {
lineWidthMinPixels: 1,
elevationScale: visConfig.elevationScale,
pointRadiusScale: radiusScale,
- fp64: fp64 || visConfig['hi-precision'],
lineMiterLimit: 4
};
@@ -363,10 +409,10 @@ export default class GeoJsonLayer extends Layer {
colorScale: this.config.colorScale
},
getLineColor: {
- color: this.config.color,
- colorField: this.config.colorField,
- colorRange: visConfig.colorRange,
- colorScale: this.config.colorScale
+ color: visConfig.strokeColor,
+ colorField: this.config.strokeColorField,
+ colorRange: visConfig.strokeColorRange,
+ colorScale: this.config.strokeColorScale
},
getLineWidth: {
sizeField: this.config.sizeField,
@@ -391,7 +437,7 @@ export default class GeoJsonLayer extends Layer {
getElevation: data.getElevation,
// highlight
pickable: true,
- // highlightColor: this.config.highlightColor,
+ highlightColor: HIGHLIGH_COLOR_3D,
autoHighlight: visConfig.enable3d,
// parameters
parameters: {depthTest: Boolean(visConfig.enable3d || mapState.dragRotate)},
@@ -400,13 +446,10 @@ export default class GeoJsonLayer extends Layer {
filled: visConfig.filled,
extruded: visConfig.enable3d,
wireframe: visConfig.wireframe,
+ lineMiterLimit: 2,
+ rounded: true,
lightSettings,
- updateTriggers,
-
- subLayers: {
- ...DeckGLGeoJsonLayer.defaultProps.subLayers,
- PolygonLayer: HighlightPolygonLayer
- }
+ updateTriggers
}),
...(this.isLayerHovered(objectHovered) && !visConfig.enable3d
? [
diff --git a/src/layers/grid-layer/grid-layer.js b/src/layers/grid-layer/grid-layer.js
index 36ae49c52..4a4043afc 100644
--- a/src/layers/grid-layer/grid-layer.js
+++ b/src/layers/grid-layer/grid-layer.js
@@ -23,6 +23,7 @@ import AggregationLayer from '../aggregation-layer';
import EnhancedGridLayer from 'deckgl-layers/grid-layer/enhanced-grid-layer';
import {pointToPolygonGeo} from './grid-utils';
import GridLayerIcon from './grid-layer-icon';
+import {HIGHLIGH_COLOR_3D} from 'constants/default-settings';
export const gridVisConfigs = {
opacity: 'opacity',
@@ -33,7 +34,6 @@ export const gridVisConfigs = {
percentile: 'percentile',
elevationPercentile: 'elevationPercentile',
elevationScale: 'elevationScale',
- 'hi-precision': 'hi-precision',
colorAggregation: 'aggregation',
sizeAggregation: 'sizeAggregation',
enable3d: 'enable3d'
@@ -103,6 +103,7 @@ export default class GridLayer extends AggregationLayer {
coverage: visConfig.coverage,
// highlight
autoHighlight: visConfig.enable3d,
+ highlightColor: HIGHLIGH_COLOR_3D,
// color
colorRange: this.getColorRange(visConfig.colorRange),
@@ -120,7 +121,6 @@ export default class GridLayer extends AggregationLayer {
parameters: {depthTest: Boolean(visConfig.enable3d || mapState.dragRotate)},
// render
- fp64: visConfig['hi-precision'],
pickable: true,
lightSettings: this.meta && this.meta.lightSettings,
diff --git a/src/layers/h3-hexagon-layer/h3-hexagon-layer.js b/src/layers/h3-hexagon-layer/h3-hexagon-layer.js
index 3a73c5ce3..f036f1cd8 100644
--- a/src/layers/h3-hexagon-layer/h3-hexagon-layer.js
+++ b/src/layers/h3-hexagon-layer/h3-hexagon-layer.js
@@ -25,7 +25,7 @@ import {GeoJsonLayer} from 'deck.gl';
import H3HexagonCellLayer from 'deckgl-layers/h3-hexagon-cell-layer/h3-hexagon-cell-layer';
import {getVertices, getCentroid, idToPolygonGeo} from './h3-utils';
import H3HexagonLayerIcon from './h3-hexagon-layer-icon';
-import {CHANNEL_SCALES} from 'constants/default-settings';
+import {CHANNEL_SCALES, HIGHLIGH_COLOR_3D} from 'constants/default-settings';
export const HEXAGON_ID_FIELDS = {
hex_id: ['hex_id', 'hexagon_id', 'h3_id']
@@ -41,8 +41,7 @@ export const HexagonIdVisConfigs = {
coverage: 'coverage',
sizeRange: 'elevationRange',
coverageRange: 'coverageRange',
- elevationScale: 'elevationScale',
- 'hi-precision': 'hi-precision'
+ elevationScale: 'elevationScale'
};
function hexToRgb(hex) {
@@ -287,6 +286,7 @@ export default class HexagonIdLayer extends Layer {
// highlight
autoHighlight: Boolean(config.sizeField),
+ highlightColor: HIGHLIGH_COLOR_3D,
// elevation
extruded: Boolean(config.sizeField),
diff --git a/src/layers/hexagon-layer/hexagon-layer.js b/src/layers/hexagon-layer/hexagon-layer.js
index d35282b72..f1a04f536 100644
--- a/src/layers/hexagon-layer/hexagon-layer.js
+++ b/src/layers/hexagon-layer/hexagon-layer.js
@@ -24,6 +24,7 @@ import EnhancedHexagonLayer from 'deckgl-layers/hexagon-layer/enhanced-hexagon-l
import {hexagonToPolygonGeo} from './hexagon-utils';
import HexagonLayerIcon from './hexagon-layer-icon';
import {clamp} from 'utils/data-utils';
+import {HIGHLIGH_COLOR_3D} from 'constants/default-settings';
export const hexagonVisConfigs = {
opacity: 'opacity',
@@ -35,7 +36,6 @@ export const hexagonVisConfigs = {
percentile: 'percentile',
elevationPercentile: 'elevationPercentile',
elevationScale: 'elevationScale',
- 'hi-precision': 'hi-precision',
colorAggregation: 'aggregation',
sizeAggregation: 'sizeAggregation',
enable3d: 'enable3d'
@@ -84,6 +84,7 @@ export default class HexagonLayer extends AggregationLayer {
// highlight
autoHighlight: visConfig.enable3d,
+ highlightColor: HIGHLIGH_COLOR_3D,
radius,
coverage: visConfig.coverage,
@@ -105,7 +106,6 @@ export default class HexagonLayer extends AggregationLayer {
elevationUpperPercentile: visConfig.elevationPercentile[1],
// render
- fp64: visConfig['hi-precision'],
pickable: true,
lightSettings: this.meta.lightSettings,
// callbacks
diff --git a/src/layers/icon-layer/icon-layer.js b/src/layers/icon-layer/icon-layer.js
index 3edddb574..524246f6e 100644
--- a/src/layers/icon-layer/icon-layer.js
+++ b/src/layers/icon-layer/icon-layer.js
@@ -48,8 +48,7 @@ export const pointVisConfigs = {
fixedRadius: 'fixedRadius',
opacity: 'opacity',
colorRange: 'colorRange',
- radiusRange: 'radiusRange',
- 'hi-precision': 'hi-precision'
+ radiusRange: 'radiusRange'
};
export default class IconLayer extends Layer {
@@ -264,7 +263,6 @@ export default class IconLayer extends Layer {
}) {
const layerProps = {
radiusMinPixels: 1,
- fp64: this.config.visConfig['hi-precision'],
radiusScale: this.getRadiusScaleByZoom(mapState),
...(this.config.visConfig.fixedRadius ? {} : {radiusMaxPixels: 500})
};
diff --git a/src/layers/layer-factory.js b/src/layers/layer-factory.js
index ee080d1dd..1a63288e7 100644
--- a/src/layers/layer-factory.js
+++ b/src/layers/layer-factory.js
@@ -124,10 +124,11 @@ export const LAYER_VIS_CONFIGS = {
group: PROPERTY_GROUPS.cell,
property: 'coverage'
},
+ // used in point layer
outline: {
type: 'boolean',
defaultValue: false,
- label: 'Draw outline',
+ label: 'Outline',
group: PROPERTY_GROUPS.display,
property: 'outline'
},
@@ -138,6 +139,13 @@ export const LAYER_VIS_CONFIGS = {
group: PROPERTY_GROUPS.color,
property: 'colorRange'
},
+ strokeColorRange: {
+ type: 'color-range-select',
+ defaultValue: DefaultColorRange,
+ label: 'Stroke Color range',
+ group: PROPERTY_GROUPS.color,
+ property: 'strokeColorRange'
+ },
targetColor: {
type: 'color-select',
label: 'Target Color',
@@ -145,6 +153,13 @@ export const LAYER_VIS_CONFIGS = {
group: PROPERTY_GROUPS.color,
property: 'targetColor'
},
+ strokeColor: {
+ type: 'color-select',
+ label: 'Stroke Color',
+ defaultValue: null,
+ group: PROPERTY_GROUPS.color,
+ property: 'strokeColor'
+ },
aggregation: {
type: 'select',
defaultValue: AGGREGATION_TYPES.average,
@@ -250,6 +265,7 @@ export const LAYER_VIS_CONFIGS = {
group: PROPERTY_GROUPS.radius,
property: 'coverageRange'
},
+ // hi precision is deprecated by deck.gl
'hi-precision': {
type: 'boolean',
defaultValue: false,
diff --git a/src/layers/line-layer/line-layer.js b/src/layers/line-layer/line-layer.js
index 219911c13..fbc67c545 100644
--- a/src/layers/line-layer/line-layer.js
+++ b/src/layers/line-layer/line-layer.js
@@ -91,7 +91,6 @@ export default class LineLayer extends ArcLayer {
getColor: data.getSourceColor,
id: this.id,
idx,
- fp64: this.config.visConfig['hi-precision'],
opacity: this.config.visConfig.opacity,
strokeScale: this.config.visConfig.thickness,
// parameters
diff --git a/src/layers/point-layer/point-layer.js b/src/layers/point-layer/point-layer.js
index 094911db2..f8c68ea53 100644
--- a/src/layers/point-layer/point-layer.js
+++ b/src/layers/point-layer/point-layer.js
@@ -18,26 +18,32 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-import Layer from '../base-layer';
import memoize from 'lodash.memoize';
+import uniq from 'lodash.uniq';
import {TextLayer} from 'deck.gl';
+
+import Layer from '../base-layer';
import ScatterplotBrushingLayer from 'deckgl-layers/scatterplot-brushing-layer/scatterplot-brushing-layer';
-import uniq from 'lodash.uniq';
import {hexToRgb} from 'utils/color-utils';
import PointLayerIcon from './point-layer-icon';
-import {DEFAULT_LAYER_COLOR} from 'constants/default-settings';
+import {DEFAULT_LAYER_COLOR, CHANNEL_SCALES} from 'constants/default-settings';
export const pointPosAccessor = ({lat, lng, altitude}) => d => [
+ // lng
d.data[lng.fieldIdx],
+ // lat
d.data[lat.fieldIdx],
+ // altitude
altitude && altitude.fieldIdx > -1 ? d.data[altitude.fieldIdx] : 0
];
export const pointPosResolver = ({lat, lng, altitude}) =>
`${lat.fieldIdx}-${lng.fieldIdx}-${altitude ? altitude.fieldIdx : 'z'}`;
-export const pointLabelAccessor = textLabel => d => String(d.data[textLabel.field.tableFieldIndex - 1]);
-export const pointLabelResolver = textLabel => textLabel.field && textLabel.field.tableFieldIndex;
+export const pointLabelAccessor = textLabel => d =>
+ String(d.data[textLabel.field.tableFieldIndex - 1]);
+export const pointLabelResolver = textLabel =>
+ textLabel.field && textLabel.field.tableFieldIndex;
export const pointRequiredColumns = ['lat', 'lng'];
export const pointOptionalColumns = ['altitude'];
@@ -48,9 +54,16 @@ export const pointVisConfigs = {
opacity: 'opacity',
outline: 'outline',
thickness: 'thickness',
+ strokeColor: 'strokeColor',
colorRange: 'colorRange',
+ strokeColorRange: 'strokeColorRange',
radiusRange: 'radiusRange',
- 'hi-precision': 'hi-precision'
+ filled: {
+ type: 'boolean',
+ label: 'Fill Color',
+ defaultValue: true,
+ property: 'filled'
+ }
};
export default class PointLayer extends Layer {
@@ -92,6 +105,15 @@ export default class PointLayer extends Layer {
get visualChannels() {
return {
...super.visualChannels,
+ strokeColor: {
+ property: 'strokeColor',
+ field: 'strokeColorField',
+ scale: 'strokeColorScale',
+ domain: 'strokeColorDomain',
+ range: 'strokeColorRange',
+ key: 'strokeColor',
+ channelScaleType: CHANNEL_SCALES.color
+ },
size: {
...super.visualChannels.size,
range: 'radiusRange',
@@ -101,6 +123,10 @@ export default class PointLayer extends Layer {
};
}
+ getPositionAccessor() {
+ return this.getPosition(this.config.columns);
+ }
+
static findDefaultLayerProps({fieldPairs = []}) {
const props = [];
@@ -125,7 +151,6 @@ export default class PointLayer extends Layer {
prop.isVisible = true;
}
- // const newLayer = new KeplerGlLayers.PointLayer(prop);
prop.columns = {
lat: latField,
lng: lngField,
@@ -138,6 +163,17 @@ export default class PointLayer extends Layer {
return props;
}
+ getDefaultLayerConfig(props = {}) {
+ return {
+ ...super.getDefaultLayerConfig(props),
+
+ // add stroke color visual channel
+ strokeColorField: null,
+ strokeColorDomain: [0, 1],
+ strokeColorScale: 'quantile'
+ };
+ }
+
// TODO: fix complexity
/* eslint-disable complexity */
formatLayerData(_, allData, filteredIndex, oldLayerData, opt = {}) {
@@ -145,16 +181,24 @@ export default class PointLayer extends Layer {
colorScale,
colorDomain,
colorField,
+ strokeColorField,
+ strokeColorScale,
+ strokeColorDomain,
color,
- columns,
sizeField,
sizeScale,
sizeDomain,
textLabel,
- visConfig: {radiusRange, fixedRadius, colorRange}
+ visConfig: {
+ radiusRange,
+ fixedRadius,
+ colorRange,
+ strokeColorRange,
+ strokeColor
+ }
} = this.config;
- // point color
+ // fill color
const cScale =
colorField &&
this.getVisChannelScale(
@@ -163,12 +207,21 @@ export default class PointLayer extends Layer {
colorRange.colors.map(hexToRgb)
);
+ // stroke color
+ const scScale =
+ strokeColorField &&
+ this.getVisChannelScale(
+ strokeColorScale,
+ strokeColorDomain,
+ strokeColorRange.colors.map(hexToRgb)
+ );
+
// point radius
const rScale =
sizeField &&
this.getVisChannelScale(sizeScale, sizeDomain, radiusRange, fixedRadius);
- const getPosition = this.getPosition(columns);
+ const getPosition = this.getPositionAccessor();
if (!oldLayerData || oldLayerData.getPosition !== getPosition) {
this.updateLayerMeta(allData, getPosition);
@@ -209,30 +262,37 @@ export default class PointLayer extends Layer {
opt.sameData &&
oldLayerData.getText === getText
) {
- labelCharacterSet = oldLayerData.labelCharacterSet
+ labelCharacterSet = oldLayerData.labelCharacterSet;
} else {
const textLabels = textLabel.field ? data.map(getText) : [];
labelCharacterSet = uniq(textLabels.join(''));
}
- const getRadius = rScale ? d =>
- this.getEncodedChannelValue(rScale, d.data, sizeField) : 1;
+ const getRadius = rScale
+ ? d => this.getEncodedChannelValue(rScale, d.data, sizeField)
+ : 1;
- const getColor = cScale ? d =>
- this.getEncodedChannelValue(cScale, d.data, colorField) : color;
+ const getFillColor = cScale
+ ? d => this.getEncodedChannelValue(cScale, d.data, colorField)
+ : color;
+ const getLineColor = scScale
+ ? d => this.getEncodedChannelValue(scScale, d.data, strokeColorField)
+ : strokeColor || color;
return {
data,
labelCharacterSet,
getPosition,
- getColor,
+ getFillColor,
+ getLineColor,
getRadius,
getText
};
}
/* eslint-enable complexity */
- updateLayerMeta(allData, getPosition) {
+ updateLayerMeta(allData) {
+ const getPosition = this.getPositionAccessor();
const bounds = this.getPointsBounds(allData, d => getPosition({data: d}));
this.updateMeta({bounds});
}
@@ -248,10 +308,11 @@ export default class PointLayer extends Layer {
const enableBrushing = interactionConfig.brush.enabled;
const layerProps = {
- outline: this.config.visConfig.outline,
+ // TODO: support setting stroke and fill simultaneously
+ stroked: this.config.visConfig.outline,
+ filled: this.config.visConfig.filled,
radiusMinPixels: 1,
- fp64: this.config.visConfig['hi-precision'],
- strokeWidth: this.config.visConfig.thickness,
+ lineWidthMinPixels: this.config.visConfig.thickness,
radiusScale: this.getRadiusScaleByZoom(mapState),
...(this.config.visConfig.fixedRadius ? {} : {radiusMaxPixels: 500})
};
@@ -269,6 +330,7 @@ export default class PointLayer extends Layer {
...layerInteraction,
...data,
...interaction,
+
idx,
id: this.id,
opacity: this.config.visConfig.opacity,
@@ -279,34 +341,47 @@ export default class PointLayer extends Layer {
},
updateTriggers: {
+ getPosition: {
+ columns: this.config.columns
+ },
getRadius: {
sizeField: this.config.sizeField,
radiusRange: this.config.visConfig.radiusRange,
fixedRadius: this.config.visConfig.fixedRadius,
sizeScale: this.config.sizeScale
},
- getColor: {
+ getFillColor: {
color: this.config.color,
colorField: this.config.colorField,
colorRange: this.config.visConfig.colorRange,
colorScale: this.config.colorScale
+ },
+ getLineColor: {
+ color: this.config.visConfig.strokeColor,
+ colorField: this.config.strokeColorField,
+ colorRange: this.config.visConfig.strokeColorRange,
+ colorScale: this.config.strokeColorScale
+ },
+ getText: {
+ textLabel: this.config.textLabel
}
}
}),
// hover layer
...(this.isLayerHovered(objectHovered)
- ? [
- new ScatterplotBrushingLayer({
- ...layerProps,
- id: `${this.id}-hovered`,
- data: [objectHovered.object],
- getColor: this.config.highlightColor,
- getRadius: data.getRadius,
- getPosition: data.getPosition,
- pickable: false
- })
- ]
- : []),
+ ? [
+ new ScatterplotBrushingLayer({
+ ...layerProps,
+ id: `${this.id}-hovered`,
+ data: [objectHovered.object],
+ getLineColor: this.config.highlightColor,
+ getFillColor: this.config.highlightColor,
+ getRadius: data.getRadius,
+ getPosition: data.getPosition,
+ pickable: false
+ })
+ ]
+ : []),
// text label layer
...(this.config.textLabel.field
? [
@@ -320,7 +395,6 @@ export default class PointLayer extends Layer {
getTextAnchor: this.config.textLabel.anchor,
getText: data.getText,
getColor: d => this.config.textLabel.color,
- fp64: this.config.visConfig['hi-precision'],
parameters: {
// text will always show on top of all layers
depthTest: false
diff --git a/src/reducers/vis-state-merger.js b/src/reducers/vis-state-merger.js
index d0cfe1c0b..e6a193e2e 100644
--- a/src/reducers/vis-state-merger.js
+++ b/src/reducers/vis-state-merger.js
@@ -405,7 +405,7 @@ export function validateLayerWithData({fields, id: dataId}, savedLayer, layerCla
const visConfig = newLayer.copyLayerConfig(
newLayer.config.visConfig,
savedLayer.config.visConfig || {},
- {notToDeepMerge: 'colorRange'}
+ {notToDeepMerge: ['colorRange', 'strokeColorRange']}
);
newLayer.updateLayerConfig({
diff --git a/src/schemas/map-style-schema.js b/src/schemas/map-style-schema.js
index e8675a30e..f0c2da9f2 100644
--- a/src/schemas/map-style-schema.js
+++ b/src/schemas/map-style-schema.js
@@ -39,8 +39,7 @@ const CustomMapStyleSchema = new Schema({
class MapStyleSchemaV1 extends Schema {
version = VERSIONS.v1;
key = 'mapStyles';
- save(mapStyles, mapStyle) {
-
+ save(mapStyles) {
// save all custom styles
const saveCustomStyle = Object.keys(mapStyles).reduce((accu, key) => ({
...(mapStyles[key].custom ?
diff --git a/src/schemas/schema-manager.js b/src/schemas/schema-manager.js
index fb6c9cd3b..52f20975f 100644
--- a/src/schemas/schema-manager.js
+++ b/src/schemas/schema-manager.js
@@ -167,8 +167,7 @@ class KeplerGLSchema {
...accu,
...(key in this._reducerSchemas
? this._reducerSchemas[key][validVersion].load(
- config[key],
- state[key]
+ config[key]
)
: {})
}),
diff --git a/src/schemas/schema.js b/src/schemas/schema.js
index aa9c51f9f..723f5c1f8 100644
--- a/src/schemas/schema.js
+++ b/src/schemas/schema.js
@@ -29,15 +29,15 @@ export default class Schema {
this.key = key;
}
- loadPropertiesOrApplySchema(node, parent, accumulator) {
- return this._getPropertyValueFromSchema('load', node, parent, accumulator);
+ loadPropertiesOrApplySchema(node, parents = [], accumulator) {
+ return this._getPropertyValueFromSchema('load', node, parents, accumulator);
}
- savePropertiesOrApplySchema(node, parent, accumulator) {
- return this._getPropertyValueFromSchema('save', node, parent, accumulator);
+ savePropertiesOrApplySchema(node, parents = [], accumulator) {
+ return this._getPropertyValueFromSchema('save', node, parents, accumulator);
}
- _getPropertyValueFromSchema(operation, node, parent, accumulator) {
+ _getPropertyValueFromSchema(operation, node, parents = [], accumulator) {
const internal = `_${operation}`;
return {
[this.key]: this.properties
@@ -49,7 +49,7 @@ export default class Schema {
? // if it's another schema
this.properties[key][operation]
? // call save or load
- this.properties[key][internal](node[key], node, accu)
+ this.properties[key][internal](node[key], [...parents, node], accu)
: {}
: {[key]: node[key]}
: {})
@@ -79,15 +79,15 @@ export default class Schema {
return this.save(...args);
}
- save(node, parent, accumulator = {}) {
- return this.savePropertiesOrApplySchema(node, parent, accumulator);
+ save(node, parents = [], accumulator = {}) {
+ return this.savePropertiesOrApplySchema(node, parents, accumulator);
}
_load(...args) {
return this.load(...args);
}
- load(node, parent, accumulator = {}) {
- return this.loadPropertiesOrApplySchema(node, parent, accumulator);
+ load(node, parents = [], accumulator = {}) {
+ return this.loadPropertiesOrApplySchema(node, parents, accumulator);
}
}
diff --git a/src/schemas/vis-state-schema.js b/src/schemas/vis-state-schema.js
index 24f78eb02..0d846aab2 100644
--- a/src/schemas/vis-state-schema.js
+++ b/src/schemas/vis-state-schema.js
@@ -21,8 +21,9 @@
import pick from 'lodash.pick';
import {VERSIONS} from './versions';
import {isValidFilterValue} from 'utils/filter-utils';
-
+import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
import Schema from './schema';
+import cloneDeep from 'lodash.clonedeep';
/**
* V0 Schema
@@ -66,7 +67,7 @@ function geojsonSizeFieldV0ToV1(config) {
// convert v0 to v1 layer config
class DimensionFieldSchemaV0 extends Schema {
version = VERSIONS.v0;
- save(field, config) {
+ save(field) {
// should not be called anymore
return {
[this.key]:
@@ -76,7 +77,8 @@ class DimensionFieldSchemaV0 extends Schema {
};
}
- load(field, config, accumulated) {
+ load(field, parents, accumulated) {
+ const [config] = parents.slice(-1);
let fieldName = this.key;
if (config.type === 'geojson' && this.key === 'sizeField' && field) {
fieldName = geojsonSizeFieldV0ToV1(config);
@@ -96,7 +98,8 @@ class DimensionScaleSchemaV0 extends Schema {
save(scale) {
return {[this.key]: scale};
}
- load(scale, config, accumulated) {
+ load(scale, parents, accumulated) {
+ const [config] = parents.slice(-1);
// fold into visualChannels to be load by VisualChannelSchemaV1
if (this.key === 'sizeScale' && config.type === 'geojson') {
// sizeScale now split into radiusScale, heightScale
@@ -116,7 +119,7 @@ class DimensionScaleSchemaV0 extends Schema {
// used to convert v0 to v1 layer config
class LayerConfigSchemaV0 extends Schema {
version = VERSIONS.v0;
- load(saved, layer, accumulated) {
+ load(saved, parents, accumulated) {
// fold v0 layer property into config.key
return {
config: {
@@ -131,7 +134,7 @@ class LayerConfigSchemaV0 extends Schema {
// only return column value for each column
class LayerColumnsSchemaV0 extends Schema {
version = VERSIONS.v0;
- load(saved, layer, accumulated) {
+ load(saved, parents, accumulated) {
// fold v0 layer property into config.key, flatten columns
return {
config: {
@@ -151,7 +154,7 @@ class LayerColumnsSchemaV0 extends Schema {
// used to convert v0 to v1 layer config.visConfig
class LayerConfigToVisConfigSchemaV0 extends Schema {
version = VERSIONS.v0;
- load(saved, layer, accumulated) {
+ load(saved, parents, accumulated) {
// fold v0 layer property into config.visConfig
const accumulatedConfig = accumulated.config || {};
return {
@@ -170,7 +173,8 @@ class LayerVisConfigSchemaV0 extends Schema {
version = VERSIONS.v0;
key = 'visConfig';
- load(visConfig, config, accumulator) {
+ load(visConfig, parents, accumulator) {
+ const [config] = parents.slice(-1);
const rename = {
geojson: {
extruded: 'enable3d',
@@ -297,7 +301,7 @@ class TextLabelSchemaV1 extends Schema {
...textLabel,
field: textLabel.field ? pick(textLabel.field, ['name', 'type']) : null
}
- }
+ };
}
load(textLabel) {
@@ -305,12 +309,52 @@ class TextLabelSchemaV1 extends Schema {
}
}
+const visualChannelModificationV1 = {
+ point: (vc, parents, accumulator) => {
+ const [layer] = parents.slice(-1);
+
+ if (
+ layer.config.visConfig.outline &&
+ vc.colorField &&
+ !vc.hasOwnProperty('strokeColorField')
+ ) {
+ // point layer now supports both outline and fill
+ // for older schema where filled has not been added to point layer
+ // copy colorField, colorScale to strokeColorField, and strokeColorScale
+ return {
+ strokeColorField: vc.colorField,
+ strokeColorScale: vc.colorScale,
+ colorField: null,
+ colorScale: 'quantile'
+ };
+ }
+ return {};
+ },
+ geojson: (vc, parents, accumulator) => {
+ const [layer] = parents.slice(-1);
+ const isOld = !vc.hasOwnProperty('strokeColorField');
+ // make our best guess if this geojson layer contains point
+ const isPoint =
+ vc.radiusField ||
+ layer.config.visConfig.radius !== LAYER_VIS_CONFIGS.radius.defaultValue;
+
+ if (isOld && !isPoint && layer.config.visConfig.stroked) {
+ // if stroked is true, copy color config to stroke color config
+ return {
+ strokeColorField: vc.colorField,
+ strokeColorScale: vc.colorScale
+ };
+ }
+ return {};
+ }
+};
/**
* V1: save [field]: {name, type}, [scale]: '' for each channel
*/
class VisualChannelSchemaV1 extends Schema {
- save(visualChannels, layer) {
+ save(visualChannels, parents) {
// only save field and scale of each channel
+ const [layer] = parents.slice(-1);
return {
[this.key]: Object.keys(visualChannels).reduce(
// save channel to null if didn't select any field
@@ -325,13 +369,82 @@ class VisualChannelSchemaV1 extends Schema {
)
};
}
- load(vc, layer, accumulator) {
+ load(vc, parents, accumulator) {
// fold channels into config
+ const [layer] = parents.slice(-1);
+ const modified = visualChannelModificationV1[layer.type]
+ ? visualChannelModificationV1[layer.type](vc, parents, accumulator)
+ : {};
+
return {
...accumulator,
config: {
...(accumulator.config || {}),
- ...vc
+ ...vc,
+ ...modified
+ }
+ };
+ }
+}
+const visConfigModificationV1 = {
+ point: (visConfig, parents, accumulated) => {
+ const modified = {};
+ const [layer] = parents.slice(-2, -1);
+ const isOld = !visConfig.hasOwnProperty('filled') &&
+ !visConfig.strokeColor && !visConfig.strokeColorRange;
+ if (isOld) {
+ // color color & color range to stroke color
+ modified.strokeColor = layer.config.color;
+ modified.strokeColorRange = cloneDeep(visConfig.colorRange);
+ if (visConfig.outline) {
+ // point layer now supports both outline and fill
+ // for older schema where filled has not been added to point layer
+ // set it to false
+ modified.filled = false;
+ }
+ }
+
+ return modified;
+ },
+ geojson: (visConfig, parents, accumulated) => {
+ // is points?
+ const modified = {};
+ const [layer] = parents.slice(-2, -1);
+ const isOld = !layer.visualChannels.hasOwnProperty('strokeColorField') &&
+ !visConfig.strokeColor && !visConfig.strokeColorRange;
+ // make our best guess if this geojson layer contains point
+ const isPoint =
+ layer.visualChannels.radiusField ||
+ visConfig.radius !== LAYER_VIS_CONFIGS.radius.defaultValue;
+
+ if (isOld) {
+ // color color & color range to stroke color
+ modified.strokeColor = layer.config.color;
+ modified.strokeColorRange = cloneDeep(visConfig.colorRange);
+ if (isPoint) {
+ // if is point, set stroke to false
+ modified.filled = true;
+ modified.stroked = false;
+ }
+ }
+
+ return modified;
+ }
+};
+
+class VisConfigSchemaV1 extends Schema {
+ key = 'visConfig';
+
+ load(visConfig, parents, accumulated) {
+ const [layer] = parents.slice(-2, -1);
+ const modified = visConfigModificationV1[layer.type]
+ ? visConfigModificationV1[layer.type](visConfig, parents, accumulated)
+ : {};
+
+ return {
+ visConfig: {
+ ...visConfig,
+ ...modified
}
};
}
@@ -352,7 +465,9 @@ export const layerPropsV1 = {
key: 'columns'
}),
isVisible: null,
- visConfig: null,
+ visConfig: new VisConfigSchemaV1({
+ version: VERSIONS.v1
+ }),
textLabel: new TextLabelSchemaV1({
version: VERSIONS.v1,
key: 'textLabel'
@@ -368,7 +483,9 @@ export const layerPropsV1 = {
class LayerSchemaV0 extends Schema {
key = 'layers';
- save(layers, visState) {
+ save(layers, parents) {
+ const [visState] = parents.slice(-1);
+
return {
[this.key]: visState.layerOrder.reduce((saved, index) => {
// save layers according to their rendering order
@@ -381,7 +498,7 @@ class LayerSchemaV0 extends Schema {
};
}
- load(layers, visState) {
+ load(layers) {
return {
[this.key]: layers.map(
layer => this.loadPropertiesOrApplySchema(layer, layers).layers
@@ -396,10 +513,7 @@ class FilterSchemaV0 extends Schema {
return {
filters: filters
.filter(isValidFilterValue)
- .map(
- filter =>
- this.savePropertiesOrApplySchema(filter, this.properties).filters
- )
+ .map(filter => this.savePropertiesOrApplySchema(filter).filters)
};
}
load(filters) {
diff --git a/src/shaderlib/picking-module.js b/src/shaderlib/picking-module.js
deleted file mode 100644
index 7fc144ef2..000000000
--- a/src/shaderlib/picking-module.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2019 Uber Technologies, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-import {picking} from 'luma.gl';
-
-// add picking_uHighlightScale to fs uniform
-const fs = `\
-uniform bool picking_uActive; // true during rendering to offscreen picking buffer
-uniform vec3 picking_uSelectedColor;
-uniform vec4 picking_uHighlightColor;
-uniform float picking_uHighlightScale;
-
-varying vec4 picking_vRGBcolor_Aselected;
-
-const float COLOR_SCALE = 1. / 255.;
-
-/*
- * Returns highlight color if this item is selected.
- */
-vec4 picking_filterHighlightColor(vec4 color) {
- bool selected = bool(picking_vRGBcolor_Aselected.a);
- // return selected ? (picking_uHighlightColor * COLOR_SCALE) : color;
- return selected ? (
- (bool(picking_uHighlightScale > 0.0) ? color * picking_uHighlightScale : picking_uHighlightColor * COLOR_SCALE)
- ) : color;
-}
-
-/*
- * Returns picking color if picking enabled else unmodified argument.
- */
-vec4 picking_filterPickingColor(vec4 color) {
- vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;
- if (picking_uActive && length(pickingColor) < 0.001) {
- discard;
- }
- return picking_uActive ? vec4(pickingColor, 1.0) : color;
-}
-
-/*
- * Returns picking color if picking is enabled if not
- * highlight color if this item is selected, otherwise unmodified argument.
- */
-vec4 picking_filterColor(vec4 color) {
- vec4 highightColor = picking_filterHighlightColor(color);
- return picking_filterPickingColor(highightColor);
-}
-`;
-
-export default {
- ...picking,
- fs
-};
diff --git a/src/utils/gl-utils.js b/src/utils/gl-utils.js
index f44895876..15998ab51 100644
--- a/src/utils/gl-utils.js
+++ b/src/utils/gl-utils.js
@@ -19,7 +19,6 @@
// THE SOFTWARE.
import {registerShaderModules, setParameters} from 'luma.gl';
-import pickingModule from 'shaderlib/picking-module';
import brushingModule from 'shaderlib/brushing-module';
import {LAYER_BLENDINGS} from 'constants/default-settings';
import GL from 'luma.gl/constants';
@@ -27,10 +26,7 @@ import GL from 'luma.gl/constants';
const getGlConst = d => GL[d];
export function onWebGLInitialized(gl) {
- registerShaderModules(
- [pickingModule, brushingModule], {
- ignoreMultipleRegistrations: true
- });
+ registerShaderModules([brushingModule], {ignoreMultipleRegistrations: true});
}
export function setLayerBlending(gl, layerBlending) {
diff --git a/src/utils/layer-utils/layer-utils.js b/src/utils/layer-utils/layer-utils.js
index dbc5e245f..be295dccb 100644
--- a/src/utils/layer-utils/layer-utils.js
+++ b/src/utils/layer-utils/layer-utils.js
@@ -36,9 +36,16 @@ export function findDefaultLayer(dataset, layerClasses) {
Object.keys(layerClasses).forEach(lc => {
const layerProps = layerClasses[lc].findDefaultLayerProps(dataset);
if (layerProps) {
- const found = (Array.isArray(layerProps) ? layerProps : [layerProps])
- .map(props => new layerClasses[lc]({...props, dataId: dataset.id}));
- layers = layers.concat(found);
+ const newLayers = (Array.isArray(layerProps) ? layerProps : [layerProps])
+ .map(props => {
+ const layer = new layerClasses[lc]({...props, dataId: dataset.id});
+
+ return typeof layer.setInitialLayerConfig === 'function'
+ ? layer.setInitialLayerConfig(dataset.allData)
+ : layer
+ });
+
+ layers = layers.concat(newLayers);
}
});
diff --git a/test/fixtures/config_v0_arc_cluster_point.js b/test/fixtures/config_v0_arc_cluster_point.js
index c0d743e8a..6bc9f85e0 100644
--- a/test/fixtures/config_v0_arc_cluster_point.js
+++ b/test/fixtures/config_v0_arc_cluster_point.js
@@ -433,6 +433,20 @@ export const parsedConfigV0 = {
'#FFC300'
]
},
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ strokeColor: [218, 112, 191],
radiusRange: [0, 50],
'hi-precision': false
}
@@ -474,6 +488,20 @@ export const parsedConfigV0 = {
'#FFC300'
]
},
+ strokeColor: [255, 153, 31],
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
radiusRange: [0, 50],
'hi-precision': false
}
@@ -515,6 +543,20 @@ export const parsedConfigV0 = {
'#FFC300'
]
},
+ strokeColor: [130, 154, 227],
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
radiusRange: [0, 50],
'hi-precision': false
}
diff --git a/test/fixtures/config_v0_geojson_point.js b/test/fixtures/config_v0_geojson_point.js
index f76b56ca0..7b4daf110 100644
--- a/test/fixtures/config_v0_geojson_point.js
+++ b/test/fixtures/config_v0_geojson_point.js
@@ -113,7 +113,7 @@ export const savedConfigV0 = {
}
};
-export const parsecConfigV0 = {
+export const parsedConfigV0 = {
visState: {
filters: [],
layers: [
@@ -149,6 +149,21 @@ export const parsecConfigV0 = {
],
reversed: false
},
+ strokeColorRange: {
+ name: 'ColorBrewer Dark2-6',
+ type: 'qualitative',
+ category: 'ColorBrewer',
+ colors: [
+ '#1b9e77',
+ '#d95f02',
+ '#7570b3',
+ '#e7298a',
+ '#66a61e',
+ '#e6ab02'
+ ],
+ reversed: false
+ },
+ strokeColor: [174, 14, 127],
opacity: 0.8,
thickness: 2,
radius: 15.8,
diff --git a/test/fixtures/config_v0_geojson_poly_fill_ele.js b/test/fixtures/config_v0_geojson_poly_fill_ele.js
index 144e9a75b..f98aea750 100644
--- a/test/fixtures/config_v0_geojson_poly_fill_ele.js
+++ b/test/fixtures/config_v0_geojson_poly_fill_ele.js
@@ -193,6 +193,21 @@ export const parsedConfigV0 = {
reversed: false,
type: 'sequential'
},
+ strokeColorRange: {
+ category: 'ColorBrewer',
+ colors: [
+ '#ffffcc',
+ '#d9f0a3',
+ '#addd8e',
+ '#78c679',
+ '#31a354',
+ '#006837'
+ ],
+ name: 'ColorBrewer YlGn-6',
+ reversed: false,
+ type: 'sequential'
+ },
+ strokeColor: [18, 147, 154, 255],
heightRange: [0, 500],
elevationScale: 5,
enable3d: true,
diff --git a/test/fixtures/config_v0_geojson_polygon.js b/test/fixtures/config_v0_geojson_polygon.js
index d2a6753e8..1f8bba6a9 100644
--- a/test/fixtures/config_v0_geojson_polygon.js
+++ b/test/fixtures/config_v0_geojson_polygon.js
@@ -202,6 +202,23 @@ export const parsedConfigV0 = {
],
reversed: false
},
+ strokeColor: [221, 178, 124, 255],
+ strokeColorRange: {
+ name: 'Pink Wine',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#2C1E3D',
+ '#50315E',
+ '#764476',
+ '#9A5B88',
+ '#B77495',
+ '#CF91A3',
+ '#E0B1B3',
+ '#EDD1CA'
+ ],
+ reversed: false
+ },
opacity: 0.8,
thickness: 13,
radius: 10,
@@ -230,6 +247,8 @@ export const parsedConfigV0 = {
isVisible: true,
colorField: null,
colorScale: 'quantile',
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
sizeField: {
name: 'c_avg_trips_per_rider',
type: 'real'
@@ -248,6 +267,20 @@ export const parsedConfigV0 = {
'#FFC300'
]
},
+ strokeColor: [136, 87, 44, 255],
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
opacity: 0.8,
thickness: 8,
radius: 10,
diff --git a/test/fixtures/state-saved-v0.js b/test/fixtures/state-saved-v0.js
index fa8082a81..6759e67e9 100644
--- a/test/fixtures/state-saved-v0.js
+++ b/test/fixtures/state-saved-v0.js
@@ -1030,6 +1030,9 @@ mergedLayer0.config = {
colorField: null,
colorScale: 'quantile',
colorDomain: [0, 1],
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
+ strokeColorDomain: [0, 1],
sizeField: null,
sizeScale: 'linear',
sizeDomain: [0, 1],
@@ -1044,6 +1047,7 @@ mergedLayer0.config = {
radius: 270.4,
opacity: 0.8,
outline: false,
+ filled: true,
thickness: 2,
fixedRadius: false,
colorRange: {
@@ -1052,8 +1056,14 @@ mergedLayer0.config = {
category: 'Uber',
colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
},
- radiusRange: [1, 100],
- 'hi-precision': false
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ strokeColor: [76, 154, 78],
+ radiusRange: [1, 100]
}
};
@@ -1127,8 +1137,7 @@ mergedLayer1.config = {
category: 'Uber',
colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
},
- sizeRange: [0, 10],
- 'hi-precision': false
+ sizeRange: [0, 10]
}
};
@@ -1167,6 +1176,9 @@ mergedLayer2.config = {
},
colorScale: 'ordinal',
colorDomain: ['2.103.2', '2.107.3', '2.116.2', '2.117.1', '3.68.4'],
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
+ strokeColorDomain: [0, 1],
sizeField: {
name: 'int_range',
format: '',
@@ -1187,6 +1199,7 @@ mergedLayer2.config = {
radius: 10,
opacity: 0.8,
outline: false,
+ filled: true,
thickness: 2,
colorRange: {
name: 'Sunrise',
@@ -1195,9 +1208,16 @@ mergedLayer2.config = {
colors: ['#355C7D', '#6C5B7B', '#C06C84', '#F67280', '#F8B195'],
reversed: false
},
+ strokeColorRange: {
+ name: 'Sunrise',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#355C7D', '#6C5B7B', '#C06C84', '#F67280', '#F8B195'],
+ reversed: false
+ },
+ strokeColor: [218, 112, 191],
fixedRadius: false,
- radiusRange: [1, 854.16],
- 'hi-precision': false
+ radiusRange: [1, 854.16]
}
};
@@ -1277,8 +1297,7 @@ mergedLayer3.config = {
sizeRange: [0, 50],
percentile: [0, 100],
elevationPercentile: [0, 100],
- elevationScale: 10,
- 'hi-precision': false
+ elevationScale: 10
}
};
@@ -1325,6 +1344,9 @@ mergedLayer4.config = {
},
colorScale: 'quantize',
colorDomain: [94107, 94132],
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
+ strokeColorDomain: [0, 1],
sizeField: null,
sizeScale: 'linear',
sizeDomain: [0, 1],
@@ -1367,6 +1389,30 @@ mergedLayer4.config = {
],
reversed: false
},
+ strokeColorRange: {
+ name: 'Uber Viz Qualitative 3',
+ type: 'qualitative',
+ category: 'Uber',
+ colors: [
+ '#12939A',
+ '#DDB27C',
+ '#88572C',
+ '#FF991F',
+ '#F15C17',
+ '#223F9A',
+ '#DA70BF',
+ '#125C77',
+ '#4DC19C',
+ '#776E57',
+ '#17B8BE',
+ '#F6D18A',
+ '#B7885E',
+ '#FFCB99',
+ '#F89570'
+ ],
+ reversed: false
+ },
+ strokeColor: [255, 153, 31, 255],
opacity: 0.8,
thickness: 2,
radius: 10,
@@ -1377,8 +1423,7 @@ mergedLayer4.config = {
stroked: false,
filled: true,
enable3d: false,
- wireframe: false,
- 'hi-precision': false
+ wireframe: false
}
};
diff --git a/test/fixtures/state-saved-v1-1.js b/test/fixtures/state-saved-v1-1.js
index 2ac812996..422f66c3b 100644
--- a/test/fixtures/state-saved-v1-1.js
+++ b/test/fixtures/state-saved-v1-1.js
@@ -673,7 +673,6 @@ export const savedStateV1 = {
radiusRange: [0, 50],
heightRange: [0, 500],
elevationScale: 18,
- 'hi-precision': true,
stroked: true,
filled: true,
enable3d: true,
@@ -885,6 +884,15 @@ mergedLayer0.config = {
},
colorScale: 'quantize',
colorDomain: [45, 9642],
+ strokeColorField: {
+ name: 'c_m_r',
+ type: 'integer',
+ id: 'c_m_r',
+ format: '',
+ tableFieldIndex: 9
+ },
+ strokeColorScale: 'quantize',
+ strokeColorDomain: [45, 9642],
sizeField: null,
sizeScale: 'linear',
sizeDomain: [0, 1],
@@ -927,14 +935,31 @@ mergedLayer0.config = {
],
reversed: true
},
+ strokeColorRange: {
+ name: 'ColorBrewer YlGnBu-9',
+ type: 'sequential',
+ category: 'ColorBrewer',
+ colors: [
+ '#081d58',
+ '#253494',
+ '#225ea8',
+ '#1d91c0',
+ '#41b6c4',
+ '#7fcdbb',
+ '#c7e9b4',
+ '#edf8b1',
+ '#ffffd9'
+ ],
+ reversed: true
+ },
radius: 10,
sizeRange: [0, 10],
radiusRange: [0, 50],
heightRange: [0, 500],
elevationScale: 18,
- 'hi-precision': true,
stroked: true,
filled: true,
+ strokeColor: [181, 18, 65],
enable3d: true,
wireframe: false
}
@@ -950,7 +975,6 @@ mergedLayer0.meta = {
lightsStrength: [0.9, 0, 0.8, 0],
numberOfLights: 2
},
- fp64: false,
fixedRadius: false,
featureTypes: {polygon: true}
};
@@ -2678,6 +2702,9 @@ mergedLayer1.config = {
colorField: null,
colorScale: 'quantile',
colorDomain: [0, 1],
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
+ strokeColorDomain: [0, 1],
sizeField: {
name: 'c_ta',
id: 'c_ta',
@@ -2709,16 +2736,22 @@ mergedLayer1.config = {
category: 'Uber',
colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
},
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
radius: 10,
sizeRange: [18.9, 47.6],
radiusRange: [0, 50],
heightRange: [0, 500],
elevationScale: 5,
- 'hi-precision': false,
stroked: true,
filled: false,
enable3d: false,
- wireframe: false
+ wireframe: false,
+ strokeColor: [221, 178, 124]
}
};
@@ -2732,7 +2765,6 @@ mergedLayer1.meta = {
lightsStrength: [0.9, 0, 0.8, 0],
numberOfLights: 2
},
- fp64: false,
fixedRadius: false,
featureTypes: {
polygon: true
diff --git a/test/fixtures/state-saved-v1-3.js b/test/fixtures/state-saved-v1-3.js
index db4e16947..48a043e37 100644
--- a/test/fixtures/state-saved-v1-3.js
+++ b/test/fixtures/state-saved-v1-3.js
@@ -233,8 +233,7 @@ export const savedStateV1 = {
],
reversed: true
},
- radiusRange: [0, 50],
- 'hi-precision': false
+ radiusRange: [0, 50]
}
},
visualChannels: {
@@ -275,7 +274,6 @@ export const savedStateV1 = {
percentile: [0, 96.54],
elevationPercentile: [0, 100],
elevationScale: 5,
- 'hi-precision': false,
colorAggregation: 'average',
sizeAggregation: 'average',
enable3d: false
@@ -386,6 +384,9 @@ mergedLayer0.config = {
highlightColor: [252, 242, 26, 255],
isConfigActive: false,
colorScale: 'quantile',
+ strokeColorField: null,
+ strokeColorDomain: [0, 1],
+ strokeColorScale: 'quantile',
sizeField: {
name: 'deliver_radius',
type: 'integer',
@@ -407,6 +408,7 @@ mergedLayer0.config = {
fixedRadius: true,
opacity: 0.29,
outline: false,
+ filled: true,
thickness: 2,
colorRange: {
name: 'ColorBrewer YlGn-6',
@@ -422,8 +424,22 @@ mergedLayer0.config = {
],
reversed: true
},
+ strokeColorRange: {
+ name: 'ColorBrewer YlGn-6',
+ type: 'sequential',
+ category: 'ColorBrewer',
+ colors: [
+ '#006837',
+ '#31a354',
+ '#78c679',
+ '#addd8e',
+ '#d9f0a3',
+ '#ffffcc'
+ ],
+ reversed: true
+ },
radiusRange: [0, 50],
- 'hi-precision': false
+ strokeColor: [18, 147, 154]
}
};
@@ -477,7 +493,6 @@ mergedLayer1.config = {
percentile: [0, 96.54],
elevationPercentile: [0, 100],
elevationScale: 5,
- 'hi-precision': false,
colorAggregation: 'average',
sizeAggregation: 'average',
enable3d: false
diff --git a/test/fixtures/state-saved-v1-4.js b/test/fixtures/state-saved-v1-4.js
index a129674cf..279f25833 100644
--- a/test/fixtures/state-saved-v1-4.js
+++ b/test/fixtures/state-saved-v1-4.js
@@ -221,10 +221,13 @@ mergedLayer0.config = {
},
isVisible: true,
colorField: null,
+ colorScale: 'quantile',
colorDomain: [0, 1],
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
+ strokeColorDomain: [0, 1],
highlightColor: [252, 242, 26, 255],
isConfigActive: false,
- colorScale: 'quantile',
sizeField: null,
sizeDomain: [0, 1],
sizeScale: 'linear',
@@ -260,9 +263,23 @@ mergedLayer0.config = {
'#FFC300'
]
},
- radiusRange: [0, 50],
- 'hi-precision': false
- },
+ filled: true,
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ strokeColor: [23, 184, 190, 255],
+ radiusRange: [0, 50]
+ }
};
export const mergedLayers = [mergedLayer0];
diff --git a/test/fixtures/test-csv-data.js b/test/fixtures/test-csv-data.js
index 01d142e49..f81fbb5f0 100644
--- a/test/fixtures/test-csv-data.js
+++ b/test/fixtures/test-csv-data.js
@@ -776,7 +776,6 @@ export const updatedLayerV2 = {
],
numberOfLights: 2
},
- fp64: false,
fixedRadius: false
}
};
@@ -955,7 +954,6 @@ export const updatedLayerSimplifiedShape = {
],
numberOfLights: 2
},
- fp64: false,
fixedRadius: false
}
};
diff --git a/test/helpers/layer-utils.js b/test/helpers/layer-utils.js
index 3a99f1d21..fefdfeb4d 100644
--- a/test/helpers/layer-utils.js
+++ b/test/helpers/layer-utils.js
@@ -25,6 +25,7 @@ import {INITIAL_VIS_STATE} from 'reducers/vis-state-updaters';
import sinon from 'sinon';
import {console as Console} from 'global/window';
import {onWebGLInitialized} from 'utils/gl-utils';
+import {colorMaker, layerColors} from 'layers/base-layer';
// Initialize gl once
onWebGLInitialized(gl);
@@ -47,7 +48,6 @@ export function testFormatLayerData(t, layer, dataArgs) {
result = layer.formatLayerData(...dataArgs);
t.ok(result, 'has layer data');
t.ok(layer, 'has updated layer');
-
}, `format ${layer.type} layerData should not fail`);
return result;
@@ -80,11 +80,18 @@ export function testFormatLayerDataCases(t, LayerClass, testCases) {
// if provided updates
if (layer && tc.updates) {
- const applyUpdates = Array.isArray(tc.updates) ? tc.updates : [tc.updates];
+ const applyUpdates = Array.isArray(tc.updates)
+ ? tc.updates
+ : [tc.updates];
// apply 1 or multiple updates
applyUpdates.forEach(update => {
- const updated = testUpdateLayer(t, updatedLayer, update.method, update.args);
+ const updated = testUpdateLayer(
+ t,
+ updatedLayer,
+ update.method,
+ update.args
+ );
updatedLayer = updated.layer;
});
}
@@ -138,8 +145,32 @@ export function testInitializeDeckLayer(t, layerType, layers) {
);
// listen on console.error in editShader, fail the test if any error is logged
- t.deepEqual(spy.args, [], 'should not call console.error during layer initialization');
+ t.deepEqual(
+ spy.args,
+ [],
+ 'should not call console.error during layer initialization'
+ );
spy.restore();
return null;
}
+
+/**
+ * Predict which color maker value would be next, allow skip couple
+ * Should be used right before calling function to be tested
+ * @param {Number} skip
+ */
+export function getNextColorMakerValue(num = 1) {
+ const results = [];
+ const colorNow = colorMaker.next().value;
+ const index = layerColors.findIndex(c => c === colorNow);
+
+ for (let n = 0; n < num; n++) {
+ const next = index + n + 1;
+ const nextIndex =
+ next < layerColors.length ? next : next - layerColors.length;
+ results.push(layerColors[nextIndex]);
+ }
+
+ return results;
+}
diff --git a/test/helpers/mock-state.js b/test/helpers/mock-state.js
index a132032cb..cd5db35f1 100644
--- a/test/helpers/mock-state.js
+++ b/test/helpers/mock-state.js
@@ -94,10 +94,13 @@ function mockStateWithFileUpload() {
}
]);
- // replace layer id and color with controlled value for easy testing
+ // replace layer id and color with controlled value for testing
updatedState.visState.layers.forEach((l, i) => {
l.id = `${l.type}-${i}`;
l.config.color = [i, i, i];
+ if (l.config.visConfig.strokeColor) {
+ l.config.visConfig.strokeColor = [i + 10, i + 10, i + 10];
+ }
});
return Immutable.fromJS(updatedState);
@@ -150,7 +153,7 @@ function mockStateWithLayerDimensions(state) {
f => f.name === 'gps_data.types'
);
- const colorFieldpayload = [layer0, {colorField}, 'color'];
+ const colorFieldPayload = [layer0, {colorField}, 'color'];
const colorRangePayload = [
layer0,
@@ -181,7 +184,7 @@ function mockStateWithLayerDimensions(state) {
// change colorField
{
action: VisStateActions.layerVisualChannelConfigChange,
- payload: colorFieldpayload
+ payload: colorFieldPayload
},
// change colorRange
@@ -313,7 +316,6 @@ export const expectedSavedLayer0 = {
percentile: [0, 100],
elevationPercentile: [0, 100],
elevationScale: 5,
- 'hi-precision': false,
colorAggregation: 'count',
sizeAggregation: 'count',
enable3d: false
@@ -368,7 +370,6 @@ export const expectedLoadedLayer0 = {
percentile: [0, 100],
elevationPercentile: [0, 100],
elevationScale: 5,
- 'hi-precision': false,
colorAggregation: 'count',
sizeAggregation: 'count',
enable3d: false
@@ -415,6 +416,7 @@ export const expectedSavedLayer1 = {
fixedRadius: false,
opacity: 0.8,
outline: false,
+ filled: true,
thickness: 2,
colorRange: {
name: 'Uber Viz Sequential 2',
@@ -422,8 +424,14 @@ export const expectedSavedLayer1 = {
category: 'Uber',
colors: ['#E6FAFA', '#AAD7DA', '#68B4BB', '#00939C']
},
- radiusRange: [0, 50],
- 'hi-precision': false
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ strokeColor: null,
+ radiusRange: [0, 50]
}
},
visualChannels: {
@@ -433,7 +441,9 @@ export const expectedSavedLayer1 = {
},
colorScale: 'ordinal',
sizeField: null,
- sizeScale: 'linear'
+ sizeScale: 'linear',
+ strokeColorField: null,
+ strokeColorScale: 'quantile'
}
};
@@ -462,14 +472,23 @@ export const expectedLoadedLayer1 = {
category: 'Uber',
colors: ['#E6FAFA', '#AAD7DA', '#68B4BB', '#00939C']
},
- radiusRange: [0, 50],
- 'hi-precision': false
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ filled: true,
+ strokeColor: null,
+ radiusRange: [0, 50]
},
colorField: {
name: 'gps_data.types',
type: 'string'
},
colorScale: 'ordinal',
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
sizeField: null,
sizeScale: 'linear',
textLabel: {
@@ -512,14 +531,20 @@ export const expectedSavedLayer2 = {
'#FFC300'
]
},
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ strokeColor: [11, 11, 11],
radius: 10,
sizeRange: [0, 10],
radiusRange: [0, 50],
heightRange: [0, 500],
elevationScale: 5,
- 'hi-precision': false,
stroked: true,
- filled: false,
+ filled: true,
enable3d: false,
wireframe: false
},
@@ -534,6 +559,8 @@ export const expectedSavedLayer2 = {
visualChannels: {
colorField: null,
colorScale: 'quantile',
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
sizeField: null,
sizeScale: 'linear',
heightField: null,
@@ -570,19 +597,27 @@ export const expectedLoadedLayer2 = {
'#FFC300'
]
},
+ strokeColorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ strokeColor: [11, 11, 11],
radius: 10,
sizeRange: [0, 10],
radiusRange: [0, 50],
heightRange: [0, 500],
elevationScale: 5,
- 'hi-precision': false,
stroked: true,
- filled: false,
+ filled: true,
enable3d: false,
wireframe: false
},
colorField: null,
colorScale: 'quantile',
+ strokeColorField: null,
+ strokeColorScale: 'quantile',
sizeField: null,
sizeScale: 'linear',
heightField: null,
diff --git a/test/node/layer-tests/geojson-layer-specs.js b/test/node/layer-tests/geojson-layer-specs.js
index 7bc7214f9..ba50b4303 100644
--- a/test/node/layer-tests/geojson-layer-specs.js
+++ b/test/node/layer-tests/geojson-layer-specs.js
@@ -46,8 +46,8 @@ test('#GeojsonLayer -> constructor', t => {
t.end();
});
-test('#GeojsonLayer -> formatLayerData', async t => {
- const {rows} = await processCsvData(wktCsv);
+test('#GeojsonLayer -> formatLayerData', t => {
+ const {rows} = processCsvData(wktCsv);
const filteredIndex = [0, 2, 4];
const data = [rows[0], rows[2], rows[4]];
diff --git a/test/node/layer-tests/point-layer-specs.js b/test/node/layer-tests/point-layer-specs.js
index 9ddee2bbb..1a33ba507 100644
--- a/test/node/layer-tests/point-layer-specs.js
+++ b/test/node/layer-tests/point-layer-specs.js
@@ -93,6 +93,7 @@ test('#PointLayer -> formatLayerData', t => {
test: result => {
const {layerData, layer} = result;
const expectedLayerData = {
+ labelCharacterSet: [],
data: [
{
data: rows[0]
@@ -105,13 +106,15 @@ test('#PointLayer -> formatLayerData', t => {
}
],
getPosition: () => {},
- getColor: () => {},
- getRadius: () => {}
+ getFillColor: () => {},
+ getLineColor: () => {},
+ getRadius: () => {},
+ getText: () => {}
};
t.deepEqual(
- Object.keys(layerData),
- ['data', 'labelCharacterSet', 'getPosition', 'getColor', 'getRadius', 'getText'],
+ Object.keys(layerData).sort(),
+ Object.keys(expectedLayerData).sort(),
'layerData should have 6 keys'
);
t.deepEqual(
@@ -124,9 +127,9 @@ test('#PointLayer -> formatLayerData', t => {
'should have getPosition accessor as function'
);
t.deepEqual(
- layerData.getColor,
+ layerData.getFillColor,
layer.config.color,
- 'getColor should be a constant'
+ 'getFillColor should be a constant'
);
t.deepEqual(
layerData.getRadius,
@@ -191,8 +194,10 @@ test('#PointLayer -> formatLayerData', t => {
}
],
getPosition: () => {},
- getColor: () => {},
- getRadius: () => {}
+ getLineColor: () => {},
+ getFillColor: () => {},
+ getRadius: () => {},
+ getText: () => {}
};
t.deepEqual(
layer.config.colorDomain,
@@ -200,8 +205,8 @@ test('#PointLayer -> formatLayerData', t => {
'should update layer color domain'
);
t.deepEqual(
- Object.keys(layerData),
- ['data', 'labelCharacterSet', 'getPosition', 'getColor', 'getRadius', 'getText'],
+ Object.keys(layerData).sort,
+ Object.keys(expectedLayerData).sort,
'layerData should have 6 keys'
);
t.deepEqual(
@@ -210,10 +215,10 @@ test('#PointLayer -> formatLayerData', t => {
'should filter out nulls, format correct point layerData'
);
t.ok(
- ['getPosition', 'getColor', 'getRadius'].every(
+ ['getPosition', 'getFillColor', 'getRadius'].every(
k => typeof layerData[k] === 'function'
),
- 'should have getPosition, getColor, getRadius accessor as function'
+ 'should have getPosition, getFillColor, getRadius accessor as function'
);
t.deepEqual(
layerData.getPosition(layerData.data[0]),
@@ -226,9 +231,9 @@ test('#PointLayer -> formatLayerData', t => {
'should format correct grid layerData'
);
t.deepEqual(
- layerData.getColor(layerData.data[0]),
+ layerData.getFillColor(layerData.data[0]),
[90, 24, 70],
- 'getColor should return correct lat lng'
+ 'getColor should return correct color'
);
t.equal(
layerData.getRadius(layerData.data[0]),
diff --git a/test/node/reducers/vis-state-merger-test.js b/test/node/reducers/vis-state-merger-test.js
index 5543f5488..ef5190b9c 100644
--- a/test/node/reducers/vis-state-merger-test.js
+++ b/test/node/reducers/vis-state-merger-test.js
@@ -335,7 +335,7 @@ test('VisStateMerger.v1 -> mergeLayers -> toEmptyState', t => {
const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
// test parsed layers
- cmpLayers(t, mergedLayersV1, stateWData.layers, {id: true});
+ cmpLayers(t, mergedLayersV1, stateWData.layers, {id: true, color: true});
t.end();
});
@@ -379,6 +379,7 @@ test('VisStateMerger.v1.label -> mergeLayers -> toEmptyState', t => {
test('VisStateMerger.v1.split -> mergeLayers -> toEmptyState', t => {
const savedConfig = cloneDeep(savedStateV1Split);
const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);
+ const expectedConfig = mergedSplitMapsV1;
const oldState = InitialState.toJS();
const oldVisState = oldState.visState;
@@ -399,7 +400,7 @@ test('VisStateMerger.v1.split -> mergeLayers -> toEmptyState', t => {
} else if (key === 'splitMaps') {
t.deepEqual(
mergedState.splitMaps,
- mergedSplitMapsV1,
+ expectedConfig,
'Should merge splitMaps'
);
} else if (key === 'interactionToBeMerged') {
@@ -425,7 +426,7 @@ test('VisStateMerger.v1.split -> mergeLayers -> toEmptyState', t => {
// test split Maps
t.deepEqual(
stateWData.splitMaps,
- mergedSplitMapsV1,
+ expectedConfig,
'should merge splitMaps'
);
diff --git a/test/node/reducers/vis-state-test.js b/test/node/reducers/vis-state-test.js
index f20b241ea..0840a9d7a 100644
--- a/test/node/reducers/vis-state-test.js
+++ b/test/node/reducers/vis-state-test.js
@@ -52,6 +52,7 @@ import {
} from 'test/helpers/comparison-utils';
import {applyActions} from 'test/helpers/mock-state';
import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
+import {getNextColorMakerValue} from 'test/helpers/layer-utils';
const mockData = {
fields: [
@@ -1030,6 +1031,8 @@ test('#visStateReducer -> UPDATE_VIS_DATA.4.Geojson', t => {
}
];
+ const [layer1Color, layer1StrokeColor] = getNextColorMakerValue(2);
+
// receive data
const initialState = reducer(
initialVisState,
@@ -1063,14 +1066,15 @@ test('#visStateReducer -> UPDATE_VIS_DATA.4.Geojson', t => {
label: 'king milkshake',
dataId: 'milkshake',
columns: {geojson: {fieldIdx: 0, value: '_geojson'}},
- isVisible: true
+ isVisible: true,
+ color: layer1Color
});
+ expectedLayer.updateLayerVisConfig({stroked: true, filled: true, strokeColor: layer1StrokeColor});
expectedLayer.dataToFeature = dataToFeature;
expectedLayer.meta = {
bounds: geoBounds,
lightSettings: geoLghtSettings,
- fp64: false,
fixedRadius: false,
featureTypes: {
polygon: true
diff --git a/test/node/schemas/schema-conversion-test.js b/test/node/schemas/schema-conversion-test.js
index 28c99e71e..a2fffb940 100644
--- a/test/node/schemas/schema-conversion-test.js
+++ b/test/node/schemas/schema-conversion-test.js
@@ -35,7 +35,7 @@ import {
import {
savedConfigV0 as savedConfig2,
- parsecConfigV0 as parsedConfig2
+ parsedConfigV0 as parsedConfig2
} from 'test/fixtures/config_v0_geojson_point';
import {
diff --git a/test/node/utils/layer-utils-test.js b/test/node/utils/layer-utils-test.js
index 4547adc7b..d97b1c7fa 100644
--- a/test/node/utils/layer-utils-test.js
+++ b/test/node/utils/layer-utils-test.js
@@ -25,10 +25,17 @@ import {findPointFieldPairs} from 'utils/dataset-utils';
import {processCsvData} from 'processors/data-processor';
import {GEOJSON_FIELDS} from 'constants/default-settings';
import {KeplerGlLayers} from 'layers';
-const {PointLayer, ArcLayer, GeojsonLayer, GridLayer, LineLayer} = KeplerGlLayers;
+
+const {
+ PointLayer,
+ ArcLayer,
+ GeojsonLayer,
+ LineLayer
+} = KeplerGlLayers;
import {wktCsv} from 'test/fixtures/test-csv-data';
import {cmpLayers} from 'test/helpers/comparison-utils';
+import {getNextColorMakerValue} from 'test/helpers/layer-utils';
test('layerUtils -> findDefaultLayer.1', t => {
const inputFields = [
@@ -235,7 +242,10 @@ test('layerUtils -> findDefaultLayer.1', t => {
];
const fieldPairs = findPointFieldPairs(inputFields);
- const layers = findDefaultLayer({fields: inputFields, fieldPairs, id: dataId}, KeplerGlLayers);
+ const layers = findDefaultLayer(
+ {fields: inputFields, fieldPairs, id: dataId},
+ KeplerGlLayers
+ );
t.equal(layers.length, outputLayers.length, 'number of layers found');
@@ -245,7 +255,6 @@ test('layerUtils -> findDefaultLayer.1', t => {
});
test('layerUtils -> findDefaultLayer.2', t => {
-
const inputFields = [
// layer 1
{
@@ -260,27 +269,43 @@ test('layerUtils -> findDefaultLayer.2', t => {
id: dataId,
fields: inputFields,
fieldPairs,
- label: 'sf_zip_geo'
+ label: 'sf_zip_geo',
+ allData: [
+ [
+ {
+ type: 'Feature',
+ properties: {index: 0},
+ geometry: {type: 'Point', coordinates: []}
+ }
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {index: 1},
+ geometry: {type: 'Point', coordinates: []}
+ }
+ ]
+ ]
};
- const outputLayers = [
- new GeojsonLayer({
- label: 'sf_zip_geo',
- isVisible: true,
- dataId,
- columns: {
- geojson: {
- value: 'all_points',
- fieldIdx: 0
- }
+ const expected = new GeojsonLayer({
+ label: 'sf_zip_geo',
+ isVisible: true,
+ dataId,
+ columns: {
+ geojson: {
+ value: 'all_points',
+ fieldIdx: 0
}
- })
- ];
+ }
+ });
+
+ expected.updateLayerVisConfig({filled: true, stroked: false});
const layers = findDefaultLayer(dataset, KeplerGlLayers);
t.equal(layers.length, 1, 'number of layers found');
- cmpLayers(t, outputLayers[0], layers[0]);
+ cmpLayers(t, expected, layers[0]);
t.end();
});
@@ -324,7 +349,10 @@ test('layerUtils -> findDefaultLayer.3', t => {
];
const fieldPairs = findPointFieldPairs(inputFields);
- const layers = findDefaultLayer({fields: inputFields, fieldPairs, id: dataId}, KeplerGlLayers);
+ const layers = findDefaultLayer(
+ {fields: inputFields, fieldPairs, id: dataId},
+ KeplerGlLayers
+ );
t.equal(layers.length, 1, 'number of layers found');
layers.forEach((l, i) => cmpLayers(t, outputLayers[i], l));
@@ -333,7 +361,6 @@ test('layerUtils -> findDefaultLayer.3', t => {
});
test('layerUtils -> findDefaultLayer.4', t => {
-
// Since all defaults layers are scanned and they
// share field names or patterns. This set produces
// multiple layers.
@@ -448,7 +475,10 @@ test('layerUtils -> findDefaultLayer.4', t => {
];
const fieldPairs = findPointFieldPairs(inputFields);
- const layers = findDefaultLayer({fields: inputFields, fieldPairs, id: dataId}, KeplerGlLayers);
+ const layers = findDefaultLayer(
+ {fields: inputFields, fieldPairs, id: dataId},
+ KeplerGlLayers
+ );
t.equal(layers.length, outputLayers.length, 'number of layers found');
layers.forEach((l, i) => cmpLayers(t, outputLayers[i], l));
@@ -457,7 +487,6 @@ test('layerUtils -> findDefaultLayer.4', t => {
});
test('layerUtils -> findDefaultLayer.5', t => {
-
const inputFields = [
// layer 1
{
@@ -471,7 +500,10 @@ test('layerUtils -> findDefaultLayer.5', t => {
];
const fieldPairs = findPointFieldPairs(inputFields);
- const layers = findDefaultLayer({fields: inputFields, fieldPairs, id: 'yo'}, KeplerGlLayers);
+ const layers = findDefaultLayer(
+ {fields: inputFields, fieldPairs, id: 'yo'},
+ KeplerGlLayers
+ );
t.equal(layers.length, 0, 'number of layers found');
@@ -479,120 +511,167 @@ test('layerUtils -> findDefaultLayer.5', t => {
});
test('layerUtils -> findDefaultLayer:GeojsonLayer', t => {
- const fields = [{
- name: 'random',
- tableFieldIndex: 1
- }, {
- name: 'begintrip_lng',
- tableFieldIndex: 2
- }, {
- name: 'cool',
- tableFieldIndex: 3
- }, {
- name: 'dropoff_lng',
- tableFieldIndex: 4
- }, {
- name: GEOJSON_FIELDS.geojson[0],
- tableFieldIndex: 5
- }, {
- name: GEOJSON_FIELDS.geojson[1],
- tableFieldIndex: 6
- }];
-
- const geojsonLayers = findDefaultLayer({
- fields,
+ const fields = [
+ {
+ name: 'random',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'begintrip_lng',
+ tableFieldIndex: 2
+ },
+ {
+ name: 'cool',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'dropoff_lng',
+ tableFieldIndex: 4
+ },
+ {
+ name: GEOJSON_FIELDS.geojson[0],
+ tableFieldIndex: 5
+ },
+ {
+ name: GEOJSON_FIELDS.geojson[1],
+ tableFieldIndex: 6
+ }
+ ];
+ const expected1 = new GeojsonLayer({
+ label: 'what',
+ dataId: 'smoothie',
+ isVisible: true,
+ columns: {
+ geojson: {value: GEOJSON_FIELDS.geojson[0], fieldIdx: 4}
+ }
+ });
+ const expected2 = new GeojsonLayer({
label: 'what',
- id: 'smoothie',
- fieldPairs: []
- }, KeplerGlLayers);
+ dataId: 'smoothie',
+ isVisible: true,
+ columns: {
+ geojson: {value: GEOJSON_FIELDS.geojson[1], fieldIdx: 5}
+ }
+ });
- const expectedGeojsonLayers = [
- new GeojsonLayer({
- label: 'what',
- dataId: 'smoothie',
- isVisible: true,
- columns: {
- geojson: {value: GEOJSON_FIELDS.geojson[0], fieldIdx: 4}
- }
- }),
- new GeojsonLayer({
+ const [layer1Color, layer2Color, layer2Stroke] = getNextColorMakerValue(3);
+ expected1.updateLayerVisConfig({filled: true, stroked: false});
+ expected2.updateLayerVisConfig({filled: true, stroked: true, strokeColor: layer2Stroke});
+
+ const geojsonLayers = findDefaultLayer(
+ {
+ fields,
label: 'what',
- dataId: 'smoothie',
- isVisible: true,
- columns: {
- geojson: {value: GEOJSON_FIELDS.geojson[1], fieldIdx: 5}
- }
- })
- ];
+ id: 'smoothie',
+ fieldPairs: [],
+ allData: [
+ [
+ 0,
+ 1,
+ 2,
+ 3,
+ {
+ type: 'Feature',
+ properties: {index: 0},
+ geometry: {type: 'Point', coordinates: []}
+ },
+ {
+ type: 'Feature',
+ properties: {index: 0},
+ geometry: {type: 'Polygon', coordinates: []}
+ }
+ ]
+ ]
+ },
+ KeplerGlLayers
+ );
- cmpLayers(t, expectedGeojsonLayers, geojsonLayers);
+ cmpLayers(t, [expected1, expected2], geojsonLayers);
t.end();
});
test('layerUtils -> findDefaultLayer:GeojsonLayer.wkt', t => {
- const {fields} = processCsvData(wktCsv);
+ const {fields, rows} = processCsvData(wktCsv);
const dataId = '0dj3h';
const label = 'some geometry file';
- const geojsonLayers = findDefaultLayer({fields, id: dataId, label, fieldPairs: []}, KeplerGlLayers);
+ const expected1 = new GeojsonLayer({
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ isVisible: true,
+ columns: {
+ geojson: {value: 'simplified_shape_v2', fieldIdx: 1}
+ }
+ });
+ const expected2 = new GeojsonLayer({
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ isVisible: true,
+ columns: {
+ geojson: {value: 'simplified_shape', fieldIdx: 2}
+ }
+ });
+ const [layer1Color, strokeColor1, layer2Color, strokeColor2] = getNextColorMakerValue(4);
+ expected1.updateLayerVisConfig({filled: true, stroked: true, strokeColor: strokeColor1});
+ expected2.updateLayerVisConfig({filled: true, stroked: true, strokeColor: strokeColor2});
- const expectedLayers = [
- new GeojsonLayer({
- dataId: '0dj3h',
- label: 'some geometry file',
- isVisible: true,
- columns: {
- geojson: {value: 'simplified_shape_v2', fieldIdx: 1}
- }
- }),
- new GeojsonLayer({
- dataId: '0dj3h',
- label: 'some geometry file',
- isVisible: true,
- columns: {
- geojson: {value: 'simplified_shape', fieldIdx: 2}
- }
- })
- ];
+ const geojsonLayers = findDefaultLayer(
+ {fields, id: dataId, label, fieldPairs: [], allData: rows},
+ KeplerGlLayers
+ );
- cmpLayers(t, expectedLayers, geojsonLayers);
+ cmpLayers(t, [expected1, expected2], geojsonLayers);
t.end();
});
test('layerUtils -> findDefaultLayer:IconLayer', t => {
-
- const inputFields = [{
- name: 'begintrip_lat',
- tableFieldIndex: 1
- }, {
- name: 'begintrip_lng',
- tableFieldIndex: 2
- }, {
- name: 'dropoff_lat',
- tableFieldIndex: 3
- }, {
- name: 'dropoff_lng',
- tableFieldIndex: 4
- }];
+ const inputFields = [
+ {
+ name: 'begintrip_lat',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'begintrip_lng',
+ tableFieldIndex: 2
+ },
+ {
+ name: 'dropoff_lat',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'dropoff_lng',
+ tableFieldIndex: 4
+ }
+ ];
const fieldPairs = findPointFieldPairs(inputFields);
const eventIcon = [{name: 'event_icon', tableFieldIndex: 5}];
const nameIcon = [{name: 'name.icon', tableFieldIndex: 5}];
- t.equal(findDefaultLayer({
- fields: inputFields,
- fieldPairs,
- id: 'meow'}, KeplerGlLayers
- ).filter(l => l.type === 'icon').length, 0,
- 'should find no icon layer');
+ t.equal(
+ findDefaultLayer(
+ {
+ fields: inputFields,
+ fieldPairs,
+ id: 'meow',
+ allData: []
+ },
+ KeplerGlLayers
+ ).filter(l => l.type === 'icon').length,
+ 0,
+ 'should find no icon layer'
+ );
const fieldsWithIcon = [...inputFields, ...eventIcon];
const fieldPairsWIcon = findPointFieldPairs(fieldsWithIcon);
- let iconLayers = findDefaultLayer({
- fields: fieldsWithIcon,
- fieldPairs: fieldPairsWIcon,
- id: 'meow'}, KeplerGlLayers
+ let iconLayers = findDefaultLayer(
+ {
+ fields: fieldsWithIcon,
+ fieldPairs: fieldPairsWIcon,
+ id: 'meow'
+ },
+ KeplerGlLayers
).filter(l => l.type === 'icon');
t.equal(iconLayers.length, 1, 'should find 1 icon layer');
@@ -601,10 +680,13 @@ test('layerUtils -> findDefaultLayer:IconLayer', t => {
const fieldsWith2Icon = [...inputFields, ...nameIcon, ...eventIcon];
const fieldPairsW2Icon = findPointFieldPairs(fieldsWith2Icon);
- iconLayers = findDefaultLayer({
- fields: fieldsWith2Icon,
- fieldPairs: fieldPairsW2Icon,
- id: 'meow'}, KeplerGlLayers
+ iconLayers = findDefaultLayer(
+ {
+ fields: fieldsWith2Icon,
+ fieldPairs: fieldPairsW2Icon,
+ id: 'meow'
+ },
+ KeplerGlLayers
).filter(l => l.type === 'icon');
t.equal(iconLayers.length, 2, 'should find 2 icon layers');
diff --git a/yarn.lock b/yarn.lock
index 29c63dfd5..693fd7702 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -43,7 +43,7 @@
semver "^5.4.1"
source-map "^0.5.0"
-"@babel/generator@^7.0.0", "@babel/generator@^7.1.3", "@babel/generator@^7.4.4":
+"@babel/generator@^7.1.3", "@babel/generator@^7.4.0", "@babel/generator@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041"
dependencies:
@@ -237,7 +237,7 @@
version "7.1.3"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.3.tgz#2c92469bac2b7fbff810b67fca07bd138b48af77"
-"@babel/parser@^7.0.0", "@babel/parser@^7.3.3", "@babel/parser@^7.4.4":
+"@babel/parser@^7.0.0", "@babel/parser@^7.3.3", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6"
@@ -845,7 +845,7 @@
dependencies:
regenerator-runtime "^0.13.2"
-"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.4.4":
+"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
dependencies:
@@ -853,7 +853,7 @@
"@babel/parser" "^7.4.4"
"@babel/types" "^7.4.4"
-"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.4", "@babel/traverse@^7.2.3", "@babel/traverse@^7.4.4":
+"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.4", "@babel/traverse@^7.2.3", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8"
dependencies:
@@ -867,7 +867,7 @@
globals "^11.1.0"
lodash "^4.17.11"
-"@babel/types@^7.0.0", "@babel/types@^7.1.3", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4":
+"@babel/types@^7.0.0", "@babel/types@^7.1.3", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0"
dependencies:
@@ -875,7 +875,7 @@
lodash "^4.17.11"
to-fast-properties "^2.0.0"
-"@deck.gl/core@^6.3.0", "@deck.gl/core@^6.4.10":
+"@deck.gl/core@^6.4.10":
version "6.4.10"
resolved "https://registry.yarnpkg.com/@deck.gl/core/-/core-6.4.10.tgz#4941ef853275d25d8fc25c53a180826a4b5db46a"
dependencies:
@@ -887,14 +887,14 @@
seer "^0.2.4"
viewport-mercator-project "^6.1.0"
-"@deck.gl/[email protected]":
- version "6.3.0"
- resolved "https://registry.yarnpkg.com/@deck.gl/experimental-layers/-/experimental-layers-6.3.0.tgz#bafe9846144b7607f6982212ffafc7331570a8aa"
+"@deck.gl/[email protected]":
+ version "6.4.10"
+ resolved "https://registry.yarnpkg.com/@deck.gl/experimental-layers/-/experimental-layers-6.4.10.tgz#131a0fbd03511a3341598e5b94b40a7c74a3cc15"
dependencies:
- "@deck.gl/core" "^6.3.0"
- "@deck.gl/layers" "^6.3.0"
+ "@deck.gl/core" "^6.4.10"
+ "@deck.gl/layers" "^6.4.10"
-"@deck.gl/layers@^6.3.0", "@deck.gl/layers@^6.4.10":
+"@deck.gl/layers@^6.4.10":
version "6.4.10"
resolved "https://registry.yarnpkg.com/@deck.gl/layers/-/layers-6.4.10.tgz#b617207f89f479970c5650f478c1aad29b805def"
dependencies:
@@ -903,7 +903,7 @@
d3-hexbin "^0.2.1"
earcut "^2.0.6"
-"@deck.gl/react@^6.3.0", "@deck.gl/react@^6.4.10":
+"@deck.gl/react@^6.4.10":
version "6.4.10"
resolved "https://registry.yarnpkg.com/@deck.gl/react/-/react-6.4.10.tgz#33ba6183c70f0060986a03e40e3ffa6ce653e041"
dependencies:
@@ -1032,8 +1032,8 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
"@types/node@*":
- version "11.13.8"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.8.tgz#e5d71173c95533be9842b2c798978f095f912aab"
+ version "12.0.1"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.1.tgz#3dde31f8da274dfeb90e96abf55038fef46285f0"
"@webassemblyjs/[email protected]":
version "1.8.5"
@@ -1229,7 +1229,7 @@ acorn@^6.0.1, acorn@^6.0.2, acorn@^6.0.5, acorn@^6.0.7:
version "6.1.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
-airbnb-prop-types@^2.12.0:
+airbnb-prop-types@^2.13.2:
version "2.13.2"
resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc"
dependencies:
@@ -1462,9 +1462,10 @@ [email protected], assert-plus@^1.0.0:
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
assert@^1.1.1, assert@^1.4.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91"
+ version "1.5.0"
+ resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb"
dependencies:
+ object-assign "^4.1.1"
util "0.10.3"
assign-symbols@^1.0.0:
@@ -1542,13 +1543,13 @@ babel-generator@^6.18.0:
trim-right "^1.0.1"
babel-loader@^8.0.0:
- version "8.0.5"
- resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33"
+ version "8.0.6"
+ resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb"
dependencies:
find-cache-dir "^2.0.0"
loader-utils "^1.0.2"
mkdirp "^0.5.1"
- util.promisify "^1.0.0"
+ pify "^4.0.1"
babel-messages@^6.23.0:
version "6.23.0"
@@ -1557,12 +1558,12 @@ babel-messages@^6.23.0:
babel-runtime "^6.22.0"
babel-plugin-istanbul@^5.1.1:
- version "5.1.3"
- resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.3.tgz#202d20ffc96a821c68a3964412de75b9bdeb48c7"
+ version "5.1.4"
+ resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
dependencies:
find-up "^3.0.0"
- istanbul-lib-instrument "^3.2.0"
- test-exclude "^5.2.2"
+ istanbul-lib-instrument "^3.3.0"
+ test-exclude "^5.2.3"
babel-plugin-module-resolver@^3.0.0:
version "3.2.0"
@@ -1667,8 +1668,8 @@ babylon@^6.18.0:
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
bail@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.3.tgz#63cfb9ddbac829b02a3128cd53224be78e6c21a3"
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b"
balanced-match@^1.0.0:
version "1.0.0"
@@ -2098,8 +2099,8 @@ camelize@^1.0.0:
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
caniuse-lite@^1.0.30000963:
- version "1.0.30000963"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000963.tgz#5be481d5292f22aff5ee0db4a6c049b65b5798b1"
+ version "1.0.30000967"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz#a5039577806fccee80a04aaafb2c0890b1ee2f73"
capture-stack-trace@^1.0.0:
version "1.0.1"
@@ -2117,8 +2118,8 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
ccount@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.3.tgz#f1cec43f332e2ea5a569fd46f9f5bde4e6102aff"
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386"
chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
@@ -2139,20 +2140,20 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
supports-color "^5.3.0"
character-entities-html4@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.2.tgz#c44fdde3ce66b52e8d321d6c1bf46101f0150610"
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.3.tgz#5ce6e01618e47048ac22f34f7f39db5c6fd679ef"
character-entities-legacy@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz#7c6defb81648498222c9855309953d05f4d63a9c"
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.3.tgz#3c729991d9293da0ede6dddcaf1f2ce1009ee8b4"
character-entities@^1.0.0:
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.2.tgz#58c8f371c0774ef0ba9b2aca5f00d8f100e6e363"
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.3.tgz#bbed4a52fe7ef98cc713c6d80d9faa26916d54e6"
character-reference-invalid@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz#21e421ad3d84055952dab4a43a04e73cd425d3ed"
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.3.tgz#1647f4f726638d3ea4a750cf5d1975c1c7919a85"
chardet@^0.7.0:
version "0.7.0"
@@ -2268,8 +2269,8 @@ code-point-at@^1.0.0:
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
collapse-white-space@^1.0.0, collapse-white-space@^1.0.2:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.4.tgz#ce05cf49e54c3277ae573036a26851ba430a0091"
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.5.tgz#c2495b699ab1ed380d29a1091e01063e75dbbe3a"
collection-visit@^1.0.0:
version "1.0.0"
@@ -2302,8 +2303,8 @@ combine-source-map@^0.8.0, combine-source-map@~0.8.0:
source-map "~0.5.3"
combined-stream@^1.0.6, combined-stream@~1.0.6:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
+ version "1.0.8"
+ resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
dependencies:
delayed-stream "~1.0.0"
@@ -2565,8 +2566,8 @@ css-select@~1.2.0:
nth-check "~1.0.1"
css-to-react-native@^2.2.2:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.3.0.tgz#bf80d24ec4a08e430306ef429c0586e6ed5485f7"
+ version "2.3.1"
+ resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.3.1.tgz#cf0f61e0514846e2d4dc188b0886e29d8bef64a2"
dependencies:
camelize "^1.0.0"
css-color-keywords "^1.0.0"
@@ -2797,15 +2798,7 @@ decamelize@^1.1.1, decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
- version "6.3.0"
- resolved "https://registry.yarnpkg.com/deck.gl/-/deck.gl-6.3.0.tgz#23fdf5f3bc218ef32d67594c9e54ff38bc034a58"
- dependencies:
- "@deck.gl/core" "^6.3.0"
- "@deck.gl/layers" "^6.3.0"
- "@deck.gl/react" "^6.3.0"
-
-deck.gl@^6.3.0:
+deck.gl@^6.3.0, deck.gl@^6.4.10:
version "6.4.10"
resolved "https://registry.yarnpkg.com/deck.gl/-/deck.gl-6.4.10.tgz#0977502cede1ec0658ca75264c6297fcd16e6953"
dependencies:
@@ -2922,8 +2915,8 @@ destroy@~1.0.4:
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
detab@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.1.tgz#531f5e326620e2fd4f03264a905fb3bcc8af4df4"
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.2.tgz#074970d1a807b045d0258a4235df5928dd683561"
dependencies:
repeat-string "^1.5.4"
@@ -3189,8 +3182,8 @@ ejs@^2.6.1:
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.1.tgz#498ec0d495655abc6f23cd61868d926464071aa0"
electron-to-chromium@^1.3.127:
- version "1.3.127"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.127.tgz#9b34d3d63ee0f3747967205b953b25fe7feb0e10"
+ version "1.3.133"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.133.tgz#c47639c19b91feee3e22fad69f5556142007008c"
elliptic@^6.0.0:
version "6.4.1"
@@ -3245,10 +3238,10 @@ entities@^1.1.1, entities@~1.1.1:
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
enzyme-adapter-react-16@^1.10.0:
- version "1.12.1"
- resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.12.1.tgz#6a2d74c80559d35ac0a91ca162fa45f4186290cf"
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.13.0.tgz#530e4aed3c127d7a7c5c7f4f634ad9ba65f719f6"
dependencies:
- enzyme-adapter-utils "^1.11.0"
+ enzyme-adapter-utils "^1.12.0"
object.assign "^4.1.0"
object.values "^1.1.0"
prop-types "^15.7.2"
@@ -3256,11 +3249,11 @@ enzyme-adapter-react-16@^1.10.0:
react-test-renderer "^16.0.0-0"
semver "^5.6.0"
-enzyme-adapter-utils@^1.11.0, enzyme-adapter-utils@^1.5.0:
- version "1.11.0"
- resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.11.0.tgz#6ffff782b1b57dd46c72a845a91fc4103956a117"
+enzyme-adapter-utils@^1.12.0, enzyme-adapter-utils@^1.5.0:
+ version "1.12.0"
+ resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"
dependencies:
- airbnb-prop-types "^2.12.0"
+ airbnb-prop-types "^2.13.2"
function.prototype.name "^1.1.0"
object.assign "^4.1.0"
object.fromentries "^2.0.0"
@@ -3318,7 +3311,7 @@ error@^7.0.0:
string-template "~0.2.1"
xtend "~4.0.0"
-es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
+es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.0, es-abstract@^1.7.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
dependencies:
@@ -3386,8 +3379,8 @@ eslint-plugin-babel@^5.3.0:
eslint-rule-composer "^0.3.0"
eslint-plugin-prettier@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d"
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d"
dependencies:
prettier-linter-helpers "^1.0.0"
@@ -4170,8 +4163,8 @@ glob@^6.0.1:
path-is-absolute "^1.0.0"
glob@^7.0.0, glob@^7.0.3, glob@^7.0.6, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.2:
- version "7.1.3"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
+ version "7.1.4"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
@@ -4475,8 +4468,8 @@ html-to-react@^1.3.4:
ramda "^0.26"
html-void-elements@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.3.tgz#956707dbecd10cf658c92c5d27fee763aa6aa982"
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.4.tgz#95e8bb5ecd6b88766569c2645f2b5f1591db9ba5"
htmlescape@^1.1.0:
version "1.1.1"
@@ -4710,16 +4703,16 @@ is-accessor-descriptor@^1.0.0:
kind-of "^6.0.0"
is-alphabetical@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.2.tgz#1fa6e49213cb7885b75d15862fb3f3d96c884f41"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.3.tgz#eb04cc47219a8895d8450ace4715abff2258a1f8"
is-alphanumeric@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4"
is-alphanumerical@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz#1138e9ae5040158dc6ff76b820acd6b7a181fd40"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.3.tgz#57ae21c374277b3defe0274c640a5704b8f6657c"
dependencies:
is-alphabetical "^1.0.0"
is-decimal "^1.0.0"
@@ -4767,8 +4760,8 @@ is-date-object@^1.0.1:
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
is-decimal@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.2.tgz#894662d6a8709d307f3a276ca4339c8fa5dff0ff"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.3.tgz#381068759b9dc807d8c0dc0bfbae2b68e1da48b7"
is-descriptor@^0.1.0:
version "0.1.6"
@@ -4849,8 +4842,8 @@ is-glob@^4.0.0:
is-extglob "^2.1.1"
is-hexadecimal@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz#b6e710d7d07bb66b98cb8cece5c9b4921deeb835"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.3.tgz#e8a426a69b6d31470d3a33a47bb825cda02506ee"
is-negated-glob@^1.0.0:
version "1.0.0"
@@ -4985,16 +4978,16 @@ is-valid-glob@^1.0.0:
resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa"
is-whitespace-character@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.3.tgz#b3ad9546d916d7d3ffa78204bca0c26b56257fac"
is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
is-word-character@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.2.tgz#46a5dac3f2a1840898b91e576cd40d493f3ae553"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.3.tgz#264d15541cbad0ba833d3992c34e6b40873b08aa"
is-wsl@^1.1.0:
version "1.1.0"
@@ -5041,9 +5034,9 @@ istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0"
-istanbul-lib-coverage@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#927a354005d99dd43a24607bb8b33fd4e9aca1ad"
+istanbul-lib-coverage@^2.0.5:
+ version "2.0.5"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49"
istanbul-lib-hook@^1.1.0:
version "1.2.2"
@@ -5063,16 +5056,16 @@ istanbul-lib-instrument@^1.10.0:
istanbul-lib-coverage "^1.2.1"
semver "^5.3.0"
-istanbul-lib-instrument@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.2.0.tgz#c549208da8a793f6622257a2da83e0ea96ae6a93"
- dependencies:
- "@babel/generator" "^7.0.0"
- "@babel/parser" "^7.0.0"
- "@babel/template" "^7.0.0"
- "@babel/traverse" "^7.0.0"
- "@babel/types" "^7.0.0"
- istanbul-lib-coverage "^2.0.4"
+istanbul-lib-instrument@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630"
+ dependencies:
+ "@babel/generator" "^7.4.0"
+ "@babel/parser" "^7.4.3"
+ "@babel/template" "^7.4.0"
+ "@babel/traverse" "^7.4.3"
+ "@babel/types" "^7.4.0"
+ istanbul-lib-coverage "^2.0.5"
semver "^6.0.0"
istanbul-lib-report@^1.1.3:
@@ -5462,8 +5455,8 @@ lolex@^1.6.0:
resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6"
longest-streak@^2.0.1:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.2.tgz#2421b6ba939a443bb9ffebf596585a50b4c38e2e"
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.3.tgz#3de7a3f47ee18e9074ded8575b5c091f5d0a4105"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
@@ -5555,12 +5548,12 @@ mapbox-gl@~0.53.0:
vt-pbf "^3.1.1"
markdown-escapes@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.2.tgz#e639cbde7b99c841c0bacc8a07982873b46d2122"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.3.tgz#6155e10416efaafab665d466ce598216375195f5"
markdown-table@^1.1.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.2.tgz#c78db948fa879903a41bce522e3b96f801c63786"
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60"
math-random@^1.0.1:
version "1.0.4"
@@ -5992,8 +5985,8 @@ [email protected]:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
neo-async@^2.5.0, neo-async@^2.6.0:
- version "2.6.0"
- resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835"
+ version "2.6.1"
+ resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
nice-try@^1.0.4:
version "1.0.5"
@@ -6081,8 +6074,8 @@ node-pre-gyp@^0.12.0:
tar "^4"
node-releases@^1.1.17:
- version "1.1.17"
- resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.17.tgz#71ea4631f0a97d5cd4f65f7d04ecf9072eac711a"
+ version "1.1.19"
+ resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.19.tgz#c492d1e381fea0350b338b646c27867e88e91b3d"
dependencies:
semver "^5.3.0"
@@ -6278,13 +6271,6 @@ object.fromentries@^2.0.0:
function-bind "^1.1.1"
has "^1.0.1"
-object.getownpropertydescriptors@^2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
- dependencies:
- define-properties "^1.1.2"
- es-abstract "^1.5.1"
-
object.omit@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
@@ -6828,8 +6814,8 @@ prettier-linter-helpers@^1.0.0:
fast-diff "^1.1.2"
prettier@^1.7.0:
- version "1.17.0"
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008"
+ version "1.17.1"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db"
pretty-ms@^2.1.0:
version "2.1.0"
@@ -7070,8 +7056,8 @@ randomfill@^1.0.3:
safe-buffer "^5.1.0"
range-parser@^1.0.3, range-parser@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
version "2.3.3"
@@ -7444,8 +7430,8 @@ reflect.ownkeys@^0.2.0:
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
regenerate-unicode-properties@^8.0.2:
- version "8.0.2"
- resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz#7b38faa296252376d363558cfbda90c9ce709662"
+ version "8.1.0"
+ resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e"
dependencies:
regenerate "^1.4.0"
@@ -7816,8 +7802,8 @@ rw@~0.1.4:
resolved "https://registry.yarnpkg.com/rw/-/rw-0.1.4.tgz#4903cbd80248ae0ede685bf58fd236a7a9b29a3e"
rxjs@^6.4.0:
- version "6.5.1"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4"
+ version "6.5.2"
+ resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7"
dependencies:
tslib "^1.9.0"
@@ -8259,8 +8245,8 @@ stackframe@^0.3.1:
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4"
state-toggle@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.1.tgz#c3cb0974f40a6a0f8e905b96789eb41afa1cde3a"
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.2.tgz#75e93a61944116b4959d665c8db2d243631d6ddc"
static-extend@^0.1.1:
version "0.1.2"
@@ -8508,8 +8494,8 @@ syntax-error@^1.1.1:
acorn-node "^1.2.0"
table@^5.2.3:
- version "5.2.3"
- resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2"
+ version "5.3.3"
+ resolved "https://registry.yarnpkg.com/table/-/table-5.3.3.tgz#eae560c90437331b74200e011487a33442bd28b4"
dependencies:
ajv "^6.9.1"
lodash "^4.17.11"
@@ -8638,9 +8624,9 @@ test-exclude@^4.2.0:
read-pkg-up "^1.0.1"
require-main-filename "^1.0.1"
-test-exclude@^5.2.2:
- version "5.2.2"
- resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.2.tgz#7322f8ab037b0b93ad2aab35fe9068baf997a4c4"
+test-exclude@^5.2.3:
+ version "5.2.3"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0"
dependencies:
glob "^7.1.3"
minimatch "^3.0.4"
@@ -8813,16 +8799,16 @@ traverse@~0.6.6:
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"
trim-lines@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.1.tgz#da738ff58fa74817588455e30b11b85289f2a396"
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.2.tgz#c8adbdbdae21bb5c2766240a661f693afe23e59b"
trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
trim-trailing-lines@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz#e0ec0810fd3c3f1730516b45f49083caaf2774d9"
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.2.tgz#d2f1e153161152e9f02fabc670fb40bec2ea2e3a"
version "0.0.1"
@@ -8897,8 +8883,8 @@ uber-licence@^3.1.1:
update-notifier "^1.0.3"
uglify-js@^3.1.4:
- version "3.5.9"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.9.tgz#372fbf95939555b1f460b1777d33a67d4a994ac9"
+ version "3.5.12"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.12.tgz#6b759cabc08c3e91fe82323d6387019f0c5864cd"
dependencies:
commander "~2.20.0"
source-map "~0.6.1"
@@ -8922,8 +8908,8 @@ undeclared-identifiers@^1.1.2:
xtend "^4.0.1"
unherit@^1.0.4:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.1.tgz#132748da3e88eab767e08fabfbb89c5e9d28628c"
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.2.tgz#14f1f397253ee4ec95cec167762e77df83678449"
dependencies:
inherits "^2.0.1"
xtend "^4.0.1"
@@ -9107,13 +9093,6 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
-util.promisify@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
- dependencies:
- define-properties "^1.1.2"
- object.getownpropertydescriptors "^2.0.3"
-
version "0.10.3"
resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
@@ -9145,12 +9124,12 @@ uuid@^3.0.1, uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
v8-compile-cache@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c"
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe"
v8flags@^3.1.1:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.2.tgz#fc5cd0c227428181e6c29b2992e4f8f1da5e0c9f"
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8"
dependencies:
homedir-polyfill "^1.0.1"
@@ -9366,8 +9345,8 @@ webpack-bundle-analyzer@^3.3.2:
ws "^6.0.0"
webpack-cli@^3.2.1:
- version "3.3.1"
- resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.1.tgz#98b0499c7138ba9ece8898bd99c4f007db59909d"
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.2.tgz#aed2437b0db0a7faa2ad28484e166a5360014a91"
dependencies:
chalk "^2.4.1"
cross-spawn "^6.0.5"
@@ -9453,8 +9432,8 @@ webpack-stats-plugin@^0.2.1:
resolved "https://registry.yarnpkg.com/webpack-stats-plugin/-/webpack-stats-plugin-0.2.1.tgz#1f5bac13fc25d62cbb5fd0ff646757dc802b8595"
webpack@^4.29.0:
- version "4.30.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.30.0.tgz#aca76ef75630a22c49fcc235b39b4c57591d33a9"
+ version "4.31.0"
+ resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.31.0.tgz#ae201d45f0571336e42d1c2b5c8ab56c4d3b0c63"
dependencies:
"@webassemblyjs/ast" "1.8.5"
"@webassemblyjs/helper-module-context" "1.8.5"
@@ -9568,8 +9547,8 @@ wordwrap@~1.0.0:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
worker-farm@^1.5.2:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0"
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
dependencies:
errno "~0.1.7"