Skip to content

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

add tests

Shan Hebfc8fcb1e33e
diff --git a/test/browser.js b/test/browser.js
new file mode 100644
index 000000000..726cac302
--- /dev/null
+++ b/test/browser.js
@@ -0,0 +1,21 @@
+// Copyright (c) 2018 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 './browser/index.js';
diff --git a/test/browser/components/container-test.js b/test/browser/components/container-test.js
new file mode 100644
index 000000000..2c6aa14dd
--- /dev/null
+++ b/test/browser/components/container-test.js
@@ -0,0 +1,159 @@
+// Copyright (c) 2018 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 React from 'react';
+import test from 'tape';
+import {mount} from 'enzyme';
+import configureStore from 'redux-mock-store';
+import {Provider} from 'react-redux';
+import sinon from 'sinon';
+import {console as Console} from 'global/window';
+import rootReducer from 'reducers/root';
+import coreReducer from 'reducers/core';
+import {keplerGlInit} from 'actions/actions';
+
+import {combineReducers} from 'redux';
+
+const initialCoreState = coreReducer(undefined, keplerGlInit());
+
+const initialState = {
+ keplerGl: {}
+};
+const mockStore = configureStore();
+
+import Container, {errorMsg} from 'components/container';
+
+test('Components -> Container -> Mount', t => {
+ // mount with empty store
+ let store = mockStore({});
+ const spy = sinon.spy(Console, 'error');
+
+ // mount without id or a kepler.gl state
+ mount(
+ <Provider store={store}>
+ <Container />
+ </Provider>
+ );
+
+ t.ok(spy.calledOnce, 'should call console.error once');
+ t.equal(
+ spy.getCall(0).args[0],
+ errorMsg.noState,
+ 'should warn when cannot find kepler.gl state'
+ );
+
+ // mount with kepler.gl state
+ store = mockStore({keplerGl: {}});
+ let appReducer = combineReducers({
+ keplerGl: rootReducer
+ });
+ t.doesNotThrow(() => {
+ mount(
+ <Provider store={store}>
+ <Container />
+ </Provider>
+ );
+ }, 'Should not throw error');
+
+ let actions = store.getActions();
+
+ let expectedActions0 = {type: '@@kepler.gl/REGISTER_ENTRY', payload: 'map'};
+
+ t.deepEqual(
+ actions,
+ [expectedActions0],
+ 'should register entry and request map style'
+ );
+
+ // dispatch register action to reducer
+ let nextState = appReducer({}, expectedActions0);
+ let expectedState = {
+ keplerGl: {
+ map: initialCoreState
+ }
+ };
+
+ t.deepEqual(
+ nextState,
+ expectedState,
+ 'should register map to root reducer by default'
+ );
+
+ // mount with custom state
+ store = mockStore({smoothie: {}});
+ appReducer = combineReducers({
+ smoothie: rootReducer
+ });
+
+ let wrapper;
+ const testId = {
+ id: 'milkshake'
+ };
+ t.doesNotThrow(() => {
+ wrapper = mount(
+ <Provider store={store}>
+ <Container getState={s => s.smoothie} id={testId.id} />
+ </Provider>
+ );
+ }, 'Should not throw error when mount');
+
+ actions = store.getActions();
+
+ expectedActions0 = {type: '@@kepler.gl/REGISTER_ENTRY', payload: 'milkshake'};
+
+ t.deepEqual(
+ actions,
+ [expectedActions0],
+ 'should register entry and request map style'
+ );
+ actions.splice(0, 2);
+
+ nextState = appReducer({}, expectedActions0);
+ expectedState = {
+ smoothie: {
+ milkshake: initialCoreState
+ }
+ };
+ t.deepEqual(
+ nextState,
+ expectedState,
+ 'should register milkshake to root reducer'
+ );
+
+ // unmount
+ wrapper.unmount();
+ expectedActions0 = {type: '@@kepler.gl/DELETE_ENTRY', payload: 'milkshake'};
+
+ actions = store.getActions();
+ t.deepEqual(actions, [expectedActions0], 'should call unmount');
+
+ nextState = appReducer(nextState, expectedActions0);
+ expectedState = {
+ smoothie: {}
+ };
+ t.deepEqual(
+ nextState,
+ expectedState,
+ 'should delete milkshake from root reducer'
+ );
+
+ spy.restore();
+ t.end();
+});
diff --git a/test/browser/components/data-table-model-test.js b/test/browser/components/data-table-model-test.js
new file mode 100644
index 000000000..bd38af01c
--- /dev/null
+++ b/test/browser/components/data-table-model-test.js
@@ -0,0 +1,119 @@
+// Copyright (c) 2018 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 React from 'react';
+import test from 'tape';
+import {mount} from 'enzyme';
+
+import DataTableModalFactory, {DatasetTabs, DatasetModalTab} from
+ 'components/modals/data-table-modal';
+import ReactDataGrid from 'react-data-grid/dist/react-data-grid.min';
+
+const DataTableModal = DataTableModalFactory();
+import {testFields, testAllData} from 'test/fixtures/test-csv-data';
+
+/* eslint-disable max-statements */
+test('Components -> DataTableModal.render', t => {
+
+ t.doesNotThrow(() => {
+ mount(
+ <DataTableModal
+ width={400}
+ height={400}
+ />
+ );
+ }, 'Show not fail without data');
+
+ const wrapper = mount(
+ <DataTableModal
+ width={800}
+ height={400}
+ datasets={{
+ smoothie: {
+ id: 'smoothie',
+ allData: testAllData,
+ fields: testFields,
+ color: [113, 113, 113],
+ data: testAllData.slice(0, 10)
+ }
+ }}
+ dataId="smoothie"
+ />
+ );
+
+ t.equal(wrapper.find(DataTableModal).length, 1, 'should render DataTableModal data');
+ t.equal(wrapper.find(ReactDataGrid).length, 1, 'should render ReactDataGrid data');
+ t.equal(wrapper.find(DatasetTabs).length, 1, 'should render DatasetTabs');
+ t.equal(wrapper.find(DatasetModalTab).length, 1, 'should render 1 dataset-modal-catalog');
+ t.equal(wrapper.find('.react-grid-Row').length, 10, 'should render 10 rows');
+
+ const expectedRow0 = [
+ '2016-09-17 00:09:55',
+ '29.9900937',
+ '31.2590542',
+ 'driver_analytics',
+ '1472688000000',
+ 'false',
+ '1',
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:41:39+00:00',
+ '2016-10-01 09:41:39+00:00',
+ '2016-09-23'
+ ];
+
+ const expectedRow2 = [
+ '2016-09-17 00:11:56',
+ '29.9907261',
+ '31.2312742',
+ 'driver_analytics',
+ '1472688000000',
+ 'false',
+ '3',
+ '2016-09-23T00:00:00.000Z',
+ '',
+ '',
+ '2016-09-23'
+ ];
+ const row0 = wrapper.find('.react-grid-Row').at(0);
+ const row2 = wrapper.find('.react-grid-Row').at(2);
+
+ const cells = row0.find('.react-grid-Cell');
+ t.equal(cells.length, 11, 'should render 11 cells');
+
+ for (let c = 0; c < cells.length; c++) {
+ const cell = row0.find('.react-grid-Cell').at(c).find('span');
+ const cellText = cell.length > 1 ? cell.at(1).text() : cell.text();
+
+ t.equal(cellText, expectedRow0[c], `should render cell ${expectedRow0[c]} correctly`);
+ }
+
+ const cells2 = row2.find('.react-grid-Cell');
+ t.equal(cells2.length, 11, 'should render 11 cells');
+
+ for (let c = 0; c < cells2.length; c++) {
+ const cell = row2.find('.react-grid-Cell').at(c).find('span');
+ const cellText = cell.length > 1 ? cell.at(1).text() : cell.text();
+
+ t.equal(cellText, expectedRow2[c], `should render cell ${expectedRow2[c]} correctly`);
+ }
+
+ t.end();
+});
+/* eslint-enable max-statements */
diff --git a/test/browser/components/index.js b/test/browser/components/index.js
new file mode 100644
index 000000000..69c016b89
--- /dev/null
+++ b/test/browser/components/index.js
@@ -0,0 +1,28 @@
+// Copyright (c) 2018 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.
+
+// required by enzymev3
+const configure = require('enzyme').configure;
+const Adapter = require('enzyme-adapter-react-15.4');
+configure({adapter: new Adapter()});
+
+import './injector-test';
+import './container-test';
+import './data-table-model-test';
diff --git a/test/browser/components/injector-test.js b/test/browser/components/injector-test.js
new file mode 100644
index 000000000..51e587c69
--- /dev/null
+++ b/test/browser/components/injector-test.js
@@ -0,0 +1,205 @@
+// Copyright (c) 2018 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 React, {Component} from 'react';
+import test from 'tape';
+import {mount, shallow} from 'enzyme';
+import configureStore from 'redux-mock-store';
+import {Provider} from 'react-redux';
+import sinon from 'sinon';
+import {console as Console} from 'global/window';
+
+import {withState, injectComponents, PanelHeaderFactory} from 'components';
+import coreReducer from 'reducers/core';
+import {keplerGlInit} from 'actions/actions';
+import {errorMsg} from 'components/injector';
+import {visStateLens, uiStateLens, mapStateLens, mapStyleLens} from 'reducers';
+
+const mockStore = configureStore();
+const initialCoreState = coreReducer(undefined, keplerGlInit());
+
+test('Components -> injector -> injectComponents', t => {
+ const CustomHeader = () => <div className="my-test-header">smoothie</div>;
+ const myCustomHeaderFactory = () => CustomHeader;
+
+ const KeplerGl = injectComponents([
+ [PanelHeaderFactory, myCustomHeaderFactory]
+ ]);
+
+ // assume instance reducer is already mounted
+ const store = mockStore({
+ keplerGl: {
+ foo: initialCoreState
+ }
+ });
+
+ const wrapper = mount(
+ <Provider store={store}>
+ <KeplerGl id="foo" />
+ </Provider>
+ );
+
+ // test if custom header is rendered
+ t.ok(wrapper.find('.my-test-header').length, 'should render custome header');
+ t.end();
+});
+
+test('Components -> injector -> missing deps', t => {
+ const spy = sinon.spy(Console, 'error');
+
+ const myCutomNameFactory = () => () => <div>name</div>;
+ const myCustomHeaderFactory = Name => () => (
+ <div className="my-test-header-1">
+ <Name />smoothie
+ </div>
+ );
+ myCustomHeaderFactory.deps = [myCutomNameFactory];
+
+ const KeplerGl = injectComponents([
+ [PanelHeaderFactory, myCustomHeaderFactory]
+ ]);
+
+ // assume instance reducer is already mounted
+ const store = mockStore({
+ keplerGl: {
+ foo: initialCoreState
+ }
+ });
+
+ const wrapper = mount(
+ <Provider store={store}>
+ <KeplerGl id="foo" />
+ </Provider>
+ );
+
+ t.ok(spy.calledOnce, 'should call console.error once');
+ t.equal(
+ spy.getCall(0).args[0],
+ errorMsg.noDep(myCutomNameFactory, myCustomHeaderFactory),
+ 'should warn when missing dependencies'
+ );
+
+ // test if custom header is still rendered
+ t.ok(
+ wrapper.find('.my-test-header-1').length,
+ 'should still render custom header'
+ );
+
+ spy.restore();
+ t.end();
+});
+
+test('Components -> injector -> wrong factory type', t => {
+ const spy = sinon.spy(Console, 'error');
+ const myCustomHeaderFactory = () => () => (
+ <div className="my-test-header-2">
+ <Name />smoothie
+ </div>
+ );
+
+ const KeplerGl = injectComponents([
+ [undefined, myCustomHeaderFactory]
+ ]);
+
+ // assume instance reducer is already mounted
+ const store = mockStore({
+ keplerGl: {
+ foo: initialCoreState
+ }
+ });
+
+ const wrapper = mount(
+ <Provider store={store}>
+ <KeplerGl id="foo" />
+ </Provider>
+ );
+
+ t.ok(spy.calledOnce, 'should call console.error once');
+ t.equal(
+ spy.getCall(0).args[0],
+ errorMsg.notFunc,
+ 'should warn when cannot find kepler.gl state'
+ );
+
+ // test if custom header is rendered
+ t.ok(wrapper.find('.side-panel__panel-header').length, 'should render default header');
+
+ spy.restore();
+ t.end();
+});
+
+test('Components -> injector -> withState', t => {
+ const CustomHeader = ({visState}) => (
+ <div className="my-test-header-3">smoothie</div>
+ );
+ const myCustomHeaderFactory = () =>
+ withState(
+ [visStateLens, mapStateLens, uiStateLens, mapStyleLens]
+ )(CustomHeader);
+
+ const KeplerGl = injectComponents([
+ [PanelHeaderFactory, myCustomHeaderFactory]
+ ]);
+
+ // assume instance reducer is already mounted
+ const store = mockStore({
+ keplerGl: {
+ foo: initialCoreState
+ }
+ });
+
+ const wrapper = mount(
+ <Provider store={store}>
+ <KeplerGl id="foo" />
+ </Provider>
+ );
+
+ // test if custom header is rendered
+ t.ok(
+ wrapper
+ .find(CustomHeader)
+ .at(0)
+ .props().visState,
+ 'should add visState to props'
+ );
+ t.ok(
+ wrapper
+ .find(CustomHeader)
+ .at(0)
+ .props().mapState,
+ 'should add mapState to props'
+ );
+ t.ok(
+ wrapper
+ .find(CustomHeader)
+ .at(0)
+ .props().mapStyle,
+ 'should add mapStyle to props'
+ );
+ t.ok(
+ wrapper
+ .find(CustomHeader)
+ .at(0)
+ .props().uiState,
+ 'should add uiState to props'
+ );
+
+ t.end();
+});
diff --git a/test/browser/index.js b/test/browser/index.js
new file mode 100644
index 000000000..5ddc7089e
--- /dev/null
+++ b/test/browser/index.js
@@ -0,0 +1,22 @@
+// Copyright (c) 2018 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.
+
+// component tests
+import './components';
diff --git a/test/fixtures/config_v0_arc_cluster_point.js b/test/fixtures/config_v0_arc_cluster_point.js
new file mode 100644
index 000000000..573898ca4
--- /dev/null
+++ b/test/fixtures/config_v0_arc_cluster_point.js
@@ -0,0 +1,563 @@
+// Copyright (c) 2018 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.
+
+export const savedConfigV0 = {
+ version: 'v0',
+ config: {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: '5em',
+ dataId: 'something',
+ label: 'trip arc',
+ color: [18, 147, 154],
+ columns: {
+ lat0: {
+ value: 'begintrip_lat',
+ fieldIdx: 3
+ },
+ lng0: {
+ value: 'begintrip_lng',
+ fieldIdx: 4
+ },
+ lat1: {
+ value: 'dropoff_lat',
+ fieldIdx: 27
+ },
+ lng1: {
+ value: 'dropoff_lng',
+ fieldIdx: 28
+ }
+ },
+ isVisible: false,
+ isAggregated: false,
+ type: 'arc',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ opacity: 0.8,
+ targetColor: null,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ sizeRange: [0, 10],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: 'gtyf',
+ dataId: 'something',
+ label: 'begintrip cluster',
+ color: [241, 92, 23],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 3
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 4
+ }
+ },
+ isVisible: false,
+ isAggregated: true,
+ type: 'cluster',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ clusterRadius: 40,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [1, 40],
+ 'hi-precision': false
+ },
+ enable3d: false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average'
+ },
+ {
+ id: 'rj',
+ dataId: 'something',
+ label: 'begintrip',
+ color: [218, 112, 191],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 3
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 4
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'point',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: '9e7',
+ dataId: 'something',
+ label: 'dropoff',
+ color: [255, 153, 31],
+ columns: {
+ lat: {
+ value: 'dropoff_lat',
+ fieldIdx: 27
+ },
+ lng: {
+ value: 'dropoff_lng',
+ fieldIdx: 28
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ },
+ isVisible: false,
+ isAggregated: false,
+ type: 'point',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: 'ej4',
+ dataId: 'something',
+ label: 'request',
+ color: [130, 154, 227],
+ columns: {
+ lat: {
+ value: 'request_lat',
+ fieldIdx: 60
+ },
+ lng: {
+ value: 'request_lng',
+ fieldIdx: 61
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ },
+ isVisible: false,
+ isAggregated: false,
+ type: 'point',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ something: ['begintrip_timestamp_local', 'dropoff_timestamp_local']
+ }
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 37.785337133852245,
+ longitude: -122.31216420269313,
+ pitch: 0,
+ zoom: 10.007195441591573
+ }
+ }
+};
+
+export const parsedConfigV0 = {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: '5em',
+ type: 'arc',
+ config: {
+ dataId: 'something',
+ label: 'trip arc',
+ color: [18, 147, 154],
+ columns: {
+ lat0: 'begintrip_lat',
+ lng0: 'begintrip_lng',
+ lat1: 'dropoff_lat',
+ lng1: 'dropoff_lng'
+ },
+ isVisible: false,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ opacity: 0.8,
+ targetColor: null,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ sizeRange: [0, 10],
+ 'hi-precision': false
+ }
+ }
+ },
+ {
+ id: 'gtyf',
+ type: 'cluster',
+ config: {
+ dataId: 'something',
+ label: 'begintrip cluster',
+ color: [241, 92, 23],
+ columns: {
+ lat: 'begintrip_lat',
+ lng: 'begintrip_lng'
+ },
+ isVisible: false,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ clusterRadius: 40,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [1, 40],
+ 'hi-precision': false,
+ enable3d: false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average'
+ }
+ }
+ },
+ {
+ id: 'rj',
+ type: 'point',
+ config: {
+ dataId: 'something',
+ label: 'begintrip',
+ color: [218, 112, 191],
+ columns: {
+ lat: 'begintrip_lat',
+ lng: 'begintrip_lng',
+ altitude: null
+ },
+ isVisible: true,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ }
+ },
+ {
+ id: '9e7',
+ type: 'point',
+ config: {
+ dataId: 'something',
+ label: 'dropoff',
+ color: [255, 153, 31],
+ columns: {
+ lat: 'dropoff_lat',
+ lng: 'dropoff_lng',
+ altitude: null
+ },
+ isVisible: false,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ }
+ },
+ {
+ id: 'ej4',
+ type: 'point',
+ config: {
+ dataId: 'something',
+ label: 'request',
+ color: [130, 154, 227],
+ columns: {
+ lat: 'request_lat',
+ lng: 'request_lng',
+ altitude: null
+ },
+ isVisible: false,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ enabled: true,
+ fieldsToShow: {
+ something: ['begintrip_timestamp_local', 'dropoff_timestamp_local']
+ }
+ },
+ brush: {
+ enabled: false
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 37.785337133852245,
+ longitude: -122.31216420269313,
+ pitch: 0,
+ zoom: 10.007195441591573
+ }
+};
diff --git a/test/fixtures/config_v0_geojson_point.js b/test/fixtures/config_v0_geojson_point.js
new file mode 100644
index 000000000..259f57d1f
--- /dev/null
+++ b/test/fixtures/config_v0_geojson_point.js
@@ -0,0 +1,207 @@
+// Copyright (c) 2018 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.
+
+export const savedConfigV0 = {
+ version: 'v0',
+ config: {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: 'z2',
+ dataId: '9sayb4m9r',
+ label: 'addresses_no_r',
+ color: [174, 14, 127],
+ columns: {
+ geojson: {
+ value: '_geojson',
+ fieldIdx: 0
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'geojson',
+ colorField: {
+ name: 'addresses',
+ type: 'string'
+ },
+ colorScale: 'ordinal',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ colorRange: {
+ name: 'ColorBrewer Dark2-6',
+ type: 'qualitative',
+ category: 'ColorBrewer',
+ colors: [
+ '#1b9e77',
+ '#d95f02',
+ '#7570b3',
+ '#e7298a',
+ '#66a61e',
+ '#e6ab02'
+ ],
+ reversed: false
+ },
+ opacity: 0.8,
+ thickness: 2,
+ radius: 15.8,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ elevationRange: [0, 500],
+ elevationScale: 5,
+ stroked: false,
+ filled: true,
+ extruded: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ '9sayb4m9r': ['fillColor', 'hi-precision', 'addresses', 'id']
+ }
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 39.98437808125723,
+ longitude: -105.15546105385808,
+ pitch: 0,
+ zoom: 16.060632707350504
+ }
+ }
+};
+
+export const parsecConfigV0 = {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: 'z2',
+ type: 'geojson',
+ config: {
+ dataId: '9sayb4m9r',
+ label: 'addresses_no_r',
+ color: [174, 14, 127],
+ columns: {
+ geojson: '_geojson'
+ },
+ isVisible: true,
+ colorField: {
+ name: 'addresses',
+ type: 'string'
+ },
+ colorScale: 'ordinal',
+ sizeField: null,
+ visConfig: {
+ colorRange: {
+ name: 'ColorBrewer Dark2-6',
+ type: 'qualitative',
+ category: 'ColorBrewer',
+ colors: [
+ '#1b9e77',
+ '#d95f02',
+ '#7570b3',
+ '#e7298a',
+ '#66a61e',
+ '#e6ab02'
+ ],
+ reversed: false
+ },
+ opacity: 0.8,
+ thickness: 2,
+ radius: 15.8,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ heightRange: [0, 500],
+ elevationScale: 5,
+ stroked: false,
+ filled: true,
+ enable3d: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ enabled: true,
+ fieldsToShow: {
+ '9sayb4m9r': ['fillColor', 'hi-precision', 'addresses', 'id']
+ }
+ },
+ brush: {
+ enabled: false
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 39.98437808125723,
+ longitude: -105.15546105385808,
+ pitch: 0,
+ zoom: 16.060632707350504
+ }
+};
diff --git a/test/fixtures/config_v0_geojson_poly_fill_ele.js b/test/fixtures/config_v0_geojson_poly_fill_ele.js
new file mode 100644
index 000000000..60c9b5fac
--- /dev/null
+++ b/test/fixtures/config_v0_geojson_poly_fill_ele.js
@@ -0,0 +1,213 @@
+// Copyright (c) 2018 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.
+
+export const savedConfigV0 = {
+ config: {
+ mapState: {
+ bearing: 24,
+ dragRotate: true,
+ latitude: 37.76155771615539,
+ longitude: -122.47016491117604,
+ pitch: 50,
+ zoom: 11.821729469300175
+ },
+ mapStyle: {
+ buildingLayer: {
+ color: [32, 32, 37],
+ isVisible: false,
+ opacity: 0.7
+ },
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ border: false,
+ building: true,
+ label: true,
+ land: true,
+ places: true,
+ road: true,
+ water: true
+ }
+ },
+ visState: {
+ filters: [],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ c0pd4bocg: ['ZIP_CODE', 'ID']
+ }
+ }
+ },
+ layerBlending: 'normal',
+ layers: [
+ {
+ color: [18, 147, 154, 255],
+ colorField: {
+ name: 'ZIP_CODE',
+ type: 'integer'
+ },
+ colorScale: 'quantize',
+ columns: {
+ geojson: {
+ fieldIdx: 0,
+ value: '_geojson'
+ }
+ },
+ dataId: 'c0pd4bocg',
+ id: '7oe',
+ isAggregated: false,
+ isVisible: true,
+ label: 'sf.zip.geo',
+ sizeField: {
+ name: 'ID',
+ type: 'integer'
+ },
+ sizeScale: 'linear',
+ type: 'geojson',
+ visConfig: {
+ colorRange: {
+ category: 'ColorBrewer',
+ colors: [
+ '#ffffcc',
+ '#d9f0a3',
+ '#addd8e',
+ '#78c679',
+ '#31a354',
+ '#006837'
+ ],
+ name: 'ColorBrewer YlGn-6',
+ reversed: false,
+ type: 'sequential'
+ },
+ elevationRange: [0, 500],
+ elevationScale: 5,
+ extruded: true,
+ filled: true,
+ 'hi-precision': false,
+ opacity: 0.8,
+ radius: 10,
+ radiusRange: [0, 50],
+ sizeRange: [0, 10],
+ stroked: false,
+ thickness: 2,
+ wireframe: false
+ }
+ }
+ ]
+ }
+ },
+ version: 'v0'
+};
+
+export const parsedConfigV0 = {
+ mapState: {
+ bearing: 24,
+ dragRotate: true,
+ latitude: 37.76155771615539,
+ longitude: -122.47016491117604,
+ pitch: 50,
+ zoom: 11.821729469300175
+ },
+ mapStyle: {
+ buildingLayer: {
+ color: [32, 32, 37],
+ isVisible: false,
+ opacity: 0.7
+ },
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ border: false,
+ building: true,
+ label: true,
+ land: true,
+ places: true,
+ road: true,
+ water: true
+ }
+ },
+ visState: {
+ filters: [],
+ interactionConfig: {
+ tooltip: {
+ enabled: true,
+ fieldsToShow: {
+ c0pd4bocg: ['ZIP_CODE', 'ID']
+ }
+ },
+ brush: {
+ enabled: false
+ }
+ },
+ layerBlending: 'normal',
+ layers: [
+ {
+ id: '7oe',
+ type: 'geojson',
+ config: {
+ color: [18, 147, 154, 255],
+ colorField: {
+ name: 'ZIP_CODE',
+ type: 'integer'
+ },
+ colorScale: 'quantize',
+ columns: {
+ geojson: '_geojson'
+ },
+ dataId: 'c0pd4bocg',
+ isVisible: true,
+ label: 'sf.zip.geo',
+ heightField: {
+ name: 'ID',
+ type: 'integer'
+ },
+ visConfig: {
+ colorRange: {
+ category: 'ColorBrewer',
+ colors: [
+ '#ffffcc',
+ '#d9f0a3',
+ '#addd8e',
+ '#78c679',
+ '#31a354',
+ '#006837'
+ ],
+ name: 'ColorBrewer YlGn-6',
+ reversed: false,
+ type: 'sequential'
+ },
+ heightRange: [0, 500],
+ elevationScale: 5,
+ enable3d: true,
+ filled: true,
+ 'hi-precision': false,
+ opacity: 0.8,
+ radius: 10,
+ radiusRange: [0, 50],
+ sizeRange: [0, 10],
+ stroked: false,
+ thickness: 2,
+ wireframe: false
+ }
+ }
+ }
+ ]
+ }
+};
diff --git a/test/fixtures/config_v0_geojson_polygon.js b/test/fixtures/config_v0_geojson_polygon.js
new file mode 100644
index 000000000..adb2427ce
--- /dev/null
+++ b/test/fixtures/config_v0_geojson_polygon.js
@@ -0,0 +1,303 @@
+// Copyright (c) 2018 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.
+
+export const savedConfigV0 = {
+ version: 'v0',
+ config: {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: 'mml',
+ dataId: 'pjcln7ts',
+ label: 'geojson_as_string',
+ color: [221, 178, 124, 255],
+ columns: {
+ geojson: {
+ value: 'simplified_shape',
+ fieldIdx: 4
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'geojson',
+ colorField: {
+ name: 'c_riders',
+ type: 'integer'
+ },
+ colorScale: 'quantile',
+ sizeField: {
+ name: 'd_population',
+ type: 'integer'
+ },
+ sizeScale: 'linear',
+ visConfig: {
+ colorRange: {
+ 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,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ elevationRange: [0, 500],
+ elevationScale: 34,
+ stroked: false,
+ filled: true,
+ extruded: true,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ },
+ {
+ id: '2oc',
+ dataId: 'pjcln7ts',
+ label: 'new layer',
+ color: [136, 87, 44, 255],
+ columns: {
+ geojson: {
+ value: 'simplified_shape_v2',
+ fieldIdx: 3
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'geojson',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: {
+ name: 'c_avg_trips_per_rider',
+ type: 'real'
+ },
+ sizeScale: 'linear',
+ visConfig: {
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ opacity: 0.8,
+ thickness: 8,
+ radius: 10,
+ sizeRange: [0, 36.6],
+ radiusRange: [0, 50],
+ elevationRange: [0, 500],
+ elevationScale: 5,
+ stroked: true,
+ filled: false,
+ extruded: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ ],
+ interactionConfig: {},
+ layerBlending: 'additive'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: -23.571428571428555,
+ dragRotate: true,
+ latitude: 40.19134928087266,
+ longitude: -74.70082543743959,
+ pitch: 13.654118895255545,
+ zoom: 8.304174758743489
+ }
+ }
+};
+
+export const parsedConfigV0 = {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: 'mml',
+ type: 'geojson',
+ config: {
+ dataId: 'pjcln7ts',
+ label: 'geojson_as_string',
+ color: [221, 178, 124, 255],
+ columns: {
+ geojson: 'simplified_shape'
+ },
+ isVisible: true,
+ colorField: {
+ name: 'c_riders',
+ type: 'integer'
+ },
+ colorScale: 'quantile',
+ heightField: {
+ name: 'd_population',
+ type: 'integer'
+ },
+ visConfig: {
+ colorRange: {
+ 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,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ heightRange: [0, 500],
+ elevationScale: 34,
+ stroked: false,
+ filled: true,
+ enable3d: true,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ },
+ {
+ id: '2oc',
+ type: 'geojson',
+ config: {
+ dataId: 'pjcln7ts',
+ label: 'new layer',
+ color: [136, 87, 44, 255],
+ columns: {
+ geojson: 'simplified_shape_v2'
+ },
+ isVisible: true,
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: {
+ name: 'c_avg_trips_per_rider',
+ type: 'real'
+ },
+ visConfig: {
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ opacity: 0.8,
+ thickness: 8,
+ radius: 10,
+ sizeRange: [0, 36.6],
+ radiusRange: [0, 50],
+ heightRange: [0, 500],
+ elevationScale: 5,
+ stroked: true,
+ filled: false,
+ enable3d: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ enabled: false
+ },
+ brush: {
+ enabled: false
+ }
+ },
+ layerBlending: 'additive'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: -23.571428571428555,
+ dragRotate: true,
+ latitude: 40.19134928087266,
+ longitude: -74.70082543743959,
+ pitch: 13.654118895255545,
+ zoom: 8.304174758743489
+ }
+};
diff --git a/test/fixtures/geojson.js b/test/fixtures/geojson.js
new file mode 100644
index 000000000..f9c411f78
--- /dev/null
+++ b/test/fixtures/geojson.js
@@ -0,0 +1,325 @@
+// Copyright (c) 2018 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.
+
+export const geojsonData = {
+ type: 'FeatureCollection',
+ features: [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 1,
+ ZIP_CODE: 94107,
+ ID: 94107,
+ TRIPS: 11,
+ RATE: 'a'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.401159718585049, 37.782024266952142],
+ [-122.400374366843309, 37.782644515545172],
+ [-122.400019020063766, 37.782925153640136],
+ [-122.399891477967842, 37.783025880124256],
+ [-122.398930331092998, 37.783784933304034],
+ [-122.397811613142864, 37.784666586003652],
+ [-122.396705177550587, 37.785542130425938],
+ [-122.395895701657864, 37.784896929203114],
+ [-122.395160622349934, 37.78431101230386],
+ [-122.394398389309941, 37.783701667981575],
+ [-122.401159718585049, 37.782024266952142]
+ ]
+ ]
+ }
+ },
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 2,
+ ZIP_CODE: 94105,
+ ID: 94105,
+ TRIPS: 4,
+ RATE: 'b'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 3,
+ ZIP_CODE: 94109,
+ ID: 94109,
+ TRIPS: 20
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 4,
+ ZIP_CODE: 94111,
+ ID: 9411,
+ RATE: 'c'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ }
+ ]
+};
+
+export const fields = [
+ {
+ type: 'geojson',
+ name: '_geojson',
+ format: '',
+ tableFieldIndex: 1
+ },
+ {
+ type: 'integer',
+ name: 'OBJECTID',
+ format: '',
+ tableFieldIndex: 2
+ },
+ {
+ type: 'integer',
+ name: 'ZIP_CODE',
+ format: '',
+ tableFieldIndex: 3
+ },
+ {
+ type: 'integer',
+ name: 'ID',
+ format: '',
+ tableFieldIndex: 4
+ },
+ {
+ type: 'integer',
+ name: 'TRIPS',
+ format: '',
+ tableFieldIndex: 5
+ },
+ {
+ type: 'string',
+ name: 'RATE',
+ format: '',
+ tableFieldIndex: 6
+ }
+];
+
+export const rows = [
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 1,
+ ZIP_CODE: 94107,
+ ID: 94107,
+ TRIPS: 11,
+ RATE: 'a'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.401159718585049, 37.782024266952142],
+ [-122.400374366843309, 37.782644515545172],
+ [-122.400019020063766, 37.782925153640136],
+ [-122.399891477967842, 37.783025880124256],
+ [-122.398930331092998, 37.783784933304034],
+ [-122.397811613142864, 37.784666586003652],
+ [-122.396705177550587, 37.785542130425938],
+ [-122.395895701657864, 37.784896929203114],
+ [-122.395160622349934, 37.78431101230386],
+ [-122.394398389309941, 37.783701667981575],
+ [-122.401159718585049, 37.782024266952142]
+ ]
+ ]
+ }
+ },
+ 1,
+ 94107,
+ 94107,
+ 11,
+ 'a'
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 2,
+ ZIP_CODE: 94105,
+ ID: 94105,
+ TRIPS: 4,
+ RATE: 'b'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ 2,
+ 94105,
+ 94105,
+ 4,
+ 'b'
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 3,
+ ZIP_CODE: 94109,
+ ID: 94109,
+ TRIPS: 20
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ 3,
+ 94109,
+ 94109,
+ 20,
+ null
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 4,
+ ZIP_CODE: 94111,
+ ID: 9411,
+ RATE: 'c'
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ 4,
+ 94111,
+ 9411,
+ null,
+ 'c'
+ ]
+];
+
+export const geoBounds = [
+ -122.40115971858505,
+ 37.78202426695214,
+ -122.39166672864975,
+ 37.79427854456892
+];
+export const geoLightSettings = {
+ lightsPosition: [
+ -122.40115971858505,
+ 37.78202426695214,
+ 8000,
+ -122.39166672864975,
+ 37.79427854456892,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+};
diff --git a/test/fixtures/state-saved-v0.js b/test/fixtures/state-saved-v0.js
new file mode 100644
index 000000000..f0714d7ee
--- /dev/null
+++ b/test/fixtures/state-saved-v0.js
@@ -0,0 +1,1467 @@
+// Copyright (c) 2018 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 {KeplerGlLayers} from 'layers';
+const {PointLayer, ArcLayer, HexagonLayer, GeojsonLayer} = KeplerGlLayers;
+
+import {Messages, Crosshairs} from 'components/common/icons';
+
+export const savedStateV0 = {
+ config: {
+ version: 'v0',
+ config: {
+ visState: {
+ filters: [
+ {
+ dataId: '9h10t7fyb',
+ id: 'vxzfwyg2v',
+ name: 'song_name',
+ type: 'multiSelect',
+ value: ['3.68.4', '2.117.1', '2.103.2', '2.116.2'],
+ enlarged: false
+ },
+ {
+ dataId: '9h10t7fyb',
+ id: 'fo9tjm2unl',
+ name: 'timestamp_local',
+ type: 'timeRange',
+ value: [1453770124000, 1453770415000],
+ enlarged: true
+ },
+ {
+ dataId: '9h10t7fyb',
+ id: 'aesy96t5',
+ name: 'type_boolean',
+ type: 'select',
+ value: false,
+ enlarged: false
+ },
+ {
+ dataId: '9h10t7fyb',
+ id: 's1bhgjt1',
+ name: 'int_range',
+ type: 'range',
+ value: [78, 309],
+ enlarged: false
+ },
+ {
+ dataId: 'v79816te8',
+ id: '5nfmxjjzl',
+ name: 'ZIP_CODE',
+ type: 'range',
+ value: [94115.3, 94132],
+ histogram: [
+ {count: 1, x0: 94107, x1: 94107.2},
+ {count: 0, x0: 94107.2, x1: 94107.4},
+ {count: 0, x0: 94107.4, x1: 94107.6},
+ {count: 0, x0: 94107.6, x1: 94107.8},
+ {count: 0, x0: 94107.8, x1: 94108},
+ {count: 0, x0: 94108, x1: 94108.2},
+ {count: 0, x0: 94108.2, x1: 94108.4},
+ {count: 0, x0: 94108.4, x1: 94108.6},
+ {count: 0, x0: 94108.6, x1: 94108.8},
+ {count: 0, x0: 94108.8, x1: 94109},
+ {count: 0, x0: 94109, x1: 94109.2},
+ {count: 0, x0: 94109.2, x1: 94109.4},
+ {count: 0, x0: 94109.4, x1: 94109.6},
+ {count: 0, x0: 94109.6, x1: 94109.8},
+ {count: 0, x0: 94109.8, x1: 94110},
+ {count: 0, x0: 94110, x1: 94110.2},
+ {count: 0, x0: 94110.2, x1: 94110.4},
+ {count: 0, x0: 94110.4, x1: 94110.6},
+ {count: 0, x0: 94110.6, x1: 94110.8},
+ {count: 0, x0: 94110.8, x1: 94111},
+ {count: 0, x0: 94111, x1: 94111.2},
+ {count: 0, x0: 94111.2, x1: 94111.4},
+ {count: 0, x0: 94111.4, x1: 94111.6},
+ {count: 0, x0: 94111.6, x1: 94111.8},
+ {count: 0, x0: 94111.8, x1: 94112},
+ {count: 0, x0: 94112, x1: 94112.2},
+ {count: 0, x0: 94112.2, x1: 94112.4},
+ {count: 0, x0: 94112.4, x1: 94112.6},
+ {count: 0, x0: 94112.6, x1: 94112.8},
+ {count: 0, x0: 94112.8, x1: 94113},
+ {count: 0, x0: 94113, x1: 94113.2},
+ {count: 0, x0: 94113.2, x1: 94113.4},
+ {count: 0, x0: 94113.4, x1: 94113.6},
+ {count: 0, x0: 94113.6, x1: 94113.8},
+ {count: 0, x0: 94113.8, x1: 94114},
+ {count: 0, x0: 94114, x1: 94114.2},
+ {count: 0, x0: 94114.2, x1: 94114.4},
+ {count: 0, x0: 94114.4, x1: 94114.6},
+ {count: 0, x0: 94114.6, x1: 94114.8},
+ {count: 0, x0: 94114.8, x1: 94115},
+ {count: 0, x0: 94115, x1: 94115.2},
+ {count: 0, x0: 94115.2, x1: 94115.4},
+ {count: 0, x0: 94115.4, x1: 94115.6},
+ {count: 0, x0: 94115.6, x1: 94115.8},
+ {count: 0, x0: 94115.8, x1: 94116},
+ {count: 0, x0: 94116, x1: 94116.2},
+ {count: 0, x0: 94116.2, x1: 94116.4},
+ {count: 0, x0: 94116.4, x1: 94116.6},
+ {count: 0, x0: 94116.6, x1: 94116.8},
+ {count: 0, x0: 94116.8, x1: 94117},
+ {count: 0, x0: 94117, x1: 94117.2},
+ {count: 0, x0: 94117.2, x1: 94117.4},
+ {count: 0, x0: 94117.4, x1: 94117.6},
+ {count: 0, x0: 94117.6, x1: 94117.8},
+ {count: 0, x0: 94117.8, x1: 94118},
+ {count: 0, x0: 94118, x1: 94118.2},
+ {count: 0, x0: 94118.2, x1: 94118.4},
+ {count: 0, x0: 94118.4, x1: 94118.6},
+ {count: 0, x0: 94118.6, x1: 94118.8},
+ {count: 0, x0: 94118.8, x1: 94119},
+ {count: 0, x0: 94119, x1: 94119.2},
+ {count: 0, x0: 94119.2, x1: 94119.4},
+ {count: 0, x0: 94119.4, x1: 94119.6},
+ {count: 0, x0: 94119.6, x1: 94119.8},
+ {count: 0, x0: 94119.8, x1: 94120},
+ {count: 0, x0: 94120, x1: 94120.2},
+ {count: 0, x0: 94120.2, x1: 94120.4},
+ {count: 0, x0: 94120.4, x1: 94120.6},
+ {count: 0, x0: 94120.6, x1: 94120.8},
+ {count: 0, x0: 94120.8, x1: 94121},
+ {count: 0, x0: 94121, x1: 94121.2},
+ {count: 0, x0: 94121.2, x1: 94121.4},
+ {count: 0, x0: 94121.4, x1: 94121.6},
+ {count: 0, x0: 94121.6, x1: 94121.8},
+ {count: 0, x0: 94121.8, x1: 94122},
+ {count: 0, x0: 94122, x1: 94122.2},
+ {count: 0, x0: 94122.2, x1: 94122.4},
+ {count: 0, x0: 94122.4, x1: 94122.6},
+ {count: 0, x0: 94122.6, x1: 94122.8},
+ {count: 0, x0: 94122.8, x1: 94123},
+ {count: 0, x0: 94123, x1: 94123.2},
+ {count: 0, x0: 94123.2, x1: 94123.4},
+ {count: 0, x0: 94123.4, x1: 94123.6},
+ {count: 0, x0: 94123.6, x1: 94123.8},
+ {count: 0, x0: 94123.8, x1: 94124},
+ {count: 0, x0: 94124, x1: 94124.2},
+ {count: 0, x0: 94124.2, x1: 94124.4},
+ {count: 0, x0: 94124.4, x1: 94124.6},
+ {count: 0, x0: 94124.6, x1: 94124.8},
+ {count: 0, x0: 94124.8, x1: 94125},
+ {count: 0, x0: 94125, x1: 94125.2},
+ {count: 0, x0: 94125.2, x1: 94125.4},
+ {count: 0, x0: 94125.4, x1: 94125.6},
+ {count: 0, x0: 94125.6, x1: 94125.8},
+ {count: 0, x0: 94125.8, x1: 94126},
+ {count: 0, x0: 94126, x1: 94126.2},
+ {count: 0, x0: 94126.2, x1: 94126.4},
+ {count: 0, x0: 94126.4, x1: 94126.6},
+ {count: 0, x0: 94126.6, x1: 94126.8},
+ {count: 0, x0: 94126.8, x1: 94127},
+ {count: 0, x0: 94127, x1: 94127.2},
+ {count: 0, x0: 94127.2, x1: 94127.4},
+ {count: 0, x0: 94127.4, x1: 94127.6},
+ {count: 0, x0: 94127.6, x1: 94127.8},
+ {count: 0, x0: 94127.8, x1: 94128},
+ {count: 0, x0: 94128, x1: 94128.2},
+ {count: 0, x0: 94128.2, x1: 94128.4},
+ {count: 0, x0: 94128.4, x1: 94128.6},
+ {count: 0, x0: 94128.6, x1: 94128.8},
+ {count: 0, x0: 94128.8, x1: 94129},
+ {count: 1, x0: 94129, x1: 94129.2},
+ {count: 0, x0: 94129.2, x1: 94129.4},
+ {count: 0, x0: 94129.4, x1: 94129.6},
+ {count: 0, x0: 94129.6, x1: 94129.8},
+ {count: 0, x0: 94129.8, x1: 94130},
+ {count: 0, x0: 94130, x1: 94130.2},
+ {count: 0, x0: 94130.2, x1: 94130.4},
+ {count: 0, x0: 94130.4, x1: 94130.6},
+ {count: 0, x0: 94130.6, x1: 94130.8},
+ {count: 0, x0: 94130.8, x1: 94131},
+ {count: 0, x0: 94131, x1: 94131.2},
+ {count: 0, x0: 94131.2, x1: 94131.4},
+ {count: 0, x0: 94131.4, x1: 94131.6},
+ {count: 0, x0: 94131.6, x1: 94131.8},
+ {count: 0, x0: 94131.8, x1: 94132},
+ {count: 1, x0: 94132, x1: 94132}
+ ],
+ enlarged: false
+ }
+ ],
+ layers: [
+ {
+ id: '1eh',
+ dataId: '9h10t7fyb',
+ label: 'dropoff',
+ color: [76, 154, 78],
+ columns: {
+ lat: {
+ value: 'dropoff_lat',
+ fieldIdx: 6
+ },
+ lng: {
+ value: 'dropoff_lng',
+ fieldIdx: 7
+ }
+ },
+ isVisible: false,
+ isAggregated: false,
+ type: 'point',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 270.4,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [1, 100],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: 'tud',
+ dataId: '9h10t7fyb',
+ label: 'trip arc',
+ color: [18, 147, 154],
+ columns: {
+ lat0: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng0: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ },
+ lat1: {
+ value: 'dropoff_lat',
+ fieldIdx: 6
+ },
+ lng1: {
+ value: 'dropoff_lng',
+ fieldIdx: 7
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'arc',
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ opacity: 0.41,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ sizeRange: [0, 10],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: 'pwl',
+ dataId: '9h10t7fyb',
+ label: 'begintrip',
+ color: [218, 112, 191],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'point',
+ colorField: {
+ name: 'song_name',
+ type: 'string'
+ },
+ colorScale: 'ordinal',
+ sizeField: {
+ name: 'int_range',
+ type: 'integer'
+ },
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Sunrise',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#355C7D', '#6C5B7B', '#C06C84', '#F67280', '#F8B195'],
+ reversed: false
+ },
+ radiusRange: [1, 854.16],
+ 'hi-precision': false
+ }
+ },
+ {
+ id: 'p5',
+ dataId: '9h10t7fyb',
+ label: 'begintrip_hex',
+ color: [241, 92, 23],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ }
+ },
+ isVisible: true,
+ isAggregated: true,
+ type: 'hexagon',
+ colorField: {
+ name: 'int_range',
+ type: 'integer'
+ },
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ opacity: 0.8,
+ worldUnitSize: 0.5,
+ resolution: 8,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ coverage: 1,
+ sizeRange: [0, 50],
+ upperPercentile: 100,
+ elevationScale: 10
+ },
+ enable3d: true,
+ colorAggregation: 'maximum',
+ sizeAggregation: 'average'
+ },
+ {
+ id: 'vta',
+ dataId: 'v79816te8',
+ label: 'zip',
+ color: [255, 153, 31, 255],
+ columns: {
+ geojson: {
+ value: '_geojson',
+ fieldIdx: 0
+ }
+ },
+ isVisible: true,
+ isAggregated: false,
+ type: 'geojson',
+ colorField: {
+ name: 'ID',
+ type: 'integer'
+ },
+ colorScale: 'quantize',
+ sizeField: null,
+ sizeScale: 'linear',
+ visConfig: {
+ colorRange: {
+ 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
+ },
+ opacity: 0.8,
+ thickness: 2,
+ sizeRange: [0, 10],
+ stroked: false,
+ filled: true,
+ extruded: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ '9h10t7fyb': ['int_range', 'detail', 'type_boolean'],
+ v79816te8: ['ID', 'ZIP_CODE']
+ }
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'muted',
+ topLayerGroups: {
+ label: true
+ },
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: false,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 37.766239122943205,
+ longitude: -122.48468972813009,
+ pitch: 0,
+ zoom: 11.433560418908408
+ }
+ }
+ },
+ datasets: [
+ {
+ version: 'v0',
+ data: {
+ id: '9h10t7fyb',
+ label: 'small_dataset.csv',
+ color: [53, 92, 125],
+ allData: [
+ [
+ '3.68.4',
+ 38.4163786,
+ -121.7922809,
+ '2016-01-26T01:13:30.000Z',
+ -83.7,
+ 'blue',
+ 38.5590766,
+ -121.3686062,
+ '2016-01-26T02:42:13.000Z',
+ 694,
+ false
+ ],
+ [
+ '2.117.1',
+ 37.75159991,
+ -122.4761712,
+ '2016-01-26T01:04:39.000Z',
+ -6.79,
+ 'red',
+ 37.79887225,
+ -122.419046,
+ '2016-01-26T01:20:42.000Z',
+ 335,
+ false
+ ],
+ [
+ '2.117.1',
+ 37.8323825,
+ -122.2736475,
+ '2016-01-26T01:05:58.000Z',
+ -12,
+ 'red',
+ 37.8983639,
+ -122.2906993,
+ '2016-01-26T01:21:27.000Z',
+ 363,
+ false
+ ],
+ [
+ '2.116.2',
+ 37.77565501,
+ -122.4403984,
+ '2016-01-26T01:02:04.000Z',
+ -8.75,
+ 'red',
+ 37.78188901,
+ -122.4784396,
+ '2016-01-26T01:12:15.000Z',
+ 78,
+ false
+ ],
+ [
+ '2.103.2',
+ 37.79659543,
+ -122.4219072,
+ '2016-01-26T01:02:11.000Z',
+ -10.58,
+ 'red',
+ 37.78444762,
+ -122.470581,
+ '2016-01-26T01:18:12.000Z',
+ 192,
+ false
+ ],
+ [
+ '2.117.1',
+ 37.7980847,
+ -122.4050548,
+ '2016-01-26T01:06:35.000Z',
+ -5.23,
+ 'red',
+ 37.80089,
+ -122.4268962,
+ '2016-01-26T01:13:40.000Z',
+ 242,
+ false
+ ],
+ [
+ '2.117.1',
+ 37.79242329,
+ -122.3986584,
+ '2016-01-26T01:02:53.000Z',
+ -7.81,
+ 'red',
+ 37.7832852,
+ -122.4252576,
+ '2016-01-26T01:13:02.000Z',
+ 175,
+ false
+ ],
+ [
+ '2.107.3',
+ 37.79669585,
+ -122.4219416,
+ '2016-01-26T01:06:34.000Z',
+ -5.76,
+ 'red',
+ 37.79929617,
+ -122.4182267,
+ '2016-01-26T01:14:24.000Z',
+ 223,
+ false
+ ],
+ [
+ '2.117.1',
+ 37.6169644,
+ -122.384047,
+ '2016-01-26T01:09:00.000Z',
+ -17.77,
+ 'red',
+ 37.7838334,
+ -122.4329964,
+ '2016-01-26T01:30:14.000Z',
+ 298,
+ false
+ ]
+ ],
+ fields: [
+ {
+ name: 'song_name',
+ type: 'string'
+ },
+ {
+ name: 'begintrip_lat',
+ type: 'real'
+ },
+ {
+ name: 'begintrip_lng',
+ type: 'real'
+ },
+ {
+ name: 'timestamp_local',
+ type: 'timestamp'
+ },
+ {
+ name: 'counting',
+ type: 'real'
+ },
+ {
+ name: 'detail',
+ type: 'string'
+ },
+ {
+ name: 'dropoff_lat',
+ type: 'real'
+ },
+ {
+ name: 'dropoff_lng',
+ type: 'real'
+ },
+ {
+ name: 'dropoff_timestamp_local',
+ type: 'timestamp'
+ },
+ {
+ name: 'int_range',
+ type: 'integer'
+ },
+ {
+ name: 'type_boolean',
+ type: 'boolean'
+ }
+ ]
+ }
+ },
+ {
+ version: 'v0',
+ data: {
+ id: 'v79816te8',
+ label: 'zip_geo.json',
+ color: [192, 108, 132],
+ allData: [
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 1,
+ ZIP_CODE: 94107,
+ ID: 94107,
+ index: 0
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.40115971858505, 37.78202426695214],
+ [-122.40037436684331, 37.78264451554517],
+ [-122.40001902006377, 37.782925153640136],
+ [-122.39989147796784, 37.783025880124256],
+ [-122.40115971858505, 37.78202426695214]
+ ]
+ ]
+ }
+ },
+ 1,
+ 94107,
+ 94107
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 3,
+ ZIP_CODE: 94129,
+ ID: 94129,
+ index: 1
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.47099072114979, 37.787534455433345],
+ [-122.47229053418182, 37.78739591716227],
+ [-122.47240190249055, 37.787384046501884],
+ [-122.47254342327507, 37.787368961705944],
+ [-122.47099072114979, 37.787534455433345]
+ ]
+ ]
+ }
+ },
+ 3,
+ 94129,
+ 94129
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 25,
+ ZIP_CODE: 94132,
+ ID: 94132,
+ index: 2
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.50828762723958, 37.733266432915535],
+ [-122.50828361009823, 37.7333097667607],
+ [-122.50825842264912, 37.73333766599817],
+ [-122.50825465624375, 37.73339026610973],
+ [-122.50826138138635, 37.73344715152078],
+ [-122.50826063283236, 37.73354742941749],
+ [-122.50826859537165, 37.73358609492605],
+ [-122.50828762723958, 37.733266432915535]
+ ]
+ ]
+ }
+ },
+ 25,
+ 94132,
+ 94132
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 25,
+ ZIP_CODE: 94132,
+ ID: 94132,
+ index: 3
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.50828762723958, 37.733266432915535],
+ [-122.50828361009823, 37.7333097667607],
+ [-122.50825842264912, 37.73333766599817],
+ [-122.50825465624375, 37.73339026610973],
+ [-122.50826138138635, 37.73344715152078],
+ [-122.50826063283236, 37.73354742941749],
+ [-122.50826859537165, 37.73358609492605],
+ [-122.50828762723958, 37.733266432915535]
+ ]
+ ]
+ }
+ },
+ 25,
+ 94132,
+ 94132
+ ]
+ ],
+ fields: [
+ {
+ name: '_geojson',
+ type: 'geojson'
+ },
+ {
+ name: 'OBJECTID',
+ type: 'integer'
+ },
+ {
+ name: 'ZIP_CODE',
+ type: 'integer'
+ },
+ {
+ name: 'ID',
+ type: 'integer'
+ }
+ ]
+ }
+ }
+ ]
+};
+
+export const expectedInfo0 = {
+ id: '9h10t7fyb',
+ label: 'small_dataset.csv',
+ color: [53, 92, 125]
+};
+
+export const expectedFields0 = [
+ {
+ name: 'song_name',
+ type: 'string',
+ format: ''
+ },
+ {
+ name: 'begintrip_lat',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'begintrip_lng',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'timestamp_local',
+ type: 'timestamp',
+ format: 'YYYY-M-DTHH:mm:ss.SSSS'
+ },
+ {
+ name: 'counting',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'detail',
+ type: 'string',
+ format: ''
+ },
+ {
+ name: 'dropoff_lat',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'dropoff_lng',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'dropoff_timestamp_local',
+ type: 'timestamp',
+ format: 'YYYY-M-DTHH:mm:ss.SSSS'
+ },
+ {
+ name: 'int_range',
+ type: 'integer',
+ format: ''
+ },
+ {
+ name: 'type_boolean',
+ type: 'boolean',
+ format: ''
+ }
+];
+
+export const expectedInfo1 = {
+ id: 'v79816te8',
+ label: 'zip_geo.json',
+ color: [192, 108, 132]
+};
+
+export const expectedFields1 = [
+ {
+ name: '_geojson',
+ type: 'geojson',
+ format: ''
+ },
+ {
+ name: 'OBJECTID',
+ type: 'integer',
+ format: ''
+ },
+ {
+ name: 'ZIP_CODE',
+ type: 'integer',
+ format: ''
+ },
+ {
+ name: 'ID',
+ type: 'integer',
+ format: ''
+ }
+];
+
+export const mergedFilters = [
+ {
+ dataId: '9h10t7fyb',
+ freeze: true,
+ id: 'vxzfwyg2v',
+ enlarged: false,
+ isAnimating: false,
+ name: 'song_name',
+ type: 'multiSelect',
+ fieldIdx: 0,
+ domain: ['3.68.4', '2.117.1', '2.116.2', '2.103.2', '2.107.3'],
+ value: ['3.68.4', '2.117.1', '2.103.2', '2.116.2'],
+ fieldType: 'string',
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ speed: 1
+ },
+ {
+ dataId: '9h10t7fyb',
+ freeze: true,
+ id: 'fo9tjm2unl',
+ enlarged: true,
+ isAnimating: false,
+ name: 'timestamp_local',
+ type: 'timeRange',
+ fieldIdx: 3,
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ histogram: ['not tested'],
+ enlargedHistogram: ['not tested'],
+ domain: [1453770124000, 1453770810000],
+ value: [1453770124000, 1453770415000],
+ step: 1000,
+ speed: 1,
+ mappedValue: [
+ 1453770810000,
+ 1453770279000,
+ 1453770358000,
+ 1453770124000,
+ 1453770131000,
+ 1453770395000,
+ 1453770173000,
+ 1453770394000,
+ 1453770540000
+ ],
+ fieldType: 'timestamp'
+ },
+ {
+ dataId: '9h10t7fyb',
+ id: 'aesy96t5',
+ name: 'type_boolean',
+ type: 'select',
+ freeze: true,
+ value: false,
+ enlarged: false,
+ isAnimating: false,
+ fieldIdx: 10,
+ domain: [true, false],
+ fieldType: 'boolean',
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ speed: 1
+ },
+ {
+ dataId: '9h10t7fyb',
+ id: 's1bhgjt1',
+ name: 'int_range',
+ type: 'range',
+ value: [78, 309],
+ freeze: true,
+ enlarged: false,
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ histogram: ['not tested'],
+ enlargedHistogram: ['not tested'],
+ isAnimating: false,
+ fieldIdx: 9,
+ domain: [78, 694],
+ step: 1,
+ speed: 1,
+ fieldType: 'integer',
+ typeOptions: ['range']
+ },
+ {
+ dataId: 'v79816te8',
+ freeze: true,
+ id: '5nfmxjjzl',
+ enlarged: false,
+ isAnimating: false,
+ name: 'ZIP_CODE',
+ type: 'range',
+ fieldIdx: 2,
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ histogram: ['not tested'],
+ enlargedHistogram: ['not tested'],
+ domain: [94107, 94132],
+ value: [94115.3, 94132],
+ step: 0.1,
+ speed: 1,
+ fieldType: 'integer',
+ typeOptions: ['range']
+ }
+];
+
+const mergedLayer0 = new PointLayer({
+ id: '1eh',
+ dataId: '9h10t7fyb',
+ label: 'dropoff',
+ color: [76, 154, 78],
+ columns: {
+ lat: {
+ value: 'dropoff_lat',
+ fieldIdx: 6
+ },
+ lng: {
+ value: 'dropoff_lng',
+ fieldIdx: 7
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ },
+ isVisible: false
+});
+
+mergedLayer0.config = {
+ ...mergedLayer0.config,
+ colorField: null,
+ colorScale: 'quantile',
+ colorDomain: [0, 1],
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ visConfig: {
+ radius: 270.4,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ fixedRadius: false,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ radiusRange: [1, 100],
+ 'hi-precision': false
+ }
+};
+
+mergedLayer0.meta = {
+ bounds: [-122.4784396, 37.78188901, -121.3686062, 38.5590766],
+ lightSettings: {
+ lightsPosition: [
+ -122.4784396,
+ 37.78188901,
+ 8000,
+ -121.3686062,
+ 38.5590766,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ }
+};
+
+const mergedLayer1 = new ArcLayer({
+ id: 'tud',
+ dataId: '9h10t7fyb',
+ label: 'trip arc',
+ color: [18, 147, 154],
+ columns: {
+ lat0: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng0: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ },
+ lat1: {
+ value: 'dropoff_lat',
+ fieldIdx: 6
+ },
+ lng1: {
+ value: 'dropoff_lng',
+ fieldIdx: 7
+ }
+ },
+ isVisible: true
+});
+
+mergedLayer1.config = {
+ ...mergedLayer1.config,
+ colorField: null,
+ colorScale: 'quantile',
+ colorDomain: [0, 1],
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ visConfig: {
+ opacity: 0.41,
+ thickness: 2,
+ targetColor: null,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ sizeRange: [0, 10],
+ 'hi-precision': false
+ }
+};
+
+const mergedLayer2 = new PointLayer({
+ id: 'pwl'
+});
+
+mergedLayer2.config = {
+ dataId: '9h10t7fyb',
+ label: 'begintrip',
+ color: [218, 112, 191],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ },
+ highlightColor: [252, 242, 26],
+ isConfigActive: false,
+ isVisible: true,
+ colorField: {
+ name: 'song_name',
+ type: 'string',
+ id: 'song_name',
+ format: '',
+ tableFieldIndex: 1
+ },
+ colorScale: 'ordinal',
+ colorDomain: ['3.68.4', '2.117.1', '2.116.2', '2.103.2', '2.107.3'],
+ sizeField: {
+ name: 'int_range',
+ format: '',
+ id: 'int_range',
+ type: 'integer',
+ tableFieldIndex: 10
+ },
+ sizeDomain: [78, 694],
+ sizeScale: 'linear',
+ visConfig: {
+ radius: 10,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Sunrise',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#355C7D', '#6C5B7B', '#C06C84', '#F67280', '#F8B195'],
+ reversed: false
+ },
+ fixedRadius: false,
+ radiusRange: [1, 854.16],
+ 'hi-precision': false
+ }
+};
+
+mergedLayer2.meta = {
+ bounds: [-122.4761712, 37.6169644, -121.7922809, 38.4163786],
+ lightSettings: {
+ lightsPosition: [
+ -122.4761712,
+ 37.6169644,
+ 8000,
+ -121.7922809,
+ 38.4163786,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ }
+};
+
+const mergedLayer3 = new HexagonLayer({
+ id: 'p5'
+});
+
+mergedLayer3.config = {
+ dataId: '9h10t7fyb',
+ label: 'begintrip_hex',
+ color: [241, 92, 23],
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 2
+ }
+ },
+ isVisible: true,
+ colorField: {
+ name: 'int_range',
+ id: 'int_range',
+ type: 'integer',
+ format: '',
+ tableFieldIndex: 10
+ },
+ highlightColor: [252, 242, 26],
+ isConfigActive: false,
+ colorScale: 'quantile',
+ colorDomain: [0, 1],
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ visConfig: {
+ colorAggregation: 'maximum',
+ sizeAggregation: 'average',
+ enable3d: true,
+ opacity: 0.8,
+ worldUnitSize: 0.5,
+ resolution: 8,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: ['#5A1846', '#900C3F', '#C70039', '#E3611C', '#F1920E', '#FFC300']
+ },
+ coverage: 1,
+ sizeRange: [0, 50],
+ percentile: [0, 100],
+ elevationPercentile: [0, 100],
+ elevationScale: 10,
+ 'hi-precision': false
+ }
+};
+
+mergedLayer3.meta = {
+ bounds: [-122.4761712, 37.6169644, -121.7922809, 38.4163786],
+ lightSettings: {
+ lightsPosition: [
+ -122.4761712,
+ 37.6169644,
+ 8000,
+ -121.7922809,
+ 38.4163786,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ }
+};
+
+const mergedLayer4 = new GeojsonLayer({id: 'vta'});
+
+mergedLayer4.config = {
+ dataId: 'v79816te8',
+ label: 'zip',
+ color: [255, 153, 31, 255],
+ columns: {
+ geojson: {
+ value: '_geojson',
+ fieldIdx: 0
+ }
+ },
+ highlightColor: [252, 242, 26],
+ isConfigActive: false,
+ isVisible: true,
+ colorField: {
+ name: 'ID',
+ id: 'ID',
+ type: 'integer',
+ format: '',
+ tableFieldIndex: 4
+ },
+ colorScale: 'quantize',
+ colorDomain: [94107, 94132],
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ heightField: null,
+ heightDomain: [0, 1],
+ heightScale: 'linear',
+
+ // add radius visual channel
+ radiusField: null,
+ radiusDomain: [0, 1],
+ radiusScale: 'linear',
+ visConfig: {
+ colorRange: {
+ 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
+ },
+ opacity: 0.8,
+ thickness: 2,
+ radius: 10,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ heightRange: [0, 500],
+ elevationScale: 5,
+ stroked: false,
+ filled: true,
+ enable3d: false,
+ wireframe: false,
+ 'hi-precision': false
+ }
+};
+
+mergedLayer4.dataToFeature = {
+ 0: {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 1,
+ ZIP_CODE: 94107,
+ ID: 94107,
+ index: 0
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.40115971858505, 37.78202426695214],
+ [-122.40037436684331, 37.78264451554517],
+ [-122.40001902006377, 37.782925153640136],
+ [-122.39989147796784, 37.783025880124256],
+ [-122.40115971858505, 37.78202426695214]
+ ]
+ ]
+ }
+ },
+ 1: {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 3,
+ ZIP_CODE: 94129,
+ ID: 94129,
+ index: 1
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.47099072114979, 37.787534455433345],
+ [-122.47229053418182, 37.78739591716227],
+ [-122.47240190249055, 37.787384046501884],
+ [-122.47254342327507, 37.787368961705944],
+ [-122.47099072114979, 37.787534455433345]
+ ]
+ ]
+ }
+ },
+ 2: {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 25,
+ ZIP_CODE: 94132,
+ ID: 94132,
+ index: 2
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.50828762723958, 37.733266432915535],
+ [-122.50828361009823, 37.7333097667607],
+ [-122.50825842264912, 37.73333766599817],
+ [-122.50825465624375, 37.73339026610973],
+ [-122.50826138138635, 37.73344715152078],
+ [-122.50826063283236, 37.73354742941749],
+ [-122.50826859537165, 37.73358609492605],
+ [-122.50828762723958, 37.733266432915535]
+ ]
+ ]
+ }
+ }
+};
+
+mergedLayer4.meta = {
+ bounds: [
+ -122.50828762723958,
+ 37.733266432915535,
+ -122.39989147796784,
+ 37.787534455433345
+ ],
+ lightSettings: {
+ lightsPosition: [
+ -122.50828762723958,
+ 37.733266432915535,
+ 8000,
+ -122.39989147796784,
+ 37.787534455433345,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ },
+ featureTypes: {polygon: true},
+ fp64: false,
+ fixedRadius: false
+};
+
+export const mergedLayers = [
+ mergedLayer0,
+ mergedLayer1,
+ mergedLayer2,
+ mergedLayer3,
+ mergedLayer4
+];
+
+export const mergedInteractions = {
+ tooltip: {
+ id: 'tooltip',
+ enabled: true,
+ config: {
+ fieldsToShow: {
+ '9h10t7fyb': ['int_range', 'detail', 'type_boolean'],
+ v79816te8: ['ID', 'ZIP_CODE']
+ }
+ },
+ iconComponent: Messages
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ config: {size: 0.5},
+ iconComponent: Crosshairs
+ }
+};
diff --git a/test/fixtures/state-saved-v1-1.js b/test/fixtures/state-saved-v1-1.js
new file mode 100644
index 000000000..6203d219f
--- /dev/null
+++ b/test/fixtures/state-saved-v1-1.js
@@ -0,0 +1,2750 @@
+// Copyright (c) 2018 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 GeojsonLayer from 'layers/geojson-layer/geojson-layer';
+import {Messages, Crosshairs} from 'components/common/icons';
+
+export const savedStateV1 = {
+ datasets: [
+ {
+ version: 'v1',
+ data: {
+ id: 'a5ybmwl2d',
+ label: 'geojson_as_string_small.csv',
+ color: [53, 92, 125],
+ allData: [
+ [
+ 7014,
+ '{"type":"Polygon","coordinates":[[[-74.158491,40.835947],[-74.157914,40.83902],[-74.148473,40.834522],[-74.146471,40.836645],[-74.142598,40.833128],[-74.140177,40.832492],[-74.136732,40.836791],[-74.142706,40.840604],[-74.144667,40.84312],[-74.142936,40.844974],[-74.136054,40.84119],[-74.1356,40.841703],[-74.133665,40.840712],[-74.133028,40.841321],[-74.13274,40.839586],[-74.121853,40.834098],[-74.121087,40.831],[-74.124447,40.822169],[-74.130031,40.819962],[-74.149242,40.830537],[-74.148818,40.830916],[-74.150888,40.833143],[-74.151923,40.832074],[-74.158491,40.835947]]]}',
+ 'POLYGON ((-74.158491 40.835947, -74.157914 40.83902, -74.148473 40.834522, -74.146471 40.836645, -74.142598 40.833128, -74.140177 40.832492, -74.136732 40.836791, -74.142706 40.840604, -74.144667 40.84312, -74.142936 40.844974, -74.136054 40.84119, -74.1356 40.841703, -74.133665 40.840712, -74.133028 40.841321, -74.13274 40.839586, -74.121853 40.834098, -74.121087 40.831, -74.124447 40.822169, -74.130031 40.819962, -74.149242 40.830537, -74.148818 40.830916, -74.150888 40.833143, -74.151923 40.832074, -74.158491 40.835947))',
+ 1.420645391,
+ 2.32754338,
+ 'C_Medium_High',
+ 7014,
+ 0.719251337,
+ 1496,
+ 29.07437458,
+ 540.4402429,
+ 0.681149733,
+ 0.988636364,
+ 17.92821726,
+ 13.56510275,
+ 0.283
+ ],
+ [
+ 7016,
+ '{"type":"Polygon","coordinates":[[[-74.31687,40.656696],[-74.319449,40.658154],[-74.326141,40.656094],[-74.326593,40.657702],[-74.327693,40.662904],[-74.325199,40.667596],[-74.326093,40.668202],[-74.323615,40.670664],[-74.323228,40.672276],[-74.324391,40.67444],[-74.322371,40.677443],[-74.310392,40.678402],[-74.312993,40.674703],[-74.312093,40.674304],[-74.314552,40.673889],[-74.312827,40.673282],[-74.307888,40.674387],[-74.306792,40.672102],[-74.290976,40.673465],[-74.29185,40.671802],[-74.290689,40.670646],[-74.288727,40.670925],[-74.285991,40.667001],[-74.284275,40.658075],[-74.283511,40.658187],[-74.283369,40.657406],[-74.285786,40.655022],[-74.282693,40.653502],[-74.280691,40.645712],[-74.282183,40.644572],[-74.281687,40.643381],[-74.287325,40.639999],[-74.29577,40.638581],[-74.304907,40.633459],[-74.319678,40.641989],[-74.316485,40.645194],[-74.320663,40.647344],[-74.312298,40.654042],[-74.31687,40.656696]]]}',
+ 'POLYGON ((-74.31687 40.656696, -74.319449 40.658154, -74.326141 40.656094, -74.326593 40.657702, -74.327693 40.662904, -74.325199 40.667596, -74.326093 40.668202, -74.323615 40.670664, -74.323228 40.672276, -74.324391 40.67444, -74.322371 40.677443, -74.310392 40.678402, -74.312993 40.674703, -74.312093 40.674304, -74.314552 40.673889, -74.312827 40.673282, -74.307888 40.674387, -74.306792 40.672102, -74.290976 40.673465, -74.29185 40.671802, -74.290689 40.670646, -74.288727 40.670925, -74.285991 40.667001, -74.284275 40.658075, -74.283511 40.658187, -74.283369 40.657406, -74.285786 40.655022, -74.282693 40.653502, -74.280691 40.645712, -74.282183 40.644572, -74.281687 40.643381, -74.287325 40.639999, -74.29577 40.638581, -74.304907 40.633459, -74.319678 40.641989, -74.316485 40.645194, -74.320663 40.647344, -74.312298 40.654042, -74.31687 40.656696))',
+ 4.873351888,
+ 2.125379919,
+ 'C_Medium_High',
+ 7016,
+ 0.621409029,
+ 5848,
+ 27.60106201,
+ 528.1274711,
+ 0.678522572,
+ 0.998290014,
+ 19.05388261,
+ 12.47290995,
+ 0.256
+ ],
+ [
+ 7023,
+ '{"type":"Polygon","coordinates":[[[-74.387589,40.632238],[-74.401749,40.640393],[-74.386745,40.653316],[-74.374682,40.646553],[-74.372634,40.6468],[-74.371828,40.644885],[-74.374122,40.642352],[-74.37327,40.641829],[-74.375777,40.636295],[-74.37717,40.634842],[-74.382333,40.632417],[-74.384457,40.630453],[-74.387589,40.632238]]]}',
+ 'POLYGON ((-74.387589 40.632238, -74.401749 40.640393, -74.386745 40.653316, -74.374682 40.646553, -74.372634 40.6468, -74.371828 40.644885, -74.374122 40.642352, -74.37327 40.641829, -74.375777 40.636295, -74.37717 40.634842, -74.382333 40.632417, -74.384457 40.630453, -74.387589 40.632238))',
+ 1.352750157,
+ 1.975548142,
+ 'C_Medium_High',
+ 7023,
+ 0.580808081,
+ 1782,
+ 23.85239437,
+ 457.401356,
+ 0.673400673,
+ 0.996071829,
+ 18.41337089,
+ 11.17832315,
+ 0.241
+ ],
+ [
+ 7029,
+ '{"type":"Polygon","coordinates":[[[-74.165995,40.747969],[-74.164799,40.754718],[-74.155877,40.751722],[-74.154327,40.753966],[-74.145563,40.751975],[-74.144976,40.748161],[-74.14586,40.748031],[-74.140783,40.742694],[-74.139386,40.743314],[-74.137492,40.741398],[-74.142688,40.739301],[-74.145288,40.735701],[-74.147188,40.734401],[-74.155687,40.733501],[-74.15998,40.734485],[-74.162093,40.736109],[-74.163788,40.739201],[-74.165987,40.745199],[-74.165995,40.747969]]]}',
+ 'POLYGON ((-74.165995 40.747969, -74.164799 40.754718, -74.155877 40.751722, -74.154327 40.753966, -74.145563 40.751975, -74.144976 40.748161, -74.14586 40.748031, -74.140783 40.742694, -74.139386 40.743314, -74.137492 40.741398, -74.142688 40.739301, -74.145288 40.735701, -74.147188 40.734401, -74.155687 40.733501, -74.15998 40.734485, -74.162093 40.736109, -74.163788 40.739201, -74.165987 40.745199, -74.165995 40.747969))',
+ 1.446889939,
+ 2.701389429,
+ 'C_Medium_High',
+ 7029,
+ 0.814644137,
+ 7812,
+ 39.13775443,
+ 545.4891226,
+ 0.653481823,
+ 0.974782386,
+ 17.88895163,
+ 13.72188322,
+ 0.474
+ ],
+ [
+ 7045,
+ '{"type":"Polygon","coordinates":[[[-74.361356,40.939299],[-74.370498,40.926937],[-74.37404,40.927298],[-74.374216,40.921969],[-74.371645,40.92135],[-74.366428,40.918141],[-74.356676,40.915791],[-74.349697,40.916512],[-74.347883,40.91351],[-74.349593,40.91185],[-74.353183,40.910446],[-74.350384,40.908593],[-74.351179,40.907344],[-74.349633,40.906311],[-74.351883,40.90419],[-74.351747,40.902647],[-74.349573,40.903845],[-74.349271,40.902641],[-74.344758,40.902596],[-74.345589,40.900045],[-74.339928,40.899308],[-74.339554,40.895904],[-74.338613,40.895769],[-74.33944,40.893881],[-74.335743,40.893239],[-74.3389,40.892087],[-74.339694,40.889839],[-74.339646,40.888758],[-74.338118,40.887173],[-74.339575,40.883893],[-74.340271,40.879528],[-74.338075,40.879652],[-74.337614,40.878206],[-74.33507,40.877426],[-74.33531,40.876555],[-74.337696,40.87591],[-74.337808,40.875101],[-74.334259,40.873471],[-74.337288,40.872611],[-74.337418,40.87179],[-74.335937,40.870521],[-74.33806,40.870059],[-74.336714,40.869079],[-74.33765,40.868402],[-74.33768,40.866752],[-74.339806,40.866539],[-74.34018,40.868365],[-74.339545,40.874876],[-74.341626,40.877524],[-74.340485,40.882283],[-74.342874,40.885385],[-74.346198,40.887367],[-74.35009,40.887702],[-74.352792,40.886265],[-74.355507,40.888913],[-74.359916,40.886643],[-74.360096,40.887329],[-74.361792,40.887158],[-74.36087,40.883379],[-74.358905,40.883365],[-74.358888,40.880786],[-74.357662,40.880344],[-74.357789,40.879259],[-74.358676,40.879136],[-74.358091,40.878002],[-74.362636,40.877577],[-74.360456,40.872665],[-74.361843,40.87065],[-74.365778,40.871801],[-74.366753,40.874063],[-74.37127,40.876723],[-74.369921,40.878054],[-74.370331,40.879192],[-74.371574,40.879878],[-74.37187,40.878855],[-74.373453,40.878978],[-74.373051,40.880533],[-74.374017,40.882604],[-74.3772,40.886221],[-74.376296,40.888095],[-74.376308,40.890713],[-74.374745,40.893264],[-74.374127,40.898616],[-74.374902,40.901059],[-74.378188,40.901844],[-74.378509,40.900151],[-74.383293,40.899546],[-74.384277,40.902503],[-74.383622,40.902564],[-74.383706,40.903409],[-74.384609,40.903338],[-74.387159,40.909755],[-74.390966,40.909837],[-74.392542,40.913437],[-74.393499,40.91741],[-74.390968,40.919447],[-74.394272,40.926232],[-74.388795,40.930394],[-74.389726,40.930836],[-74.38883,40.931932],[-74.389795,40.931872],[-74.390036,40.932698],[-74.374793,40.940133],[-74.374929,40.941559],[-74.37655,40.942487],[-74.381516,40.942622],[-74.380974,40.946451],[-74.374397,40.954036],[-74.367575,40.955078],[-74.365156,40.954335],[-74.363667,40.955394],[-74.364141,40.954467],[-74.362181,40.951667],[-74.36267,40.944287],[-74.360703,40.940588],[-74.361356,40.939299]]]}',
+ 'POLYGON ((-74.361356 40.939299, -74.370498 40.926937, -74.37404 40.927298, -74.374216 40.921969, -74.371645 40.92135, -74.366428 40.918141, -74.356676 40.915791, -74.349697 40.916512, -74.347883 40.91351, -74.349593 40.91185, -74.353183 40.910446, -74.350384 40.908593, -74.351179 40.907344, -74.349633 40.906311, -74.351883 40.90419, -74.351747 40.902647, -74.349573 40.903845, -74.349271 40.902641, -74.344758 40.902596, -74.345589 40.900045, -74.339928 40.899308, -74.339554 40.895904, -74.338613 40.895769, -74.33944 40.893881, -74.335743 40.893239, -74.3389 40.892087, -74.339694 40.889839, -74.339646 40.888758, -74.338118 40.887173, -74.339575 40.883893, -74.340271 40.879528, -74.338075 40.879652, -74.337614 40.878206, -74.33507 40.877426, -74.33531 40.876555, -74.337696 40.87591, -74.337808 40.875101, -74.334259 40.873471, -74.337288 40.872611, -74.337418 40.87179, -74.335937 40.870521, -74.33806 40.870059, -74.336714 40.869079, -74.33765 40.868402, -74.33768 40.866752, -74.339806 40.866539, -74.34018 40.868365, -74.339545 40.874876, -74.341626 40.877524, -74.340485 40.882283, -74.342874 40.885385, -74.346198 40.887367, -74.35009 40.887702, -74.352792 40.886265, -74.355507 40.888913, -74.359916 40.886643, -74.360096 40.887329, -74.361792 40.887158, -74.36087 40.883379, -74.358905 40.883365, -74.358888 40.880786, -74.357662 40.880344, -74.357789 40.879259, -74.358676 40.879136, -74.358091 40.878002, -74.362636 40.877577, -74.360456 40.872665, -74.361843 40.87065, -74.365778 40.871801, -74.366753 40.874063, -74.37127 40.876723, -74.369921 40.878054, -74.370331 40.879192, -74.371574 40.879878, -74.37187 40.878855, -74.373453 40.878978, -74.373051 40.880533, -74.374017 40.882604, -74.3772 40.886221, -74.376296 40.888095, -74.376308 40.890713, -74.374745 40.893264, -74.374127 40.898616, -74.374902 40.901059, -74.378188 40.901844, -74.378509 40.900151, -74.383293 40.899546, -74.384277 40.902503, -74.383622 40.902564, -74.383706 40.903409, -74.384609 40.903338, -74.387159 40.909755, -74.390966 40.909837, -74.392542 40.913437, -74.393499 40.91741, -74.390968 40.919447, -74.394272 40.926232, -74.388795 40.930394, -74.389726 40.930836, -74.38883 40.931932, -74.389795 40.931872, -74.390036 40.932698, -74.374793 40.940133, -74.374929 40.941559, -74.37655 40.942487, -74.381516 40.942622, -74.380974 40.946451, -74.374397 40.954036, -74.367575 40.955078, -74.365156 40.954335, -74.363667 40.955394, -74.364141 40.954467, -74.362181 40.951667, -74.36267 40.944287, -74.360703 40.940588, -74.361356 40.939299))',
+ 7.403173506,
+ 2.253640666,
+ 'B_Low_Suburban',
+ 7045,
+ 0.477082503,
+ 2509,
+ 28.18247299,
+ 519.2220835,
+ 0.672777999,
+ 0.996014348,
+ 18.72091503,
+ 12.48069003,
+ 0.258
+ ],
+ [
+ 7073,
+ '{"type":"Polygon","coordinates":[[[-74.087219,40.799287],[-74.105261,40.838083],[-74.113924,40.842218],[-74.121404,40.847184],[-74.119291,40.851674],[-74.119462,40.85335],[-74.11538,40.850927],[-74.109,40.845092],[-74.078747,40.827548],[-74.070783,40.822082],[-74.066115,40.817041],[-74.061984,40.810171],[-74.060685,40.8057],[-74.065135,40.80302],[-74.068585,40.7986],[-74.071399,40.797241],[-74.077,40.796379],[-74.077787,40.792796],[-74.081794,40.787994],[-74.087219,40.799287]]]}',
+ 'POLYGON ((-74.087219 40.799287, -74.105261 40.838083, -74.113924 40.842218, -74.121404 40.847184, -74.119291 40.851674, -74.119462 40.85335, -74.11538 40.850927, -74.109 40.845092, -74.078747 40.827548, -74.070783 40.822082, -74.066115 40.817041, -74.061984 40.810171, -74.060685 40.8057, -74.065135 40.80302, -74.068585 40.7986, -74.071399 40.797241, -74.077 40.796379, -74.077787 40.792796, -74.081794 40.787994, -74.087219 40.799287))',
+ 4.076259122,
+ 2.483658001,
+ 'B_Low_Suburban',
+ 7073,
+ 0.745130406,
+ 3029,
+ 35.66977674,
+ 638.4631914,
+ 0.671838891,
+ 0.990756025,
+ 18.39194713,
+ 15.62142573,
+ 0.333
+ ],
+ [
+ 7081,
+ '{"type":"Polygon","coordinates":[[[-74.347067,40.691722],[-74.36039,40.699821],[-74.352171,40.70148],[-74.342221,40.707846],[-74.333594,40.716901],[-74.330619,40.716055],[-74.332088,40.720176],[-74.325596,40.717075],[-74.321408,40.719072],[-74.315991,40.719199],[-74.311691,40.715601],[-74.309791,40.715501],[-74.308793,40.714508],[-74.302092,40.713301],[-74.299496,40.713889],[-74.29869,40.71479],[-74.296151,40.712434],[-74.297212,40.710298],[-74.301677,40.707498],[-74.301078,40.704678],[-74.306692,40.703802],[-74.309119,40.702625],[-74.310906,40.700392],[-74.310666,40.699622],[-74.307393,40.698801],[-74.307893,40.695999],[-74.30664,40.694304],[-74.308655,40.691171],[-74.312226,40.689892],[-74.310772,40.683794],[-74.307292,40.682506],[-74.308989,40.680407],[-74.307753,40.680292],[-74.310392,40.678402],[-74.322575,40.677433],[-74.347067,40.691722]]]}',
+ 'POLYGON ((-74.347067 40.691722, -74.36039 40.699821, -74.352171 40.70148, -74.342221 40.707846, -74.333594 40.716901, -74.330619 40.716055, -74.332088 40.720176, -74.325596 40.717075, -74.321408 40.719072, -74.315991 40.719199, -74.311691 40.715601, -74.309791 40.715501, -74.308793 40.714508, -74.302092 40.713301, -74.299496 40.713889, -74.29869 40.71479, -74.296151 40.712434, -74.297212 40.710298, -74.301677 40.707498, -74.301078 40.704678, -74.306692 40.703802, -74.309119 40.702625, -74.310906 40.700392, -74.310666 40.699622, -74.307393 40.698801, -74.307893 40.695999, -74.30664 40.694304, -74.308655 40.691171, -74.312226 40.689892, -74.310772 40.683794, -74.307292 40.682506, -74.308989 40.680407, -74.307753 40.680292, -74.310392 40.678402, -74.322575 40.677433, -74.347067 40.691722))',
+ 5.142008449,
+ 2.352650655,
+ 'C_Medium_High',
+ 7081,
+ 0.65038271,
+ 4442,
+ 29.37274368,
+ 514.8178812,
+ 0.693156236,
+ 0.997748762,
+ 18.36100331,
+ 12.61739583,
+ 0.273
+ ],
+ [
+ 7102,
+ '{"type":"Polygon","coordinates":[[[-74.184345,40.727604],[-74.183145,40.730677],[-74.181958,40.730397],[-74.181105,40.732722],[-74.181977,40.732938],[-74.181504,40.734135],[-74.18328,40.734558],[-74.182741,40.735778],[-74.179407,40.737014],[-74.182582,40.73798],[-74.181787,40.739633],[-74.179055,40.737705],[-74.178029,40.739555],[-74.179295,40.739935],[-74.17785,40.742469],[-74.18066,40.74342],[-74.179821,40.744703],[-74.177068,40.743847],[-74.175752,40.745597],[-74.17646,40.745849],[-74.175989,40.747417],[-74.173784,40.746929],[-74.173566,40.747955],[-74.170978,40.747424],[-74.167568,40.748054],[-74.167484,40.747446],[-74.165976,40.748091],[-74.165987,40.745199],[-74.163788,40.739201],[-74.161669,40.735781],[-74.166099,40.732923],[-74.175517,40.72346],[-74.176772,40.723054],[-74.17736,40.723261],[-74.176965,40.723961],[-74.180517,40.724365],[-74.179633,40.725829],[-74.180319,40.726113],[-74.184236,40.724266],[-74.183892,40.72506],[-74.185205,40.725405],[-74.184345,40.727604]]]}',
+ 'POLYGON ((-74.184345 40.727604, -74.183145 40.730677, -74.181958 40.730397, -74.181105 40.732722, -74.181977 40.732938, -74.181504 40.734135, -74.18328 40.734558, -74.182741 40.735778, -74.179407 40.737014, -74.182582 40.73798, -74.181787 40.739633, -74.179055 40.737705, -74.178029 40.739555, -74.179295 40.739935, -74.17785 40.742469, -74.18066 40.74342, -74.179821 40.744703, -74.177068 40.743847, -74.175752 40.745597, -74.17646 40.745849, -74.175989 40.747417, -74.173784 40.746929, -74.173566 40.747955, -74.170978 40.747424, -74.167568 40.748054, -74.167484 40.747446, -74.165976 40.748091, -74.165987 40.745199, -74.163788 40.739201, -74.161669 40.735781, -74.166099 40.732923, -74.175517 40.72346, -74.176772 40.723054, -74.17736 40.723261, -74.176965 40.723961, -74.180517 40.724365, -74.179633 40.725829, -74.180319 40.726113, -74.184236 40.724266, -74.183892 40.72506, -74.185205 40.725405, -74.184345 40.727604))',
+ 1.203818912,
+ 3.301076417,
+ 'C_Medium_High',
+ 7102,
+ 0.832516129,
+ 3875,
+ 55.20608285,
+ 769.5874437,
+ 0.645935484,
+ 0.984258065,
+ 18.16678028,
+ 19.06305599,
+ 0.3
+ ],
+ [
+ 7110,
+ '{"type":"Polygon","coordinates":[[[-74.1404,40.805639],[-74.146391,40.806291],[-74.149012,40.80766],[-74.149521,40.806858],[-74.148617,40.806521],[-74.175644,40.809531],[-74.183836,40.812225],[-74.179511,40.816664],[-74.178999,40.818771],[-74.176443,40.821854],[-74.174992,40.821802],[-74.162628,40.837869],[-74.151923,40.832074],[-74.150888,40.833143],[-74.148818,40.830916],[-74.149242,40.830537],[-74.130031,40.819962],[-74.136487,40.8182],[-74.137287,40.8173],[-74.138787,40.8074],[-74.1404,40.805639]]]}',
+ 'POLYGON ((-74.1404 40.805639, -74.146391 40.806291, -74.149012 40.80766, -74.149521 40.806858, -74.148617 40.806521, -74.175644 40.809531, -74.183836 40.812225, -74.179511 40.816664, -74.178999 40.818771, -74.176443 40.821854, -74.174992 40.821802, -74.162628 40.837869, -74.151923 40.832074, -74.150888 40.833143, -74.148818 40.830916, -74.149242 40.830537, -74.130031 40.819962, -74.136487 40.8182, -74.137287 40.8173, -74.138787 40.8074, -74.1404 40.805639))',
+ 3.418972265,
+ 2.350813772,
+ 'C_Medium_High',
+ 7110,
+ 0.740131579,
+ 7600,
+ 28.24510978,
+ 494.0816839,
+ 0.686578947,
+ 0.988815789,
+ 18.33537813,
+ 12.12610704,
+ 0.268
+ ],
+ [
+ 7416,
+ '{"type":"MultiPolygon","coordinates":[[[[-74.566993,41.087294],[-74.564908,41.089339],[-74.56559,41.090507],[-74.564446,41.091931],[-74.562675,41.093801],[-74.560495,41.094523],[-74.559465,41.093899],[-74.558011,41.094312],[-74.556055,41.091781],[-74.554015,41.092675],[-74.552353,41.091647],[-74.552998,41.09013],[-74.556709,41.087409],[-74.558078,41.085348],[-74.56136,41.08293],[-74.563205,41.082847],[-74.565111,41.081667],[-74.567341,41.082366],[-74.566524,41.085226],[-74.566993,41.087294]]],[[[-74.593264,41.088526],[-74.601504,41.094096],[-74.602269,41.092905],[-74.606875,41.096689],[-74.606957,41.097715],[-74.638551,41.118611],[-74.634186,41.132604],[-74.633166,41.133324],[-74.629712,41.131934],[-74.625246,41.136424],[-74.620677,41.139411],[-74.613785,41.139652],[-74.6101,41.137965],[-74.610517,41.136736],[-74.606433,41.135423],[-74.60466,41.136534],[-74.598719,41.137644],[-74.595925,41.139251],[-74.593358,41.139231],[-74.579959,41.144635],[-74.576893,41.136939],[-74.573312,41.136907],[-74.571246,41.137717],[-74.569941,41.136878],[-74.575411,41.101456],[-74.577128,41.101248],[-74.574449,41.101263],[-74.567456,41.103641],[-74.562238,41.103369],[-74.55789,41.106705],[-74.552862,41.10746],[-74.557344,41.105958],[-74.56193,41.102739],[-74.569487,41.100323],[-74.575935,41.095058],[-74.578362,41.09142],[-74.583558,41.087448],[-74.585763,41.083491],[-74.593264,41.088526]]]]}',
+ 'MULTIPOLYGON (((-74.566993 41.087294, -74.564908 41.089339, -74.56559 41.090507, -74.564446 41.091931, -74.562675 41.093801, -74.560495 41.094523, -74.559465 41.093899, -74.558011 41.094312, -74.556055 41.091781, -74.554015 41.092675, -74.552353 41.091647, -74.552998 41.09013, -74.556709 41.087409, -74.558078 41.085348, -74.56136 41.08293, -74.563205 41.082847, -74.565111 41.081667, -74.567341 41.082366, -74.566524 41.085226, -74.566993 41.087294)), ((-74.593264 41.088526, -74.601504 41.094096, -74.602269 41.092905, -74.606875 41.096689, -74.606957 41.097715, -74.638551 41.118611, -74.634186 41.132604, -74.633166 41.133324, -74.629712 41.131934, -74.625246 41.136424, -74.620677 41.139411, -74.613785 41.139652, -74.6101 41.137965, -74.610517 41.136736, -74.606433 41.135423, -74.60466 41.136534, -74.598719 41.137644, -74.595925 41.139251, -74.593358 41.139231, -74.579959 41.144635, -74.576893 41.136939, -74.573312 41.136907, -74.571246 41.137717, -74.569941 41.136878, -74.575411 41.101456, -74.577128 41.101248, -74.574449 41.101263, -74.567456 41.103641, -74.562238 41.103369, -74.55789 41.106705, -74.552862 41.10746, -74.557344 41.105958, -74.56193 41.102739, -74.569487 41.100323, -74.575935 41.095058, -74.578362 41.09142, -74.583558 41.087448, -74.585763 41.083491, -74.593264 41.088526)))',
+ 9.599149618,
+ 2.546774404,
+ 'A_Low_Rural',
+ 7416,
+ 0.362944162,
+ 394,
+ 13.81679389,
+ 234.9184295,
+ 0.748730964,
+ 0.997461929,
+ 14.28320611,
+ 7.401229981,
+ 0.066
+ ],
+ [
+ 7481,
+ '{"type":"Polygon","coordinates":[[[-74.158531,41.025141],[-74.155604,41.02585],[-74.155079,41.0217],[-74.147648,41.022058],[-74.149441,41.013336],[-74.151076,41.010084],[-74.142115,41.008711],[-74.141446,41.007704],[-74.137536,41.007495],[-74.141401,41.005903],[-74.145988,41.001919],[-74.155782,41.001404],[-74.157154,40.998933],[-74.153255,40.996719],[-74.151282,40.993204],[-74.153874,40.98999],[-74.149887,40.987538],[-74.142812,40.986407],[-74.141437,40.984207],[-74.14121,40.982761],[-74.142619,40.981621],[-74.149088,40.971137],[-74.17021,40.983865],[-74.170988,40.976997],[-74.191835,40.978688],[-74.189987,40.992282],[-74.189546,41.003824],[-74.18806,41.00691],[-74.187244,41.01685],[-74.16758,41.023781],[-74.163392,41.022212],[-74.158531,41.025141]]]}',
+ 'POLYGON ((-74.158531 41.025141, -74.155604 41.02585, -74.155079 41.0217, -74.147648 41.022058, -74.149441 41.013336, -74.151076 41.010084, -74.142115 41.008711, -74.141446 41.007704, -74.137536 41.007495, -74.141401 41.005903, -74.145988 41.001919, -74.155782 41.001404, -74.157154 40.998933, -74.153255 40.996719, -74.151282 40.993204, -74.153874 40.98999, -74.149887 40.987538, -74.142812 40.986407, -74.141437 40.984207, -74.14121 40.982761, -74.142619 40.981621, -74.149088 40.971137, -74.17021 40.983865, -74.170988 40.976997, -74.191835 40.978688, -74.189987 40.992282, -74.189546 41.003824, -74.18806 41.00691, -74.187244 41.01685, -74.16758 41.023781, -74.163392 41.022212, -74.158531 41.025141))',
+ 6.59865985,
+ 2.21913015,
+ 'B_Low_Suburban',
+ 7481,
+ 0.507943713,
+ 4406,
+ 37.98110631,
+ 779.7471722,
+ 0.639809351,
+ 0.997049478,
+ 20.78244176,
+ 16.88378255,
+ 0.262
+ ],
+ [
+ 7495,
+ '{"type":"Polygon","coordinates":[[[-74.164572,41.104182],[-74.166137,41.104468],[-74.163755,41.105993],[-74.16128,41.105606],[-74.162067,41.104822],[-74.161454,41.103924],[-74.162067,41.102889],[-74.163932,41.102848],[-74.164572,41.104182]]]}',
+ 'POLYGON ((-74.164572 41.104182, -74.166137 41.104468, -74.163755 41.105993, -74.16128 41.105606, -74.162067 41.104822, -74.161454 41.103924, -74.162067 41.102889, -74.163932 41.102848, -74.164572 41.104182))',
+ 0.03213684,
+ 3.361538462,
+ 'A_Low_Rural',
+ 7495,
+ 0.355555556,
+ 45,
+ 30.4,
+ 709.541378,
+ 0.8,
+ 1,
+ 18.01481481,
+ 17.72394684,
+ 0
+ ],
+ [
+ 7506,
+ '{"type":"Polygon","coordinates":[[[-74.151143,40.97231],[-74.141048,40.966348],[-74.148059,40.94159],[-74.149587,40.941398],[-74.153938,40.937972],[-74.16151,40.937498],[-74.167127,40.934519],[-74.171588,40.941998],[-74.169018,40.947413],[-74.167486,40.95733],[-74.16921,40.969444],[-74.170814,40.970178],[-74.17021,40.983865],[-74.151143,40.97231]]]}',
+ 'POLYGON ((-74.151143 40.97231, -74.141048 40.966348, -74.148059 40.94159, -74.149587 40.941398, -74.153938 40.937972, -74.16151 40.937498, -74.167127 40.934519, -74.171588 40.941998, -74.169018 40.947413, -74.167486 40.95733, -74.16921 40.969444, -74.170814 40.970178, -74.17021 40.983865, -74.151143 40.97231))',
+ 3.374654059,
+ 2.479267611,
+ 'C_Medium_High',
+ 7506,
+ 0.677288685,
+ 3703,
+ 26.69672353,
+ 436.3732942,
+ 0.703483662,
+ 0.997299487,
+ 16.88975539,
+ 11.62645508,
+ 0.196
+ ],
+ [
+ 7605,
+ '{"type":"Polygon","coordinates":[[[-73.99863,40.866791],[-73.992942,40.873032],[-73.994052,40.874607],[-73.993799,40.876601],[-73.983367,40.875127],[-73.978515,40.870534],[-73.97569,40.868903],[-73.977687,40.8605],[-73.979382,40.860799],[-73.980514,40.857975],[-73.987985,40.850884],[-73.997417,40.856176],[-73.99829,40.855105],[-74.006059,40.85697],[-74.002723,40.864981],[-73.99863,40.866791]]]}',
+ 'POLYGON ((-73.99863 40.866791, -73.992942 40.873032, -73.994052 40.874607, -73.993799 40.876601, -73.983367 40.875127, -73.978515 40.870534, -73.97569 40.868903, -73.977687 40.8605, -73.979382 40.860799, -73.980514 40.857975, -73.987985 40.850884, -73.997417 40.856176, -73.99829 40.855105, -74.006059 40.85697, -74.002723 40.864981, -73.99863 40.866791))',
+ 1.642585048,
+ 2.453964783,
+ 'C_Medium_High',
+ 7605,
+ 0.656508653,
+ 2658,
+ 33.78153495,
+ 611.0165724,
+ 0.656884876,
+ 0.990218209,
+ 18.13150963,
+ 15.16462023,
+ 0.293
+ ],
+ [
+ 7631,
+ '{"type":"Polygon","coordinates":[[[-73.99002,40.887038],[-73.994572,40.888663],[-73.98955,40.900569],[-73.989916,40.906341],[-73.989286,40.911479],[-73.988717,40.911674],[-73.972202,40.912892],[-73.971972,40.913617],[-73.949229,40.900817],[-73.959169,40.885014],[-73.95583,40.883117],[-73.957173,40.881425],[-73.957839,40.882492],[-73.958321,40.882085],[-73.957902,40.880512],[-73.969825,40.865568],[-73.978515,40.870534],[-73.983367,40.875127],[-73.993933,40.876539],[-73.992783,40.879099],[-73.98739,40.886003],[-73.99002,40.887038]]]}',
+ 'POLYGON ((-73.99002 40.887038, -73.994572 40.888663, -73.98955 40.900569, -73.989916 40.906341, -73.989286 40.911479, -73.988717 40.911674, -73.972202 40.912892, -73.971972 40.913617, -73.949229 40.900817, -73.959169 40.885014, -73.95583 40.883117, -73.957173 40.881425, -73.957839 40.882492, -73.958321 40.882085, -73.957902 40.880512, -73.969825 40.865568, -73.978515 40.870534, -73.983367 40.875127, -73.993933 40.876539, -73.992783 40.879099, -73.98739 40.886003, -73.99002 40.887038))',
+ 4.926323412,
+ 2.742937844,
+ 'C_Medium_High',
+ 7631,
+ 0.695602572,
+ 9642,
+ 39.65661571,
+ 777.8438479,
+ 0.669155777,
+ 0.983717071,
+ 18.88216131,
+ 18.53758825,
+ 0.354
+ ],
+ [
+ 7643,
+ '{"type":"Polygon","coordinates":[[[-74.04531,40.854103],[-74.044779,40.853794],[-74.044816,40.85746],[-74.043745,40.857547],[-74.043757,40.85919],[-74.032018,40.858647],[-74.028884,40.855216],[-74.028418,40.852282],[-74.029969,40.847658],[-74.029185,40.843427],[-74.030484,40.8389],[-74.029084,40.8344],[-74.030084,40.832],[-74.035384,40.8288],[-74.036918,40.82855],[-74.040269,40.830288],[-74.03909,40.830425],[-74.039014,40.832249],[-74.040669,40.832316],[-74.039777,40.834102],[-74.04154,40.833922],[-74.041217,40.834652],[-74.042195,40.834792],[-74.042262,40.836937],[-74.043267,40.838359],[-74.042435,40.840983],[-74.043045,40.843654],[-74.045484,40.843596],[-74.045798,40.846145],[-74.051577,40.847894],[-74.052563,40.848853],[-74.052518,40.850817],[-74.053981,40.853863],[-74.051677,40.857692],[-74.04531,40.854103]]]}',
+ 'POLYGON ((-74.04531 40.854103, -74.044779 40.853794, -74.044816 40.85746, -74.043745 40.857547, -74.043757 40.85919, -74.032018 40.858647, -74.028884 40.855216, -74.028418 40.852282, -74.029969 40.847658, -74.029185 40.843427, -74.030484 40.8389, -74.029084 40.8344, -74.030084 40.832, -74.035384 40.8288, -74.036918 40.82855, -74.040269 40.830288, -74.03909 40.830425, -74.039014 40.832249, -74.040669 40.832316, -74.039777 40.834102, -74.04154 40.833922, -74.041217 40.834652, -74.042195 40.834792, -74.042262 40.836937, -74.043267 40.838359, -74.042435 40.840983, -74.043045 40.843654, -74.045484 40.843596, -74.045798 40.846145, -74.051577 40.847894, -74.052563 40.848853, -74.052518 40.850817, -74.053981 40.853863, -74.051677 40.857692, -74.04531 40.854103))',
+ 1.698675619,
+ 2.552779817,
+ 'C_Medium_High',
+ 7643,
+ 0.787673552,
+ 2953,
+ 28.46145797,
+ 457.6531695,
+ 0.686420589,
+ 0.970877074,
+ 16.71062667,
+ 12.32412945,
+ 0.275
+ ],
+ [
+ 7645,
+ '{"type":"Polygon","coordinates":[[[-74.033649,41.039572],[-74.03703,41.043696],[-74.051378,41.049278],[-74.063774,41.044631],[-74.069675,41.041541],[-74.071014,41.046613],[-74.072234,41.046686],[-74.072452,41.048935],[-74.079369,41.048492],[-74.078814,41.055144],[-74.07699,41.061365],[-74.071915,41.072883],[-74.012583,41.046396],[-74.013197,41.041442],[-74.012452,41.038698],[-74.028831,41.036591],[-74.030807,41.037199],[-74.029374,41.039144],[-74.029546,41.040261],[-74.031631,41.037894],[-74.033649,41.039572]]]}',
+ 'POLYGON ((-74.033649 41.039572, -74.03703 41.043696, -74.051378 41.049278, -74.063774 41.044631, -74.069675 41.041541, -74.071014 41.046613, -74.072234 41.046686, -74.072452 41.048935, -74.079369 41.048492, -74.078814 41.055144, -74.07699 41.061365, -74.071915 41.072883, -74.012583 41.046396, -74.013197 41.041442, -74.012452 41.038698, -74.028831 41.036591, -74.030807 41.037199, -74.029374 41.039144, -74.029546 41.040261, -74.031631 41.037894, -74.033649 41.039572))',
+ 3.99137919,
+ 2.383176018,
+ 'B_Low_Suburban',
+ 7645,
+ 0.464448496,
+ 2194,
+ 31.67185355,
+ 625.3501419,
+ 0.667730173,
+ 0.995897903,
+ 18.75967963,
+ 15.00065936,
+ 0.277
+ ],
+ [
+ 7405,
+ '{"type":"Polygon","coordinates":[[[-74.424256,41.026137],[-74.423728,41.027596],[-74.421458,41.02854],[-74.417803,41.028693],[-74.414744,41.027759],[-74.41085,41.026199],[-74.40977,41.024847],[-74.40592,41.024094],[-74.403388,41.021833],[-74.402254,41.019233],[-74.399391,41.017289],[-74.390997,41.015688],[-74.389678,41.014254],[-74.389303,41.012431],[-74.388223,41.012046],[-74.386295,41.011688],[-74.382247,41.013959],[-74.379565,41.014282],[-74.371373,41.011399],[-74.367459,41.011994],[-74.364124,41.011293],[-74.36235,41.01383],[-74.355441,41.013943],[-74.351481,41.01099],[-74.351029,41.007174],[-74.352168,41.005987],[-74.350926,41.004335],[-74.34612,41.0046],[-74.342264,41.006904],[-74.340618,41.005845],[-74.336429,41.007529],[-74.334805,41.006464],[-74.334456,41.003592],[-74.329578,41.002512],[-74.328411,41.001419],[-74.330477,40.997535],[-74.329601,40.995845],[-74.329855,40.991939],[-74.332185,40.990168],[-74.331401,40.988262],[-74.330459,40.966053],[-74.336465,40.960102],[-74.340902,40.953453],[-74.339763,40.95213],[-74.336043,40.951261],[-74.335478,40.949418],[-74.341094,40.946298],[-74.364296,40.957929],[-74.397898,40.959829],[-74.410065,40.958717],[-74.428155,40.958911],[-74.428555,40.958226],[-74.428574,40.959286],[-74.431175,40.959368],[-74.430749,40.984608],[-74.432097,40.984008],[-74.432025,40.992541],[-74.430602,40.993339],[-74.430178,41.018128],[-74.429211,41.017679],[-74.425375,41.019271],[-74.426013,41.020166],[-74.423504,41.025734],[-74.424256,41.026137]]]}',
+ 'POLYGON ((-74.424256 41.026137, -74.423728 41.027596, -74.421458 41.02854, -74.417803 41.028693, -74.414744 41.027759, -74.41085 41.026199, -74.40977 41.024847, -74.40592 41.024094, -74.403388 41.021833, -74.402254 41.019233, -74.399391 41.017289, -74.390997 41.015688, -74.389678 41.014254, -74.389303 41.012431, -74.388223 41.012046, -74.386295 41.011688, -74.382247 41.013959, -74.379565 41.014282, -74.371373 41.011399, -74.367459 41.011994, -74.364124 41.011293, -74.36235 41.01383, -74.355441 41.013943, -74.351481 41.01099, -74.351029 41.007174, -74.352168 41.005987, -74.350926 41.004335, -74.34612 41.0046, -74.342264 41.006904, -74.340618 41.005845, -74.336429 41.007529, -74.334805 41.006464, -74.334456 41.003592, -74.329578 41.002512, -74.328411 41.001419, -74.330477 40.997535, -74.329601 40.995845, -74.329855 40.991939, -74.332185 40.990168, -74.331401 40.988262, -74.330459 40.966053, -74.336465 40.960102, -74.340902 40.953453, -74.339763 40.95213, -74.336043 40.951261, -74.335478 40.949418, -74.341094 40.946298, -74.364296 40.957929, -74.397898 40.959829, -74.410065 40.958717, -74.428155 40.958911, -74.428555 40.958226, -74.428574 40.959286, -74.431175 40.959368, -74.430749 40.984608, -74.432097 40.984008, -74.432025 40.992541, -74.430602 40.993339, -74.430178 41.018128, -74.429211 41.017679, -74.425375 41.019271, -74.426013 41.020166, -74.423504 41.025734, -74.424256 41.026137))',
+ 20.89261574,
+ 2.276330461,
+ 'A_Low_Rural',
+ 7405,
+ 0.480898221,
+ 3429,
+ 23.42811222,
+ 430.9574125,
+ 0.721201516,
+ 0.997958589,
+ 18.08334307,
+ 10.72428006,
+ 0.193
+ ],
+ [
+ 7712,
+ '{"type":"Polygon","coordinates":[[[-74.105049,40.269701],[-74.103488,40.272418],[-74.106018,40.274773],[-74.101607,40.280574],[-74.100748,40.279887],[-74.100161,40.280996],[-74.098821,40.28123],[-74.082891,40.274113],[-74.082201,40.270348],[-74.072487,40.275582],[-74.071041,40.274346],[-74.070161,40.270832],[-74.069033,40.270664],[-74.067579,40.27089],[-74.065924,40.272621],[-74.061569,40.273615],[-74.051627,40.272795],[-74.049539,40.271935],[-74.043385,40.273422],[-74.039322,40.25183],[-74.019689,40.253485],[-74.019866,40.251435],[-74.01764,40.249613],[-74.018373,40.247723],[-74.020904,40.246901],[-74.022762,40.240874],[-74.015502,40.23916],[-74.015218,40.237693],[-74.01292,40.236238],[-74.008684,40.235364],[-74.009389,40.232973],[-74.007068,40.232283],[-74.006199,40.231174],[-73.994705,40.230067],[-73.994681,40.224512],[-73.998481,40.216812],[-74.002556,40.21709],[-74.018647,40.213377],[-74.024998,40.213125],[-74.025508,40.219099],[-74.02618,40.219151],[-74.025518,40.219641],[-74.025516,40.223269],[-74.077409,40.234395],[-74.076503,40.240881],[-74.078391,40.240398],[-74.079541,40.242058],[-74.07912,40.243797],[-74.075526,40.245243],[-74.073864,40.257239],[-74.075693,40.259189],[-74.081411,40.258528],[-74.082119,40.251457],[-74.08462,40.252719],[-74.08778,40.250225],[-74.095925,40.249682],[-74.096515,40.245582],[-74.097686,40.245471],[-74.110838,40.252683],[-74.10372,40.255887],[-74.106884,40.259944],[-74.108802,40.260613],[-74.108582,40.264424],[-74.106872,40.265512],[-74.105049,40.269701]]]}',
+ 'POLYGON ((-74.105049 40.269701, -74.103488 40.272418, -74.106018 40.274773, -74.101607 40.280574, -74.100748 40.279887, -74.100161 40.280996, -74.098821 40.28123, -74.082891 40.274113, -74.082201 40.270348, -74.072487 40.275582, -74.071041 40.274346, -74.070161 40.270832, -74.069033 40.270664, -74.067579 40.27089, -74.065924 40.272621, -74.061569 40.273615, -74.051627 40.272795, -74.049539 40.271935, -74.043385 40.273422, -74.039322 40.25183, -74.019689 40.253485, -74.019866 40.251435, -74.01764 40.249613, -74.018373 40.247723, -74.020904 40.246901, -74.022762 40.240874, -74.015502 40.23916, -74.015218 40.237693, -74.01292 40.236238, -74.008684 40.235364, -74.009389 40.232973, -74.007068 40.232283, -74.006199 40.231174, -73.994705 40.230067, -73.994681 40.224512, -73.998481 40.216812, -74.002556 40.21709, -74.018647 40.213377, -74.024998 40.213125, -74.025508 40.219099, -74.02618 40.219151, -74.025518 40.219641, -74.025516 40.223269, -74.077409 40.234395, -74.076503 40.240881, -74.078391 40.240398, -74.079541 40.242058, -74.07912 40.243797, -74.075526 40.245243, -74.073864 40.257239, -74.075693 40.259189, -74.081411 40.258528, -74.082119 40.251457, -74.08462 40.252719, -74.08778 40.250225, -74.095925 40.249682, -74.096515 40.245582, -74.097686 40.245471, -74.110838 40.252683, -74.10372 40.255887, -74.106884 40.259944, -74.108802 40.260613, -74.108582 40.264424, -74.106872 40.265512, -74.105049 40.269701))',
+ 12.20511482,
+ 2.181023176,
+ 'C_Medium_High',
+ 7712,
+ 0.586637182,
+ 6331,
+ 25.68419385,
+ 428.1136837,
+ 0.683936187,
+ 0.9973148,
+ 18.24031781,
+ 10.56183119,
+ 0.162
+ ],
+ [
+ 7036,
+ '{"type":"Polygon","coordinates":[[[-74.293808,40.633387],[-74.291091,40.636102],[-74.290991,40.638102],[-74.28982,40.639951],[-74.287325,40.639999],[-74.281687,40.643381],[-74.282183,40.644572],[-74.280691,40.645712],[-74.281494,40.647271],[-74.281488,40.650145],[-74.264342,40.637244],[-74.258956,40.643217],[-74.251701,40.645117],[-74.248772,40.647293],[-74.241341,40.649791],[-74.232513,40.654927],[-74.200469,40.63263],[-74.202247,40.630903],[-74.203737,40.624227],[-74.201864,40.618557],[-74.203128,40.614109],[-74.203813,40.605961],[-74.199408,40.600201],[-74.19952,40.597539],[-74.203688,40.592691],[-74.210741,40.597032],[-74.212032,40.598372],[-74.21287,40.602035],[-74.215101,40.604074],[-74.220216,40.600555],[-74.231748,40.598881],[-74.234067,40.600345],[-74.234767,40.601945],[-74.236609,40.60272],[-74.242593,40.599754],[-74.25381,40.600989],[-74.255822,40.602194],[-74.258114,40.60225],[-74.255608,40.607618],[-74.278844,40.629365],[-74.285491,40.635102],[-74.290491,40.632903],[-74.292494,40.630803],[-74.296379,40.628711],[-74.297134,40.62933],[-74.293808,40.633387]]]}',
+ 'POLYGON ((-74.293808 40.633387, -74.291091 40.636102, -74.290991 40.638102, -74.28982 40.639951, -74.287325 40.639999, -74.281687 40.643381, -74.282183 40.644572, -74.280691 40.645712, -74.281494 40.647271, -74.281488 40.650145, -74.264342 40.637244, -74.258956 40.643217, -74.251701 40.645117, -74.248772 40.647293, -74.241341 40.649791, -74.232513 40.654927, -74.200469 40.63263, -74.202247 40.630903, -74.203737 40.624227, -74.201864 40.618557, -74.203128 40.614109, -74.203813 40.605961, -74.199408 40.600201, -74.19952 40.597539, -74.203688 40.592691, -74.210741 40.597032, -74.212032 40.598372, -74.21287 40.602035, -74.215101 40.604074, -74.220216 40.600555, -74.231748 40.598881, -74.234067 40.600345, -74.234767 40.601945, -74.236609 40.60272, -74.242593 40.599754, -74.25381 40.600989, -74.255822 40.602194, -74.258114 40.60225, -74.255608 40.607618, -74.278844 40.629365, -74.285491 40.635102, -74.290491 40.632903, -74.292494 40.630803, -74.296379 40.628711, -74.297134 40.62933, -74.293808 40.633387))',
+ 11.53874114,
+ 2.699232307,
+ 'C_Medium_High',
+ 7036,
+ 0.801162911,
+ 9631,
+ 28.86601273,
+ 389.7025478,
+ 0.719862943,
+ 0.995016094,
+ 15.60384361,
+ 11.23865061,
+ 0.228
+ ],
+ [
+ 7723,
+ '{"type":"Polygon","coordinates":[[[-74.013788,40.249179],[-74.01764,40.249613],[-74.019302,40.250582],[-74.019689,40.253485],[-74.012618,40.253141],[-74.011201,40.257],[-74.003013,40.256831],[-74.002888,40.258313],[-74.000094,40.257407],[-74.0002,40.26345],[-73.992354,40.262405],[-73.986681,40.260211],[-73.992881,40.237266],[-74.008001,40.239851],[-74.008447,40.242576],[-74.009543,40.243782],[-74.009733,40.248425],[-74.013788,40.249179]]]}',
+ 'POLYGON ((-74.013788 40.249179, -74.01764 40.249613, -74.019302 40.250582, -74.019689 40.253485, -74.012618 40.253141, -74.011201 40.257, -74.003013 40.256831, -74.002888 40.258313, -74.000094 40.257407, -74.0002 40.26345, -73.992354 40.262405, -73.986681 40.260211, -73.992881 40.237266, -74.008001 40.239851, -74.008447 40.242576, -74.009543 40.243782, -74.009733 40.248425, -74.013788 40.249179))',
+ 1.726296628,
+ 2.781885387,
+ 'A_Low_Rural',
+ 7723,
+ 0.28340081,
+ 247,
+ 40.21138211,
+ 761.4119818,
+ 0.71659919,
+ 0.995951417,
+ 20.89796748,
+ 16.39563236,
+ 0.213
+ ],
+ [
+ 7822,
+ '{"type":"Polygon","coordinates":[[[-74.680775,41.141961],[-74.694975,41.131348],[-74.69885,41.135537],[-74.701359,41.136794],[-74.703406,41.13429],[-74.706486,41.126963],[-74.713138,41.120327],[-74.711489,41.118891],[-74.720408,41.112296],[-74.746949,41.119559],[-74.745694,41.120599],[-74.745157,41.124768],[-74.741896,41.12892],[-74.737953,41.129147],[-74.737676,41.128104],[-74.735155,41.126436],[-74.728554,41.128919],[-74.733121,41.130496],[-74.735764,41.13238],[-74.739,41.137338],[-74.733352,41.138875],[-74.731341,41.143627],[-74.721084,41.150262],[-74.716727,41.151405],[-74.715427,41.151356],[-74.712447,41.147925],[-74.705516,41.147476],[-74.704311,41.147987],[-74.703071,41.146962],[-74.694816,41.157602],[-74.690193,41.159813],[-74.684027,41.164539],[-74.681418,41.165103],[-74.67785,41.163684],[-74.674644,41.163581],[-74.67129,41.168764],[-74.667272,41.172585],[-74.660801,41.166128],[-74.66382,41.163773],[-74.663566,41.162153],[-74.66462,41.159589],[-74.663429,41.157321],[-74.664679,41.155926],[-74.670442,41.154203],[-74.668458,41.152808],[-74.668539,41.151161],[-74.680775,41.141961]]]}',
+ 'POLYGON ((-74.680775 41.141961, -74.694975 41.131348, -74.69885 41.135537, -74.701359 41.136794, -74.703406 41.13429, -74.706486 41.126963, -74.713138 41.120327, -74.711489 41.118891, -74.720408 41.112296, -74.746949 41.119559, -74.745694 41.120599, -74.745157 41.124768, -74.741896 41.12892, -74.737953 41.129147, -74.737676 41.128104, -74.735155 41.126436, -74.728554 41.128919, -74.733121 41.130496, -74.735764 41.13238, -74.739 41.137338, -74.733352 41.138875, -74.731341 41.143627, -74.721084 41.150262, -74.716727 41.151405, -74.715427 41.151356, -74.712447 41.147925, -74.705516 41.147476, -74.704311 41.147987, -74.703071 41.146962, -74.694816 41.157602, -74.690193 41.159813, -74.684027 41.164539, -74.681418 41.165103, -74.67785 41.163684, -74.674644 41.163581, -74.67129 41.168764, -74.667272 41.172585, -74.660801 41.166128, -74.66382 41.163773, -74.663566 41.162153, -74.66462 41.159589, -74.663429 41.157321, -74.664679 41.155926, -74.670442 41.154203, -74.668458 41.152808, -74.668539 41.151161, -74.680775 41.141961))',
+ 6.647012773,
+ 2.433311133,
+ 'A_Low_Rural',
+ 7822,
+ 0.273684211,
+ 95,
+ 17.43157895,
+ 349.6450282,
+ 0.768421053,
+ 1,
+ 16.78491228,
+ 9.373910335,
+ 0.118
+ ],
+ [
+ 7054,
+ '{"type":"Polygon","coordinates":[[[-74.39366,40.830496],[-74.405638,40.838928],[-74.422925,40.8447],[-74.451083,40.838346],[-74.463181,40.843465],[-74.467565,40.846525],[-74.465964,40.848547],[-74.464617,40.848757],[-74.46076,40.846768],[-74.454244,40.85264],[-74.452162,40.852242],[-74.449605,40.854737],[-74.45126,40.859271],[-74.449707,40.860541],[-74.451701,40.860499],[-74.461277,40.86634],[-74.46095,40.867844],[-74.449226,40.866302],[-74.443807,40.866626],[-74.447036,40.867209],[-74.439733,40.866511],[-74.43882,40.870782],[-74.440454,40.869142],[-74.445241,40.867982],[-74.450476,40.869008],[-74.450185,40.872275],[-74.44921,40.874111],[-74.451584,40.873513],[-74.451567,40.876515],[-74.447705,40.876866],[-74.448803,40.879174],[-74.450256,40.879959],[-74.433632,40.874255],[-74.433403,40.877506],[-74.43068,40.881706],[-74.425693,40.882707],[-74.424699,40.879771],[-74.425187,40.878315],[-74.419916,40.879254],[-74.420486,40.875395],[-74.419362,40.871206],[-74.414728,40.868737],[-74.410267,40.877077],[-74.405039,40.875898],[-74.404027,40.878969],[-74.4017,40.881459],[-74.396071,40.881961],[-74.392244,40.873568],[-74.39051,40.874087],[-74.390446,40.87614],[-74.384095,40.876199],[-74.383996,40.875199],[-74.380159,40.876783],[-74.376464,40.876885],[-74.376099,40.875662],[-74.375014,40.876373],[-74.372986,40.875671],[-74.371975,40.870267],[-74.36966,40.871168],[-74.368983,40.869851],[-74.369611,40.869488],[-74.365509,40.869788],[-74.365091,40.868735],[-74.366462,40.867373],[-74.366416,40.864756],[-74.36514,40.866106],[-74.362694,40.863887],[-74.358996,40.863608],[-74.354787,40.86599],[-74.35609,40.867062],[-74.358298,40.866561],[-74.361219,40.867003],[-74.361668,40.867421],[-74.357831,40.866738],[-74.355927,40.867299],[-74.353829,40.86556],[-74.352328,40.866215],[-74.349994,40.864479],[-74.349303,40.86285],[-74.348177,40.862628],[-74.34716,40.859279],[-74.347658,40.856795],[-74.346489,40.856411],[-74.345626,40.857625],[-74.344092,40.856842],[-74.340904,40.852353],[-74.341387,40.85158],[-74.344485,40.850715],[-74.341838,40.849039],[-74.341288,40.847784],[-74.341951,40.846224],[-74.35252,40.844081],[-74.354781,40.840973],[-74.360222,40.840871],[-74.367495,40.836199],[-74.371095,40.835699],[-74.379803,40.828479],[-74.380291,40.830042],[-74.381487,40.828478],[-74.380893,40.827515],[-74.383959,40.824991],[-74.388727,40.825989],[-74.39366,40.830496]]]}',
+ 'POLYGON ((-74.39366 40.830496, -74.405638 40.838928, -74.422925 40.8447, -74.451083 40.838346, -74.463181 40.843465, -74.467565 40.846525, -74.465964 40.848547, -74.464617 40.848757, -74.46076 40.846768, -74.454244 40.85264, -74.452162 40.852242, -74.449605 40.854737, -74.45126 40.859271, -74.449707 40.860541, -74.451701 40.860499, -74.461277 40.86634, -74.46095 40.867844, -74.449226 40.866302, -74.443807 40.866626, -74.447036 40.867209, -74.439733 40.866511, -74.43882 40.870782, -74.440454 40.869142, -74.445241 40.867982, -74.450476 40.869008, -74.450185 40.872275, -74.44921 40.874111, -74.451584 40.873513, -74.451567 40.876515, -74.447705 40.876866, -74.448803 40.879174, -74.450256 40.879959, -74.433632 40.874255, -74.433403 40.877506, -74.43068 40.881706, -74.425693 40.882707, -74.424699 40.879771, -74.425187 40.878315, -74.419916 40.879254, -74.420486 40.875395, -74.419362 40.871206, -74.414728 40.868737, -74.410267 40.877077, -74.405039 40.875898, -74.404027 40.878969, -74.4017 40.881459, -74.396071 40.881961, -74.392244 40.873568, -74.39051 40.874087, -74.390446 40.87614, -74.384095 40.876199, -74.383996 40.875199, -74.380159 40.876783, -74.376464 40.876885, -74.376099 40.875662, -74.375014 40.876373, -74.372986 40.875671, -74.371975 40.870267, -74.36966 40.871168, -74.368983 40.869851, -74.369611 40.869488, -74.365509 40.869788, -74.365091 40.868735, -74.366462 40.867373, -74.366416 40.864756, -74.36514 40.866106, -74.362694 40.863887, -74.358996 40.863608, -74.354787 40.86599, -74.35609 40.867062, -74.358298 40.866561, -74.361219 40.867003, -74.361668 40.867421, -74.357831 40.866738, -74.355927 40.867299, -74.353829 40.86556, -74.352328 40.866215, -74.349994 40.864479, -74.349303 40.86285, -74.348177 40.862628, -74.34716 40.859279, -74.347658 40.856795, -74.346489 40.856411, -74.345626 40.857625, -74.344092 40.856842, -74.340904 40.852353, -74.341387 40.85158, -74.344485 40.850715, -74.341838 40.849039, -74.341288 40.847784, -74.341951 40.846224, -74.35252 40.844081, -74.354781 40.840973, -74.360222 40.840871, -74.367495 40.836199, -74.371095 40.835699, -74.379803 40.828479, -74.380291 40.830042, -74.381487 40.828478, -74.380893 40.827515, -74.383959 40.824991, -74.388727 40.825989, -74.39366 40.830496))',
+ 14.37823635,
+ 2.515879321,
+ 'B_Low_Suburban',
+ 7054,
+ 0.5693362,
+ 7442,
+ 27.18441628,
+ 491.6000821,
+ 0.709486697,
+ 0.99677506,
+ 17.45079087,
+ 12.67679148,
+ 0.256
+ ],
+ [
+ 7832,
+ '{"type":"Polygon","coordinates":[[[-75.097586,40.843042],[-75.095784,40.847082],[-75.090962,40.849187],[-75.076684,40.849875],[-75.07083,40.847392],[-75.067655,40.847329],[-75.064328,40.848338],[-75.063343,40.851499],[-75.060491,40.85302],[-75.059239,40.856102],[-75.053294,40.8599],[-75.051692,40.863363],[-75.050839,40.868067],[-75.053664,40.87366],[-75.058655,40.877654],[-75.062073,40.882188],[-75.060998,40.882237],[-75.060556,40.883385],[-75.059124,40.884072],[-75.060651,40.889189],[-75.064166,40.893064],[-75.063612,40.895385],[-75.066827,40.895434],[-75.067646,40.896657],[-75.067452,40.899412],[-75.071768,40.898989],[-75.072097,40.898253],[-75.073515,40.900408],[-75.07391,40.899656],[-75.075231,40.899947],[-75.07609,40.907039],[-75.07929,40.913886],[-75.095528,40.924148],[-75.104809,40.935247],[-75.106148,40.93967],[-75.111689,40.948127],[-75.117767,40.953013],[-75.119116,40.958161],[-75.118076,40.959633],[-75.118346,40.963676],[-75.120435,40.968302],[-75.122603,40.970152],[-75.130166,40.968961],[-75.132622,40.970005],[-75.134701,40.972038],[-75.135531,40.973803],[-75.135521,40.976865],[-75.132522,40.981235],[-75.131096,40.990464],[-75.127196,40.993954],[-75.110595,41.002174],[-75.109113,41.004102],[-75.095556,41.008874],[-75.088596,41.015024],[-75.081101,41.016838],[-75.074999,41.01713],[-75.069277,41.019348],[-75.068369,41.018018],[-75.037857,41.030485],[-75.029696,41.035357],[-75.027882,41.037279],[-75.024165,41.038536],[-75.017392,41.042515],[-75.015185,41.04423],[-75.009346,41.051893],[-75.003538,41.057084],[-75.000477,41.058017],[-74.998034,41.057699],[-74.995569,41.058848],[-74.992703,41.058564],[-74.992174,41.05969],[-74.984424,41.064889],[-74.984063,41.062832],[-74.980707,41.061781],[-74.964688,41.063446],[-74.963232,41.060643],[-74.964228,41.057935],[-74.961406,41.055613],[-74.96458,41.051797],[-74.99578,41.033212],[-75.002831,41.030399],[-75.003773,41.031045],[-75.004225,41.032144],[-75.002834,41.033539],[-74.998731,41.035666],[-74.998954,41.038437],[-74.998147,41.038507],[-74.998255,41.037117],[-74.997435,41.037002],[-74.995356,41.040166],[-74.991659,41.042442],[-74.994705,41.041671],[-75.004298,41.035416],[-75.005265,41.031919],[-75.003411,41.030082],[-75.016649,41.022886],[-75.021761,41.020728],[-75.036997,41.017017],[-75.04378,41.014322],[-75.03456,41.008186],[-75.034725,41.004652],[-75.033729,41.002569],[-75.034213,41.001403],[-75.032281,40.999595],[-75.032341,40.996951],[-75.02898,40.99561],[-75.011902,40.998459],[-75.008874,40.99009],[-75.010378,40.985846],[-75.010075,40.984303],[-75.002953,40.981862],[-75.005732,40.980256],[-75.021928,40.975764],[-75.02123,40.970357],[-75.024322,40.969825],[-75.021013,40.968997],[-75.020256,40.963611],[-75.018195,40.964426],[-75.019502,40.961433],[-75.018391,40.959758],[-75.038299,40.952908],[-75.03083,40.946719],[-75.029307,40.946706],[-75.020847,40.940258],[-75.019403,40.941591],[-75.019535,40.939241],[-75.021033,40.939612],[-75.022159,40.938123],[-75.015041,40.928458],[-75.027891,40.920693],[-75.02861,40.915329],[-75.031276,40.912284],[-75.024568,40.908851],[-75.0223,40.905808],[-75.03156,40.896317],[-75.030145,40.89056],[-75.024001,40.891451],[-75.022183,40.892446],[-75.020636,40.891426],[-75.017441,40.891496],[-75.01407,40.890293],[-75.008894,40.885907],[-75.010391,40.884111],[-75.014797,40.882787],[-75.019161,40.881981],[-75.024044,40.883433],[-75.025249,40.882262],[-75.02744,40.88172],[-75.021561,40.875098],[-75.014017,40.868236],[-75.016147,40.867869],[-75.016559,40.868533],[-75.020503,40.866673],[-75.021161,40.867805],[-75.022549,40.86763],[-75.023738,40.863747],[-75.025591,40.860958],[-75.02513,40.858498],[-75.024052,40.857718],[-75.028967,40.856352],[-75.030658,40.857634],[-75.032149,40.85736],[-75.029716,40.863273],[-75.031074,40.869309],[-75.035994,40.868633],[-75.051176,40.860567],[-75.049486,40.860618],[-75.055534,40.855224],[-75.057455,40.852435],[-75.057422,40.848045],[-75.062178,40.847418],[-75.061305,40.843848],[-75.064167,40.842773],[-75.06489,40.843711],[-75.068656,40.844534],[-75.070267,40.842345],[-75.070187,40.837954],[-75.07707,40.840947],[-75.088876,40.832533],[-75.096301,40.83839],[-75.097572,40.840967],[-75.097586,40.843042]]]}',
+ 'POLYGON ((-75.097586 40.843042, -75.095784 40.847082, -75.090962 40.849187, -75.076684 40.849875, -75.07083 40.847392, -75.067655 40.847329, -75.064328 40.848338, -75.063343 40.851499, -75.060491 40.85302, -75.059239 40.856102, -75.053294 40.8599, -75.051692 40.863363, -75.050839 40.868067, -75.053664 40.87366, -75.058655 40.877654, -75.062073 40.882188, -75.060998 40.882237, -75.060556 40.883385, -75.059124 40.884072, -75.060651 40.889189, -75.064166 40.893064, -75.063612 40.895385, -75.066827 40.895434, -75.067646 40.896657, -75.067452 40.899412, -75.071768 40.898989, -75.072097 40.898253, -75.073515 40.900408, -75.07391 40.899656, -75.075231 40.899947, -75.07609 40.907039, -75.07929 40.913886, -75.095528 40.924148, -75.104809 40.935247, -75.106148 40.93967, -75.111689 40.948127, -75.117767 40.953013, -75.119116 40.958161, -75.118076 40.959633, -75.118346 40.963676, -75.120435 40.968302, -75.122603 40.970152, -75.130166 40.968961, -75.132622 40.970005, -75.134701 40.972038, -75.135531 40.973803, -75.135521 40.976865, -75.132522 40.981235, -75.131096 40.990464, -75.127196 40.993954, -75.110595 41.002174, -75.109113 41.004102, -75.095556 41.008874, -75.088596 41.015024, -75.081101 41.016838, -75.074999 41.01713, -75.069277 41.019348, -75.068369 41.018018, -75.037857 41.030485, -75.029696 41.035357, -75.027882 41.037279, -75.024165 41.038536, -75.017392 41.042515, -75.015185 41.04423, -75.009346 41.051893, -75.003538 41.057084, -75.000477 41.058017, -74.998034 41.057699, -74.995569 41.058848, -74.992703 41.058564, -74.992174 41.05969, -74.984424 41.064889, -74.984063 41.062832, -74.980707 41.061781, -74.964688 41.063446, -74.963232 41.060643, -74.964228 41.057935, -74.961406 41.055613, -74.96458 41.051797, -74.99578 41.033212, -75.002831 41.030399, -75.003773 41.031045, -75.004225 41.032144, -75.002834 41.033539, -74.998731 41.035666, -74.998954 41.038437, -74.998147 41.038507, -74.998255 41.037117, -74.997435 41.037002, -74.995356 41.040166, -74.991659 41.042442, -74.994705 41.041671, -75.004298 41.035416, -75.005265 41.031919, -75.003411 41.030082, -75.016649 41.022886, -75.021761 41.020728, -75.036997 41.017017, -75.04378 41.014322, -75.03456 41.008186, -75.034725 41.004652, -75.033729 41.002569, -75.034213 41.001403, -75.032281 40.999595, -75.032341 40.996951, -75.02898 40.99561, -75.011902 40.998459, -75.008874 40.99009, -75.010378 40.985846, -75.010075 40.984303, -75.002953 40.981862, -75.005732 40.980256, -75.021928 40.975764, -75.02123 40.970357, -75.024322 40.969825, -75.021013 40.968997, -75.020256 40.963611, -75.018195 40.964426, -75.019502 40.961433, -75.018391 40.959758, -75.038299 40.952908, -75.03083 40.946719, -75.029307 40.946706, -75.020847 40.940258, -75.019403 40.941591, -75.019535 40.939241, -75.021033 40.939612, -75.022159 40.938123, -75.015041 40.928458, -75.027891 40.920693, -75.02861 40.915329, -75.031276 40.912284, -75.024568 40.908851, -75.0223 40.905808, -75.03156 40.896317, -75.030145 40.89056, -75.024001 40.891451, -75.022183 40.892446, -75.020636 40.891426, -75.017441 40.891496, -75.01407 40.890293, -75.008894 40.885907, -75.010391 40.884111, -75.014797 40.882787, -75.019161 40.881981, -75.024044 40.883433, -75.025249 40.882262, -75.02744 40.88172, -75.021561 40.875098, -75.014017 40.868236, -75.016147 40.867869, -75.016559 40.868533, -75.020503 40.866673, -75.021161 40.867805, -75.022549 40.86763, -75.023738 40.863747, -75.025591 40.860958, -75.02513 40.858498, -75.024052 40.857718, -75.028967 40.856352, -75.030658 40.857634, -75.032149 40.85736, -75.029716 40.863273, -75.031074 40.869309, -75.035994 40.868633, -75.051176 40.860567, -75.049486 40.860618, -75.055534 40.855224, -75.057455 40.852435, -75.057422 40.848045, -75.062178 40.847418, -75.061305 40.843848, -75.064167 40.842773, -75.06489 40.843711, -75.068656 40.844534, -75.070267 40.842345, -75.070187 40.837954, -75.07707 40.840947, -75.088876 40.832533, -75.096301 40.83839, -75.097572 40.840967, -75.097586 40.843042))',
+ 48.08259073,
+ 2.222012926,
+ 'A_Low_Rural',
+ 7832,
+ 0.291390728,
+ 302,
+ 13.33670034,
+ 237.9317288,
+ 0.801324503,
+ 0.983443709,
+ 15.91447811,
+ 6.727790706,
+ 0.081
+ ],
+ [
+ 7924,
+ '{"type":"Polygon","coordinates":[[[-74.624966,40.729228],[-74.623454,40.730678],[-74.622391,40.735039],[-74.620469,40.736001],[-74.627104,40.737727],[-74.628747,40.736844],[-74.630137,40.735166],[-74.631305,40.734548],[-74.632923,40.732801],[-74.633441,40.732418],[-74.633871,40.732237],[-74.632255,40.733644],[-74.630508,40.736973],[-74.631292,40.738187],[-74.629319,40.739683],[-74.63127,40.741111],[-74.555922,40.75831],[-74.555203,40.756999],[-74.553197,40.756439],[-74.551914,40.754863],[-74.550924,40.751073],[-74.552886,40.749578],[-74.548756,40.746131],[-74.549383,40.745092],[-74.548999,40.740994],[-74.550988,40.741647],[-74.551958,40.739985],[-74.55856,40.736104],[-74.556731,40.73478],[-74.560814,40.731351],[-74.563545,40.730267],[-74.564013,40.728933],[-74.552547,40.722803],[-74.555477,40.721368],[-74.5533,40.719188],[-74.556246,40.717896],[-74.567761,40.706455],[-74.607957,40.694414],[-74.609197,40.696081],[-74.611319,40.695338],[-74.61599,40.695721],[-74.618622,40.695149],[-74.618226,40.704919],[-74.620821,40.710878],[-74.620235,40.712269],[-74.615067,40.715173],[-74.612185,40.719403],[-74.612003,40.72373],[-74.61545,40.723053],[-74.620932,40.716648],[-74.623654,40.715129],[-74.625684,40.715004],[-74.634205,40.722291],[-74.631262,40.72482],[-74.626871,40.725334],[-74.626784,40.727547],[-74.625149,40.72802],[-74.625639,40.728948],[-74.624966,40.729228]]]}',
+ 'POLYGON ((-74.624966 40.729228, -74.623454 40.730678, -74.622391 40.735039, -74.620469 40.736001, -74.627104 40.737727, -74.628747 40.736844, -74.630137 40.735166, -74.631305 40.734548, -74.632923 40.732801, -74.633441 40.732418, -74.633871 40.732237, -74.632255 40.733644, -74.630508 40.736973, -74.631292 40.738187, -74.629319 40.739683, -74.63127 40.741111, -74.555922 40.75831, -74.555203 40.756999, -74.553197 40.756439, -74.551914 40.754863, -74.550924 40.751073, -74.552886 40.749578, -74.548756 40.746131, -74.549383 40.745092, -74.548999 40.740994, -74.550988 40.741647, -74.551958 40.739985, -74.55856 40.736104, -74.556731 40.73478, -74.560814 40.731351, -74.563545 40.730267, -74.564013 40.728933, -74.552547 40.722803, -74.555477 40.721368, -74.5533 40.719188, -74.556246 40.717896, -74.567761 40.706455, -74.607957 40.694414, -74.609197 40.696081, -74.611319 40.695338, -74.61599 40.695721, -74.618622 40.695149, -74.618226 40.704919, -74.620821 40.710878, -74.620235 40.712269, -74.615067 40.715173, -74.612185 40.719403, -74.612003 40.72373, -74.61545 40.723053, -74.620932 40.716648, -74.623654 40.715129, -74.625684 40.715004, -74.634205 40.722291, -74.631262 40.72482, -74.626871 40.725334, -74.626784 40.727547, -74.625149 40.72802, -74.625639 40.728948, -74.624966 40.729228))',
+ 12.13371074,
+ 2.402380687,
+ 'A_Low_Rural',
+ 7924,
+ 0.384324324,
+ 1850,
+ 33.00813449,
+ 677.5939771,
+ 0.667027027,
+ 0.996756757,
+ 19.17525307,
+ 15.90160445,
+ 0.242
+ ],
+ [
+ 7928,
+ '{"type":"Polygon","coordinates":[[[-74.409178,40.741059],[-74.405471,40.73989],[-74.402552,40.742258],[-74.402172,40.741487],[-74.391635,40.75198],[-74.389873,40.751394],[-74.383649,40.754173],[-74.38351,40.755403],[-74.380255,40.755386],[-74.381513,40.754696],[-74.373581,40.75015],[-74.370371,40.752139],[-74.363072,40.750403],[-74.367572,40.748824],[-74.364765,40.746788],[-74.366562,40.743889],[-74.371979,40.742359],[-74.37256,40.741587],[-74.370829,40.735753],[-74.371246,40.734627],[-74.374669,40.733545],[-74.377932,40.734319],[-74.379732,40.73396],[-74.380295,40.7333],[-74.379853,40.732492],[-74.377503,40.730032],[-74.384382,40.724385],[-74.388232,40.726165],[-74.39069,40.725499],[-74.390769,40.718294],[-74.39509,40.717273],[-74.402254,40.718001],[-74.404574,40.715245],[-74.40735,40.713461],[-74.408466,40.710106],[-74.410057,40.709517],[-74.412495,40.7103],[-74.413818,40.707248],[-74.4154,40.705781],[-74.426897,40.701711],[-74.430005,40.697838],[-74.429578,40.697004],[-74.430781,40.693453],[-74.434551,40.693575],[-74.437847,40.6919],[-74.43797,40.690247],[-74.444333,40.687969],[-74.449736,40.718831],[-74.447841,40.718904],[-74.437223,40.723493],[-74.426842,40.729088],[-74.424382,40.734726],[-74.426048,40.733344],[-74.427376,40.733482],[-74.426785,40.735839],[-74.429199,40.735878],[-74.430449,40.734831],[-74.430765,40.735285],[-74.428298,40.736522],[-74.430213,40.7377],[-74.43032,40.736951],[-74.432798,40.736704],[-74.434311,40.735493],[-74.437467,40.735121],[-74.437348,40.73587],[-74.439214,40.73673],[-74.44084,40.73642],[-74.439595,40.736006],[-74.440803,40.734753],[-74.441744,40.735486],[-74.441043,40.736868],[-74.442891,40.735942],[-74.444308,40.738929],[-74.438047,40.741641],[-74.432156,40.746447],[-74.434702,40.747732],[-74.438198,40.752308],[-74.436616,40.752849],[-74.435314,40.752306],[-74.436024,40.751602],[-74.433267,40.750069],[-74.432271,40.751089],[-74.428827,40.749474],[-74.430019,40.746001],[-74.41515,40.742751],[-74.409916,40.740501],[-74.409178,40.741059]]]}',
+ 'POLYGON ((-74.409178 40.741059, -74.405471 40.73989, -74.402552 40.742258, -74.402172 40.741487, -74.391635 40.75198, -74.389873 40.751394, -74.383649 40.754173, -74.38351 40.755403, -74.380255 40.755386, -74.381513 40.754696, -74.373581 40.75015, -74.370371 40.752139, -74.363072 40.750403, -74.367572 40.748824, -74.364765 40.746788, -74.366562 40.743889, -74.371979 40.742359, -74.37256 40.741587, -74.370829 40.735753, -74.371246 40.734627, -74.374669 40.733545, -74.377932 40.734319, -74.379732 40.73396, -74.380295 40.7333, -74.379853 40.732492, -74.377503 40.730032, -74.384382 40.724385, -74.388232 40.726165, -74.39069 40.725499, -74.390769 40.718294, -74.39509 40.717273, -74.402254 40.718001, -74.404574 40.715245, -74.40735 40.713461, -74.408466 40.710106, -74.410057 40.709517, -74.412495 40.7103, -74.413818 40.707248, -74.4154 40.705781, -74.426897 40.701711, -74.430005 40.697838, -74.429578 40.697004, -74.430781 40.693453, -74.434551 40.693575, -74.437847 40.6919, -74.43797 40.690247, -74.444333 40.687969, -74.449736 40.718831, -74.447841 40.718904, -74.437223 40.723493, -74.426842 40.729088, -74.424382 40.734726, -74.426048 40.733344, -74.427376 40.733482, -74.426785 40.735839, -74.429199 40.735878, -74.430449 40.734831, -74.430765 40.735285, -74.428298 40.736522, -74.430213 40.7377, -74.43032 40.736951, -74.432798 40.736704, -74.434311 40.735493, -74.437467 40.735121, -74.437348 40.73587, -74.439214 40.73673, -74.44084 40.73642, -74.439595 40.736006, -74.440803 40.734753, -74.441744 40.735486, -74.441043 40.736868, -74.442891 40.735942, -74.444308 40.738929, -74.438047 40.741641, -74.432156 40.746447, -74.434702 40.747732, -74.438198 40.752308, -74.436616 40.752849, -74.435314 40.752306, -74.436024 40.751602, -74.433267 40.750069, -74.432271 40.751089, -74.428827 40.749474, -74.430019 40.746001, -74.41515 40.742751, -74.409916 40.740501, -74.409178 40.741059))',
+ 8.953905337,
+ 2.250793062,
+ 'B_Low_Suburban',
+ 7928,
+ 0.539032204,
+ 5931,
+ 39.01961447,
+ 858.5168842,
+ 0.613050076,
+ 0.997133704,
+ 20.95072145,
+ 18.44006178,
+ 0.31
+ ],
+ [
+ 7979,
+ '{"type":"Polygon","coordinates":[[[-74.746315,40.699842],[-74.738518,40.708428],[-74.73803,40.711868],[-74.734191,40.71672],[-74.729987,40.717241],[-74.732448,40.720062],[-74.724418,40.719455],[-74.720152,40.720857],[-74.721834,40.718984],[-74.720881,40.716657],[-74.71557,40.714933],[-74.715093,40.713903],[-74.717147,40.714164],[-74.716015,40.710283],[-74.717798,40.709288],[-74.714601,40.703286],[-74.714347,40.699368],[-74.721624,40.690735],[-74.722079,40.688939],[-74.72065,40.687797],[-74.72303,40.68265],[-74.725555,40.683786],[-74.729034,40.68356],[-74.730184,40.682581],[-74.732786,40.683785],[-74.730782,40.686112],[-74.73592,40.688406],[-74.732475,40.692508],[-74.733375,40.693151],[-74.734169,40.699729],[-74.744802,40.697551],[-74.746315,40.699842]]]}',
+ 'POLYGON ((-74.746315 40.699842, -74.738518 40.708428, -74.73803 40.711868, -74.734191 40.71672, -74.729987 40.717241, -74.732448 40.720062, -74.724418 40.719455, -74.720152 40.720857, -74.721834 40.718984, -74.720881 40.716657, -74.71557 40.714933, -74.715093 40.713903, -74.717147 40.714164, -74.716015 40.710283, -74.717798 40.709288, -74.714601 40.703286, -74.714347 40.699368, -74.721624 40.690735, -74.722079 40.688939, -74.72065 40.687797, -74.72303 40.68265, -74.725555 40.683786, -74.729034 40.68356, -74.730184 40.682581, -74.732786 40.683785, -74.730782 40.686112, -74.73592 40.688406, -74.732475 40.692508, -74.733375 40.693151, -74.734169 40.699729, -74.744802 40.697551, -74.746315 40.699842))',
+ 2.439857168,
+ 2.316265052,
+ 'A_Low_Rural',
+ 7979,
+ 0.139534884,
+ 215,
+ 22.95774648,
+ 284.0477961,
+ 0.693023256,
+ 0.990697674,
+ 14.85117371,
+ 8.606828708,
+ 0.354
+ ],
+ [
+ 7838,
+ '{"type":"Polygon","coordinates":[[[-74.96258,40.908359],[-74.959171,40.909348],[-74.958166,40.910924],[-74.955046,40.911941],[-74.952035,40.914182],[-74.947947,40.912938],[-74.945624,40.911373],[-74.945686,40.909849],[-74.944298,40.909232],[-74.940447,40.911676],[-74.93977,40.916014],[-74.93583,40.915965],[-74.93084,40.917595],[-74.927867,40.906805],[-74.887969,40.933194],[-74.887988,40.931636],[-74.886846,40.929954],[-74.882716,40.930239],[-74.874369,40.932296],[-74.873234,40.934085],[-74.86866,40.936267],[-74.866899,40.933617],[-74.859938,40.93051],[-74.852375,40.930101],[-74.848303,40.933399],[-74.847051,40.933475],[-74.844269,40.930927],[-74.844978,40.927355],[-74.840887,40.923065],[-74.840416,40.921211],[-74.84412,40.919599],[-74.842955,40.919474],[-74.844491,40.91793],[-74.844531,40.915532],[-74.859914,40.909303],[-74.860956,40.904959],[-74.862287,40.903064],[-74.858839,40.900314],[-74.858959,40.899168],[-74.848263,40.892969],[-74.851169,40.889839],[-74.85923,40.885743],[-74.859366,40.887143],[-74.860511,40.887838],[-74.863545,40.883912],[-74.867125,40.884417],[-74.872203,40.882492],[-74.872768,40.883398],[-74.876052,40.884353],[-74.882058,40.883988],[-74.882891,40.882731],[-74.887871,40.879998],[-74.889572,40.87633],[-74.894028,40.872274],[-74.89991,40.869372],[-74.903521,40.865869],[-74.905344,40.866523],[-74.903426,40.864607],[-74.903128,40.86326],[-74.900129,40.862348],[-74.896917,40.858397],[-74.894792,40.857851],[-74.894754,40.856634],[-74.893744,40.8561],[-74.894932,40.856353],[-74.895533,40.851298],[-74.907884,40.855752],[-74.915047,40.852114],[-74.924079,40.851947],[-74.929062,40.848559],[-74.934249,40.85086],[-74.933294,40.852222],[-74.935853,40.852373],[-74.941042,40.846725],[-74.94384,40.846406],[-74.950587,40.842517],[-74.951581,40.839414],[-74.956373,40.834365],[-74.971647,40.842927],[-74.971381,40.843883],[-74.968743,40.844635],[-74.960144,40.855778],[-74.963608,40.855651],[-74.963127,40.858348],[-74.964627,40.85919],[-74.96689,40.85904],[-74.968542,40.860945],[-74.97156,40.860844],[-74.968929,40.864416],[-74.969525,40.86504],[-74.971744,40.861518],[-74.972369,40.86245],[-74.9725,40.861514],[-74.973998,40.861535],[-74.974787,40.860622],[-74.978735,40.87158],[-74.979484,40.87194],[-74.97877,40.873364],[-74.979931,40.874228],[-74.976368,40.876708],[-74.982155,40.879127],[-74.980311,40.880401],[-74.980521,40.881626],[-74.976513,40.883126],[-74.978397,40.88719],[-74.976715,40.890538],[-74.9757,40.883461],[-74.977469,40.879267],[-74.97593,40.878446],[-74.976152,40.879675],[-74.974987,40.881253],[-74.969259,40.884146],[-74.963281,40.885689],[-74.957982,40.890776],[-74.957476,40.893947],[-74.961516,40.894095],[-74.95829,40.900182],[-74.962611,40.906121],[-74.959793,40.907294],[-74.96258,40.908359]]]}',
+ 'POLYGON ((-74.96258 40.908359, -74.959171 40.909348, -74.958166 40.910924, -74.955046 40.911941, -74.952035 40.914182, -74.947947 40.912938, -74.945624 40.911373, -74.945686 40.909849, -74.944298 40.909232, -74.940447 40.911676, -74.93977 40.916014, -74.93583 40.915965, -74.93084 40.917595, -74.927867 40.906805, -74.887969 40.933194, -74.887988 40.931636, -74.886846 40.929954, -74.882716 40.930239, -74.874369 40.932296, -74.873234 40.934085, -74.86866 40.936267, -74.866899 40.933617, -74.859938 40.93051, -74.852375 40.930101, -74.848303 40.933399, -74.847051 40.933475, -74.844269 40.930927, -74.844978 40.927355, -74.840887 40.923065, -74.840416 40.921211, -74.84412 40.919599, -74.842955 40.919474, -74.844491 40.91793, -74.844531 40.915532, -74.859914 40.909303, -74.860956 40.904959, -74.862287 40.903064, -74.858839 40.900314, -74.858959 40.899168, -74.848263 40.892969, -74.851169 40.889839, -74.85923 40.885743, -74.859366 40.887143, -74.860511 40.887838, -74.863545 40.883912, -74.867125 40.884417, -74.872203 40.882492, -74.872768 40.883398, -74.876052 40.884353, -74.882058 40.883988, -74.882891 40.882731, -74.887871 40.879998, -74.889572 40.87633, -74.894028 40.872274, -74.89991 40.869372, -74.903521 40.865869, -74.905344 40.866523, -74.903426 40.864607, -74.903128 40.86326, -74.900129 40.862348, -74.896917 40.858397, -74.894792 40.857851, -74.894754 40.856634, -74.893744 40.8561, -74.894932 40.856353, -74.895533 40.851298, -74.907884 40.855752, -74.915047 40.852114, -74.924079 40.851947, -74.929062 40.848559, -74.934249 40.85086, -74.933294 40.852222, -74.935853 40.852373, -74.941042 40.846725, -74.94384 40.846406, -74.950587 40.842517, -74.951581 40.839414, -74.956373 40.834365, -74.971647 40.842927, -74.971381 40.843883, -74.968743 40.844635, -74.960144 40.855778, -74.963608 40.855651, -74.963127 40.858348, -74.964627 40.85919, -74.96689 40.85904, -74.968542 40.860945, -74.97156 40.860844, -74.968929 40.864416, -74.969525 40.86504, -74.971744 40.861518, -74.972369 40.86245, -74.9725 40.861514, -74.973998 40.861535, -74.974787 40.860622, -74.978735 40.87158, -74.979484 40.87194, -74.97877 40.873364, -74.979931 40.874228, -74.976368 40.876708, -74.982155 40.879127, -74.980311 40.880401, -74.980521 40.881626, -74.976513 40.883126, -74.978397 40.88719, -74.976715 40.890538, -74.9757 40.883461, -74.977469 40.879267, -74.97593 40.878446, -74.976152 40.879675, -74.974987 40.881253, -74.969259 40.884146, -74.963281 40.885689, -74.957982 40.890776, -74.957476 40.893947, -74.961516 40.894095, -74.95829 40.900182, -74.962611 40.906121, -74.959793 40.907294, -74.96258 40.908359))',
+ 25.10592549,
+ 2.007636482,
+ 'A_Low_Rural',
+ 7838,
+ 0.346875,
+ 320,
+ 11.98119122,
+ 211.9244058,
+ 0.771875,
+ 0.996875,
+ 15.3553814,
+ 6.210590289,
+ 0.082
+ ],
+ [
+ 7044,
+ '{"type":"Polygon","coordinates":[[[-74.261032,40.832085],[-74.259357,40.836363],[-74.257107,40.838124],[-74.256523,40.841781],[-74.251892,40.849829],[-74.2334,40.844389],[-74.237214,40.836034],[-74.227445,40.83331],[-74.227147,40.836396],[-74.22099,40.834799],[-74.225755,40.827381],[-74.224352,40.827071],[-74.227054,40.824221],[-74.227725,40.824867],[-74.229113,40.822199],[-74.229079,40.820019],[-74.232573,40.814863],[-74.250795,40.824461],[-74.264305,40.825431],[-74.261032,40.832085]]]}',
+ 'POLYGON ((-74.261032 40.832085, -74.259357 40.836363, -74.257107 40.838124, -74.256523 40.841781, -74.251892 40.849829, -74.2334 40.844389, -74.237214 40.836034, -74.227445 40.83331, -74.227147 40.836396, -74.22099 40.834799, -74.225755 40.827381, -74.224352 40.827071, -74.227054 40.824221, -74.227725 40.824867, -74.229113 40.822199, -74.229079 40.820019, -74.232573 40.814863, -74.250795 40.824461, -74.264305 40.825431, -74.261032 40.832085))',
+ 2.791550146,
+ 2.282754753,
+ 'C_Medium_High',
+ 7044,
+ 0.652425579,
+ 3628,
+ 31.61574586,
+ 596.5287053,
+ 0.677508269,
+ 0.997794928,
+ 19.71404236,
+ 13.61658418,
+ 0.263
+ ]
+ ],
+ fields: [
+ {
+ name: 'a_zip',
+ type: 'integer'
+ },
+ {
+ name: 'simplified_shape_v2',
+ type: 'geojson'
+ },
+ {
+ name: 'simplified_shape',
+ type: 'geojson'
+ },
+ {
+ name: 'zip_area',
+ type: 'real'
+ },
+ {
+ name: 'avg_number',
+ type: 'real'
+ },
+ {
+ name: 'str_type',
+ type: 'string'
+ },
+ {
+ name: 'int_type',
+ type: 'integer'
+ },
+ {
+ name: 'real_type',
+ type: 'real'
+ },
+ {
+ name: 'c_m_r',
+ type: 'integer'
+ },
+ {
+ name: 'c_m_t',
+ type: 'real'
+ },
+ {
+ name: 'c_a_v',
+ type: 'real'
+ },
+ {
+ name: 'c_ch',
+ type: 'real'
+ },
+ {
+ name: 'c_ta',
+ type: 'real'
+ },
+ {
+ name: 'c_k_a',
+ type: 'real'
+ },
+ {
+ name: 'c_ltv',
+ type: 'real'
+ },
+ {
+ name: 'b_r_p',
+ type: 'real'
+ }
+ ]
+ }
+ }
+ ],
+ config: {
+ version: 'v1',
+ config: {
+ visState: {
+ filters: [
+ {
+ dataId: 'a5ybmwl2d',
+ id: '9ca0l7p2a',
+ name: 'zip_area',
+ type: 'range',
+ value: [0, 21.8],
+ enlarged: false
+ }
+ ],
+ layers: [
+ {
+ id: '8zr03we',
+ type: 'geojson',
+ config: {
+ dataId: 'a5ybmwl2d',
+ label: 'extruded polygon',
+ color: [181, 18, 65],
+ columns: {
+ geojson: 'simplified_shape_v2'
+ },
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ thickness: 2,
+ colorRange: {
+ 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,
+ enable3d: true,
+ wireframe: false
+ }
+ },
+ visualChannels: {
+ colorField: {
+ name: 'c_m_r',
+ type: 'integer'
+ },
+ colorScale: 'quantize',
+ sizeField: null,
+ sizeScale: 'linear',
+ heightField: {
+ name: 'c_a_v',
+ type: 'real'
+ },
+ heightScale: 'linear',
+ radiusField: null,
+ radiusScale: 'linear'
+ }
+ },
+ {
+ id: 'u7apppt',
+ type: 'geojson',
+ config: {
+ dataId: 'a5ybmwl2d',
+ label: 'stroke by pop',
+ color: [221, 178, 124],
+ columns: {
+ geojson: 'simplified_shape'
+ },
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ thickness: 7.6,
+ colorRange: {
+ 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
+ }
+ },
+ visualChannels: {
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: {
+ name: 'c_ta',
+ type: 'real'
+ },
+ sizeScale: 'linear',
+ heightField: null,
+ heightScale: 'linear',
+ radiusField: null,
+ radiusScale: 'linear'
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ a5ybmwl2d: ['a_zip', 'str_type', 'int_type']
+ },
+ enabled: false
+ },
+ brush: {
+ size: 1,
+ enabled: false
+ }
+ },
+ layerBlending: 'normal'
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [209, 206, 199],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 37.75043,
+ longitude: -122.34679,
+ pitch: 0,
+ zoom: 9
+ },
+ queryStatus: {
+ pastQueries: [
+ {
+ id: 'a5ybmwl2d',
+ label: 'geojson_as_string_small.csv',
+ queryType: 'file',
+ queryOption: 'csv',
+ params: {
+ file: null
+ },
+ size: 67502
+ }
+ ]
+ }
+ }
+ }
+};
+
+export const v0ExpectedInfo = {
+ id: 'a5ybmwl2d',
+ label: 'geojson_as_string_small.csv',
+ color: [53, 92, 125]
+};
+
+export const v0ExpectedFields = [
+ {name: 'a_zip', type: 'integer', format: ''},
+ {name: 'simplified_shape_v2', type: 'geojson', format: ''},
+ {name: 'simplified_shape', type: 'geojson', format: ''},
+ {name: 'zip_area', type: 'real', format: ''},
+ {name: 'avg_number', type: 'real', format: ''},
+ {name: 'str_type', type: 'string', format: ''},
+ {name: 'int_type', type: 'integer', format: ''},
+ {name: 'real_type', type: 'real', format: ''},
+ {name: 'c_m_r', type: 'integer', format: ''},
+ {name: 'c_m_t', type: 'real', format: ''},
+ {name: 'c_a_v', type: 'real', format: ''},
+ {name: 'c_ch', type: 'real', format: ''},
+ {name: 'c_ta', type: 'real', format: ''},
+ {name: 'c_k_a', type: 'real', format: ''},
+ {name: 'c_ltv', type: 'real', format: ''},
+ {name: 'b_r_p', type: 'real', format: ''}
+];
+
+export const mergedFilters = [
+ {
+ dataId: 'a5ybmwl2d',
+ freeze: true,
+ id: '9ca0l7p2a',
+ enlarged: false,
+ isAnimating: false,
+ name: 'zip_area',
+ type: 'range',
+ fieldIdx: 3,
+ domain: [0, 48.1],
+ value: [0, 21.8],
+ step: 0.1,
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ histogram: ['Not tested'],
+ enlargedHistogram: ['Not tested'],
+ speed: 1,
+ fieldType: 'real',
+ typeOptions: ['range']
+ }
+];
+
+const mergedLayer0 = new GeojsonLayer({
+ id: '8zr03we'
+});
+
+mergedLayer0.config = {
+ dataId: 'a5ybmwl2d',
+ label: 'extruded polygon',
+ color: [181, 18, 65],
+ columns: {
+ geojson: {
+ fieldIdx: 1,
+ value: 'simplified_shape_v2'
+ }
+ },
+ isVisible: true,
+ isConfigActive: false,
+ highlightColor: [252, 242, 26],
+ colorField: {
+ name: 'c_m_r',
+ type: 'integer',
+ id: 'c_m_r',
+ format: '',
+ tableFieldIndex: 9
+ },
+ colorScale: 'quantize',
+ colorDomain: [45, 9642],
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ heightField: {
+ name: 'c_a_v',
+ type: 'real',
+ id: 'c_a_v',
+ format: '',
+ tableFieldIndex: 11
+ },
+ heightScale: 'linear',
+ heightDomain: [211.9244058, 858.5168842],
+ radiusField: null,
+ radiusScale: 'linear',
+ radiusDomain: [0, 1],
+ visConfig: {
+ opacity: 0.8,
+ thickness: 2,
+ colorRange: {
+ 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,
+ enable3d: true,
+ wireframe: false
+ }
+};
+
+mergedLayer0.meta = {
+ bounds: [-75.135531, 40.213125, -73.949229, 41.172585],
+ lightSettings: {
+ lightsPosition: [-75.135531, 40.213125, 8000, -73.949229, 41.172585, 8000],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ },
+ fp64: false,
+ fixedRadius: false,
+ featureTypes: {polygon: true}
+};
+
+mergedLayer0.dataToFeature = {
+ 0: {
+ type: 'Feature',
+ properties: {index: 0},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.158491, 40.835947],
+ [-74.157914, 40.83902],
+ [-74.148473, 40.834522],
+ [-74.146471, 40.836645],
+ [-74.142598, 40.833128],
+ [-74.140177, 40.832492],
+ [-74.136732, 40.836791],
+ [-74.142706, 40.840604],
+ [-74.144667, 40.84312],
+ [-74.142936, 40.844974],
+ [-74.136054, 40.84119],
+ [-74.1356, 40.841703],
+ [-74.133665, 40.840712],
+ [-74.133028, 40.841321],
+ [-74.13274, 40.839586],
+ [-74.121853, 40.834098],
+ [-74.121087, 40.831],
+ [-74.124447, 40.822169],
+ [-74.130031, 40.819962],
+ [-74.149242, 40.830537],
+ [-74.148818, 40.830916],
+ [-74.150888, 40.833143],
+ [-74.151923, 40.832074],
+ [-74.158491, 40.835947]
+ ]
+ ]
+ }
+ },
+ 1: {
+ type: 'Feature',
+ properties: {index: 1},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.31687, 40.656696],
+ [-74.319449, 40.658154],
+ [-74.326141, 40.656094],
+ [-74.326593, 40.657702],
+ [-74.327693, 40.662904],
+ [-74.325199, 40.667596],
+ [-74.326093, 40.668202],
+ [-74.323615, 40.670664],
+ [-74.323228, 40.672276],
+ [-74.324391, 40.67444],
+ [-74.322371, 40.677443],
+ [-74.310392, 40.678402],
+ [-74.312993, 40.674703],
+ [-74.312093, 40.674304],
+ [-74.314552, 40.673889],
+ [-74.312827, 40.673282],
+ [-74.307888, 40.674387],
+ [-74.306792, 40.672102],
+ [-74.290976, 40.673465],
+ [-74.29185, 40.671802],
+ [-74.290689, 40.670646],
+ [-74.288727, 40.670925],
+ [-74.285991, 40.667001],
+ [-74.284275, 40.658075],
+ [-74.283511, 40.658187],
+ [-74.283369, 40.657406],
+ [-74.285786, 40.655022],
+ [-74.282693, 40.653502],
+ [-74.280691, 40.645712],
+ [-74.282183, 40.644572],
+ [-74.281687, 40.643381],
+ [-74.287325, 40.639999],
+ [-74.29577, 40.638581],
+ [-74.304907, 40.633459],
+ [-74.319678, 40.641989],
+ [-74.316485, 40.645194],
+ [-74.320663, 40.647344],
+ [-74.312298, 40.654042],
+ [-74.31687, 40.656696]
+ ]
+ ]
+ }
+ },
+ 2: {
+ type: 'Feature',
+ properties: {index: 2},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.387589, 40.632238],
+ [-74.401749, 40.640393],
+ [-74.386745, 40.653316],
+ [-74.374682, 40.646553],
+ [-74.372634, 40.6468],
+ [-74.371828, 40.644885],
+ [-74.374122, 40.642352],
+ [-74.37327, 40.641829],
+ [-74.375777, 40.636295],
+ [-74.37717, 40.634842],
+ [-74.382333, 40.632417],
+ [-74.384457, 40.630453],
+ [-74.387589, 40.632238]
+ ]
+ ]
+ }
+ },
+ 3: {
+ type: 'Feature',
+ properties: {index: 3},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.165995, 40.747969],
+ [-74.164799, 40.754718],
+ [-74.155877, 40.751722],
+ [-74.154327, 40.753966],
+ [-74.145563, 40.751975],
+ [-74.144976, 40.748161],
+ [-74.14586, 40.748031],
+ [-74.140783, 40.742694],
+ [-74.139386, 40.743314],
+ [-74.137492, 40.741398],
+ [-74.142688, 40.739301],
+ [-74.145288, 40.735701],
+ [-74.147188, 40.734401],
+ [-74.155687, 40.733501],
+ [-74.15998, 40.734485],
+ [-74.162093, 40.736109],
+ [-74.163788, 40.739201],
+ [-74.165987, 40.745199],
+ [-74.165995, 40.747969]
+ ]
+ ]
+ }
+ },
+ 4: {
+ type: 'Feature',
+ properties: {index: 4},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.361356, 40.939299],
+ [-74.370498, 40.926937],
+ [-74.37404, 40.927298],
+ [-74.374216, 40.921969],
+ [-74.371645, 40.92135],
+ [-74.366428, 40.918141],
+ [-74.356676, 40.915791],
+ [-74.349697, 40.916512],
+ [-74.347883, 40.91351],
+ [-74.349593, 40.91185],
+ [-74.353183, 40.910446],
+ [-74.350384, 40.908593],
+ [-74.351179, 40.907344],
+ [-74.349633, 40.906311],
+ [-74.351883, 40.90419],
+ [-74.351747, 40.902647],
+ [-74.349573, 40.903845],
+ [-74.349271, 40.902641],
+ [-74.344758, 40.902596],
+ [-74.345589, 40.900045],
+ [-74.339928, 40.899308],
+ [-74.339554, 40.895904],
+ [-74.338613, 40.895769],
+ [-74.33944, 40.893881],
+ [-74.335743, 40.893239],
+ [-74.3389, 40.892087],
+ [-74.339694, 40.889839],
+ [-74.339646, 40.888758],
+ [-74.338118, 40.887173],
+ [-74.339575, 40.883893],
+ [-74.340271, 40.879528],
+ [-74.338075, 40.879652],
+ [-74.337614, 40.878206],
+ [-74.33507, 40.877426],
+ [-74.33531, 40.876555],
+ [-74.337696, 40.87591],
+ [-74.337808, 40.875101],
+ [-74.334259, 40.873471],
+ [-74.337288, 40.872611],
+ [-74.337418, 40.87179],
+ [-74.335937, 40.870521],
+ [-74.33806, 40.870059],
+ [-74.336714, 40.869079],
+ [-74.33765, 40.868402],
+ [-74.33768, 40.866752],
+ [-74.339806, 40.866539],
+ [-74.34018, 40.868365],
+ [-74.339545, 40.874876],
+ [-74.341626, 40.877524],
+ [-74.340485, 40.882283],
+ [-74.342874, 40.885385],
+ [-74.346198, 40.887367],
+ [-74.35009, 40.887702],
+ [-74.352792, 40.886265],
+ [-74.355507, 40.888913],
+ [-74.359916, 40.886643],
+ [-74.360096, 40.887329],
+ [-74.361792, 40.887158],
+ [-74.36087, 40.883379],
+ [-74.358905, 40.883365],
+ [-74.358888, 40.880786],
+ [-74.357662, 40.880344],
+ [-74.357789, 40.879259],
+ [-74.358676, 40.879136],
+ [-74.358091, 40.878002],
+ [-74.362636, 40.877577],
+ [-74.360456, 40.872665],
+ [-74.361843, 40.87065],
+ [-74.365778, 40.871801],
+ [-74.366753, 40.874063],
+ [-74.37127, 40.876723],
+ [-74.369921, 40.878054],
+ [-74.370331, 40.879192],
+ [-74.371574, 40.879878],
+ [-74.37187, 40.878855],
+ [-74.373453, 40.878978],
+ [-74.373051, 40.880533],
+ [-74.374017, 40.882604],
+ [-74.3772, 40.886221],
+ [-74.376296, 40.888095],
+ [-74.376308, 40.890713],
+ [-74.374745, 40.893264],
+ [-74.374127, 40.898616],
+ [-74.374902, 40.901059],
+ [-74.378188, 40.901844],
+ [-74.378509, 40.900151],
+ [-74.383293, 40.899546],
+ [-74.384277, 40.902503],
+ [-74.383622, 40.902564],
+ [-74.383706, 40.903409],
+ [-74.384609, 40.903338],
+ [-74.387159, 40.909755],
+ [-74.390966, 40.909837],
+ [-74.392542, 40.913437],
+ [-74.393499, 40.91741],
+ [-74.390968, 40.919447],
+ [-74.394272, 40.926232],
+ [-74.388795, 40.930394],
+ [-74.389726, 40.930836],
+ [-74.38883, 40.931932],
+ [-74.389795, 40.931872],
+ [-74.390036, 40.932698],
+ [-74.374793, 40.940133],
+ [-74.374929, 40.941559],
+ [-74.37655, 40.942487],
+ [-74.381516, 40.942622],
+ [-74.380974, 40.946451],
+ [-74.374397, 40.954036],
+ [-74.367575, 40.955078],
+ [-74.365156, 40.954335],
+ [-74.363667, 40.955394],
+ [-74.364141, 40.954467],
+ [-74.362181, 40.951667],
+ [-74.36267, 40.944287],
+ [-74.360703, 40.940588],
+ [-74.361356, 40.939299]
+ ]
+ ]
+ }
+ },
+ 5: {
+ type: 'Feature',
+ properties: {index: 5},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.087219, 40.799287],
+ [-74.105261, 40.838083],
+ [-74.113924, 40.842218],
+ [-74.121404, 40.847184],
+ [-74.119291, 40.851674],
+ [-74.119462, 40.85335],
+ [-74.11538, 40.850927],
+ [-74.109, 40.845092],
+ [-74.078747, 40.827548],
+ [-74.070783, 40.822082],
+ [-74.066115, 40.817041],
+ [-74.061984, 40.810171],
+ [-74.060685, 40.8057],
+ [-74.065135, 40.80302],
+ [-74.068585, 40.7986],
+ [-74.071399, 40.797241],
+ [-74.077, 40.796379],
+ [-74.077787, 40.792796],
+ [-74.081794, 40.787994],
+ [-74.087219, 40.799287]
+ ]
+ ]
+ }
+ },
+ 6: {
+ type: 'Feature',
+ properties: {index: 6},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.347067, 40.691722],
+ [-74.36039, 40.699821],
+ [-74.352171, 40.70148],
+ [-74.342221, 40.707846],
+ [-74.333594, 40.716901],
+ [-74.330619, 40.716055],
+ [-74.332088, 40.720176],
+ [-74.325596, 40.717075],
+ [-74.321408, 40.719072],
+ [-74.315991, 40.719199],
+ [-74.311691, 40.715601],
+ [-74.309791, 40.715501],
+ [-74.308793, 40.714508],
+ [-74.302092, 40.713301],
+ [-74.299496, 40.713889],
+ [-74.29869, 40.71479],
+ [-74.296151, 40.712434],
+ [-74.297212, 40.710298],
+ [-74.301677, 40.707498],
+ [-74.301078, 40.704678],
+ [-74.306692, 40.703802],
+ [-74.309119, 40.702625],
+ [-74.310906, 40.700392],
+ [-74.310666, 40.699622],
+ [-74.307393, 40.698801],
+ [-74.307893, 40.695999],
+ [-74.30664, 40.694304],
+ [-74.308655, 40.691171],
+ [-74.312226, 40.689892],
+ [-74.310772, 40.683794],
+ [-74.307292, 40.682506],
+ [-74.308989, 40.680407],
+ [-74.307753, 40.680292],
+ [-74.310392, 40.678402],
+ [-74.322575, 40.677433],
+ [-74.347067, 40.691722]
+ ]
+ ]
+ }
+ },
+ 7: {
+ type: 'Feature',
+ properties: {index: 7},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.184345, 40.727604],
+ [-74.183145, 40.730677],
+ [-74.181958, 40.730397],
+ [-74.181105, 40.732722],
+ [-74.181977, 40.732938],
+ [-74.181504, 40.734135],
+ [-74.18328, 40.734558],
+ [-74.182741, 40.735778],
+ [-74.179407, 40.737014],
+ [-74.182582, 40.73798],
+ [-74.181787, 40.739633],
+ [-74.179055, 40.737705],
+ [-74.178029, 40.739555],
+ [-74.179295, 40.739935],
+ [-74.17785, 40.742469],
+ [-74.18066, 40.74342],
+ [-74.179821, 40.744703],
+ [-74.177068, 40.743847],
+ [-74.175752, 40.745597],
+ [-74.17646, 40.745849],
+ [-74.175989, 40.747417],
+ [-74.173784, 40.746929],
+ [-74.173566, 40.747955],
+ [-74.170978, 40.747424],
+ [-74.167568, 40.748054],
+ [-74.167484, 40.747446],
+ [-74.165976, 40.748091],
+ [-74.165987, 40.745199],
+ [-74.163788, 40.739201],
+ [-74.161669, 40.735781],
+ [-74.166099, 40.732923],
+ [-74.175517, 40.72346],
+ [-74.176772, 40.723054],
+ [-74.17736, 40.723261],
+ [-74.176965, 40.723961],
+ [-74.180517, 40.724365],
+ [-74.179633, 40.725829],
+ [-74.180319, 40.726113],
+ [-74.184236, 40.724266],
+ [-74.183892, 40.72506],
+ [-74.185205, 40.725405],
+ [-74.184345, 40.727604]
+ ]
+ ]
+ }
+ },
+ 8: {
+ type: 'Feature',
+ properties: {index: 8},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.1404, 40.805639],
+ [-74.146391, 40.806291],
+ [-74.149012, 40.80766],
+ [-74.149521, 40.806858],
+ [-74.148617, 40.806521],
+ [-74.175644, 40.809531],
+ [-74.183836, 40.812225],
+ [-74.179511, 40.816664],
+ [-74.178999, 40.818771],
+ [-74.176443, 40.821854],
+ [-74.174992, 40.821802],
+ [-74.162628, 40.837869],
+ [-74.151923, 40.832074],
+ [-74.150888, 40.833143],
+ [-74.148818, 40.830916],
+ [-74.149242, 40.830537],
+ [-74.130031, 40.819962],
+ [-74.136487, 40.8182],
+ [-74.137287, 40.8173],
+ [-74.138787, 40.8074],
+ [-74.1404, 40.805639]
+ ]
+ ]
+ }
+ },
+ 9: {
+ type: 'Feature',
+ properties: {index: 9},
+ geometry: {
+ type: 'MultiPolygon',
+ coordinates: [
+ [
+ [
+ [-74.566993, 41.087294],
+ [-74.564908, 41.089339],
+ [-74.56559, 41.090507],
+ [-74.564446, 41.091931],
+ [-74.562675, 41.093801],
+ [-74.560495, 41.094523],
+ [-74.559465, 41.093899],
+ [-74.558011, 41.094312],
+ [-74.556055, 41.091781],
+ [-74.554015, 41.092675],
+ [-74.552353, 41.091647],
+ [-74.552998, 41.09013],
+ [-74.556709, 41.087409],
+ [-74.558078, 41.085348],
+ [-74.56136, 41.08293],
+ [-74.563205, 41.082847],
+ [-74.565111, 41.081667],
+ [-74.567341, 41.082366],
+ [-74.566524, 41.085226],
+ [-74.566993, 41.087294]
+ ]
+ ],
+ [
+ [
+ [-74.593264, 41.088526],
+ [-74.601504, 41.094096],
+ [-74.602269, 41.092905],
+ [-74.606875, 41.096689],
+ [-74.606957, 41.097715],
+ [-74.638551, 41.118611],
+ [-74.634186, 41.132604],
+ [-74.633166, 41.133324],
+ [-74.629712, 41.131934],
+ [-74.625246, 41.136424],
+ [-74.620677, 41.139411],
+ [-74.613785, 41.139652],
+ [-74.6101, 41.137965],
+ [-74.610517, 41.136736],
+ [-74.606433, 41.135423],
+ [-74.60466, 41.136534],
+ [-74.598719, 41.137644],
+ [-74.595925, 41.139251],
+ [-74.593358, 41.139231],
+ [-74.579959, 41.144635],
+ [-74.576893, 41.136939],
+ [-74.573312, 41.136907],
+ [-74.571246, 41.137717],
+ [-74.569941, 41.136878],
+ [-74.575411, 41.101456],
+ [-74.577128, 41.101248],
+ [-74.574449, 41.101263],
+ [-74.567456, 41.103641],
+ [-74.562238, 41.103369],
+ [-74.55789, 41.106705],
+ [-74.552862, 41.10746],
+ [-74.557344, 41.105958],
+ [-74.56193, 41.102739],
+ [-74.569487, 41.100323],
+ [-74.575935, 41.095058],
+ [-74.578362, 41.09142],
+ [-74.583558, 41.087448],
+ [-74.585763, 41.083491],
+ [-74.593264, 41.088526]
+ ]
+ ]
+ ]
+ }
+ },
+ 10: {
+ type: 'Feature',
+ properties: {index: 10},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.158531, 41.025141],
+ [-74.155604, 41.02585],
+ [-74.155079, 41.0217],
+ [-74.147648, 41.022058],
+ [-74.149441, 41.013336],
+ [-74.151076, 41.010084],
+ [-74.142115, 41.008711],
+ [-74.141446, 41.007704],
+ [-74.137536, 41.007495],
+ [-74.141401, 41.005903],
+ [-74.145988, 41.001919],
+ [-74.155782, 41.001404],
+ [-74.157154, 40.998933],
+ [-74.153255, 40.996719],
+ [-74.151282, 40.993204],
+ [-74.153874, 40.98999],
+ [-74.149887, 40.987538],
+ [-74.142812, 40.986407],
+ [-74.141437, 40.984207],
+ [-74.14121, 40.982761],
+ [-74.142619, 40.981621],
+ [-74.149088, 40.971137],
+ [-74.17021, 40.983865],
+ [-74.170988, 40.976997],
+ [-74.191835, 40.978688],
+ [-74.189987, 40.992282],
+ [-74.189546, 41.003824],
+ [-74.18806, 41.00691],
+ [-74.187244, 41.01685],
+ [-74.16758, 41.023781],
+ [-74.163392, 41.022212],
+ [-74.158531, 41.025141]
+ ]
+ ]
+ }
+ },
+ 11: {
+ type: 'Feature',
+ properties: {index: 11},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.164572, 41.104182],
+ [-74.166137, 41.104468],
+ [-74.163755, 41.105993],
+ [-74.16128, 41.105606],
+ [-74.162067, 41.104822],
+ [-74.161454, 41.103924],
+ [-74.162067, 41.102889],
+ [-74.163932, 41.102848],
+ [-74.164572, 41.104182]
+ ]
+ ]
+ }
+ },
+ 12: {
+ type: 'Feature',
+ properties: {index: 12},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.151143, 40.97231],
+ [-74.141048, 40.966348],
+ [-74.148059, 40.94159],
+ [-74.149587, 40.941398],
+ [-74.153938, 40.937972],
+ [-74.16151, 40.937498],
+ [-74.167127, 40.934519],
+ [-74.171588, 40.941998],
+ [-74.169018, 40.947413],
+ [-74.167486, 40.95733],
+ [-74.16921, 40.969444],
+ [-74.170814, 40.970178],
+ [-74.17021, 40.983865],
+ [-74.151143, 40.97231]
+ ]
+ ]
+ }
+ },
+ 13: {
+ type: 'Feature',
+ properties: {index: 13},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-73.99863, 40.866791],
+ [-73.992942, 40.873032],
+ [-73.994052, 40.874607],
+ [-73.993799, 40.876601],
+ [-73.983367, 40.875127],
+ [-73.978515, 40.870534],
+ [-73.97569, 40.868903],
+ [-73.977687, 40.8605],
+ [-73.979382, 40.860799],
+ [-73.980514, 40.857975],
+ [-73.987985, 40.850884],
+ [-73.997417, 40.856176],
+ [-73.99829, 40.855105],
+ [-74.006059, 40.85697],
+ [-74.002723, 40.864981],
+ [-73.99863, 40.866791]
+ ]
+ ]
+ }
+ },
+ 14: {
+ type: 'Feature',
+ properties: {index: 14},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-73.99002, 40.887038],
+ [-73.994572, 40.888663],
+ [-73.98955, 40.900569],
+ [-73.989916, 40.906341],
+ [-73.989286, 40.911479],
+ [-73.988717, 40.911674],
+ [-73.972202, 40.912892],
+ [-73.971972, 40.913617],
+ [-73.949229, 40.900817],
+ [-73.959169, 40.885014],
+ [-73.95583, 40.883117],
+ [-73.957173, 40.881425],
+ [-73.957839, 40.882492],
+ [-73.958321, 40.882085],
+ [-73.957902, 40.880512],
+ [-73.969825, 40.865568],
+ [-73.978515, 40.870534],
+ [-73.983367, 40.875127],
+ [-73.993933, 40.876539],
+ [-73.992783, 40.879099],
+ [-73.98739, 40.886003],
+ [-73.99002, 40.887038]
+ ]
+ ]
+ }
+ },
+ 15: {
+ type: 'Feature',
+ properties: {index: 15},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.04531, 40.854103],
+ [-74.044779, 40.853794],
+ [-74.044816, 40.85746],
+ [-74.043745, 40.857547],
+ [-74.043757, 40.85919],
+ [-74.032018, 40.858647],
+ [-74.028884, 40.855216],
+ [-74.028418, 40.852282],
+ [-74.029969, 40.847658],
+ [-74.029185, 40.843427],
+ [-74.030484, 40.8389],
+ [-74.029084, 40.8344],
+ [-74.030084, 40.832],
+ [-74.035384, 40.8288],
+ [-74.036918, 40.82855],
+ [-74.040269, 40.830288],
+ [-74.03909, 40.830425],
+ [-74.039014, 40.832249],
+ [-74.040669, 40.832316],
+ [-74.039777, 40.834102],
+ [-74.04154, 40.833922],
+ [-74.041217, 40.834652],
+ [-74.042195, 40.834792],
+ [-74.042262, 40.836937],
+ [-74.043267, 40.838359],
+ [-74.042435, 40.840983],
+ [-74.043045, 40.843654],
+ [-74.045484, 40.843596],
+ [-74.045798, 40.846145],
+ [-74.051577, 40.847894],
+ [-74.052563, 40.848853],
+ [-74.052518, 40.850817],
+ [-74.053981, 40.853863],
+ [-74.051677, 40.857692],
+ [-74.04531, 40.854103]
+ ]
+ ]
+ }
+ },
+ 16: {
+ type: 'Feature',
+ properties: {index: 16},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.033649, 41.039572],
+ [-74.03703, 41.043696],
+ [-74.051378, 41.049278],
+ [-74.063774, 41.044631],
+ [-74.069675, 41.041541],
+ [-74.071014, 41.046613],
+ [-74.072234, 41.046686],
+ [-74.072452, 41.048935],
+ [-74.079369, 41.048492],
+ [-74.078814, 41.055144],
+ [-74.07699, 41.061365],
+ [-74.071915, 41.072883],
+ [-74.012583, 41.046396],
+ [-74.013197, 41.041442],
+ [-74.012452, 41.038698],
+ [-74.028831, 41.036591],
+ [-74.030807, 41.037199],
+ [-74.029374, 41.039144],
+ [-74.029546, 41.040261],
+ [-74.031631, 41.037894],
+ [-74.033649, 41.039572]
+ ]
+ ]
+ }
+ },
+ 17: {
+ type: 'Feature',
+ properties: {index: 17},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.424256, 41.026137],
+ [-74.423728, 41.027596],
+ [-74.421458, 41.02854],
+ [-74.417803, 41.028693],
+ [-74.414744, 41.027759],
+ [-74.41085, 41.026199],
+ [-74.40977, 41.024847],
+ [-74.40592, 41.024094],
+ [-74.403388, 41.021833],
+ [-74.402254, 41.019233],
+ [-74.399391, 41.017289],
+ [-74.390997, 41.015688],
+ [-74.389678, 41.014254],
+ [-74.389303, 41.012431],
+ [-74.388223, 41.012046],
+ [-74.386295, 41.011688],
+ [-74.382247, 41.013959],
+ [-74.379565, 41.014282],
+ [-74.371373, 41.011399],
+ [-74.367459, 41.011994],
+ [-74.364124, 41.011293],
+ [-74.36235, 41.01383],
+ [-74.355441, 41.013943],
+ [-74.351481, 41.01099],
+ [-74.351029, 41.007174],
+ [-74.352168, 41.005987],
+ [-74.350926, 41.004335],
+ [-74.34612, 41.0046],
+ [-74.342264, 41.006904],
+ [-74.340618, 41.005845],
+ [-74.336429, 41.007529],
+ [-74.334805, 41.006464],
+ [-74.334456, 41.003592],
+ [-74.329578, 41.002512],
+ [-74.328411, 41.001419],
+ [-74.330477, 40.997535],
+ [-74.329601, 40.995845],
+ [-74.329855, 40.991939],
+ [-74.332185, 40.990168],
+ [-74.331401, 40.988262],
+ [-74.330459, 40.966053],
+ [-74.336465, 40.960102],
+ [-74.340902, 40.953453],
+ [-74.339763, 40.95213],
+ [-74.336043, 40.951261],
+ [-74.335478, 40.949418],
+ [-74.341094, 40.946298],
+ [-74.364296, 40.957929],
+ [-74.397898, 40.959829],
+ [-74.410065, 40.958717],
+ [-74.428155, 40.958911],
+ [-74.428555, 40.958226],
+ [-74.428574, 40.959286],
+ [-74.431175, 40.959368],
+ [-74.430749, 40.984608],
+ [-74.432097, 40.984008],
+ [-74.432025, 40.992541],
+ [-74.430602, 40.993339],
+ [-74.430178, 41.018128],
+ [-74.429211, 41.017679],
+ [-74.425375, 41.019271],
+ [-74.426013, 41.020166],
+ [-74.423504, 41.025734],
+ [-74.424256, 41.026137]
+ ]
+ ]
+ }
+ },
+ 18: {
+ type: 'Feature',
+ properties: {index: 18},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.105049, 40.269701],
+ [-74.103488, 40.272418],
+ [-74.106018, 40.274773],
+ [-74.101607, 40.280574],
+ [-74.100748, 40.279887],
+ [-74.100161, 40.280996],
+ [-74.098821, 40.28123],
+ [-74.082891, 40.274113],
+ [-74.082201, 40.270348],
+ [-74.072487, 40.275582],
+ [-74.071041, 40.274346],
+ [-74.070161, 40.270832],
+ [-74.069033, 40.270664],
+ [-74.067579, 40.27089],
+ [-74.065924, 40.272621],
+ [-74.061569, 40.273615],
+ [-74.051627, 40.272795],
+ [-74.049539, 40.271935],
+ [-74.043385, 40.273422],
+ [-74.039322, 40.25183],
+ [-74.019689, 40.253485],
+ [-74.019866, 40.251435],
+ [-74.01764, 40.249613],
+ [-74.018373, 40.247723],
+ [-74.020904, 40.246901],
+ [-74.022762, 40.240874],
+ [-74.015502, 40.23916],
+ [-74.015218, 40.237693],
+ [-74.01292, 40.236238],
+ [-74.008684, 40.235364],
+ [-74.009389, 40.232973],
+ [-74.007068, 40.232283],
+ [-74.006199, 40.231174],
+ [-73.994705, 40.230067],
+ [-73.994681, 40.224512],
+ [-73.998481, 40.216812],
+ [-74.002556, 40.21709],
+ [-74.018647, 40.213377],
+ [-74.024998, 40.213125],
+ [-74.025508, 40.219099],
+ [-74.02618, 40.219151],
+ [-74.025518, 40.219641],
+ [-74.025516, 40.223269],
+ [-74.077409, 40.234395],
+ [-74.076503, 40.240881],
+ [-74.078391, 40.240398],
+ [-74.079541, 40.242058],
+ [-74.07912, 40.243797],
+ [-74.075526, 40.245243],
+ [-74.073864, 40.257239],
+ [-74.075693, 40.259189],
+ [-74.081411, 40.258528],
+ [-74.082119, 40.251457],
+ [-74.08462, 40.252719],
+ [-74.08778, 40.250225],
+ [-74.095925, 40.249682],
+ [-74.096515, 40.245582],
+ [-74.097686, 40.245471],
+ [-74.110838, 40.252683],
+ [-74.10372, 40.255887],
+ [-74.106884, 40.259944],
+ [-74.108802, 40.260613],
+ [-74.108582, 40.264424],
+ [-74.106872, 40.265512],
+ [-74.105049, 40.269701]
+ ]
+ ]
+ }
+ },
+ 19: {
+ type: 'Feature',
+ properties: {index: 19},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.293808, 40.633387],
+ [-74.291091, 40.636102],
+ [-74.290991, 40.638102],
+ [-74.28982, 40.639951],
+ [-74.287325, 40.639999],
+ [-74.281687, 40.643381],
+ [-74.282183, 40.644572],
+ [-74.280691, 40.645712],
+ [-74.281494, 40.647271],
+ [-74.281488, 40.650145],
+ [-74.264342, 40.637244],
+ [-74.258956, 40.643217],
+ [-74.251701, 40.645117],
+ [-74.248772, 40.647293],
+ [-74.241341, 40.649791],
+ [-74.232513, 40.654927],
+ [-74.200469, 40.63263],
+ [-74.202247, 40.630903],
+ [-74.203737, 40.624227],
+ [-74.201864, 40.618557],
+ [-74.203128, 40.614109],
+ [-74.203813, 40.605961],
+ [-74.199408, 40.600201],
+ [-74.19952, 40.597539],
+ [-74.203688, 40.592691],
+ [-74.210741, 40.597032],
+ [-74.212032, 40.598372],
+ [-74.21287, 40.602035],
+ [-74.215101, 40.604074],
+ [-74.220216, 40.600555],
+ [-74.231748, 40.598881],
+ [-74.234067, 40.600345],
+ [-74.234767, 40.601945],
+ [-74.236609, 40.60272],
+ [-74.242593, 40.599754],
+ [-74.25381, 40.600989],
+ [-74.255822, 40.602194],
+ [-74.258114, 40.60225],
+ [-74.255608, 40.607618],
+ [-74.278844, 40.629365],
+ [-74.285491, 40.635102],
+ [-74.290491, 40.632903],
+ [-74.292494, 40.630803],
+ [-74.296379, 40.628711],
+ [-74.297134, 40.62933],
+ [-74.293808, 40.633387]
+ ]
+ ]
+ }
+ },
+ 20: {
+ type: 'Feature',
+ properties: {index: 20},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.013788, 40.249179],
+ [-74.01764, 40.249613],
+ [-74.019302, 40.250582],
+ [-74.019689, 40.253485],
+ [-74.012618, 40.253141],
+ [-74.011201, 40.257],
+ [-74.003013, 40.256831],
+ [-74.002888, 40.258313],
+ [-74.000094, 40.257407],
+ [-74.0002, 40.26345],
+ [-73.992354, 40.262405],
+ [-73.986681, 40.260211],
+ [-73.992881, 40.237266],
+ [-74.008001, 40.239851],
+ [-74.008447, 40.242576],
+ [-74.009543, 40.243782],
+ [-74.009733, 40.248425],
+ [-74.013788, 40.249179]
+ ]
+ ]
+ }
+ },
+ 21: {
+ type: 'Feature',
+ properties: {index: 21},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.680775, 41.141961],
+ [-74.694975, 41.131348],
+ [-74.69885, 41.135537],
+ [-74.701359, 41.136794],
+ [-74.703406, 41.13429],
+ [-74.706486, 41.126963],
+ [-74.713138, 41.120327],
+ [-74.711489, 41.118891],
+ [-74.720408, 41.112296],
+ [-74.746949, 41.119559],
+ [-74.745694, 41.120599],
+ [-74.745157, 41.124768],
+ [-74.741896, 41.12892],
+ [-74.737953, 41.129147],
+ [-74.737676, 41.128104],
+ [-74.735155, 41.126436],
+ [-74.728554, 41.128919],
+ [-74.733121, 41.130496],
+ [-74.735764, 41.13238],
+ [-74.739, 41.137338],
+ [-74.733352, 41.138875],
+ [-74.731341, 41.143627],
+ [-74.721084, 41.150262],
+ [-74.716727, 41.151405],
+ [-74.715427, 41.151356],
+ [-74.712447, 41.147925],
+ [-74.705516, 41.147476],
+ [-74.704311, 41.147987],
+ [-74.703071, 41.146962],
+ [-74.694816, 41.157602],
+ [-74.690193, 41.159813],
+ [-74.684027, 41.164539],
+ [-74.681418, 41.165103],
+ [-74.67785, 41.163684],
+ [-74.674644, 41.163581],
+ [-74.67129, 41.168764],
+ [-74.667272, 41.172585],
+ [-74.660801, 41.166128],
+ [-74.66382, 41.163773],
+ [-74.663566, 41.162153],
+ [-74.66462, 41.159589],
+ [-74.663429, 41.157321],
+ [-74.664679, 41.155926],
+ [-74.670442, 41.154203],
+ [-74.668458, 41.152808],
+ [-74.668539, 41.151161],
+ [-74.680775, 41.141961]
+ ]
+ ]
+ }
+ },
+ 22: {
+ type: 'Feature',
+ properties: {index: 22},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.39366, 40.830496],
+ [-74.405638, 40.838928],
+ [-74.422925, 40.8447],
+ [-74.451083, 40.838346],
+ [-74.463181, 40.843465],
+ [-74.467565, 40.846525],
+ [-74.465964, 40.848547],
+ [-74.464617, 40.848757],
+ [-74.46076, 40.846768],
+ [-74.454244, 40.85264],
+ [-74.452162, 40.852242],
+ [-74.449605, 40.854737],
+ [-74.45126, 40.859271],
+ [-74.449707, 40.860541],
+ [-74.451701, 40.860499],
+ [-74.461277, 40.86634],
+ [-74.46095, 40.867844],
+ [-74.449226, 40.866302],
+ [-74.443807, 40.866626],
+ [-74.447036, 40.867209],
+ [-74.439733, 40.866511],
+ [-74.43882, 40.870782],
+ [-74.440454, 40.869142],
+ [-74.445241, 40.867982],
+ [-74.450476, 40.869008],
+ [-74.450185, 40.872275],
+ [-74.44921, 40.874111],
+ [-74.451584, 40.873513],
+ [-74.451567, 40.876515],
+ [-74.447705, 40.876866],
+ [-74.448803, 40.879174],
+ [-74.450256, 40.879959],
+ [-74.433632, 40.874255],
+ [-74.433403, 40.877506],
+ [-74.43068, 40.881706],
+ [-74.425693, 40.882707],
+ [-74.424699, 40.879771],
+ [-74.425187, 40.878315],
+ [-74.419916, 40.879254],
+ [-74.420486, 40.875395],
+ [-74.419362, 40.871206],
+ [-74.414728, 40.868737],
+ [-74.410267, 40.877077],
+ [-74.405039, 40.875898],
+ [-74.404027, 40.878969],
+ [-74.4017, 40.881459],
+ [-74.396071, 40.881961],
+ [-74.392244, 40.873568],
+ [-74.39051, 40.874087],
+ [-74.390446, 40.87614],
+ [-74.384095, 40.876199],
+ [-74.383996, 40.875199],
+ [-74.380159, 40.876783],
+ [-74.376464, 40.876885],
+ [-74.376099, 40.875662],
+ [-74.375014, 40.876373],
+ [-74.372986, 40.875671],
+ [-74.371975, 40.870267],
+ [-74.36966, 40.871168],
+ [-74.368983, 40.869851],
+ [-74.369611, 40.869488],
+ [-74.365509, 40.869788],
+ [-74.365091, 40.868735],
+ [-74.366462, 40.867373],
+ [-74.366416, 40.864756],
+ [-74.36514, 40.866106],
+ [-74.362694, 40.863887],
+ [-74.358996, 40.863608],
+ [-74.354787, 40.86599],
+ [-74.35609, 40.867062],
+ [-74.358298, 40.866561],
+ [-74.361219, 40.867003],
+ [-74.361668, 40.867421],
+ [-74.357831, 40.866738],
+ [-74.355927, 40.867299],
+ [-74.353829, 40.86556],
+ [-74.352328, 40.866215],
+ [-74.349994, 40.864479],
+ [-74.349303, 40.86285],
+ [-74.348177, 40.862628],
+ [-74.34716, 40.859279],
+ [-74.347658, 40.856795],
+ [-74.346489, 40.856411],
+ [-74.345626, 40.857625],
+ [-74.344092, 40.856842],
+ [-74.340904, 40.852353],
+ [-74.341387, 40.85158],
+ [-74.344485, 40.850715],
+ [-74.341838, 40.849039],
+ [-74.341288, 40.847784],
+ [-74.341951, 40.846224],
+ [-74.35252, 40.844081],
+ [-74.354781, 40.840973],
+ [-74.360222, 40.840871],
+ [-74.367495, 40.836199],
+ [-74.371095, 40.835699],
+ [-74.379803, 40.828479],
+ [-74.380291, 40.830042],
+ [-74.381487, 40.828478],
+ [-74.380893, 40.827515],
+ [-74.383959, 40.824991],
+ [-74.388727, 40.825989],
+ [-74.39366, 40.830496]
+ ]
+ ]
+ }
+ },
+ 23: {
+ type: 'Feature',
+ properties: {index: 23},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-75.097586, 40.843042],
+ [-75.095784, 40.847082],
+ [-75.090962, 40.849187],
+ [-75.076684, 40.849875],
+ [-75.07083, 40.847392],
+ [-75.067655, 40.847329],
+ [-75.064328, 40.848338],
+ [-75.063343, 40.851499],
+ [-75.060491, 40.85302],
+ [-75.059239, 40.856102],
+ [-75.053294, 40.8599],
+ [-75.051692, 40.863363],
+ [-75.050839, 40.868067],
+ [-75.053664, 40.87366],
+ [-75.058655, 40.877654],
+ [-75.062073, 40.882188],
+ [-75.060998, 40.882237],
+ [-75.060556, 40.883385],
+ [-75.059124, 40.884072],
+ [-75.060651, 40.889189],
+ [-75.064166, 40.893064],
+ [-75.063612, 40.895385],
+ [-75.066827, 40.895434],
+ [-75.067646, 40.896657],
+ [-75.067452, 40.899412],
+ [-75.071768, 40.898989],
+ [-75.072097, 40.898253],
+ [-75.073515, 40.900408],
+ [-75.07391, 40.899656],
+ [-75.075231, 40.899947],
+ [-75.07609, 40.907039],
+ [-75.07929, 40.913886],
+ [-75.095528, 40.924148],
+ [-75.104809, 40.935247],
+ [-75.106148, 40.93967],
+ [-75.111689, 40.948127],
+ [-75.117767, 40.953013],
+ [-75.119116, 40.958161],
+ [-75.118076, 40.959633],
+ [-75.118346, 40.963676],
+ [-75.120435, 40.968302],
+ [-75.122603, 40.970152],
+ [-75.130166, 40.968961],
+ [-75.132622, 40.970005],
+ [-75.134701, 40.972038],
+ [-75.135531, 40.973803],
+ [-75.135521, 40.976865],
+ [-75.132522, 40.981235],
+ [-75.131096, 40.990464],
+ [-75.127196, 40.993954],
+ [-75.110595, 41.002174],
+ [-75.109113, 41.004102],
+ [-75.095556, 41.008874],
+ [-75.088596, 41.015024],
+ [-75.081101, 41.016838],
+ [-75.074999, 41.01713],
+ [-75.069277, 41.019348],
+ [-75.068369, 41.018018],
+ [-75.037857, 41.030485],
+ [-75.029696, 41.035357],
+ [-75.027882, 41.037279],
+ [-75.024165, 41.038536],
+ [-75.017392, 41.042515],
+ [-75.015185, 41.04423],
+ [-75.009346, 41.051893],
+ [-75.003538, 41.057084],
+ [-75.000477, 41.058017],
+ [-74.998034, 41.057699],
+ [-74.995569, 41.058848],
+ [-74.992703, 41.058564],
+ [-74.992174, 41.05969],
+ [-74.984424, 41.064889],
+ [-74.984063, 41.062832],
+ [-74.980707, 41.061781],
+ [-74.964688, 41.063446],
+ [-74.963232, 41.060643],
+ [-74.964228, 41.057935],
+ [-74.961406, 41.055613],
+ [-74.96458, 41.051797],
+ [-74.99578, 41.033212],
+ [-75.002831, 41.030399],
+ [-75.003773, 41.031045],
+ [-75.004225, 41.032144],
+ [-75.002834, 41.033539],
+ [-74.998731, 41.035666],
+ [-74.998954, 41.038437],
+ [-74.998147, 41.038507],
+ [-74.998255, 41.037117],
+ [-74.997435, 41.037002],
+ [-74.995356, 41.040166],
+ [-74.991659, 41.042442],
+ [-74.994705, 41.041671],
+ [-75.004298, 41.035416],
+ [-75.005265, 41.031919],
+ [-75.003411, 41.030082],
+ [-75.016649, 41.022886],
+ [-75.021761, 41.020728],
+ [-75.036997, 41.017017],
+ [-75.04378, 41.014322],
+ [-75.03456, 41.008186],
+ [-75.034725, 41.004652],
+ [-75.033729, 41.002569],
+ [-75.034213, 41.001403],
+ [-75.032281, 40.999595],
+ [-75.032341, 40.996951],
+ [-75.02898, 40.99561],
+ [-75.011902, 40.998459],
+ [-75.008874, 40.99009],
+ [-75.010378, 40.985846],
+ [-75.010075, 40.984303],
+ [-75.002953, 40.981862],
+ [-75.005732, 40.980256],
+ [-75.021928, 40.975764],
+ [-75.02123, 40.970357],
+ [-75.024322, 40.969825],
+ [-75.021013, 40.968997],
+ [-75.020256, 40.963611],
+ [-75.018195, 40.964426],
+ [-75.019502, 40.961433],
+ [-75.018391, 40.959758],
+ [-75.038299, 40.952908],
+ [-75.03083, 40.946719],
+ [-75.029307, 40.946706],
+ [-75.020847, 40.940258],
+ [-75.019403, 40.941591],
+ [-75.019535, 40.939241],
+ [-75.021033, 40.939612],
+ [-75.022159, 40.938123],
+ [-75.015041, 40.928458],
+ [-75.027891, 40.920693],
+ [-75.02861, 40.915329],
+ [-75.031276, 40.912284],
+ [-75.024568, 40.908851],
+ [-75.0223, 40.905808],
+ [-75.03156, 40.896317],
+ [-75.030145, 40.89056],
+ [-75.024001, 40.891451],
+ [-75.022183, 40.892446],
+ [-75.020636, 40.891426],
+ [-75.017441, 40.891496],
+ [-75.01407, 40.890293],
+ [-75.008894, 40.885907],
+ [-75.010391, 40.884111],
+ [-75.014797, 40.882787],
+ [-75.019161, 40.881981],
+ [-75.024044, 40.883433],
+ [-75.025249, 40.882262],
+ [-75.02744, 40.88172],
+ [-75.021561, 40.875098],
+ [-75.014017, 40.868236],
+ [-75.016147, 40.867869],
+ [-75.016559, 40.868533],
+ [-75.020503, 40.866673],
+ [-75.021161, 40.867805],
+ [-75.022549, 40.86763],
+ [-75.023738, 40.863747],
+ [-75.025591, 40.860958],
+ [-75.02513, 40.858498],
+ [-75.024052, 40.857718],
+ [-75.028967, 40.856352],
+ [-75.030658, 40.857634],
+ [-75.032149, 40.85736],
+ [-75.029716, 40.863273],
+ [-75.031074, 40.869309],
+ [-75.035994, 40.868633],
+ [-75.051176, 40.860567],
+ [-75.049486, 40.860618],
+ [-75.055534, 40.855224],
+ [-75.057455, 40.852435],
+ [-75.057422, 40.848045],
+ [-75.062178, 40.847418],
+ [-75.061305, 40.843848],
+ [-75.064167, 40.842773],
+ [-75.06489, 40.843711],
+ [-75.068656, 40.844534],
+ [-75.070267, 40.842345],
+ [-75.070187, 40.837954],
+ [-75.07707, 40.840947],
+ [-75.088876, 40.832533],
+ [-75.096301, 40.83839],
+ [-75.097572, 40.840967],
+ [-75.097586, 40.843042]
+ ]
+ ]
+ }
+ },
+ 24: {
+ type: 'Feature',
+ properties: {index: 24},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.624966, 40.729228],
+ [-74.623454, 40.730678],
+ [-74.622391, 40.735039],
+ [-74.620469, 40.736001],
+ [-74.627104, 40.737727],
+ [-74.628747, 40.736844],
+ [-74.630137, 40.735166],
+ [-74.631305, 40.734548],
+ [-74.632923, 40.732801],
+ [-74.633441, 40.732418],
+ [-74.633871, 40.732237],
+ [-74.632255, 40.733644],
+ [-74.630508, 40.736973],
+ [-74.631292, 40.738187],
+ [-74.629319, 40.739683],
+ [-74.63127, 40.741111],
+ [-74.555922, 40.75831],
+ [-74.555203, 40.756999],
+ [-74.553197, 40.756439],
+ [-74.551914, 40.754863],
+ [-74.550924, 40.751073],
+ [-74.552886, 40.749578],
+ [-74.548756, 40.746131],
+ [-74.549383, 40.745092],
+ [-74.548999, 40.740994],
+ [-74.550988, 40.741647],
+ [-74.551958, 40.739985],
+ [-74.55856, 40.736104],
+ [-74.556731, 40.73478],
+ [-74.560814, 40.731351],
+ [-74.563545, 40.730267],
+ [-74.564013, 40.728933],
+ [-74.552547, 40.722803],
+ [-74.555477, 40.721368],
+ [-74.5533, 40.719188],
+ [-74.556246, 40.717896],
+ [-74.567761, 40.706455],
+ [-74.607957, 40.694414],
+ [-74.609197, 40.696081],
+ [-74.611319, 40.695338],
+ [-74.61599, 40.695721],
+ [-74.618622, 40.695149],
+ [-74.618226, 40.704919],
+ [-74.620821, 40.710878],
+ [-74.620235, 40.712269],
+ [-74.615067, 40.715173],
+ [-74.612185, 40.719403],
+ [-74.612003, 40.72373],
+ [-74.61545, 40.723053],
+ [-74.620932, 40.716648],
+ [-74.623654, 40.715129],
+ [-74.625684, 40.715004],
+ [-74.634205, 40.722291],
+ [-74.631262, 40.72482],
+ [-74.626871, 40.725334],
+ [-74.626784, 40.727547],
+ [-74.625149, 40.72802],
+ [-74.625639, 40.728948],
+ [-74.624966, 40.729228]
+ ]
+ ]
+ }
+ },
+ 25: {
+ type: 'Feature',
+ properties: {index: 25},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.409178, 40.741059],
+ [-74.405471, 40.73989],
+ [-74.402552, 40.742258],
+ [-74.402172, 40.741487],
+ [-74.391635, 40.75198],
+ [-74.389873, 40.751394],
+ [-74.383649, 40.754173],
+ [-74.38351, 40.755403],
+ [-74.380255, 40.755386],
+ [-74.381513, 40.754696],
+ [-74.373581, 40.75015],
+ [-74.370371, 40.752139],
+ [-74.363072, 40.750403],
+ [-74.367572, 40.748824],
+ [-74.364765, 40.746788],
+ [-74.366562, 40.743889],
+ [-74.371979, 40.742359],
+ [-74.37256, 40.741587],
+ [-74.370829, 40.735753],
+ [-74.371246, 40.734627],
+ [-74.374669, 40.733545],
+ [-74.377932, 40.734319],
+ [-74.379732, 40.73396],
+ [-74.380295, 40.7333],
+ [-74.379853, 40.732492],
+ [-74.377503, 40.730032],
+ [-74.384382, 40.724385],
+ [-74.388232, 40.726165],
+ [-74.39069, 40.725499],
+ [-74.390769, 40.718294],
+ [-74.39509, 40.717273],
+ [-74.402254, 40.718001],
+ [-74.404574, 40.715245],
+ [-74.40735, 40.713461],
+ [-74.408466, 40.710106],
+ [-74.410057, 40.709517],
+ [-74.412495, 40.7103],
+ [-74.413818, 40.707248],
+ [-74.4154, 40.705781],
+ [-74.426897, 40.701711],
+ [-74.430005, 40.697838],
+ [-74.429578, 40.697004],
+ [-74.430781, 40.693453],
+ [-74.434551, 40.693575],
+ [-74.437847, 40.6919],
+ [-74.43797, 40.690247],
+ [-74.444333, 40.687969],
+ [-74.449736, 40.718831],
+ [-74.447841, 40.718904],
+ [-74.437223, 40.723493],
+ [-74.426842, 40.729088],
+ [-74.424382, 40.734726],
+ [-74.426048, 40.733344],
+ [-74.427376, 40.733482],
+ [-74.426785, 40.735839],
+ [-74.429199, 40.735878],
+ [-74.430449, 40.734831],
+ [-74.430765, 40.735285],
+ [-74.428298, 40.736522],
+ [-74.430213, 40.7377],
+ [-74.43032, 40.736951],
+ [-74.432798, 40.736704],
+ [-74.434311, 40.735493],
+ [-74.437467, 40.735121],
+ [-74.437348, 40.73587],
+ [-74.439214, 40.73673],
+ [-74.44084, 40.73642],
+ [-74.439595, 40.736006],
+ [-74.440803, 40.734753],
+ [-74.441744, 40.735486],
+ [-74.441043, 40.736868],
+ [-74.442891, 40.735942],
+ [-74.444308, 40.738929],
+ [-74.438047, 40.741641],
+ [-74.432156, 40.746447],
+ [-74.434702, 40.747732],
+ [-74.438198, 40.752308],
+ [-74.436616, 40.752849],
+ [-74.435314, 40.752306],
+ [-74.436024, 40.751602],
+ [-74.433267, 40.750069],
+ [-74.432271, 40.751089],
+ [-74.428827, 40.749474],
+ [-74.430019, 40.746001],
+ [-74.41515, 40.742751],
+ [-74.409916, 40.740501],
+ [-74.409178, 40.741059]
+ ]
+ ]
+ }
+ },
+ 26: {
+ type: 'Feature',
+ properties: {index: 26},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.746315, 40.699842],
+ [-74.738518, 40.708428],
+ [-74.73803, 40.711868],
+ [-74.734191, 40.71672],
+ [-74.729987, 40.717241],
+ [-74.732448, 40.720062],
+ [-74.724418, 40.719455],
+ [-74.720152, 40.720857],
+ [-74.721834, 40.718984],
+ [-74.720881, 40.716657],
+ [-74.71557, 40.714933],
+ [-74.715093, 40.713903],
+ [-74.717147, 40.714164],
+ [-74.716015, 40.710283],
+ [-74.717798, 40.709288],
+ [-74.714601, 40.703286],
+ [-74.714347, 40.699368],
+ [-74.721624, 40.690735],
+ [-74.722079, 40.688939],
+ [-74.72065, 40.687797],
+ [-74.72303, 40.68265],
+ [-74.725555, 40.683786],
+ [-74.729034, 40.68356],
+ [-74.730184, 40.682581],
+ [-74.732786, 40.683785],
+ [-74.730782, 40.686112],
+ [-74.73592, 40.688406],
+ [-74.732475, 40.692508],
+ [-74.733375, 40.693151],
+ [-74.734169, 40.699729],
+ [-74.744802, 40.697551],
+ [-74.746315, 40.699842]
+ ]
+ ]
+ }
+ },
+ 27: {
+ type: 'Feature',
+ properties: {index: 27},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.96258, 40.908359],
+ [-74.959171, 40.909348],
+ [-74.958166, 40.910924],
+ [-74.955046, 40.911941],
+ [-74.952035, 40.914182],
+ [-74.947947, 40.912938],
+ [-74.945624, 40.911373],
+ [-74.945686, 40.909849],
+ [-74.944298, 40.909232],
+ [-74.940447, 40.911676],
+ [-74.93977, 40.916014],
+ [-74.93583, 40.915965],
+ [-74.93084, 40.917595],
+ [-74.927867, 40.906805],
+ [-74.887969, 40.933194],
+ [-74.887988, 40.931636],
+ [-74.886846, 40.929954],
+ [-74.882716, 40.930239],
+ [-74.874369, 40.932296],
+ [-74.873234, 40.934085],
+ [-74.86866, 40.936267],
+ [-74.866899, 40.933617],
+ [-74.859938, 40.93051],
+ [-74.852375, 40.930101],
+ [-74.848303, 40.933399],
+ [-74.847051, 40.933475],
+ [-74.844269, 40.930927],
+ [-74.844978, 40.927355],
+ [-74.840887, 40.923065],
+ [-74.840416, 40.921211],
+ [-74.84412, 40.919599],
+ [-74.842955, 40.919474],
+ [-74.844491, 40.91793],
+ [-74.844531, 40.915532],
+ [-74.859914, 40.909303],
+ [-74.860956, 40.904959],
+ [-74.862287, 40.903064],
+ [-74.858839, 40.900314],
+ [-74.858959, 40.899168],
+ [-74.848263, 40.892969],
+ [-74.851169, 40.889839],
+ [-74.85923, 40.885743],
+ [-74.859366, 40.887143],
+ [-74.860511, 40.887838],
+ [-74.863545, 40.883912],
+ [-74.867125, 40.884417],
+ [-74.872203, 40.882492],
+ [-74.872768, 40.883398],
+ [-74.876052, 40.884353],
+ [-74.882058, 40.883988],
+ [-74.882891, 40.882731],
+ [-74.887871, 40.879998],
+ [-74.889572, 40.87633],
+ [-74.894028, 40.872274],
+ [-74.89991, 40.869372],
+ [-74.903521, 40.865869],
+ [-74.905344, 40.866523],
+ [-74.903426, 40.864607],
+ [-74.903128, 40.86326],
+ [-74.900129, 40.862348],
+ [-74.896917, 40.858397],
+ [-74.894792, 40.857851],
+ [-74.894754, 40.856634],
+ [-74.893744, 40.8561],
+ [-74.894932, 40.856353],
+ [-74.895533, 40.851298],
+ [-74.907884, 40.855752],
+ [-74.915047, 40.852114],
+ [-74.924079, 40.851947],
+ [-74.929062, 40.848559],
+ [-74.934249, 40.85086],
+ [-74.933294, 40.852222],
+ [-74.935853, 40.852373],
+ [-74.941042, 40.846725],
+ [-74.94384, 40.846406],
+ [-74.950587, 40.842517],
+ [-74.951581, 40.839414],
+ [-74.956373, 40.834365],
+ [-74.971647, 40.842927],
+ [-74.971381, 40.843883],
+ [-74.968743, 40.844635],
+ [-74.960144, 40.855778],
+ [-74.963608, 40.855651],
+ [-74.963127, 40.858348],
+ [-74.964627, 40.85919],
+ [-74.96689, 40.85904],
+ [-74.968542, 40.860945],
+ [-74.97156, 40.860844],
+ [-74.968929, 40.864416],
+ [-74.969525, 40.86504],
+ [-74.971744, 40.861518],
+ [-74.972369, 40.86245],
+ [-74.9725, 40.861514],
+ [-74.973998, 40.861535],
+ [-74.974787, 40.860622],
+ [-74.978735, 40.87158],
+ [-74.979484, 40.87194],
+ [-74.97877, 40.873364],
+ [-74.979931, 40.874228],
+ [-74.976368, 40.876708],
+ [-74.982155, 40.879127],
+ [-74.980311, 40.880401],
+ [-74.980521, 40.881626],
+ [-74.976513, 40.883126],
+ [-74.978397, 40.88719],
+ [-74.976715, 40.890538],
+ [-74.9757, 40.883461],
+ [-74.977469, 40.879267],
+ [-74.97593, 40.878446],
+ [-74.976152, 40.879675],
+ [-74.974987, 40.881253],
+ [-74.969259, 40.884146],
+ [-74.963281, 40.885689],
+ [-74.957982, 40.890776],
+ [-74.957476, 40.893947],
+ [-74.961516, 40.894095],
+ [-74.95829, 40.900182],
+ [-74.962611, 40.906121],
+ [-74.959793, 40.907294],
+ [-74.96258, 40.908359]
+ ]
+ ]
+ }
+ },
+ 28: {
+ type: 'Feature',
+ properties: {index: 28},
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-74.261032, 40.832085],
+ [-74.259357, 40.836363],
+ [-74.257107, 40.838124],
+ [-74.256523, 40.841781],
+ [-74.251892, 40.849829],
+ [-74.2334, 40.844389],
+ [-74.237214, 40.836034],
+ [-74.227445, 40.83331],
+ [-74.227147, 40.836396],
+ [-74.22099, 40.834799],
+ [-74.225755, 40.827381],
+ [-74.224352, 40.827071],
+ [-74.227054, 40.824221],
+ [-74.227725, 40.824867],
+ [-74.229113, 40.822199],
+ [-74.229079, 40.820019],
+ [-74.232573, 40.814863],
+ [-74.250795, 40.824461],
+ [-74.264305, 40.825431],
+ [-74.261032, 40.832085]
+ ]
+ ]
+ }
+ }
+};
+
+const mergedLayer1 = new GeojsonLayer({id: 'u7apppt'});
+mergedLayer1.config = {
+ dataId: 'a5ybmwl2d',
+ label: 'stroke by pop',
+ color: [221, 178, 124],
+ columns: {
+ geojson: {value: 'simplified_shape', fieldIdx: 2}
+ },
+ isVisible: true,
+ isConfigActive: false,
+ highlightColor: [252, 242, 26],
+ colorField: null,
+ colorScale: 'quantile',
+ colorDomain: [0, 1],
+ sizeField: {
+ name: 'c_ta',
+ id: 'c_ta',
+ type: 'real',
+ format: '',
+ tableFieldIndex: 13
+ },
+ sizeScale: 'linear',
+ sizeDomain: [0.970877074, 1],
+ heightField: null,
+ heightScale: 'linear',
+ heightDomain: [0, 1],
+ radiusField: null,
+ radiusScale: 'linear',
+ radiusDomain: [0, 1],
+ visConfig: {
+ opacity: 0.8,
+ thickness: 7.6,
+ colorRange: {
+ 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
+ }
+};
+
+mergedLayer1.meta = {
+ bounds: [-75.135531, 40.213125, -73.949229, 41.172585],
+ lightSettings: {
+ lightsPosition: [-75.135531, 40.213125, 8000, -73.949229, 41.172585, 8000],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ },
+ fp64: false,
+ fixedRadius: false,
+ featureTypes: {
+ polygon: true
+ }
+};
+
+mergedLayer1.dataToFeature = mergedLayer0.dataToFeature;
+
+export const mergedLayers = [mergedLayer0, mergedLayer1];
+
+export const mergedInteraction = {
+ tooltip: {
+ id: 'tooltip',
+ iconComponent: Messages,
+ enabled: false,
+ config: {
+ fieldsToShow: {
+ a5ybmwl2d: ['a_zip', 'str_type', 'int_type']
+ }
+ }
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ iconComponent: Crosshairs,
+ config: {
+ size: 1
+ }
+ }
+};
diff --git a/test/fixtures/state-saved-v1-2.js b/test/fixtures/state-saved-v1-2.js
new file mode 100644
index 000000000..f7300133b
--- /dev/null
+++ b/test/fixtures/state-saved-v1-2.js
@@ -0,0 +1,5054 @@
+// Copyright (c) 2018 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.
+
+export const stateSavedV1_2 = {
+ config: {
+ version: 'v1',
+ config: {
+ visState: {
+ filters: [
+ {
+ dataId: 'test_phone_data',
+ id: 'me',
+ name: 'epoch',
+ type: 'timeRange',
+ value: [1477646491000, 1477646695000],
+ enlarged: true,
+ plotType: 'lineChart',
+ yAxis: {name: 'metric', type: 'real'}
+ },
+ {
+ dataId: 'test_phone_data',
+ id: '7ihrp33kx',
+ name: 'time string',
+ type: 'timeRange',
+ value: [1509533725000, 1509534560000],
+ enlarged: false,
+ plotType: 'histogram',
+ yAxis: null
+ }
+ ],
+ layers: [
+ {
+ id: 'b18ve1q',
+ type: 'point',
+ config: {
+ dataId: 'test_phone_data',
+ label: 'Point',
+ color: [18, 147, 154],
+ columns: {lat: 'lat', lng: 'lng', altitude: null},
+ isVisible: true,
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ },
+ visualChannels: {
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ test_phone_data: [
+ 'uuid',
+ 'Latitude',
+ 'Longitude',
+ 'at_Latitude',
+ 'at_Longitude'
+ ]
+ },
+ enabled: true
+ },
+ brush: {size: 0.5, enabled: false}
+ },
+ layerBlending: 'normal',
+ splitMaps: []
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 40.739854859310576,
+ longitude: -73.95072736262398,
+ pitch: 0,
+ zoom: 13.015607264274948,
+ isSplit: false
+ },
+ queryStatus: {
+ pastQueries: [{label: 'sample phone data', id: 'test_phone_data'}]
+ }
+ }
+ },
+ datasets: [
+ {
+ version: 'v1',
+ data: {
+ id: 'test_phone_data',
+ label: 'sample phone data',
+ color: [53, 92, 125],
+ allData: [
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7504998,
+ -73.9858009,
+ 40.7504998,
+ -73.9858009,
+ 40.7504998,
+ -73.9858009,
+ 0,
+ 1477646131,
+ 1477646131000,
+ 0,
+ 1477646130,
+ 1477646140,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7504998,
+ -73.9858009,
+ 40.7504998,
+ -73.9858009,
+ 40.7504998,
+ -73.9858009,
+ 0,
+ 1477646133,
+ 1477646133000,
+ 0,
+ 1477646130,
+ 1477646140,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7504838,
+ -73.9857678,
+ 40.7504838,
+ -73.9857678,
+ 40.7504838,
+ -73.9857678,
+ 2.3134842,
+ 1477646134,
+ 1477646134000,
+ 0,
+ 1477646130,
+ 1477646140,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7504231,
+ -73.9856432,
+ 40.7504231,
+ -73.9856432,
+ 40.7504231,
+ -73.9856432,
+ 4.863105,
+ 1477646137,
+ 1477646137000,
+ 0,
+ 1477646130,
+ 1477646140,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.75036,
+ -73.9855336,
+ 40.75036,
+ -73.9855336,
+ 40.75036,
+ -73.9855336,
+ 7.373735,
+ 1477646142,
+ 1477646142000,
+ 0,
+ 1477646140,
+ 1477646150,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7502398,
+ -73.9852918,
+ 40.7502398,
+ -73.9852918,
+ 40.7502398,
+ -73.9852918,
+ 8.513238,
+ 1477646144,
+ 1477646144000,
+ 0,
+ 1477646140,
+ 1477646150,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7501249,
+ -73.9850585,
+ 40.7501249,
+ -73.9850585,
+ 40.7501249,
+ -73.9850585,
+ 12.516513,
+ 1477646146,
+ 1477646146000,
+ 0,
+ 1477646140,
+ 1477646150,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7499997,
+ -73.9847462,
+ 40.7499997,
+ -73.9847462,
+ 40.7499997,
+ -73.9847462,
+ 10.460479,
+ 1477646147,
+ 1477646147000,
+ 0,
+ 1477646140,
+ 1477646150,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7498623,
+ -73.9841722,
+ 40.7498623,
+ -73.9841722,
+ 40.7498623,
+ -73.9841722,
+ 10.121932,
+ 1477646154,
+ 1477646154000,
+ 0,
+ 1477646150,
+ 1477646160,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7497829,
+ -73.983867,
+ 40.7497829,
+ -73.983867,
+ 40.7497829,
+ -73.983867,
+ 8.882398,
+ 1477646156,
+ 1477646156000,
+ 0,
+ 1477646150,
+ 1477646160,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7497127,
+ -73.9836725,
+ 40.7497127,
+ -73.9836725,
+ 40.7497127,
+ -73.9836725,
+ 9.106246,
+ 1477646158,
+ 1477646158000,
+ 0,
+ 1477646150,
+ 1477646160,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7495674,
+ -73.9833727,
+ 40.7495674,
+ -73.9833727,
+ 40.7495674,
+ -73.9833727,
+ 10.073572,
+ 1477646161,
+ 1477646161000,
+ 0,
+ 1477646160,
+ 1477646170,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7494574,
+ -73.9831373,
+ 40.7494574,
+ -73.9831373,
+ 40.7494574,
+ -73.9831373,
+ 11.328796,
+ 1477646163,
+ 1477646163000,
+ 0,
+ 1477646160,
+ 1477646170,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7493774,
+ -73.9829227,
+ 40.7493774,
+ -73.9829227,
+ 40.7493774,
+ -73.9829227,
+ 9.637881,
+ 1477646164,
+ 1477646164000,
+ 0,
+ 1477646160,
+ 1477646170,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492847,
+ -73.9826511,
+ 40.7492847,
+ -73.9826511,
+ 40.7492847,
+ -73.9826511,
+ 5.911331,
+ 1477646167,
+ 1477646167000,
+ 0,
+ 1477646160,
+ 1477646170,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492451,
+ -73.9825461,
+ 40.7492451,
+ -73.9825461,
+ 40.7492451,
+ -73.9825461,
+ 2.557522,
+ 1477646169,
+ 1477646169000,
+ 0,
+ 1477646160,
+ 1477646170,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492377,
+ -73.9825278,
+ 40.7492377,
+ -73.9825278,
+ 40.7492377,
+ -73.9825278,
+ 0.69229937,
+ 1477646171,
+ 1477646171000,
+ 0,
+ 1477646170,
+ 1477646180,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 1.1836067,
+ 1477646175,
+ 1477646175000,
+ 0,
+ 1477646170,
+ 1477646180,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646178,
+ 1477646178000,
+ 0,
+ 1477646170,
+ 1477646180,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646181,
+ 1477646181000,
+ 0,
+ 1477646180,
+ 1477646190,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646184,
+ 1477646184000,
+ 0,
+ 1477646180,
+ 1477646190,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646188,
+ 1477646188000,
+ 0,
+ 1477646180,
+ 1477646190,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646192,
+ 1477646192000,
+ 0,
+ 1477646190,
+ 1477646200,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646195,
+ 1477646195000,
+ 0,
+ 1477646190,
+ 1477646200,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646197,
+ 1477646197000,
+ 0,
+ 1477646190,
+ 1477646200,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646199,
+ 1477646199000,
+ 0,
+ 1477646190,
+ 1477646200,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 40.7492326,
+ -73.9825152,
+ 0,
+ 1477646201,
+ 1477646201000,
+ 0,
+ 1477646200,
+ 1477646210,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7491192,
+ -73.9822488,
+ 40.7491192,
+ -73.9822488,
+ 40.7491192,
+ -73.9822488,
+ 5.7204247,
+ 1477646205,
+ 1477646205000,
+ 0,
+ 1477646200,
+ 1477646210,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7490291,
+ -73.9820764,
+ 40.7490291,
+ -73.9820764,
+ 40.7490291,
+ -73.9820764,
+ 7.251427,
+ 1477646207,
+ 1477646207000,
+ 0,
+ 1477646200,
+ 1477646210,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7489464,
+ -73.9819092,
+ 40.7489464,
+ -73.9819092,
+ 40.7489464,
+ -73.9819092,
+ 10.329027,
+ 1477646209,
+ 1477646209000,
+ 0,
+ 1477646200,
+ 1477646210,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7487989,
+ -73.9815884,
+ 40.7487989,
+ -73.9815884,
+ 40.7487989,
+ -73.9815884,
+ 9.959309,
+ 1477646214,
+ 1477646214000,
+ 0,
+ 1477646210,
+ 1477646220,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7487105,
+ -73.9813701,
+ 40.7487105,
+ -73.9813701,
+ 40.7487105,
+ -73.9813701,
+ 10.941365,
+ 1477646216,
+ 1477646216000,
+ 0,
+ 1477646210,
+ 1477646220,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7485925,
+ -73.9811102,
+ 40.7485925,
+ -73.9811102,
+ 40.7485925,
+ -73.9811102,
+ 0,
+ 1477646218,
+ 1477646218000,
+ 0,
+ 1477646210,
+ 1477646220,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7484258,
+ -73.9807382,
+ 40.7484258,
+ -73.9807382,
+ 40.7484258,
+ -73.9807382,
+ 11.978285,
+ 1477646219,
+ 1477646219000,
+ 0,
+ 1477646210,
+ 1477646220,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7482774,
+ -73.9803614,
+ 40.7482774,
+ -73.9803614,
+ 40.7482774,
+ -73.9803614,
+ 11.851179,
+ 1477646222,
+ 1477646222000,
+ 0,
+ 1477646220,
+ 1477646230,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7481752,
+ -73.9801143,
+ 40.7481752,
+ -73.9801143,
+ 40.7481752,
+ -73.9801143,
+ 11.236809,
+ 1477646224,
+ 1477646224000,
+ 0,
+ 1477646220,
+ 1477646230,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7480729,
+ -73.97988,
+ 40.7480729,
+ -73.97988,
+ 40.7480729,
+ -73.97988,
+ 11.487315,
+ 1477646226,
+ 1477646226000,
+ 0,
+ 1477646220,
+ 1477646230,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478419,
+ -73.9793727,
+ 40.7478419,
+ -73.9793727,
+ 40.7478419,
+ -73.9793727,
+ 5.9004717,
+ 1477646234,
+ 1477646234000,
+ 0,
+ 1477646230,
+ 1477646240,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478181,
+ -73.9793179,
+ 40.7478181,
+ -73.9793179,
+ 40.7478181,
+ -73.9793179,
+ 0.34833142,
+ 1477646236,
+ 1477646236000,
+ 0,
+ 1477646230,
+ 1477646240,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646239,
+ 1477646239000,
+ 0,
+ 1477646230,
+ 1477646240,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646241,
+ 1477646241000,
+ 0,
+ 1477646240,
+ 1477646250,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646243,
+ 1477646243000,
+ 0,
+ 1477646240,
+ 1477646250,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646247,
+ 1477646247000,
+ 0,
+ 1477646240,
+ 1477646250,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646248,
+ 1477646248000,
+ 0,
+ 1477646240,
+ 1477646250,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646251,
+ 1477646251000,
+ 0,
+ 1477646250,
+ 1477646260,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646254,
+ 1477646254000,
+ 0,
+ 1477646250,
+ 1477646260,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646256,
+ 1477646256000,
+ 0,
+ 1477646250,
+ 1477646260,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646258,
+ 1477646258000,
+ 0,
+ 1477646250,
+ 1477646260,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646264,
+ 1477646264000,
+ 0,
+ 1477646260,
+ 1477646270,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646265,
+ 1477646265000,
+ 0,
+ 1477646260,
+ 1477646270,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646268,
+ 1477646268000,
+ 0,
+ 1477646260,
+ 1477646270,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646271,
+ 1477646271000,
+ 0,
+ 1477646270,
+ 1477646280,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 40.7478149,
+ -73.9793104,
+ 0,
+ 1477646273,
+ 1477646273000,
+ 0,
+ 1477646270,
+ 1477646280,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.747795,
+ -73.9792619,
+ 40.747795,
+ -73.9792619,
+ 40.747795,
+ -73.9792619,
+ 2.7623723,
+ 1477646275,
+ 1477646275000,
+ 0,
+ 1477646270,
+ 1477646280,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7477287,
+ -73.979076,
+ 40.7477287,
+ -73.979076,
+ 40.7477287,
+ -73.979076,
+ 0,
+ 1477646277,
+ 1477646277000,
+ 0,
+ 1477646270,
+ 1477646280,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7476501,
+ -73.9788568,
+ 40.7476501,
+ -73.9788568,
+ 40.7476501,
+ -73.9788568,
+ 7.7189913,
+ 1477646279,
+ 1477646279000,
+ 0,
+ 1477646270,
+ 1477646280,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7475827,
+ -73.9786797,
+ 40.7475827,
+ -73.9786797,
+ 40.7475827,
+ -73.9786797,
+ 8.895677,
+ 1477646281,
+ 1477646281000,
+ 0,
+ 1477646280,
+ 1477646290,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7474731,
+ -73.9783971,
+ 40.7474731,
+ -73.9783971,
+ 40.7474731,
+ -73.9783971,
+ 9.336869,
+ 1477646285,
+ 1477646285000,
+ 0,
+ 1477646280,
+ 1477646290,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7474006,
+ -73.9782137,
+ 40.7474006,
+ -73.9782137,
+ 40.7474006,
+ -73.9782137,
+ 7.701453,
+ 1477646287,
+ 1477646287000,
+ 0,
+ 1477646280,
+ 1477646290,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7473185,
+ -73.978056,
+ 40.7473185,
+ -73.978056,
+ 40.7473185,
+ -73.978056,
+ 7.371801,
+ 1477646289,
+ 1477646289000,
+ 0,
+ 1477646280,
+ 1477646290,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7472603,
+ -73.9779182,
+ 40.7472603,
+ -73.9779182,
+ 40.7472603,
+ -73.9779182,
+ 6.3743296,
+ 1477646291,
+ 1477646291000,
+ 0,
+ 1477646290,
+ 1477646300,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471888,
+ -73.9777441,
+ 40.7471888,
+ -73.9777441,
+ 40.7471888,
+ -73.9777441,
+ 4.381162,
+ 1477646294,
+ 1477646294000,
+ 0,
+ 1477646290,
+ 1477646300,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 1.2524523,
+ 1477646298,
+ 1477646298000,
+ 0,
+ 1477646290,
+ 1477646300,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 0,
+ 1477646301,
+ 1477646301000,
+ 0,
+ 1477646300,
+ 1477646310,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 0,
+ 1477646303,
+ 1477646303000,
+ 0,
+ 1477646300,
+ 1477646310,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 0,
+ 1477646305,
+ 1477646305000,
+ 0,
+ 1477646300,
+ 1477646310,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 0,
+ 1477646307,
+ 1477646307000,
+ 0,
+ 1477646300,
+ 1477646310,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 40.7471598,
+ -73.9776657,
+ 0,
+ 1477646309,
+ 1477646309000,
+ 0,
+ 1477646300,
+ 1477646310,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7471554,
+ -73.9776514,
+ 40.7471554,
+ -73.9776514,
+ 40.7471554,
+ -73.9776514,
+ 1.153652,
+ 1477646311,
+ 1477646311000,
+ 0,
+ 1477646310,
+ 1477646320,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7470848,
+ -73.9774972,
+ 40.7470848,
+ -73.9774972,
+ 40.7470848,
+ -73.9774972,
+ 4.964964,
+ 1477646313,
+ 1477646313000,
+ 0,
+ 1477646310,
+ 1477646320,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7470246,
+ -73.9773576,
+ 40.7470246,
+ -73.9773576,
+ 40.7470246,
+ -73.9773576,
+ 7.7313733,
+ 1477646315,
+ 1477646315000,
+ 0,
+ 1477646310,
+ 1477646320,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7469558,
+ -73.977182,
+ 40.7469558,
+ -73.977182,
+ 40.7469558,
+ -73.977182,
+ 9.398899,
+ 1477646318,
+ 1477646318000,
+ 0,
+ 1477646310,
+ 1477646320,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7467818,
+ -73.9767237,
+ 40.7467818,
+ -73.9767237,
+ 40.7467818,
+ -73.9767237,
+ 11.618991,
+ 1477646324,
+ 1477646324000,
+ 0,
+ 1477646320,
+ 1477646330,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7465333,
+ -73.9761115,
+ 40.7465333,
+ -73.9761115,
+ 40.7465333,
+ -73.9761115,
+ 11.881396,
+ 1477646326,
+ 1477646326000,
+ 0,
+ 1477646320,
+ 1477646330,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7464436,
+ -73.9758651,
+ 40.7464436,
+ -73.9758651,
+ 40.7464436,
+ -73.9758651,
+ 11.311087,
+ 1477646328,
+ 1477646328000,
+ 0,
+ 1477646320,
+ 1477646330,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7463027,
+ -73.975514,
+ 40.7463027,
+ -73.975514,
+ 40.7463027,
+ -73.975514,
+ 11.1060915,
+ 1477646332,
+ 1477646332000,
+ 0,
+ 1477646330,
+ 1477646340,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7461633,
+ -73.9751873,
+ 40.7461633,
+ -73.9751873,
+ 40.7461633,
+ -73.9751873,
+ 10.482742,
+ 1477646334,
+ 1477646334000,
+ 0,
+ 1477646330,
+ 1477646340,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7460954,
+ -73.9749928,
+ 40.7460954,
+ -73.9749928,
+ 40.7460954,
+ -73.9749928,
+ 8.920771,
+ 1477646336,
+ 1477646336000,
+ 0,
+ 1477646330,
+ 1477646340,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7460008,
+ -73.9746995,
+ 40.7460008,
+ -73.9746995,
+ 40.7460008,
+ -73.9746995,
+ 9.171494,
+ 1477646341,
+ 1477646341000,
+ 0,
+ 1477646340,
+ 1477646350,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7459243,
+ -73.9743702,
+ 40.7459243,
+ -73.9743702,
+ 40.7459243,
+ -73.9743702,
+ 9.917238,
+ 1477646343,
+ 1477646343000,
+ 0,
+ 1477646340,
+ 1477646350,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7458846,
+ -73.9741343,
+ 40.7458846,
+ -73.9741343,
+ 40.7458846,
+ -73.9741343,
+ 9.391925,
+ 1477646345,
+ 1477646345000,
+ 0,
+ 1477646340,
+ 1477646350,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7457771,
+ -73.9738108,
+ 40.7457771,
+ -73.9738108,
+ 40.7457771,
+ -73.9738108,
+ 9.963142,
+ 1477646349,
+ 1477646349000,
+ 0,
+ 1477646340,
+ 1477646350,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7455663,
+ -73.9731593,
+ 40.7455663,
+ -73.9731593,
+ 40.7455663,
+ -73.9731593,
+ 8.678049,
+ 1477646353,
+ 1477646353000,
+ 0,
+ 1477646350,
+ 1477646360,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7455892,
+ -73.9727863,
+ 40.7455892,
+ -73.9727863,
+ 40.7455892,
+ -73.9727863,
+ 10.395492,
+ 1477646357,
+ 1477646357000,
+ 0,
+ 1477646350,
+ 1477646360,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7456771,
+ -73.9724278,
+ 40.7456771,
+ -73.9724278,
+ 40.7456771,
+ -73.9724278,
+ 10.022741,
+ 1477646362,
+ 1477646362000,
+ 0,
+ 1477646360,
+ 1477646370,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7454237,
+ -73.973315,
+ 40.7454237,
+ -73.973315,
+ 40.7454237,
+ -73.973315,
+ 0,
+ 1477646407,
+ 1477646407000,
+ 0,
+ 1477646400,
+ 1477646410,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7441281,
+ -73.9655551,
+ 40.7441281,
+ -73.9655551,
+ 40.7441281,
+ -73.9655551,
+ 0,
+ 1477646423,
+ 1477646423000,
+ 0,
+ 1477646420,
+ 1477646430,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7412123,
+ -73.9493915,
+ 40.7412123,
+ -73.9493915,
+ 40.7412123,
+ -73.9493915,
+ 0,
+ 1477646474,
+ 1477646474000,
+ 0,
+ 1477646470,
+ 1477646480,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413539,
+ -73.9529713,
+ 40.7413539,
+ -73.9529713,
+ 40.7413539,
+ -73.9529713,
+ 8.257094,
+ 1477646483,
+ 1477646483000,
+ 0,
+ 1477646480,
+ 1477646490,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413283,
+ -73.9528125,
+ 40.7413283,
+ -73.9528125,
+ 40.7413283,
+ -73.9528125,
+ 5.7617188,
+ 1477646487,
+ 1477646487000,
+ 0,
+ 1477646480,
+ 1477646490,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413151,
+ -73.9525884,
+ 40.7413151,
+ -73.9525884,
+ 40.7413151,
+ -73.9525884,
+ 3.0065663,
+ 1477646492,
+ 1477646492000,
+ 0,
+ 1477646490,
+ 1477646500,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413078,
+ -73.9525147,
+ 40.7413078,
+ -73.9525147,
+ 40.7413078,
+ -73.9525147,
+ 2.148815,
+ 1477646494,
+ 1477646494000,
+ 0,
+ 1477646490,
+ 1477646500,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413058,
+ -73.9524018,
+ 40.7413058,
+ -73.9524018,
+ 40.7413058,
+ -73.9524018,
+ 5.3495803,
+ 1477646496,
+ 1477646496000,
+ 0,
+ 1477646490,
+ 1477646500,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7413358,
+ -73.9515823,
+ 40.7413358,
+ -73.9515823,
+ 40.7413358,
+ -73.9515823,
+ 13.522032,
+ 1477646501,
+ 1477646501000,
+ 0,
+ 1477646500,
+ 1477646510,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7414609,
+ -73.9510389,
+ 40.7414609,
+ -73.9510389,
+ 40.7414609,
+ -73.9510389,
+ 16.217,
+ 1477646504,
+ 1477646504000,
+ 0,
+ 1477646500,
+ 1477646510,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.741549,
+ -73.9504947,
+ 40.741549,
+ -73.9504947,
+ 40.741549,
+ -73.9504947,
+ 16.721155,
+ 1477646508,
+ 1477646508000,
+ 0,
+ 1477646500,
+ 1477646510,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7415677,
+ -73.9498967,
+ 40.7415677,
+ -73.9498967,
+ 40.7415677,
+ -73.9498967,
+ 17.827305,
+ 1477646511,
+ 1477646511000,
+ 0,
+ 1477646510,
+ 1477646520,
+ '11/1/17 11:01'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7415418,
+ -73.9494483,
+ 40.7415418,
+ -73.9494483,
+ 40.7415418,
+ -73.9494483,
+ 18.955433,
+ 1477646513,
+ 1477646513000,
+ 0,
+ 1477646510,
+ 1477646520,
+ '11/1/17 11:02'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7414799,
+ -73.949008,
+ 40.7414799,
+ -73.949008,
+ 40.7414799,
+ -73.949008,
+ 19.612692,
+ 1477646515,
+ 1477646515000,
+ 0,
+ 1477646510,
+ 1477646520,
+ '11/1/17 11:03'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7414082,
+ -73.9485429,
+ 40.7414082,
+ -73.9485429,
+ 40.7414082,
+ -73.9485429,
+ 20.748034,
+ 1477646517,
+ 1477646517000,
+ 0,
+ 1477646510,
+ 1477646520,
+ '11/1/17 11:04'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7412702,
+ -73.947779,
+ 40.7412702,
+ -73.947779,
+ 40.7412702,
+ -73.947779,
+ 22.42561,
+ 1477646521,
+ 1477646521000,
+ 0,
+ 1477646520,
+ 1477646530,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7411235,
+ -73.9469953,
+ 40.7411235,
+ -73.9469953,
+ 40.7411235,
+ -73.9469953,
+ 23.08805,
+ 1477646523,
+ 1477646523000,
+ 0,
+ 1477646520,
+ 1477646530,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7410223,
+ -73.9464731,
+ 40.7410223,
+ -73.9464731,
+ 40.7410223,
+ -73.9464731,
+ 22.99983,
+ 1477646525,
+ 1477646525000,
+ 0,
+ 1477646520,
+ 1477646530,
+ '11/1/17 11:05'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7409133,
+ -73.9459422,
+ 40.7409133,
+ -73.9459422,
+ 40.7409133,
+ -73.9459422,
+ 22.93067,
+ 1477646528,
+ 1477646528000,
+ 0,
+ 1477646520,
+ 1477646530,
+ '11/1/17 11:10'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7405695,
+ -73.9446514,
+ 40.7405695,
+ -73.9446514,
+ 40.7405695,
+ -73.9446514,
+ 23.105522,
+ 1477646532,
+ 1477646532000,
+ 0,
+ 1477646530,
+ 1477646540,
+ '11/1/17 11:00'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7403907,
+ -73.9441615,
+ 40.7403907,
+ -73.9441615,
+ 40.7403907,
+ -73.9441615,
+ 22.983301,
+ 1477646534,
+ 1477646534000,
+ 0,
+ 1477646530,
+ 1477646540,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7401085,
+ -73.9434534,
+ 40.7401085,
+ -73.9434534,
+ 40.7401085,
+ -73.9434534,
+ 23.045782,
+ 1477646538,
+ 1477646538000,
+ 0,
+ 1477646530,
+ 1477646540,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7395878,
+ -73.9422209,
+ 40.7395878,
+ -73.9422209,
+ 40.7395878,
+ -73.9422209,
+ 23.27081,
+ 1477646542,
+ 1477646542000,
+ 0,
+ 1477646540,
+ 1477646550,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7392932,
+ -73.9415291,
+ 40.7392932,
+ -73.9415291,
+ 40.7392932,
+ -73.9415291,
+ 23.16073,
+ 1477646544,
+ 1477646544000,
+ 0,
+ 1477646540,
+ 1477646550,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7390901,
+ -73.9410361,
+ 40.7390901,
+ -73.9410361,
+ 40.7390901,
+ -73.9410361,
+ 24.436981,
+ 1477646546,
+ 1477646546000,
+ 0,
+ 1477646540,
+ 1477646550,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.738776,
+ -73.9402473,
+ 40.738776,
+ -73.9402473,
+ 40.738776,
+ -73.9402473,
+ 25.41179,
+ 1477646551,
+ 1477646551000,
+ 0,
+ 1477646550,
+ 1477646560,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7384664,
+ -73.9394387,
+ 40.7384664,
+ -73.9394387,
+ 40.7384664,
+ -73.9394387,
+ 25.119013,
+ 1477646553,
+ 1477646553000,
+ 0,
+ 1477646550,
+ 1477646560,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7382883,
+ -73.9388887,
+ 40.7382883,
+ -73.9388887,
+ 40.7382883,
+ -73.9388887,
+ 24.935415,
+ 1477646555,
+ 1477646555000,
+ 0,
+ 1477646550,
+ 1477646560,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7380675,
+ -73.9380285,
+ 40.7380675,
+ -73.9380285,
+ 40.7380675,
+ -73.9380285,
+ 25.291101,
+ 1477646559,
+ 1477646559000,
+ 0,
+ 1477646550,
+ 1477646560,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7378185,
+ -73.936549,
+ 40.7378185,
+ -73.936549,
+ 40.7378185,
+ -73.936549,
+ 25.382856,
+ 1477646563,
+ 1477646563000,
+ 0,
+ 1477646560,
+ 1477646570,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7375965,
+ -73.9351032,
+ 40.7375965,
+ -73.9351032,
+ 40.7375965,
+ -73.9351032,
+ 24.748867,
+ 1477646568,
+ 1477646568000,
+ 0,
+ 1477646560,
+ 1477646570,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.73743,
+ -73.9342532,
+ 40.73743,
+ -73.9342532,
+ 40.73743,
+ -73.9342532,
+ 24.7851,
+ 1477646572,
+ 1477646572000,
+ 0,
+ 1477646570,
+ 1477646580,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7371306,
+ -73.9325934,
+ 40.7371306,
+ -73.9325934,
+ 40.7371306,
+ -73.9325934,
+ 23.329536,
+ 1477646576,
+ 1477646576000,
+ 0,
+ 1477646570,
+ 1477646580,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7368275,
+ -73.9310825,
+ 40.7368275,
+ -73.9310825,
+ 40.7368275,
+ -73.9310825,
+ 19.574614,
+ 1477646583,
+ 1477646583000,
+ 0,
+ 1477646580,
+ 1477646590,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.736728,
+ -73.9306084,
+ 40.736728,
+ -73.9306084,
+ 40.736728,
+ -73.9306084,
+ 20.056524,
+ 1477646585,
+ 1477646585000,
+ 0,
+ 1477646580,
+ 1477646590,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7366351,
+ -73.9301129,
+ 40.7366351,
+ -73.9301129,
+ 40.7366351,
+ -73.9301129,
+ 20.795082,
+ 1477646586,
+ 1477646586000,
+ 0,
+ 1477646580,
+ 1477646590,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7364946,
+ -73.9294031,
+ 40.7364946,
+ -73.9294031,
+ 40.7364946,
+ -73.9294031,
+ 20.3169,
+ 1477646589,
+ 1477646589000,
+ 0,
+ 1477646580,
+ 1477646590,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7364007,
+ -73.9289478,
+ 40.7364007,
+ -73.9289478,
+ 40.7364007,
+ -73.9289478,
+ 19.846592,
+ 1477646593,
+ 1477646593000,
+ 0,
+ 1477646590,
+ 1477646600,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7361271,
+ -73.9276136,
+ 40.7361271,
+ -73.9276136,
+ 40.7361271,
+ -73.9276136,
+ 20.346718,
+ 1477646597,
+ 1477646597000,
+ 0,
+ 1477646590,
+ 1477646600,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7360359,
+ -73.927155,
+ 40.7360359,
+ -73.927155,
+ 40.7360359,
+ -73.927155,
+ 19.627155,
+ 1477646602,
+ 1477646602000,
+ 0,
+ 1477646600,
+ 1477646610,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7358998,
+ -73.9264952,
+ 40.7358998,
+ -73.9264952,
+ 40.7358998,
+ -73.9264952,
+ 18.476479,
+ 1477646604,
+ 1477646604000,
+ 0,
+ 1477646600,
+ 1477646610,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7358147,
+ -73.9260823,
+ 40.7358147,
+ -73.9260823,
+ 40.7358147,
+ -73.9260823,
+ 17.66287,
+ 1477646606,
+ 1477646606000,
+ 0,
+ 1477646600,
+ 1477646610,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7356621,
+ -73.9255063,
+ 40.7356621,
+ -73.9255063,
+ 40.7356621,
+ -73.9255063,
+ 16.96675,
+ 1477646608,
+ 1477646608000,
+ 0,
+ 1477646600,
+ 1477646610,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7354302,
+ -73.9247205,
+ 40.7354302,
+ -73.9247205,
+ 40.7354302,
+ -73.9247205,
+ 18.212366,
+ 1477646611,
+ 1477646611000,
+ 0.4,
+ 1477646610,
+ 1477646620,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7352334,
+ -73.9241493,
+ 40.7352334,
+ -73.9241493,
+ 40.7352334,
+ -73.9241493,
+ 18.156546,
+ 1477646614,
+ 1477646614000,
+ 0.4,
+ 1477646610,
+ 1477646620,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7349952,
+ -73.9236143,
+ 40.7349952,
+ -73.9236143,
+ 40.7349952,
+ -73.9236143,
+ 17.546999,
+ 1477646619,
+ 1477646619000,
+ 0.4,
+ 1477646610,
+ 1477646620,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646631,
+ 1477646631000,
+ 0.545454545,
+ 1477646630,
+ 1477646640,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646636,
+ 1477646636000,
+ 0.545454545,
+ 1477646630,
+ 1477646640,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646638,
+ 1477646638000,
+ 0.545454545,
+ 1477646630,
+ 1477646640,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646641,
+ 1477646641000,
+ 1,
+ 1477646640,
+ 1477646650,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646644,
+ 1477646644000,
+ 1,
+ 1477646640,
+ 1477646650,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646648,
+ 1477646648000,
+ 1,
+ 1477646640,
+ 1477646650,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646649,
+ 1477646649000,
+ 1,
+ 1477646640,
+ 1477646650,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646652,
+ 1477646652000,
+ 0.9,
+ 1477646650,
+ 1477646660,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646657,
+ 1477646657000,
+ 0.9,
+ 1477646650,
+ 1477646660,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646659,
+ 1477646659000,
+ 0.9,
+ 1477646650,
+ 1477646660,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646661,
+ 1477646661000,
+ 1,
+ 1477646660,
+ 1477646670,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646662,
+ 1477646662000,
+ 1,
+ 1477646660,
+ 1477646670,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646665,
+ 1477646665000,
+ 1,
+ 1477646660,
+ 1477646670,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646669,
+ 1477646669000,
+ 1,
+ 1477646660,
+ 1477646670,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646671,
+ 1477646671000,
+ 0.9,
+ 1477646670,
+ 1477646680,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646674,
+ 1477646674000,
+ 0.9,
+ 1477646670,
+ 1477646680,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646675,
+ 1477646675000,
+ 0.9,
+ 1477646670,
+ 1477646680,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646678,
+ 1477646678000,
+ 0.9,
+ 1477646670,
+ 1477646680,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646682,
+ 1477646682000,
+ 1,
+ 1477646680,
+ 1477646690,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646685,
+ 1477646685000,
+ 1,
+ 1477646680,
+ 1477646690,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646687,
+ 1477646687000,
+ 1,
+ 1477646680,
+ 1477646690,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646689,
+ 1477646689000,
+ 1,
+ 1477646680,
+ 1477646690,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646691,
+ 1477646691000,
+ 1,
+ 1477646690,
+ 1477646700,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646693,
+ 1477646693000,
+ 1,
+ 1477646690,
+ 1477646700,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646695,
+ 1477646695000,
+ 1,
+ 1477646690,
+ 1477646700,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646699,
+ 1477646699000,
+ 1,
+ 1477646690,
+ 1477646700,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646702,
+ 1477646702000,
+ 0.9,
+ 1477646700,
+ 1477646710,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646704,
+ 1477646704000,
+ 0.9,
+ 1477646700,
+ 1477646710,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646705,
+ 1477646705000,
+ 0.9,
+ 1477646700,
+ 1477646710,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646708,
+ 1477646708000,
+ 0.9,
+ 1477646700,
+ 1477646710,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646712,
+ 1477646712000,
+ 1,
+ 1477646710,
+ 1477646720,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646714,
+ 1477646714000,
+ 1,
+ 1477646710,
+ 1477646720,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646717,
+ 1477646717000,
+ 1,
+ 1477646710,
+ 1477646720,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646721,
+ 1477646721000,
+ 1,
+ 1477646720,
+ 1477646730,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646723,
+ 1477646723000,
+ 1,
+ 1477646720,
+ 1477646730,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646725,
+ 1477646725000,
+ 1,
+ 1477646720,
+ 1477646730,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646727,
+ 1477646727000,
+ 1,
+ 1477646720,
+ 1477646730,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646729,
+ 1477646729000,
+ 1,
+ 1477646720,
+ 1477646730,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646734,
+ 1477646734000,
+ 0.8,
+ 1477646730,
+ 1477646740,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646736,
+ 1477646736000,
+ 0.8,
+ 1477646730,
+ 1477646740,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646738,
+ 1477646738000,
+ 0.8,
+ 1477646730,
+ 1477646740,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646742,
+ 1477646742000,
+ 1,
+ 1477646740,
+ 1477646750,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646747,
+ 1477646747000,
+ 1,
+ 1477646740,
+ 1477646750,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646748,
+ 1477646748000,
+ 1,
+ 1477646740,
+ 1477646750,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646751,
+ 1477646751000,
+ 1,
+ 1477646750,
+ 1477646760,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646753,
+ 1477646753000,
+ 1,
+ 1477646750,
+ 1477646760,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646755,
+ 1477646755000,
+ 1,
+ 1477646750,
+ 1477646760,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646756,
+ 1477646756000,
+ 1,
+ 1477646750,
+ 1477646760,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646759,
+ 1477646759000,
+ 1,
+ 1477646750,
+ 1477646760,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646764,
+ 1477646764000,
+ 1,
+ 1477646760,
+ 1477646770,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646765,
+ 1477646765000,
+ 1,
+ 1477646760,
+ 1477646770,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646768,
+ 1477646768000,
+ 1,
+ 1477646760,
+ 1477646770,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646769,
+ 1477646769000,
+ 1,
+ 1477646760,
+ 1477646770,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646772,
+ 1477646772000,
+ 1,
+ 1477646770,
+ 1477646780,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646777,
+ 1477646777000,
+ 1,
+ 1477646770,
+ 1477646780,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646778,
+ 1477646778000,
+ 1,
+ 1477646770,
+ 1477646780,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646781,
+ 1477646781000,
+ 1,
+ 1477646780,
+ 1477646790,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646783,
+ 1477646783000,
+ 1,
+ 1477646780,
+ 1477646790,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646785,
+ 1477646785000,
+ 1,
+ 1477646780,
+ 1477646790,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646791,
+ 1477646791000,
+ 1,
+ 1477646790,
+ 1477646800,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646794,
+ 1477646794000,
+ 1,
+ 1477646790,
+ 1477646800,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646795,
+ 1477646795000,
+ 1,
+ 1477646790,
+ 1477646800,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646798,
+ 1477646798000,
+ 1,
+ 1477646790,
+ 1477646800,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646802,
+ 1477646802000,
+ 0.8,
+ 1477646800,
+ 1477646810,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646807,
+ 1477646807000,
+ 0.8,
+ 1477646800,
+ 1477646810,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646809,
+ 1477646809000,
+ 0.8,
+ 1477646800,
+ 1477646810,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646811,
+ 1477646811000,
+ 0.5,
+ 1477646810,
+ 1477646820,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646812,
+ 1477646812000,
+ 0.5,
+ 1477646810,
+ 1477646820,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646815,
+ 1477646815000,
+ 0.5,
+ 1477646810,
+ 1477646820,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646822,
+ 1477646822000,
+ 1,
+ 1477646820,
+ 1477646830,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646824,
+ 1477646824000,
+ 1,
+ 1477646820,
+ 1477646830,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646826,
+ 1477646826000,
+ 1,
+ 1477646820,
+ 1477646830,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646828,
+ 1477646828000,
+ 1,
+ 1477646820,
+ 1477646830,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646832,
+ 1477646832000,
+ 1,
+ 1477646830,
+ 1477646840,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646834,
+ 1477646834000,
+ 1,
+ 1477646830,
+ 1477646840,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646837,
+ 1477646837000,
+ 1,
+ 1477646830,
+ 1477646840,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646841,
+ 1477646841000,
+ 1,
+ 1477646840,
+ 1477646850,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646842,
+ 1477646842000,
+ 1,
+ 1477646840,
+ 1477646850,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646845,
+ 1477646845000,
+ 1,
+ 1477646840,
+ 1477646850,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646846,
+ 1477646846000,
+ 1,
+ 1477646840,
+ 1477646850,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646849,
+ 1477646849000,
+ 1,
+ 1477646840,
+ 1477646850,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646854,
+ 1477646854000,
+ 1,
+ 1477646850,
+ 1477646860,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646856,
+ 1477646856000,
+ 1,
+ 1477646850,
+ 1477646860,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646858,
+ 1477646858000,
+ 1,
+ 1477646850,
+ 1477646860,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646862,
+ 1477646862000,
+ 0.9,
+ 1477646860,
+ 1477646870,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646867,
+ 1477646867000,
+ 0.9,
+ 1477646860,
+ 1477646870,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646868,
+ 1477646868000,
+ 0.9,
+ 1477646860,
+ 1477646870,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646871,
+ 1477646871000,
+ 1,
+ 1477646870,
+ 1477646880,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646873,
+ 1477646873000,
+ 1,
+ 1477646870,
+ 1477646880,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646875,
+ 1477646875000,
+ 1,
+ 1477646870,
+ 1477646880,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646879,
+ 1477646879000,
+ 1,
+ 1477646870,
+ 1477646880,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646882,
+ 1477646882000,
+ 0.9,
+ 1477646880,
+ 1477646890,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646884,
+ 1477646884000,
+ 0.9,
+ 1477646880,
+ 1477646890,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646888,
+ 1477646888000,
+ 0.9,
+ 1477646880,
+ 1477646890,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646889,
+ 1477646889000,
+ 0.9,
+ 1477646880,
+ 1477646890,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646892,
+ 1477646892000,
+ 1,
+ 1477646890,
+ 1477646900,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646894,
+ 1477646894000,
+ 1,
+ 1477646890,
+ 1477646900,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646896,
+ 1477646896000,
+ 1,
+ 1477646890,
+ 1477646900,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646901,
+ 1477646901000,
+ 1,
+ 1477646900,
+ 1477646910,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646903,
+ 1477646903000,
+ 1,
+ 1477646900,
+ 1477646910,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646905,
+ 1477646905000,
+ 1,
+ 1477646900,
+ 1477646910,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646906,
+ 1477646906000,
+ 1,
+ 1477646900,
+ 1477646910,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646909,
+ 1477646909000,
+ 1,
+ 1477646900,
+ 1477646910,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646911,
+ 1477646911000,
+ 0.8,
+ 1477646910,
+ 1477646920,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646913,
+ 1477646913000,
+ 0.8,
+ 1477646910,
+ 1477646920,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646918,
+ 1477646918000,
+ 0.8,
+ 1477646910,
+ 1477646920,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646919,
+ 1477646919000,
+ 0.8,
+ 1477646910,
+ 1477646920,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646922,
+ 1477646922000,
+ 0.6,
+ 1477646920,
+ 1477646930,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646926,
+ 1477646926000,
+ 0.6,
+ 1477646920,
+ 1477646930,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646929,
+ 1477646929000,
+ 0.6,
+ 1477646920,
+ 1477646930,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646931,
+ 1477646931000,
+ 0.8,
+ 1477646930,
+ 1477646940,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646932,
+ 1477646932000,
+ 0.8,
+ 1477646930,
+ 1477646940,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646935,
+ 1477646935000,
+ 0.8,
+ 1477646930,
+ 1477646940,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646939,
+ 1477646939000,
+ 0.8,
+ 1477646930,
+ 1477646940,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646943,
+ 1477646943000,
+ 1,
+ 1477646940,
+ 1477646950,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646948,
+ 1477646948000,
+ 1,
+ 1477646940,
+ 1477646950,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646952,
+ 1477646952000,
+ 1,
+ 1477646950,
+ 1477646960,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646953,
+ 1477646953000,
+ 1,
+ 1477646950,
+ 1477646960,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646956,
+ 1477646956000,
+ 1,
+ 1477646950,
+ 1477646960,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646959,
+ 1477646959000,
+ 1,
+ 1477646950,
+ 1477646960,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646961,
+ 1477646961000,
+ 0.9,
+ 1477646960,
+ 1477646970,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646965,
+ 1477646965000,
+ 0.9,
+ 1477646960,
+ 1477646970,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646966,
+ 1477646966000,
+ 0.9,
+ 1477646960,
+ 1477646970,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646969,
+ 1477646969000,
+ 0.9,
+ 1477646960,
+ 1477646970,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646973,
+ 1477646973000,
+ 1,
+ 1477646970,
+ 1477646980,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646976,
+ 1477646976000,
+ 1,
+ 1477646970,
+ 1477646980,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646978,
+ 1477646978000,
+ 1,
+ 1477646970,
+ 1477646980,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646979,
+ 1477646979000,
+ 1,
+ 1477646970,
+ 1477646980,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646982,
+ 1477646982000,
+ 1,
+ 1477646980,
+ 1477646990,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646986,
+ 1477646986000,
+ 1,
+ 1477646980,
+ 1477646990,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646987,
+ 1477646987000,
+ 1,
+ 1477646980,
+ 1477646990,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646995,
+ 1477646995000,
+ 1,
+ 1477646990,
+ 1477647000,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646996,
+ 1477646996000,
+ 1,
+ 1477646990,
+ 1477647000,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477646999,
+ 1477646999000,
+ 1,
+ 1477646990,
+ 1477647000,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647003,
+ 1477647003000,
+ 0.2,
+ 1477647000,
+ 1477647010,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647005,
+ 1477647005000,
+ 0.2,
+ 1477647000,
+ 1477647010,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647007,
+ 1477647007000,
+ 0.2,
+ 1477647000,
+ 1477647010,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647011,
+ 1477647011000,
+ 0,
+ 1477647010,
+ 1477647020,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647016,
+ 1477647016000,
+ 0,
+ 1477647010,
+ 1477647020,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647018,
+ 1477647018000,
+ 0,
+ 1477647010,
+ 1477647020,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647022,
+ 1477647022000,
+ 0,
+ 1477647020,
+ 1477647030,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647024,
+ 1477647024000,
+ 0,
+ 1477647020,
+ 1477647030,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647029,
+ 1477647029000,
+ 0,
+ 1477647020,
+ 1477647030,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647033,
+ 1477647033000,
+ 0,
+ 1477647030,
+ 1477647040,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647035,
+ 1477647035000,
+ 0,
+ 1477647030,
+ 1477647040,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647037,
+ 1477647037000,
+ 0,
+ 1477647030,
+ 1477647040,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647042,
+ 1477647042000,
+ 0,
+ 1477647040,
+ 1477647050,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647046,
+ 1477647046000,
+ 0,
+ 1477647040,
+ 1477647050,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647048,
+ 1477647048000,
+ 0,
+ 1477647040,
+ 1477647050,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647054,
+ 1477647054000,
+ 0,
+ 1477647050,
+ 1477647060,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647056,
+ 1477647056000,
+ 0,
+ 1477647050,
+ 1477647060,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647058,
+ 1477647058000,
+ 0,
+ 1477647050,
+ 1477647060,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647061,
+ 1477647061000,
+ 0,
+ 1477647060,
+ 1477647070,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647063,
+ 1477647063000,
+ 0,
+ 1477647060,
+ 1477647070,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 40.7347789,
+ -73.9231919,
+ 0,
+ 1477647067,
+ 1477647067000,
+ 0,
+ 1477647060,
+ 1477647070,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 0,
+ 1477647069,
+ 1477647069000,
+ 0,
+ 1477647060,
+ 1477647070,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 0,
+ 1477647071,
+ 1477647071000,
+ 0,
+ 1477647070,
+ 1477647080,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 0,
+ 1477647074,
+ 1477647074000,
+ 0,
+ 1477647070,
+ 1477647080,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 0,
+ 1477647076,
+ 1477647076000,
+ 0,
+ 1477647070,
+ 1477647080,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 40.7347536,
+ -73.9231675,
+ 0,
+ 1477647081,
+ 1477647081000,
+ 0,
+ 1477647080,
+ 1477647090,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647084,
+ 1477647084000,
+ 0,
+ 1477647080,
+ 1477647090,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647088,
+ 1477647088000,
+ 0.5,
+ 1477647080,
+ 1477647090,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647091,
+ 1477647091000,
+ 0,
+ 1477647090,
+ 1477647100,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647093,
+ 1477647093000,
+ 0,
+ 1477647090,
+ 1477647100,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647094,
+ 1477647094000,
+ 0.9,
+ 1477647090,
+ 1477647100,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647097,
+ 1477647097000,
+ 0.8,
+ 1477647090,
+ 1477647100,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647101,
+ 1477647101000,
+ 0,
+ 1477647100,
+ 1477647110,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647102,
+ 1477647102000,
+ 0,
+ 1477647100,
+ 1477647110,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647105,
+ 1477647105000,
+ 0,
+ 1477647100,
+ 1477647110,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647111,
+ 1477647111000,
+ 1,
+ 1477647110,
+ 1477647120,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647114,
+ 1477647114000,
+ 1,
+ 1477647110,
+ 1477647120,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647115,
+ 1477647115000,
+ 1,
+ 1477647110,
+ 1477647120,
+ '11/1/17 10:30'
+ ],
+ [
+ '0824eb2b-bfcf-4fd8-9fc1-6d7573611792',
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 40.7347486,
+ -73.9232025,
+ 0,
+ 1477647118,
+ 1477647118000,
+ 1,
+ 1477647110,
+ 1477647120,
+ '11/1/17 10:30'
+ ]
+ ],
+ fields: [
+ {name: 'uuid', type: 'string', format: ''},
+ {name: 'lat', type: 'real', format: ''},
+ {name: 'lng', type: 'real', format: ''},
+ {name: 'Latitude', type: 'real', format: ''},
+ {name: 'Longitude', type: 'real', format: ''},
+ {name: 'at_Latitude', type: 'real', format: ''},
+ {name: 'at_Longitude', type: 'real', format: ''},
+ {name: 'metric', type: 'real', format: ''},
+ {name: 'epoch', type: 'timestamp', format: 'x'},
+ {name: 'epoch_ms', type: 'timestamp', format: 'X'},
+ {name: 'meta_data', type: 'real', format: ''},
+ {name: 'start_ts', type: 'timestamp', format: 'x'},
+ {name: 'end_ts', type: 'timestamp', format: 'x'},
+ {name: 'time string', type: 'timestamp', format: 'M/D/YYYY H:m'}
+ ]
+ }
+ }
+ ]
+};
+
+export const v1expectedInfo_2 = {
+ id: 'test_phone_data',
+ label: 'sample phone data',
+ color: [53, 92, 125]
+};
+
+export const v1expectedFields_2 = [
+ {name: 'uuid', type: 'string', format: ''},
+ {name: 'lat', type: 'real', format: ''},
+ {name: 'lng', type: 'real', format: ''},
+ {name: 'Latitude', type: 'real', format: ''},
+ {name: 'Longitude', type: 'real', format: ''},
+ {name: 'at_Latitude', type: 'real', format: ''},
+ {name: 'at_Longitude', type: 'real', format: ''},
+ {name: 'metric', type: 'real', format: ''},
+ {name: 'epoch', type: 'timestamp', format: 'x'},
+ {name: 'epoch_ms', type: 'timestamp', format: 'X'},
+ {name: 'meta_data', type: 'real', format: ''},
+ {name: 'start_ts', type: 'timestamp', format: 'x'},
+ {name: 'end_ts', type: 'timestamp', format: 'x'},
+ {name: 'time string', type: 'timestamp', format: 'YYYY/M/D H:m'}
+];
\ No newline at end of file
diff --git a/test/fixtures/state-saved-v1-3.js b/test/fixtures/state-saved-v1-3.js
new file mode 100644
index 000000000..b77fb2bce
--- /dev/null
+++ b/test/fixtures/state-saved-v1-3.js
@@ -0,0 +1,488 @@
+// Copyright (c) 2018 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 {KeplerGlLayers} from 'layers';
+const {PointLayer, HexagonLayer} = KeplerGlLayers;
+// saved state v1 with split maps
+export const savedStateV1 = {
+ datasets: [
+ {
+ version: 'v1',
+ data: {
+ id: 'fm8v2jcza',
+ label: 'eats_res_radius.csv',
+ color: [53, 92, 125],
+ allData: [
+ [
+ 1000,
+ 38.4163786,
+ -121.7922809,
+ false,
+ false,
+ 1,
+ false,
+ 'Hello',
+ '11/1/17 11:00',
+ 1512780000000
+ ],
+ [
+ 1000,
+ 37.75159991,
+ -122.4761712,
+ false,
+ false,
+ 2,
+ false,
+ 'Smoothie',
+ '11/1/17 11:01',
+ 1512780000000
+ ],
+ [
+ 2000,
+ 37.8323825,
+ -122.2736475,
+ false,
+ false,
+ 3,
+ false,
+ 'Milkshake',
+ '11/1/17 11:02',
+ 1512770000000
+ ],
+ [
+ 2000,
+ 37.77565501,
+ -122.4403984,
+ false,
+ false,
+ 4,
+ false,
+ 'Amsterdam',
+ '11/1/17 11:03',
+ 1512770000000
+ ],
+ [
+ 3000,
+ 37.79659543,
+ -122.4219072,
+ false,
+ false,
+ 0,
+ false,
+ 'Smoothie',
+ '11/1/17 11:04',
+ 1512770000000
+ ],
+ [
+ 3000,
+ 37.7980847,
+ -122.4050548,
+ false,
+ false,
+ 1,
+ false,
+ 'Smoothie',
+ '11/1/17 11:00',
+ 1512770000000
+ ],
+ [
+ 3000,
+ 37.79242329,
+ -122.3986584,
+ false,
+ false,
+ 0,
+ false,
+ 'World',
+ '11/1/17 11:00',
+ 1512270000000
+ ],
+ [
+ 3000,
+ 37.79669585,
+ -122.4219416,
+ false,
+ false,
+ 1,
+ false,
+ 'yo',
+ '11/1/17 11:05',
+ 1512270000000
+ ],
+ [
+ 2000,
+ 37.6169644,
+ -122.384047,
+ false,
+ false,
+ 0,
+ false,
+ 'really',
+ '11/1/17 11:10',
+ 1512270000000
+ ]
+ ],
+ fields: [
+ {
+ name: 'deliver_radius',
+ type: 'integer',
+ format: ''
+ },
+ {
+ name: 'restaurant_lat',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'restaurant_lng',
+ type: 'real',
+ format: ''
+ },
+ {
+ name: 'boolean',
+ type: 'boolean',
+ format: ''
+ },
+ {
+ name: 'num_boolean',
+ type: 'boolean',
+ format: ''
+ },
+ {
+ name: 'int',
+ type: 'integer',
+ format: ''
+ },
+ {
+ name: 'boolean_1',
+ type: 'boolean',
+ format: ''
+ },
+ {
+ name: 'name',
+ type: 'string',
+ format: ''
+ },
+ {
+ name: 'time',
+ type: 'timestamp',
+ format: 'M/D/YYYY H:m'
+ },
+ {
+ name: 'epoch',
+ type: 'timestamp',
+ format: 'X'
+ }
+ ]
+ }
+ }
+ ],
+ config: {
+ version: 'v1',
+ config: {
+ visState: {
+ filters: [],
+ layers: [
+ {
+ id: 'f24uw1',
+ type: 'point',
+ config: {
+ dataId: 'fm8v2jcza',
+ label: 'restaurant',
+ color: [18, 147, 154],
+ columns: {
+ lat: 'restaurant_lat',
+ lng: 'restaurant_lng',
+ altitude: null
+ },
+ isVisible: true,
+ visConfig: {
+ radius: 10,
+ fixedRadius: true,
+ opacity: 0.29,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'ColorBrewer YlGn-6',
+ type: 'sequential',
+ category: 'ColorBrewer',
+ colors: [
+ '#006837',
+ '#31a354',
+ '#78c679',
+ '#addd8e',
+ '#d9f0a3',
+ '#ffffcc'
+ ],
+ reversed: true
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+ },
+ visualChannels: {
+ colorField: {name: 'deliver_radius', type: 'integer'},
+ colorScale: 'quantile',
+ sizeField: {name: 'deliver_radius', type: 'integer'},
+ sizeScale: 'sqrt'
+ }
+ },
+ {
+ id: '9x77w7h',
+ type: 'hexagon',
+ config: {
+ dataId: 'fm8v2jcza',
+ label: 'hexagon',
+ color: [221, 178, 124],
+ columns: {lat: 'restaurant_lat', lng: 'restaurant_lng'},
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ worldUnitSize: 2.73,
+ resolution: 8,
+ colorRange: {
+ name: 'Uber Viz Diverging 1',
+ type: 'diverging',
+ category: 'Uber',
+ colors: [
+ '#00939C',
+ '#85C4C8',
+ '#FEEEE8',
+ '#EC9370',
+ '#C22E00'
+ ],
+ reversed: false
+ },
+ coverage: 1,
+ sizeRange: [0, 500],
+ percentile: [0, 96.54],
+ elevationPercentile: [0, 100],
+ elevationScale: 5,
+ 'hi-precision': false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average',
+ enable3d: false
+ }
+ },
+ visualChannels: {
+ colorField: null,
+ colorScale: 'quantize',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ fieldsToShow: {
+ fm8v2jcza: [
+ 'deliver_radius',
+ 'boolean',
+ 'num_boolean',
+ 'int',
+ 'boolean_1'
+ ]
+ },
+ enabled: true
+ },
+ brush: {size: 0.5, enabled: false}
+ },
+ layerBlending: 'normal',
+ splitMaps: [
+ {
+ layers: {
+ f24uw1: {isAvailable: true, isVisible: false},
+ '9x77w7h': {isAvailable: true, isVisible: true}
+ }
+ },
+ {
+ layers: {
+ f24uw1: {isAvailable: true, isVisible: true},
+ '9x77w7h': {isAvailable: true, isVisible: false}
+ }
+ }
+ ]
+ },
+ mapStyle: {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {
+ label: true,
+ places: true,
+ road: true,
+ border: false,
+ building: true,
+ water: true,
+ land: true
+ },
+ buildingLayer: {
+ isVisible: false,
+ color: [32, 32, 37],
+ opacity: 0.7
+ }
+ },
+ mapState: {
+ bearing: 0,
+ dragRotate: false,
+ latitude: 37.77321745781781,
+ longitude: -122.566946177778,
+ pitch: 0,
+ zoom: 10.39910631173387,
+ isSplit: true
+ }
+ }
+ }
+};
+
+const mergedLayer0 = new PointLayer({
+ id: 'f24uw1'
+});
+
+mergedLayer0.config = {
+ dataId: 'fm8v2jcza',
+ label: 'restaurant',
+ color: [18, 147, 154],
+ columns: {
+ lat: {
+ value: 'restaurant_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'restaurant_lng',
+ fieldIdx: 2
+ },
+ altitude: {
+ fieldIdx: -1,
+ optional: true,
+ value: null
+ }
+ },
+ isVisible: true,
+ colorField: {
+ name: 'deliver_radius',
+ type: 'integer',
+ id: 'deliver_radius',
+ format: '',
+ tableFieldIndex: 1
+ },
+ colorDomain: [1000, 1000, 2000, 2000, 2000, 3000, 3000, 3000, 3000],
+ highlightColor: [252, 242, 26],
+ isConfigActive: false,
+ colorScale: 'quantile',
+ sizeField: {
+ name: 'deliver_radius',
+ type: 'integer',
+ id: 'deliver_radius',
+ format: '',
+ tableFieldIndex: 1
+ },
+ sizeScale: 'sqrt',
+ sizeDomain: [1000, 3000],
+ visConfig: {
+ radius: 10,
+ fixedRadius: true,
+ opacity: 0.29,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'ColorBrewer YlGn-6',
+ type: 'sequential',
+ category: 'ColorBrewer',
+ colors: [
+ '#006837',
+ '#31a354',
+ '#78c679',
+ '#addd8e',
+ '#d9f0a3',
+ '#ffffcc'
+ ],
+ reversed: true
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ }
+};
+
+const mergedLayer1 = new HexagonLayer({
+ id: '9x77w7h'
+});
+
+mergedLayer1.config = {
+ dataId: 'fm8v2jcza',
+ label: 'hexagon',
+ color: [221, 178, 124],
+ columns: {
+ lat: {
+ value: 'restaurant_lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'restaurant_lng',
+ fieldIdx: 2
+ }
+ },
+ isVisible: true,
+ colorField: null,
+ colorDomain: [0, 1],
+ highlightColor: [252, 242, 26],
+ isConfigActive: false,
+ colorScale: 'quantize',
+ sizeField: null,
+ sizeScale: 'linear',
+ sizeDomain: [0, 1],
+ visConfig: {
+ opacity: 0.8,
+ worldUnitSize: 2.73,
+ resolution: 8,
+ colorRange: {
+ name: 'Uber Viz Diverging 1',
+ type: 'diverging',
+ category: 'Uber',
+ colors: ['#00939C', '#85C4C8', '#FEEEE8', '#EC9370', '#C22E00'],
+ reversed: false
+ },
+ coverage: 1,
+ sizeRange: [0, 500],
+ percentile: [0, 96.54],
+ elevationPercentile: [0, 100],
+ elevationScale: 5,
+ 'hi-precision': false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average',
+ enable3d: false
+ }
+};
+
+export const mergedLayers = [mergedLayer0, mergedLayer1];
+
+export const mergedSplitMaps = [
+ {
+ layers: {
+ f24uw1: {isAvailable: true, isVisible: false},
+ '9x77w7h': {isAvailable: true, isVisible: true}
+ }
+ },
+ {
+ layers: {
+ f24uw1: {isAvailable: true, isVisible: true},
+ '9x77w7h': {isAvailable: true, isVisible: false}
+ }
+ }
+];
diff --git a/test/fixtures/test-csv-data.js b/test/fixtures/test-csv-data.js
new file mode 100644
index 000000000..a8dee9809
--- /dev/null
+++ b/test/fixtures/test-csv-data.js
@@ -0,0 +1,963 @@
+// Copyright (c) 2018 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.
+
+/* eslint-disable max-lens */
+const data = `gps_data.utc_timestamp,gps_data.lat,gps_data.lng,gps_data.types,epoch,has_result,id,time,begintrip_ts_utc,begintrip_ts_local,date
+2016-09-17 00:09:55,29.9900937,31.2590542,driver_analytics,1472688000000,False,1,2016-09-23T00:00:00.000Z,2016-10-01 09:41:39+00:00,2016-10-01 09:41:39+00:00,2016-09-23
+2016-09-17 00:10:56,29.9927699,31.2461142,driver_analytics,1472688000000,False,2,2016-09-23T00:00:00.000Z,2016-10-01 09:46:37+00:00,2016-10-01 16:46:37+00:00,2016-09-23
+2016-09-17 00:11:56,29.9907261,31.2312742,driver_analytics,1472688000000,False,3,2016-09-23T00:00:00.000Z,,,2016-09-23
+2016-09-17 00:12:58,29.9870074,31.2175827,driver_analytics,1472688000000,False,4,2016-09-23T00:00:00.000Z,,,2016-09-23
+2016-09-17 00:14:00,29.9923041,31.2154899,driver_analytics,1472688000000,False,5,2016-09-23T00:00:00.000Z,2016-10-01 09:47:37+00:00,2016-10-01 16:47:37+00:00,
+2016-09-17 00:15:01,29.9968249,31.2149361,driver_analytics,1472688000000,False,12124,2016-09-23T05:00:00.000Z,,,
+2016-09-17 00:16:03,30.0037217,31.2164035,driver_analytics,1472688000000,False,222,2016-09-23T05:00:00.000Z,,,
+2016-09-17 00:17:05,30.0116207,31.2179346,driver_analytics,1472688000000,False,345,2016-09-23T00:00:00.000Z,,,2016-09-24
+2016-09-17 00:18:09,30.0208925,31.2179556,driver_analytics,1472708000000,False,,2016-09-23T00:00:00.000Z,,,2016-09-24
+2016-09-17 00:19:12,30.0218999,31.2178842,driver_analytics,1472708000000,False,,2016-09-23T06:00:00.000Z,,,2016-09-24
+2016-09-17 00:19:27,30.0229344,31.2179138,driver_analytics,1472708000000,False,,2016-09-23T05:00:00.000Z,,,2016-09-24
+2016-09-17 00:20:14,30.0264237,31.2179415,driver_analytics,1472708000000,False,,,,,2016-09-24
+2016-09-17 00:21:17,30.0292134,31.2181809,driver_analytics,1472754400000,False,,,,,2016-09-24
+2016-09-17 00:22:20,30.034391,31.2193991,driver_analytics,1472754400000,,,2016-09-23T06:00:00.000Z,,,
+2016-09-17 00:23:22,30.0352752,31.2181803,driver_analytics,1472754400000,,,2016-09-23T06:00:00.000Z,2016-10-01 10:01:54+00:00,2016-10-01 17:01:54+00:00,
+2016-09-17 00:24:24,30.0395918,31.2195902,driver_analytics,1472754400000,,1,2016-09-23T00:00:00.000Z,2016-10-01 09:53:04+00:00,2016-10-01 16:53:04+00:00,
+2016-09-17 00:25:28,30.0497387,31.2174421,driver_analytics,1472774400000,,,2016-09-23T07:00:00.000Z,2016-10-01 09:55:23+00:00,2016-10-01 16:55:23+00:00,
+2016-09-17 00:26:29,30.0538936,31.2165983,driver_analytics,1472774400000,,43,2016-09-23T07:00:00.000Z,2016-10-01 09:59:53+00:00,2016-10-01 16:59:53+00:00,2016-10-10
+2016-09-17 00:27:31,30.060911,31.2148748,driver_analytics,1472774400000,,4,2016-09-23T07:00:00.000Z,2016-10-01 09:57:11+00:00,2016-10-01 16:57:11+00:00,2016-10-10
+2016-09-17 00:28:35,30.060334,31.2212278,driver_analytics,1472774400000,,5,2016-09-23T07:00:00.000Z,2016-10-01 09:59:27+00:00,2016-10-01 16:59:27+00:00,2016-10-10
+2016-09-17 00:29:40,30.0554663,31.2288985,driver_analytics,1472774400000,True,,2016-09-23T07:00:00.000Z,2016-10-01 09:46:36+00:00,2016-10-01 16:46:36+00:00,2016-10-10
+2016-09-17 00:30:03,30.0614122,31.2187021,driver_gps,1472774400000,True,6,2016-09-23T08:00:00.000Z,2016-10-01 09:54:31+00:00,2016-10-01 16:54:31+00:00,2016-10-10
+2016-09-17 00:30:03,30.0612697,31.2191059,driver_gps,1472774400000,True,7,2016-09-23T08:00:00.000Z,2016-10-01 09:53:35+00:00,2016-10-01 16:53:35+00:00,2016-10-10
+2016-09-17 00:30:08,30.0610977,31.2194728,driver_gps,1472774400000,True,,2016-09-23T08:00:00.000Z,,,`;
+
+export const dataWithNulls = `gps_data.utc_timestamp,gps_data.lat,gps_data.lng,gps_data.types,epoch,has_result,id,time,begintrip_ts_utc,begintrip_ts_local,date
+2016-09-17 00:09:55,29.9900937,31.2590542,driver_analytics,1472688000000,False,1,2016-09-23T00:00:00.000Z,2016-10-01 09:41:39+00:00,2016-10-01 09:41:39+00:00,2016-09-23
+2016-09-17 00:10:56,29.9927699,31.2461142,driver_analytics,1472688000000,False,null,2016-09-23T00:00:00.000Z,2016-10-01 09:46:37+00:00,2016-10-01 16:46:37+00:00,2016-09-23
+2016-09-17 00:11:56,29.9907261,NaN,driver_analytics,1472688000000,False,3,2016-09-23T00:00:00.000Z,,,2016-09-23
+2016-09-17 00:12:58,29.9870074,31.2175827,driver_analytics,1472688000000,False,4,2016-09-23T00:00:00.000Z,,,2016-09-23
+2016-09-17 00:14:00,29.9923041,31.2154899,driver_analytics,1472688000000,1,5,2016-09-23T00:00:00.000Z,2016-10-01 09:47:37+00:00,2016-10-01 16:47:37+00:00,
+2016-09-17 00:15:01,29.9968249,31.2149361,driver_analytics,1472688000000,False,12124,2016-09-23T05:00:00.000Z,,,
+2016-09-17 00:16:03,Null,31.2164035,driver_analytics,1472688000000,False,222,2016-09-23T05:00:00.000Z,,,
+2016-09-17 00:17:05,30.0116207,31.2179346,driver_analytics,1472688000000,False,345,2016-09-23T00:00:00.000Z,,,2016-09-24
+2016-09-17 00:18:09,30.0208925,31.2179556,driver_analytics,1472708000000,False,,2016-09-23T00:00:00.000Z,,,2016-09-24
+2016-09-17 00:19:12,30.0218999,31.2178842,driver_analytics,NULL,0,,2016-09-23T06:00:00.000Z,,,2016-09-24
+2016-09-17 00:19:27,30.0229344,31.2179138,driver_analytics,1472708000000,False,,2016-09-23T05:00:00.000Z,,,2016-09-24
+2016-09-17 00:20:14,30.0264237,31.2179415,driver_analytics,1472708000000,False,,,,,2016-09-24
+2016-09-17 00:21:17,30.0292134,31.2181809,driver_analytics,1472754400000,False,,,,,2016-09-24`;
+
+export const parsedDataWithNulls = [[
+ '2016-09-17 00:09:55',
+ 29.9900937,
+ 31.2590542,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 1,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:41:39+00:00',
+ '2016-10-01 09:41:39+00:00',
+ '2016-09-23'
+], [
+ '2016-09-17 00:10:56',
+ 29.9927699,
+ 31.2461142,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ null,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:46:37+00:00',
+ '2016-10-01 16:46:37+00:00',
+ '2016-09-23'
+], [
+ '2016-09-17 00:11:56',
+ 29.9907261,
+ null,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 3,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-23'
+], [
+ '2016-09-17 00:12:58',
+ 29.9870074,
+ 31.2175827,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 4,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-23'
+], [
+ '2016-09-17 00:14:00',
+ 29.9923041,
+ 31.2154899,
+ 'driver_analytics',
+ 1472688000000,
+ true,
+ 5,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:47:37+00:00',
+ '2016-10-01 16:47:37+00:00',
+ null
+], [
+ '2016-09-17 00:15:01',
+ 29.9968249,
+ 31.2149361,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 12124,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ null
+], [
+ '2016-09-17 00:16:03',
+ null,
+ 31.2164035,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 222,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ null
+], [
+ '2016-09-17 00:17:05',
+ 30.0116207,
+ 31.2179346,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 345,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:18:09',
+ 30.0208925,
+ 31.2179556,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:19:12',
+ 30.0218999,
+ 31.2178842,
+ 'driver_analytics',
+ null,
+ false,
+ null,
+ '2016-09-23T06:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:19:27',
+ 30.0229344,
+ 31.2179138,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:20:14',
+ 30.0264237,
+ 31.2179415,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ null,
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:21:17',
+ 30.0292134,
+ 31.2181809,
+ 'driver_analytics',
+ 1472754400000,
+ false,
+ null,
+ null,
+ null,
+ null,
+ '2016-09-24'
+]];
+
+export const wktCsv = `a_zip,simplified_shape_v2,simplified_shape,m_rate,c_zip_type,c_number
+7014,"{""type"":""Polygon"",""coordinates"":[[[-74.158491,40.835947],[-74.157914,40.83902],[-74.148473,40.834522]]]}","POLYGON ((-74.158491 40.835947, -74.158491 40.835947))",7.5,C_Medium_High,29.07437458
+7016,"{""type"":""Polygon"",""coordinates"":[[[-74.31687,40.656696],[-74.319449,40.658154],[-74.31687,40.656696]]]}","POLYGON ((-74.31687 40.656696, -74.312298 40.654042, -74.31687 40.656696))",6.5,C_Medium_High,27.60106201
+7023,"{""type"":""Polygon"",""coordinates"":[[[-74.387589,40.632238],[-74.387589,40.632238]]]}","POLYGON ((-74.387589 40.632238, -74.382333 40.632417, -74.384457 40.630453, -74.387589 40.632238))",7.6,C_Medium_High,23.85239437
+7029,"{""type"":""Polygon"",""coordinates"":[[[-74.165995,40.747969],[-74.165987,40.745199],[-74.165995,40.747969]]]}","POLYGON ((-74.165995 40.747969, -74.163788 40.739201, -74.165987 40.745199, -74.165995 40.747969))",11.8,C_Medium_High,39.13775443
+7416,"{""type"":""MultiPolygon"",""coordinates"":[[[[-74.566993,41.087294],[-74.564908,41.089339],[-74.552353,41.091647],[-74.566993,41.087294]]],[[[-74.593264,41.088526],[-74.593264,41.088526]]]]}","MULTIPOLYGON (((-74.566993 41.087294, -74.564908 41.089339, -74.56559 41.090507, -74.557344 41.105958, -74.585763 41.083491, -74.593264 41.088526)))",10,A_Low_Rural,13.81679389`;
+
+export const testFields = [{
+ type: 'timestamp',
+ name: 'gps_data.utc_timestamp',
+ format: 'YYYY-M-D H:m:s',
+ tableFieldIndex: 1
+}, {
+ type: 'real',
+ name: 'gps_data.lat',
+ format: '',
+ tableFieldIndex: 2
+}, {
+ type: 'real',
+ name: 'gps_data.lng',
+ format: '',
+ tableFieldIndex: 3
+}, {
+ type: 'string',
+ name: 'gps_data.types',
+ format: '',
+ tableFieldIndex: 4
+}, {
+ type: 'timestamp',
+ name: 'epoch',
+ format: 'X',
+ tableFieldIndex: 5
+}, {
+ type: 'boolean',
+ name: 'has_result',
+ format: '',
+ tableFieldIndex: 6
+}, {
+ type: 'integer',
+ name: 'id',
+ format: '',
+ tableFieldIndex: 7
+}, {
+ type: 'timestamp',
+ name: 'time',
+ format: 'YYYY-M-DTHH:mm:ss.SSSS',
+ tableFieldIndex: 8
+}, {
+ type: 'timestamp',
+ name: 'begintrip_ts_utc',
+ format: 'YYYY-M-D HH:mm:ssZZ',
+ tableFieldIndex: 9
+}, {
+ type: 'timestamp',
+ name: 'begintrip_ts_local',
+ format: 'YYYY-M-D HH:mm:ssZZ',
+ tableFieldIndex: 10
+}, {
+ type: 'date',
+ name: 'date',
+ format: 'YYYY-M-D',
+ tableFieldIndex: 11
+}];
+
+export const wktCsvFields = [{
+ type: 'integer',
+ name: 'a_zip',
+ format: '',
+ tableFieldIndex: 1
+}, {
+ type: 'geojson',
+ name: 'simplified_shape_v2',
+ format: '',
+ tableFieldIndex: 2
+}, {
+ type: 'geojson',
+ name: 'simplified_shape',
+ format: '',
+ tableFieldIndex: 3
+}, {
+ type: 'real',
+ name: 'm_rate',
+ format: '',
+ tableFieldIndex: 4
+}, {
+ type: 'string',
+ name: 'c_zip_type',
+ format: '',
+ tableFieldIndex: 5
+}, {
+ type: 'real',
+ name: 'c_number',
+ format: '',
+ tableFieldIndex: 6
+}];
+
+export const testAllData = [[
+ '2016-09-17 00:09:55',
+ 29.9900937,
+ 31.2590542,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 1,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:41:39+00:00',
+ '2016-10-01 09:41:39+00:00',
+ '2016-09-23'
+], [
+ '2016-09-17 00:10:56',
+ 29.9927699,
+ 31.2461142,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 2,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:46:37+00:00',
+ '2016-10-01 16:46:37+00:00',
+ '2016-09-23'
+], [
+ '2016-09-17 00:11:56',
+ 29.9907261,
+ 31.2312742,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 3,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-23'
+], [
+ '2016-09-17 00:12:58',
+ 29.9870074,
+ 31.2175827,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 4,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-23'
+], [
+ '2016-09-17 00:14:00',
+ 29.9923041,
+ 31.2154899,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 5,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:47:37+00:00',
+ '2016-10-01 16:47:37+00:00',
+ null
+], [
+ '2016-09-17 00:15:01',
+ 29.9968249,
+ 31.2149361,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 12124,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ null
+], [
+ '2016-09-17 00:16:03',
+ 30.0037217,
+ 31.2164035,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 222,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ null
+], [
+ '2016-09-17 00:17:05',
+ 30.0116207,
+ 31.2179346,
+ 'driver_analytics',
+ 1472688000000,
+ false,
+ 345,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:18:09',
+ 30.0208925,
+ 31.2179556,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ '2016-09-23T00:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:19:12',
+ 30.0218999,
+ 31.2178842,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ '2016-09-23T06:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:19:27',
+ 30.0229344,
+ 31.2179138,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ '2016-09-23T05:00:00.000Z',
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:20:14',
+ 30.0264237,
+ 31.2179415,
+ 'driver_analytics',
+ 1472708000000,
+ false,
+ null,
+ null,
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:21:17',
+ 30.0292134,
+ 31.2181809,
+ 'driver_analytics',
+ 1472754400000,
+ false,
+ null,
+ null,
+ null,
+ null,
+ '2016-09-24'
+], [
+ '2016-09-17 00:22:20',
+ 30.034391,
+ 31.2193991,
+ 'driver_analytics',
+ 1472754400000,
+ null,
+ null,
+ '2016-09-23T06:00:00.000Z',
+ null,
+ null,
+ null
+], [
+ '2016-09-17 00:23:22',
+ 30.0352752,
+ 31.2181803,
+ 'driver_analytics',
+ 1472754400000,
+ null,
+ null,
+ '2016-09-23T06:00:00.000Z',
+ '2016-10-01 10:01:54+00:00',
+ '2016-10-01 17:01:54+00:00',
+ null
+], [
+ '2016-09-17 00:24:24',
+ 30.0395918,
+ 31.2195902,
+ 'driver_analytics',
+ 1472754400000,
+ null,
+ 1,
+ '2016-09-23T00:00:00.000Z',
+ '2016-10-01 09:53:04+00:00',
+ '2016-10-01 16:53:04+00:00',
+ null
+], [
+ '2016-09-17 00:25:28',
+ 30.0497387,
+ 31.2174421,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ null,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:55:23+00:00',
+ '2016-10-01 16:55:23+00:00',
+ null
+], [
+ '2016-09-17 00:26:29',
+ 30.0538936,
+ 31.2165983,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 43,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:59:53+00:00',
+ '2016-10-01 16:59:53+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:27:31',
+ 30.060911,
+ 31.2148748,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 4,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:57:11+00:00',
+ '2016-10-01 16:57:11+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:28:35',
+ 30.060334,
+ 31.2212278,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 5,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:59:27+00:00',
+ '2016-10-01 16:59:27+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:29:40',
+ 30.0554663,
+ 31.2288985,
+ 'driver_analytics',
+ 1472774400000,
+ true,
+ null,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:46:36+00:00',
+ '2016-10-01 16:46:36+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:30:03',
+ 30.0614122,
+ 31.2187021,
+ 'driver_gps',
+ 1472774400000,
+ true,
+ 6,
+ '2016-09-23T08:00:00.000Z',
+ '2016-10-01 09:54:31+00:00',
+ '2016-10-01 16:54:31+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:30:03',
+ 30.0612697,
+ 31.2191059,
+ 'driver_gps',
+ 1472774400000,
+ true,
+ 7,
+ '2016-09-23T08:00:00.000Z',
+ '2016-10-01 09:53:35+00:00',
+ '2016-10-01 16:53:35+00:00',
+ '2016-10-10'
+], [
+ '2016-09-17 00:30:08',
+ 30.0610977,
+ 31.2194728,
+ 'driver_gps',
+ 1472774400000,
+ true,
+ null,
+ '2016-09-23T08:00:00.000Z',
+ null,
+ null,
+ null
+]];
+
+export default data;
+
+export const updatedLayerV2 = {
+ dataToFeature: {
+ 0: {
+ type: 'Feature',
+ properties: {
+ index: 0
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.158491,
+ 40.835947
+ ],
+ [
+ -74.157914,
+ 40.83902
+ ],
+ [
+ -74.148473,
+ 40.834522
+ ]
+ ]
+ ]
+ }
+ },
+ 1: {
+ type: 'Feature',
+ properties: {
+ index: 1
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.31687,
+ 40.656696
+ ],
+ [
+ -74.319449,
+ 40.658154
+ ],
+ [
+ -74.31687,
+ 40.656696
+ ]
+ ]
+ ]
+ }
+ },
+ 2: {
+ type: 'Feature',
+ properties: {
+ index: 2
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.387589,
+ 40.632238
+ ],
+ [
+ -74.387589,
+ 40.632238
+ ]
+ ]
+ ]
+ }
+ },
+ 3: {
+ type: 'Feature',
+ properties: {
+ index: 3
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.165995,
+ 40.747969
+ ],
+ [
+ -74.165987,
+ 40.745199
+ ],
+ [
+ -74.165995,
+ 40.747969
+ ]
+ ]
+ ]
+ }
+ },
+ 4: {
+ type: 'Feature',
+ properties: {
+ index: 4
+ },
+ geometry: {
+ type: 'MultiPolygon',
+ coordinates: [
+ [
+ [
+ [
+ -74.566993,
+ 41.087294
+ ],
+ [
+ -74.564908,
+ 41.089339
+ ],
+ [
+ -74.552353,
+ 41.091647
+ ],
+ [
+ -74.566993,
+ 41.087294
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -74.593264,
+ 41.088526
+ ],
+ [
+ -74.593264,
+ 41.088526
+ ]
+ ]
+ ]
+ ]
+ }
+ }
+ },
+ meta: {
+ featureTypes: {polygon: true},
+ bounds: [
+ -74.593264,
+ 40.632238,
+ -74.148473,
+ 41.091647
+ ],
+ lightSettings: {
+ lightsPosition: [
+ -74.593264,
+ 40.632238,
+ 8000,
+ -74.148473,
+ 41.091647,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [
+ 0.9,
+ 0,
+ 0.8,
+ 0
+ ],
+ numberOfLights: 2
+ },
+ fp64: false,
+ fixedRadius: false
+ }
+};
+
+export const updatedLayerSimplifiedShape = {
+ dataToFeature: {
+ 0: {
+ type: 'Feature',
+ properties: {
+ index: 0
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.158491,
+ 40.835947
+ ],
+ [
+ -74.158491,
+ 40.835947
+ ]
+ ]
+ ]
+ }
+ },
+ 1: {
+ type: 'Feature',
+ properties: {
+ index: 1
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.31687,
+ 40.656696
+ ],
+ [
+ -74.312298,
+ 40.654042
+ ],
+ [
+ -74.31687,
+ 40.656696
+ ]
+ ]
+ ]
+ }
+ },
+ 2: {
+ type: 'Feature',
+ properties: {
+ index: 2
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.387589,
+ 40.632238
+ ],
+ [
+ -74.382333,
+ 40.632417
+ ],
+ [
+ -74.384457,
+ 40.630453
+ ],
+ [
+ -74.387589,
+ 40.632238
+ ]
+ ]
+ ]
+ }
+ },
+ 3: {
+ type: 'Feature',
+ properties: {
+ index: 3
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ -74.165995,
+ 40.747969
+ ],
+ [
+ -74.163788,
+ 40.739201
+ ],
+ [
+ -74.165987,
+ 40.745199
+ ],
+ [
+ -74.165995,
+ 40.747969
+ ]
+ ]
+ ]
+ }
+ },
+ 4: {
+ type: 'Feature',
+ properties: {
+ index: 4
+ },
+ geometry: {
+ type: 'MultiPolygon',
+ coordinates: [
+ [
+ [
+ [
+ -74.566993,
+ 41.087294
+ ],
+ [
+ -74.564908,
+ 41.089339
+ ],
+ [
+ -74.56559,
+ 41.090507
+ ],
+ [
+ -74.557344,
+ 41.105958
+ ],
+ [
+ -74.585763,
+ 41.083491
+ ],
+ [
+ -74.593264,
+ 41.088526
+ ]
+ ]
+ ]
+ ]
+ }
+ }
+ },
+ meta: {
+ featureTypes: {polygon: true},
+ bounds: [
+ -74.593264,
+ 40.630453,
+ -74.158491,
+ 41.105958
+ ],
+ lightSettings: {
+ lightsPosition: [
+ -74.593264,
+ 40.630453,
+ 8000,
+ -74.158491,
+ 41.105958,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [
+ 0.9,
+ 0,
+ 0.8,
+ 0
+ ],
+ numberOfLights: 2
+ },
+ fp64: false,
+ fixedRadius: false
+ }
+};
+
+/* eslint-enable max-lens */
diff --git a/test/helpers/comparison-utils.js b/test/helpers/comparison-utils.js
new file mode 100644
index 000000000..ab095be63
--- /dev/null
+++ b/test/helpers/comparison-utils.js
@@ -0,0 +1,269 @@
+// Copyright (c) 2018 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 {FILTER_TYPES} from 'utils/filter-utils';
+export function cmpFilters(
+ t,
+ expectedFilter,
+ actualFilter,
+ opt = {},
+ idx = ''
+) {
+ t.equal(
+ typeof actualFilter,
+ typeof expectedFilter,
+ 'filters should be same type'
+ );
+
+ if (Array.isArray(expectedFilter) && Array.isArray(actualFilter)) {
+ t.equal(
+ actualFilter.length,
+ expectedFilter.length,
+ 'should have same number of filters'
+ );
+ expectedFilter.forEach((f, i) => {
+ cmpFilters(t, expectedFilter[i], actualFilter[i], opt, i);
+ });
+ } else {
+ t.deepEqual(
+ Object.keys(actualFilter).sort(),
+ Object.keys(expectedFilter).sort(),
+ `idx:${idx} | ${actualFilter.type} filter should have same keys`
+ );
+
+ Object.keys(actualFilter).forEach(key => {
+ if (key === 'histogram' || key === 'enlargedHistogram') {
+ if (actualFilter.type === FILTER_TYPES.range || FILTER_TYPES.timeRange) {
+ t.ok(actualFilter[key].length, `filter.${key} shoud not be empty`);
+ }
+ } else if (key !== 'id' || opt.id) {
+ // test everything except id, which is auto generated
+ t.deepEqual(
+ actualFilter[key],
+ expectedFilter[key],
+ `idx:${idx} | ${actualFilter.type} filter.${key} should be correct`
+ );
+ }
+ });
+ }
+}
+
+export function cmpLayers(t, expectedLayer, actualLayer, opt = {}) {
+ t.ok(
+ actualLayer.constructor === expectedLayer.constructor,
+ 'layer should be same class'
+ );
+
+ // if is array of layers
+ if (Array.isArray(expectedLayer) && Array.isArray(actualLayer)) {
+ t.equal(
+ actualLayer.length,
+ expectedLayer.length,
+ 'should have same number of layers'
+ );
+ expectedLayer.forEach((_, i) => {
+ cmpLayers(t, expectedLayer[i], actualLayer[i]);
+ });
+ } else {
+ t.deepEqual(
+ Object.keys(actualLayer.config).sort(),
+ Object.keys(expectedLayer.config).sort(),
+ `layer.${actualLayer.id} should have same keys`
+ );
+
+ Object.keys(expectedLayer.config).forEach(key => {
+ // test everything except color and id, which is auto generated
+ // also skip functions
+ if (
+ (key !== 'id' || opt.id) &&
+ (key !== 'color' || opt.color) &&
+ typeof expectedLayer.config[key] !== 'function'
+ ) {
+ t.deepEqual(
+ actualLayer.config[key],
+ expectedLayer.config[key],
+ `${actualLayer.type} layer ${key} should be correct`
+ );
+ }
+ });
+ }
+}
+
+export function cmpSavedLayers(
+ t,
+ expectedLayer,
+ actualLayer,
+ opt = {},
+ idx = ''
+) {
+ // if is array of layers
+ if (Array.isArray(expectedLayer) && Array.isArray(actualLayer)) {
+ t.equal(
+ actualLayer.length,
+ expectedLayer.length,
+ 'should have same number of layers'
+ );
+ expectedLayer.forEach((_, i) => {
+ cmpSavedLayers(t, expectedLayer[i], actualLayer[i], opt, i);
+ });
+ } else {
+ t.deepEqual(
+ Object.keys(actualLayer).sort(),
+ Object.keys(expectedLayer).sort(),
+ `idx:${idx} | layer.${actualLayer.type} should have same keys`
+ );
+
+ t.deepEqual(
+ actualLayer,
+ expectedLayer,
+ `idx:${idx} | layer.${actualLayer.type} should be saved correctly`
+ );
+
+ Object.keys(expectedLayer).forEach(key => {
+ t.deepEqual(
+ actualLayer[key],
+ expectedLayer[key],
+ `idx:${idx} | ${actualLayer.type} layer ${key} should be correct`
+ );
+
+ if (key === 'config') {
+ t.deepEqual(
+ Object.keys(actualLayer.config).sort(),
+ Object.keys(expectedLayer.config).sort(),
+ `idx:${idx} | layer.${actualLayer.type} config should have same keys`
+ );
+
+ Object.keys(actualLayer.config).forEach(ck => {
+ t.deepEqual(
+ actualLayer.config[ck],
+ expectedLayer.config[ck],
+ `idx:${idx} | ${
+ actualLayer.type
+ } layer.config ${ck} should be correct`
+ );
+ });
+ }
+ });
+ }
+}
+
+export function cmpDatasets(t, expectedDatasets, actualDatasets) {
+ t.deepEqual(
+ Object.keys(actualDatasets).sort(),
+ Object.keys(expectedDatasets).sort(),
+ 'datasets should have same keys'
+ );
+
+ Object.keys(actualDatasets).forEach(dataId => {
+ cmpDataset(t, expectedDatasets[dataId], actualDatasets[dataId]);
+ });
+}
+
+export function cmpDataset(t, expectedDataset, actualDataset, opt = {}) {
+ t.deepEqual(
+ Object.keys(actualDataset).sort(),
+ Object.keys(expectedDataset).sort(),
+ 'dataset should have same keys'
+ );
+
+ // test everything except color, which is auto generated
+ Object.keys(actualDataset).forEach(key => {
+ if (key === 'fields') {
+ t.equal(
+ actualDataset.fields.length,
+ expectedDataset.fields.length,
+ `dataset.${key} should have same number of fields`
+ );
+ actualDataset.fields.forEach((actualField, i) => {
+ t.deepEqual(
+ actualField,
+ expectedDataset.fields[i],
+ `dataset.${key} fields ${actualField.name} should be the same`
+ );
+ });
+ } else if (key !== 'color' || opt.color) {
+ t.deepEqual(
+ actualDataset[key],
+ expectedDataset[key],
+ `dataset.${key} should be correct`
+ );
+ }
+ });
+}
+
+export function cmpInteraction(t, expectedInt, actualInt) {
+ t.deepEqual(
+ Object.keys(actualInt).sort(),
+ Object.keys(expectedInt).sort(),
+ 'interaction should have same keys'
+ );
+
+ Object.keys(actualInt).forEach(key => {
+ t.equal(
+ typeof actualInt[key],
+ typeof expectedInt[key],
+ `interaction.${key} should be same type`
+ );
+
+ if (typeof actualInt[key] === 'object' && !Array.isArray(actualInt[key])) {
+ cmpInteraction(t, expectedInt[key], actualInt[key]);
+ } else {
+ t.deepEqual(
+ actualInt[key],
+ expectedInt[key],
+ `interaction.${key} should be correct`
+ );
+ }
+ });
+}
+
+export function cmpParsedAppConfigs(
+ t,
+ expectedConfig,
+ actualConfig,
+ {name} = {}
+) {
+ t.deepEqual(actualConfig, expectedConfig, `${name} should be expected`);
+
+ Object.keys(actualConfig).forEach(key => {
+ if (key === 'visState') {
+ t.deepEqual(
+ Object.keys(actualConfig[key]).sort(),
+ Object.keys(expectedConfig[key]).sort(),
+ 'visState should have same keys'
+ );
+ // for visConfig go through each entry
+ cmpParsedAppConfigs(t, expectedConfig[key], actualConfig[key], {
+ name: key
+ });
+ } else if (key === 'layers') {
+ cmpSavedLayers(t, expectedConfig[key], actualConfig[key], {id: true});
+ } else if (key === 'filters') {
+ cmpFilters(t, expectedConfig[key], actualConfig[key], {id: true});
+ } else {
+ // for each reducer entry
+ t.deepEqual(
+ actualConfig[key],
+ expectedConfig[key],
+ `${key} should be correct`
+ );
+ }
+ });
+}
diff --git a/test/helpers/layer-utils.js b/test/helpers/layer-utils.js
new file mode 100644
index 000000000..4dc35f586
--- /dev/null
+++ b/test/helpers/layer-utils.js
@@ -0,0 +1,88 @@
+// Copyright (c) 2018 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.
+
+export function testCreateLayer(t, LayerClass, props = {}) {
+ let layer;
+
+ t.doesNotThrow(() => {
+ layer = new LayerClass(props);
+ t.ok(layer instanceof LayerClass, `${layer.type} layer created`);
+ }, `creating layer should not fail`);
+
+ return layer;
+}
+
+export function testFormatLayerData(t, layer, dataArgs) {
+ let result;
+
+ t.doesNotThrow(() => {
+ 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;
+}
+
+export function testCreateCases(t, LayerClass, testCases) {
+ testCases.forEach(tc => {
+ const layer = testCreateLayer(t, LayerClass, tc.props);
+ if (layer && tc.test) {
+ tc.test(layer);
+ }
+ });
+}
+
+export function testUpdateLayer(t, layer, updateMethod, updateArgs) {
+ let result;
+
+ t.doesNotThrow(() => {
+ result = layer[updateMethod](...updateArgs);
+ t.ok(layer, `layer ${updateMethod} called`);
+ }, 'update layer should not fail');
+
+ return {result, layer};
+}
+
+export function testFormatLayerDataCases(t, LayerClass, testCases) {
+ testCases.forEach(tc => {
+ const layer = testCreateLayer(t, LayerClass, tc.props);
+ let updatedLayer = layer;
+
+ // if provided updates
+ if (layer && 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);
+ updatedLayer = updated.layer;
+ });
+ }
+
+ if (updatedLayer) {
+ const result = testFormatLayerData(t, updatedLayer, tc.data);
+ if (result && tc.test) {
+ tc.test({layerData: result, layer: updatedLayer});
+ }
+ }
+ });
+}
diff --git a/test/helpers/mock-state.js b/test/helpers/mock-state.js
new file mode 100644
index 000000000..4e11aca54
--- /dev/null
+++ b/test/helpers/mock-state.js
@@ -0,0 +1,499 @@
+// Copyright (c) 2018 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 Immutable from 'immutable';
+import cloneDeep from 'lodash.clonedeep';
+import {VizColorPalette} from 'constants/custom-color-ranges';
+
+import keplerGlReducer from 'reducers/core';
+import * as VisStateActions from 'actions/vis-state-actions';
+
+// fixtures
+import {testFields, testAllData} from 'test/fixtures/test-csv-data';
+import {fields, rows} from 'test/fixtures/geojson';
+
+const geojsonFields = cloneDeep(fields);
+const geojsonRows = cloneDeep(rows);
+
+const csvInfo = {
+ id: '190vdll3di',
+ label: 'hello.csv',
+ queryType: 'file',
+ queryOption: 'csv',
+ params: {file: null}
+};
+
+const geojsonInfo = {
+ id: 'ieukmgne',
+ label: 'zip.geojson',
+ queryType: 'file',
+ queryOption: 'geojson',
+ params: {file: null}
+};
+
+function applyActions(reducer, initialState, actions) {
+ const actionQ = Array.isArray(actions) ? actions : [actions];
+
+ return actionQ.reduce(
+ (updatedState, {action, payload}) =>
+ reducer(updatedState, action(...payload)),
+ initialState
+ );
+}
+
+/**
+ * Mock Initial App Sate
+ * @returns {Immutable} appState
+ */
+export function mockInitialState() {
+ const initialState = keplerGlReducer(undefined, {});
+ return Immutable.fromJS(initialState);
+}
+
+export const InitialState = mockInitialState();
+
+/**
+ * Mock app state with uploaded geojson and csv file
+ * @returns {Immutable} appState
+ */
+function mockStateWithFileUpload() {
+ const initialState = InitialState.toJS();
+
+ // load csv and geojson
+ const updatedState = applyActions(keplerGlReducer, initialState, [
+ {
+ action: VisStateActions.updateVisData,
+ payload: [
+ [{info: csvInfo, data: {fields: testFields, rows: testAllData}}]
+ ]
+ },
+ {
+ action: VisStateActions.updateVisData,
+ payload: [
+ [{info: geojsonInfo, data: {fields: geojsonFields, rows: geojsonRows}}]
+ ]
+ }
+ ]);
+
+ // replace layer id and color with controlled value for easy testing
+ updatedState.visState.layers.forEach((l, i) => {
+ l.id = `${l.type}-${i}`;
+ l.config.color = [i, i, i]
+ });
+
+ return Immutable.fromJS(updatedState);
+}
+
+function mockStateWithFilters(state) {
+ const initialState =
+ (state && state.toJS()) || mockStateWithFileUpload().toJS();
+
+ const prepareState = applyActions(keplerGlReducer, initialState, [
+ // add filter
+ {action: VisStateActions.addFilter, payload: ['190vdll3di']},
+
+ // set filter to 'time'
+ {action: VisStateActions.setFilter, payload: [0, 'name', 'time']},
+
+ // set filter value
+ {
+ action: VisStateActions.setFilter,
+ payload: [0, 'value', [1474606800000, 1474617600000]]
+ },
+
+ // add another filter
+ {action: VisStateActions.addFilter, payload: ['ieukmgne']},
+
+ // set filter to 'RATE'
+ {action: VisStateActions.setFilter, payload: [1, 'name', 'RATE']},
+
+ // set filter value
+ {action: VisStateActions.setFilter, payload: [1, 'value', ['a']]}
+ ]);
+
+ // replace filter id with controlled value for easy testing
+ prepareState.visState.filters.forEach((f, i) => {
+ f.id = `${f.name}-${i}`;
+ });
+
+ return Immutable.fromJS(prepareState);
+}
+
+function mockStateWithLayerDimensions(state) {
+ const initialState =
+ (state && state.toJS()) || mockStateWithFileUpload().toJS();
+
+ const layer0 = initialState.visState.layers.find(
+ l => l.config.dataId === '190vdll3di' && l.type === 'point'
+ );
+
+ const colorField = initialState.visState.datasets['190vdll3di'].fields.find(
+ f => f.name === 'gps_data.types'
+ );
+
+ const colorFieldpayload = [layer0, {colorField}, 'color'];
+
+ const colorRangePayload = [
+ layer0,
+ {colorRange: VizColorPalette.find(c => c.name === 'Uber Viz Sequential 2')},
+ 'color'
+ ];
+
+ // layers = [ 'point', 'geojson', 'hexagon' ]
+ const reorderPayload = [[2, 0, 1]];
+
+ const prepareState = applyActions(keplerGlReducer, initialState, [
+ // change colorField
+ {
+ action: VisStateActions.layerVisualChannelConfigChange,
+ payload: colorFieldpayload
+ },
+
+ // change colorRange
+ {action: VisStateActions.layerVisConfigChange, payload: colorRangePayload},
+
+ // add layer
+ {action: VisStateActions.addLayer, payload: [{id: 'hexagon-2', color: [2, 2, 2]}]}
+ ]);
+
+ const newLayer = prepareState.visState.layers[2];
+
+ // set new layer to hexagon
+ const updateState = applyActions(keplerGlReducer, prepareState, [
+ {action: VisStateActions.layerTypeChange, payload: [newLayer, 'hexagon']}
+ ]);
+
+ const hexagonLayer = updateState.visState.layers[2];
+ hexagonLayer.id = 'hexagon-2';
+
+ const updateLayerConfig = {
+ dataId: '190vdll3di',
+ columns: {
+ lat: {value: 'gps_data.lat', fieldIdx: 1},
+ lng: {value: 'gps_data.lng', fieldIdx: 2}
+ },
+ isConfigActive: false
+ };
+
+ const resultState = applyActions(keplerGlReducer, updateState, [
+ // select hexagon layer columns
+ {
+ action: VisStateActions.layerConfigChange,
+ payload: [hexagonLayer, updateLayerConfig]
+ },
+
+ // reorder Layer
+ {action: VisStateActions.reorderLayer, payload: reorderPayload}
+ ]);
+
+ return Immutable.fromJS(resultState);
+}
+
+export const StateWFiles = mockStateWithFileUpload();
+export const StateWFilters = mockStateWithFilters();
+export const StateWFilesFiltersLayerColor = mockStateWithLayerDimensions(
+ StateWFilters
+);
+
+// saved hexagon layer
+export const expectedSavedLayer0 = {
+ id: 'hexagon-2',
+ type: 'hexagon',
+ config: {
+ dataId: '190vdll3di',
+ label: 'new layer',
+ color: [2, 2, 2],
+ columns: {
+ lat: 'gps_data.lat',
+ lng: 'gps_data.lng'
+ },
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ worldUnitSize: 1,
+ resolution: 8,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ coverage: 1,
+ sizeRange: [0, 500],
+ percentile: [0, 100],
+ elevationPercentile: [0, 100],
+ elevationScale: 5,
+ 'hi-precision': false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average',
+ enable3d: false
+ }
+ },
+ visualChannels: {
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+};
+
+export const expectedLoadedLayer0 = {
+ id: 'hexagon-2',
+ type: 'hexagon',
+ config: {
+ dataId: '190vdll3di',
+ label: 'new layer',
+ color: [2, 2, 2],
+ columns: {
+ lat: 'gps_data.lat',
+ lng: 'gps_data.lng'
+ },
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ worldUnitSize: 1,
+ resolution: 8,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ coverage: 1,
+ sizeRange: [0, 500],
+ percentile: [0, 100],
+ elevationPercentile: [0, 100],
+ elevationScale: 5,
+ 'hi-precision': false,
+ colorAggregation: 'average',
+ sizeAggregation: 'average',
+ enable3d: false
+ },
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+};
+
+export const expectedSavedLayer1 = {
+ id: 'point-0',
+ type: 'point',
+ config: {
+ dataId: '190vdll3di',
+ label: 'gps data',
+ color: [0, 0, 0],
+ columns: {
+ lat: 'gps_data.lat',
+ lng: 'gps_data.lng',
+ altitude: null
+ },
+ isVisible: true,
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Uber Viz Sequential 2',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#E6FAFA',
+ '#AAD7DA',
+ '#68B4BB',
+ '#00939C'
+ ]
+ },
+ radiusRange: [
+ 0,
+ 50
+ ],
+ 'hi-precision': false
+ }
+ },
+ visualChannels: {
+ colorField: {
+ name: 'gps_data.types',
+ type: 'string'
+ },
+ colorScale: 'ordinal',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+};
+
+export const expectedLoadedLayer1 = {
+ id: 'point-0',
+ type: 'point',
+ config: {
+ dataId: '190vdll3di',
+ label: 'gps data',
+ color: [0, 0, 0],
+ columns: {
+ lat: 'gps_data.lat',
+ lng: 'gps_data.lng',
+ altitude: null
+ },
+ isVisible: true,
+ visConfig: {
+ radius: 10,
+ fixedRadius: false,
+ opacity: 0.8,
+ outline: false,
+ thickness: 2,
+ colorRange: {
+ name: 'Uber Viz Sequential 2',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#E6FAFA',
+ '#AAD7DA',
+ '#68B4BB',
+ '#00939C'
+ ]
+ },
+ radiusRange: [0, 50],
+ 'hi-precision': false
+ },
+ colorField: {
+ name: 'gps_data.types',
+ type: 'string'
+ },
+ colorScale: 'ordinal',
+ sizeField: null,
+ sizeScale: 'linear'
+ }
+};
+
+export const expectedSavedLayer2 = {
+ id :'geojson-1',
+ type :'geojson',
+ config :{
+ dataId :'ieukmgne',
+ label :'zip',
+ color :[1, 1, 1],
+ columns :{
+ geojson :'_geojson'
+ },
+ isVisible :true,
+ visConfig :{
+ opacity :0.8,
+ thickness :2,
+ colorRange :{
+ name :'Global Warming',
+ type :'sequential',
+ category :'Uber',
+ colors :[
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radius :10,
+ sizeRange :[0, 10],
+ radiusRange :[0, 50],
+ heightRange :[0, 500],
+ elevationScale :5,
+ 'hi-precision' :false,
+ stroked :true,
+ filled :false,
+ enable3d :false,
+ wireframe :false
+ }
+ },
+ visualChannels :{
+ colorField :null,
+ colorScale :'quantile',
+ sizeField :null,
+ sizeScale :'linear',
+ heightField :null,
+ heightScale :'linear',
+ radiusField :null,
+ radiusScale :'linear'
+ }
+};
+
+export const expectedLoadedLayer2 = {
+ id: 'geojson-1',
+ type: 'geojson',
+ config: {
+ dataId: 'ieukmgne',
+ label: 'zip',
+ color: [1, 1, 1],
+ columns: {
+ geojson: '_geojson'
+ },
+ isVisible: true,
+ visConfig: {
+ opacity: 0.8,
+ thickness: 2,
+ colorRange: {
+ name: 'Global Warming',
+ type: 'sequential',
+ category: 'Uber',
+ colors: [
+ '#5A1846',
+ '#900C3F',
+ '#C70039',
+ '#E3611C',
+ '#F1920E',
+ '#FFC300'
+ ]
+ },
+ radius: 10,
+ sizeRange: [0, 10],
+ radiusRange: [0, 50],
+ heightRange: [0, 500],
+ elevationScale: 5,
+ 'hi-precision': false,
+ stroked: true,
+ filled: false,
+ enable3d: false,
+ wireframe: false
+ },
+ colorField: null,
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeScale: 'linear',
+ heightField: null,
+ heightScale: 'linear',
+ radiusField: null,
+ radiusScale: 'linear'
+ }
+};
diff --git a/test/node.js b/test/node.js
new file mode 100644
index 000000000..c7380d4c5
--- /dev/null
+++ b/test/node.js
@@ -0,0 +1,22 @@
+// Copyright (c) 2018 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.
+
+// Run the tests
+require('./node/index.js');
\ No newline at end of file
diff --git a/test/node/index.js b/test/node/index.js
new file mode 100644
index 000000000..f9608156f
--- /dev/null
+++ b/test/node/index.js
@@ -0,0 +1,46 @@
+// Copyright (c) 2018 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.
+
+/*eslint-disable */
+import './utils/data-utils-test';
+import './utils/data-processor-test';
+import './utils/filter-utils-test';
+import './utils/layer-utils-test';
+import './utils/data-scale-utils-test';
+import './utils/interaction-utils-test';
+
+// test reducer
+import './reducers/map-state-test';
+import './reducers/vis-state-test';
+import './reducers/ui-state-test';
+import './reducers/composer-state-test';
+
+// test schemas
+import './schemas/vis-state-schema-test';
+import './schemas/map-state-schema-test';
+import './schemas/map-style-schema-test';
+import './schemas/dataset-schema-test';
+import './schemas/schema-conversion-test';
+
+// test mergers
+import './reducers/vis-state-merger-test';
+
+// test layers
+import './layer-tests/index';
diff --git a/test/node/layer-tests/base-layer-sepcs.js b/test/node/layer-tests/base-layer-sepcs.js
new file mode 100644
index 000000000..23198c92c
--- /dev/null
+++ b/test/node/layer-tests/base-layer-sepcs.js
@@ -0,0 +1,92 @@
+// Copyright (c) 2018 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 test from 'tape-catch';
+import {Layer} from 'layers';
+import AggregationLayer from 'layers/aggregation-layer';
+
+test('#BaseLayer -> updateLayerDomain', t => {
+
+ const data = [['a', 3], ['b', 4], ['c', 1], ['d', null]];
+ const mockLayer = new Layer();
+
+ mockLayer.updateLayerConfig({
+ colorField: {
+ tableFieldIndex: 2,
+ type: 'real'
+ },
+ colorDomain: [0, 1],
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeDomain: [0, 1]
+ });
+
+ const expectedDomain = [1, 3, 4];
+ const updatedLayer = mockLayer.updateLayerDomain({data, allData: data});
+
+ t.deepEqual(updatedLayer.config.colorDomain, expectedDomain,
+ 'should calculate layer color domain');
+
+ t.deepEqual(updatedLayer.config.sizeDomain, [0, 1],
+ 'should not calculate layer size domain');
+
+ t.end();
+});
+
+test('#AggregationLayer -> updateLayerDomain', t => {
+ const data = [['a', 3], ['b', 4], ['c', 1], ['d', null]];
+ const mockLayer = new AggregationLayer();
+
+ mockLayer.updateLayerConfig({
+ colorField: {
+ tableFieldIndex: 2,
+ type: 'real'
+ },
+ colorDomain: [0, 1],
+ colorScale: 'quantile',
+ sizeField: null,
+ sizeDomain: [0, 1]
+ });
+
+ const updatedLayer = mockLayer.updateLayerDomain({data, allData: data});
+ t.deepEqual(updatedLayer.config.colorDomain, [0, 1],
+ 'should not calculate aggregation layer domain');
+
+ t.end();
+});
+
+test('#BaseLayer -> getAllPossibleColumnParis', t => {
+ const columnes1 = {
+ a: [1, 2],
+ b: [3, 4]
+ };
+ const columnes2 = {
+ a: [1],
+ b: [3, 4]
+ };
+
+ const columnes3 = {
+ a: [1]
+ };
+ t.equal(Layer.getAllPossibleColumnParis(columnes1).length, 4, 'should find 4 pairs');
+ t.equal(Layer.getAllPossibleColumnParis(columnes2).length, 2, 'should find 4 pairs');
+ t.equal(Layer.getAllPossibleColumnParis(columnes3).length, 1, 'should find 4 pairs');
+ t.end();
+});
diff --git a/test/node/layer-tests/geojson-layer-specs.js b/test/node/layer-tests/geojson-layer-specs.js
new file mode 100644
index 000000000..970d76026
--- /dev/null
+++ b/test/node/layer-tests/geojson-layer-specs.js
@@ -0,0 +1,142 @@
+// Copyright (c) 2018 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 test from 'tape';
+import GeojsonLayer from 'layers/geojson-layer/geojson-layer';
+import {processCsvData} from 'processors/data-processor';
+
+import {wktCsv, updatedLayerSimplifiedShape, updatedLayerV2}
+from 'test/fixtures/test-csv-data';
+import {testCreateCases, testFormatLayerDataCases} from 'test/helpers/layer-utils';
+
+test('#GeojsonLayer -> constructor', t => {
+ const TEST_CASES = {
+ CREATE: [{
+ props: {
+ dataId: 'smoothie',
+ isVisible: true,
+ label: 'test geojson layer'
+ },
+ test: layer => {
+ t.ok(layer.config.dataId === 'smoothie', 'geojsonLayer dataId should be correct');
+ t.ok(layer.type === 'geojson', 'type should be geojson');
+ t.ok(layer.isAggregated === false, 'geojsonLayer is not aggregated');
+ }
+ }]
+ };
+
+ testCreateCases(t, GeojsonLayer, TEST_CASES.CREATE);
+ t.end();
+});
+
+test('#GeojsonLayer -> formatLayerData', async t => {
+ const {rows} = await processCsvData(wktCsv);
+
+ const filteredIndex = [0, 2, 4];
+ const data = [rows[0], rows[2], rows[4]];
+
+ const TEST_CASES = [{
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ geojson: {
+ value: 'simplified_shape_v2',
+ fieldIdx: 1
+ }
+ }
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+ const expectedLayerData = {
+ data: [
+ updatedLayerV2.dataToFeature[0],
+ updatedLayerV2.dataToFeature[2],
+ updatedLayerV2.dataToFeature[4]
+ ],
+ getFeature: () => {},
+ getFillColor: () => {},
+ getLineColor: () => {},
+ getLineWidth: () => {},
+ getElevation: () => {},
+ getRadius: () => {}
+ };
+ const expectedLayerMeta = updatedLayerV2.meta;
+ const expectedDataToFeature = updatedLayerV2.dataToFeature;
+
+ t.deepEqual(layerData.data, expectedLayerData.data, 'should format correct geojson layerData');
+ t.ok(typeof layerData.getFeature === 'function', 'should have getFeature');
+ t.ok(typeof layerData.getFillColor === 'function', 'should have getFillColor');
+ t.ok(typeof layerData.getLineColor === 'function', 'should have getLineColor');
+ t.ok(typeof layerData.getLineWidth === 'function', 'should have getSize');
+ t.ok(typeof layerData.getElevation === 'function', 'should have getRadius');
+ t.ok(typeof layerData.getRadius === 'function', 'should have getRadius');
+
+ t.deepEqual(layer.meta, expectedLayerMeta, 'should format correct geojson layerData');
+ t.deepEqual(layer.dataToFeature, expectedDataToFeature, 'should format correct geojson layerData');
+ }
+ }, {
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ geojson: {
+ value: 'simplified_shape',
+ fieldIdx: 2
+ }
+ }
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+
+ const expectedLayerData = {
+ data: [
+ updatedLayerSimplifiedShape.dataToFeature[0],
+ updatedLayerSimplifiedShape.dataToFeature[2],
+ updatedLayerSimplifiedShape.dataToFeature[4]
+ ],
+ getFeature: () => {},
+ getFillColor: () => {},
+ getLineColor: () => {},
+ getLineWidth: () => {},
+ getElevation: () => {},
+ getRadius: () => {}
+ };
+ const expectedLayerMeta = updatedLayerSimplifiedShape.meta;
+ const expectedDataToFeature = updatedLayerSimplifiedShape.dataToFeature;
+
+ t.deepEqual(layerData.data, expectedLayerData.data, 'should format correct geojson layerData');
+ t.ok(typeof layerData.getFeature === 'function', 'should have getFeature');
+ t.ok(typeof layerData.getFillColor === 'function', 'should have getFillColor');
+ t.ok(typeof layerData.getLineColor === 'function', 'should have getLineColor');
+ t.ok(typeof layerData.getLineWidth === 'function', 'should have getSize');
+ t.ok(typeof layerData.getElevation === 'function', 'should have getRadius');
+ t.ok(typeof layerData.getRadius === 'function', 'should have getRadius');
+
+ t.deepEqual(layer.meta, expectedLayerMeta, 'should format correct geojson layerData');
+ t.deepEqual(layer.dataToFeature, expectedDataToFeature, 'should format correct geojson layerData');
+ }
+ }];
+
+ testFormatLayerDataCases(t, GeojsonLayer, TEST_CASES);
+ t.end();
+});
diff --git a/test/node/layer-tests/grid-layer-specs.js b/test/node/layer-tests/grid-layer-specs.js
new file mode 100644
index 000000000..9da7d23b6
--- /dev/null
+++ b/test/node/layer-tests/grid-layer-specs.js
@@ -0,0 +1,200 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {
+ testCreateCases,
+ testFormatLayerDataCases
+} from 'test/helpers/layer-utils';
+import csvData, {testFields} from 'test/fixtures/test-csv-data';
+
+import GridLayer from 'layers/grid-layer/grid-layer';
+import {processCsvData} from 'processors/data-processor';
+
+test('#GridLayer -> constructor', t => {
+ const TEST_CASES = {
+ CREATE: [
+ {
+ props: {
+ dataId: 'smoothie',
+ isVisible: true,
+ label: 'test grid layer'
+ },
+ test: layer => {
+ t.ok(
+ layer.config.dataId === 'smoothie',
+ 'gridLayer dataId should be correct'
+ );
+ t.ok(layer.type === 'grid', 'type should be grid');
+ t.ok(layer.isAggregated === true, 'gridLayer is aggregated');
+ }
+ }
+ ]
+ };
+
+ testCreateCases(t, GridLayer, TEST_CASES.CREATE);
+ t.end();
+});
+
+test('#GridLayer -> formatLayerData', t => {
+ const {rows} = processCsvData(csvData);
+
+ const filteredIndex = [0, 2, 4];
+ const data = [rows[0], rows[2], rows[4]];
+
+ const dataWithNull = [[null, null, '12']].concat(data);
+ const allDataWithNull = [[null, null, '12']].concat(rows);
+
+ const expectedLayerMeta = {
+ bounds: [31.2148748, 29.9870074, 31.2590542, 30.0614122],
+ lightSettings: {
+ lightsPosition: [
+ 31.2148748,
+ 29.9870074,
+ 8000,
+ 31.2590542,
+ 30.0614122,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ }
+ };
+
+ const TEST_CASES = [
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+ const expectedLayerData = {
+ data: [rows[0], rows[2], rows[4]],
+ getPosition: () => {}
+ };
+
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition'],
+ 'layerData should have 2 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should format correct grid layerData'
+ );
+ t.ok(
+ typeof layerData.getPosition === 'function',
+ 'should have getPosition'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ [31.2590542, 29.9900937],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct grid layerData'
+ );
+ }
+ },
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ updates: [
+ {method: 'updateLayerConfig', args: [{colorField: testFields[6]}]},
+ {
+ method: 'updateLayerVisualChannel',
+ args: [{data: dataWithNull, allData: allDataWithNull}, 'color']
+ }
+ ],
+ data: [dataWithNull, allDataWithNull, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+
+ const expectedLayerData = {
+ data: [rows[1], rows[3]],
+ getPosition: () => {},
+ getColorValue: () => {}
+ };
+
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition', 'getColorValue'],
+ 'layerData should have 2 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should filter out nulls, format correct grid layerData'
+ );
+ t.ok(
+ typeof layerData.getPosition === 'function',
+ 'should have getPosition'
+ );
+ t.ok(
+ typeof layerData.getColorValue === 'function',
+ 'should have getColorValue'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ [31.2461142, 29.9927699],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct grid layerData'
+ );
+ }
+ }
+ ];
+
+ testFormatLayerDataCases(t, GridLayer, TEST_CASES);
+ t.end();
+});
diff --git a/test/node/layer-tests/heatmap-layer-specs.js b/test/node/layer-tests/heatmap-layer-specs.js
new file mode 100644
index 000000000..520072d02
--- /dev/null
+++ b/test/node/layer-tests/heatmap-layer-specs.js
@@ -0,0 +1,164 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {
+ testCreateCases,
+ testFormatLayerDataCases
+} from 'test/helpers/layer-utils';
+import {processCsvData} from "processors/data-processor";
+import csvData from 'test/fixtures/test-csv-data';
+
+import HeatmapLayer from 'layers/heatmap-layer/heatmap-layer';
+
+test('#HeatmapLayer -> contructor', t => {
+ const TEST_CASES = {
+ CREATE: [
+ {
+ props: {
+ dataId: 'heatmap',
+ isVisible: true,
+ label: 'test heatmap layer'
+ },
+ test: layer => {
+ // test constructor
+ t.equal(
+ layer.config.visConfig.weight,
+ 1,
+ 'Heatmap default layer weight should be 1'
+ )
+ }
+ }
+ ]
+ };
+
+ testCreateCases(t, HeatmapLayer, TEST_CASES.CREATE);
+ t.end()
+});
+
+
+test('#Heatmaplayer -> formatLayerData', t => {
+ const {rows} = processCsvData(csvData);
+ const filteredIndex = Array(rows.length).fill().map((_, index) => index);
+ const data = rows;
+ const columns = {
+ lat: {
+ name: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ name: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ };
+ const TEST_CASES = [
+ {
+ props: {
+ dataId: 'heatmap',
+ label: 'mapbox heatmap',
+ isVisible: true,
+ columns
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+ // log(layer);
+ // log(layerData);
+
+ const expectedLayerData = {
+ columns,
+ config: {
+ type: 'heatmap',
+ source: 'heatmap',
+ layout: {
+ visibility: 'visible'
+ },
+ maxzoom: 18,
+ paint: {
+ 'heatmap-weight': 1,
+ 'heatmap-intensity': [
+ 'interpolate',
+ ['linear'],
+ ['zoom'],
+ 0, 1,
+ 18, 3
+ ],
+ 'heatmap-color': [
+ 'interpolate',
+ ['linear'],
+ ['heatmap-density']
+ ],
+ 'heatmap-radius': [
+ 'interpolate',
+ ['linear'],
+ ['zoom'],
+ 0, 2,
+ 18, 20 // radius
+ ],
+ 'heatmap-opacity': 0.8
+ }
+ },
+ data: {
+ type: 'FeatureCollection',
+ features: [
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2590542, 29.9900937, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2461142, 29.9927699, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2312742, 29.9907261, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2175827, 29.9870074, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2154899, 29.9923041, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2149361, 29.9968249, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2164035, 30.0037217, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2179346, 30.0116207, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2179556, 30.0208925, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2178842, 30.0218999, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2179138, 30.0229344, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2179415, 30.0264237, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2181809, 30.0292134, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2193991, 30.034391, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2181803, 30.0352752, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2195902, 30.0395918, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2174421, 30.0497387, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2165983, 30.0538936, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2148748, 30.060911, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2212278, 30.060334, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2288985, 30.0554663, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2187021, 30.0614122, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2191059, 30.0612697, 0 ] } },
+ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.2194728, 30.0610977, 0 ] } }
+ ]
+ },
+ weightField: null
+ };
+
+ t.deepEqual(layerData.data, expectedLayerData.data,
+ "should format correct geojson layerData")
+ }
+ }
+ ];
+
+ testFormatLayerDataCases(t, HeatmapLayer, TEST_CASES);
+ t.end()
+});
+
+// todo: make sure data is created correctly
+// todo: define heatmap weight based on property
+// todo: make sure data is recomputed when weight property is changed
+// todo: make sure data is not recomputed if things don't change
+// todo: make sure config is the same when things don't change
diff --git a/test/node/layer-tests/hexagon-layer-specs.js b/test/node/layer-tests/hexagon-layer-specs.js
new file mode 100644
index 000000000..f6146c608
--- /dev/null
+++ b/test/node/layer-tests/hexagon-layer-specs.js
@@ -0,0 +1,200 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {
+ testCreateCases,
+ testFormatLayerDataCases
+} from 'test/helpers/layer-utils';
+import csvData, {testFields} from 'test/fixtures/test-csv-data';
+
+import HexagonLayer from 'layers/hexagon-layer/hexagon-layer';
+import {processCsvData} from 'processors/data-processor';
+
+test('#HexagonLayer -> constructor', t => {
+ const TEST_CASES = {
+ CREATE: [
+ {
+ props: {
+ dataId: 'smoothie',
+ isVisible: true,
+ label: 'test hexagon layer'
+ },
+ test: layer => {
+ t.ok(
+ layer.config.dataId === 'smoothie',
+ 'HexagonLayer dataId should be correct'
+ );
+ t.ok(layer.type === 'hexagon', 'type should be hexagon');
+ t.ok(layer.isAggregated === true, 'HexagonLayer is aggregated');
+ }
+ }
+ ]
+ };
+
+ testCreateCases(t, HexagonLayer, TEST_CASES.CREATE);
+ t.end();
+});
+
+test('#HexagonLayer -> formatLayerData', async t => {
+ const {rows} = await processCsvData(csvData);
+
+ const filteredIndex = [0, 2, 4];
+ const data = [rows[0], rows[2], rows[4]];
+
+ const dataWithNull = [[null, null, '12']].concat(data);
+ const allDataWithNull = [[null, null, '12']].concat(rows);
+
+ const expectedLayerMeta = {
+ bounds: [31.2148748, 29.9870074, 31.2590542, 30.0614122],
+ lightSettings: {
+ lightsPosition: [
+ 31.2148748,
+ 29.9870074,
+ 8000,
+ 31.2590542,
+ 30.0614122,
+ 8000
+ ],
+ ambientRatio: 0.4,
+ diffuseRatio: 0.6,
+ specularRatio: 0.3,
+ lightsStrength: [0.9, 0, 0.8, 0],
+ numberOfLights: 2
+ }
+ };
+
+ const TEST_CASES = [
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+ const expectedLayerData = {
+ data: [rows[0], rows[2], rows[4]],
+ getPosition: () => {}
+ };
+
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition'],
+ 'layerData should have 2 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should format correct hexagon layerData'
+ );
+ t.ok(
+ typeof layerData.getPosition === 'function',
+ 'should have getPosition'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ [31.2590542, 29.9900937],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct grid layerData'
+ );
+ }
+ },
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'some geometry file',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ updates: [
+ {method: 'updateLayerConfig', args: [{colorField: testFields[6]}]},
+ {
+ method: 'updateLayerVisualChannel',
+ args: [{data: dataWithNull, allData: allDataWithNull}, 'color']
+ }
+ ],
+ data: [dataWithNull, allDataWithNull, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+
+ const expectedLayerData = {
+ data: [[null, null, '12'], rows[1], rows[3]],
+ getPosition: () => {},
+ getColorValue: () => {}
+ };
+
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition', 'getColorValue'],
+ 'layerData should have 2 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should not filter out nulls, format correct hexagon layerData'
+ );
+ t.ok(
+ typeof layerData.getPosition === 'function',
+ 'should have getPosition'
+ );
+ t.ok(
+ typeof layerData.getColorValue === 'function',
+ 'should have getColorValue'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ ['12', null],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct grid layerData'
+ );
+ }
+ }
+ ];
+
+ testFormatLayerDataCases(t, HexagonLayer, TEST_CASES);
+ t.end();
+});
diff --git a/test/node/layer-tests/index.js b/test/node/layer-tests/index.js
new file mode 100644
index 000000000..4e775d3d3
--- /dev/null
+++ b/test/node/layer-tests/index.js
@@ -0,0 +1,26 @@
+// Copyright (c) 2018 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 './base-layer-sepcs';
+import './geojson-layer-specs';
+import './grid-layer-specs';
+import './point-layer-specs';
+import './hexagon-layer-specs';
+import './heatmap-layer-specs';
diff --git a/test/node/layer-tests/point-layer-specs.js b/test/node/layer-tests/point-layer-specs.js
new file mode 100644
index 000000000..351435fa5
--- /dev/null
+++ b/test/node/layer-tests/point-layer-specs.js
@@ -0,0 +1,230 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {
+ testCreateCases,
+ testFormatLayerDataCases
+} from 'test/helpers/layer-utils';
+import csvData, {testFields} from 'test/fixtures/test-csv-data';
+
+import {KeplerGlLayers} from 'layers';
+const {PointLayer} = KeplerGlLayers;
+
+import {processCsvData} from 'processors/data-processor';
+
+test('#PointLayer -> constructor', t => {
+ const TEST_CASES = {
+ CREATE: [
+ {
+ props: {
+ dataId: 'smoothie',
+ isVisible: true,
+ label: 'test point layer'
+ },
+ test: layer => {
+ t.ok(
+ layer.config.dataId === 'smoothie',
+ 'PointLayer dataId should be correct'
+ );
+ t.ok(layer.type === 'point', 'type should be grid');
+ t.ok(layer.isAggregated === false, 'PointLayer is not aggregated');
+ }
+ }
+ ]
+ };
+
+ testCreateCases(t, PointLayer, TEST_CASES.CREATE);
+ t.end();
+});
+
+test('#PointLayer -> formatLayerData', t => {
+ const {rows} = processCsvData(csvData);
+
+ const filteredIndex = [0, 2, 4];
+ const data = [rows[0], rows[2], rows[4]];
+
+ const dataWithNull = [[null, null, '12']].concat(data);
+ const allDataWithNull = [[null, null, '12']].concat(rows);
+
+ const expectedLayerMeta = {
+ bounds: [31.2148748, 29.9870074, 31.2590542, 30.0614122]
+ };
+
+ const TEST_CASES = [
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'gps point',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ data: [data, rows, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+ const expectedLayerData = {
+ data: [
+ {
+ data: rows[0]
+ },
+ {
+ data: rows[2]
+ },
+ {
+ data: rows[4]
+ }
+ ],
+ getPosition: () => {},
+ getColor: () => {},
+ getRadius: () => {}
+ };
+
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition', 'getColor', 'getRadius'],
+ 'layerData should have 3 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should format correct grid layerData'
+ );
+ t.ok(
+ ['getPosition', 'getColor', 'getRadius'].every(
+ k => typeof layerData[k] === 'function'
+ ),
+ 'should have getPosition, getColor, getRadius accessor as function'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ [31.2590542, 29.9900937, 0],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct point layer meta'
+ );
+ }
+ },
+ {
+ props: {
+ dataId: '0dj3h',
+ label: 'some point file',
+ columns: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ }
+ },
+ updates: [
+ {method: 'updateLayerConfig', args: [{colorField: testFields[6]}]},
+ {
+ method: 'updateLayerVisualChannel',
+ args: [{data: dataWithNull, allData: allDataWithNull}, 'color']
+ },
+ {method: 'updateLayerConfig', args: [{sizeField: testFields[6]}]},
+ {
+ method: 'updateLayerVisualChannel',
+ args: [{data: dataWithNull, allData: allDataWithNull}, 'size']
+ },
+ {
+ method: 'updateLayerVisConfig',
+ args: [{fixedRadius: true}]
+ }
+ ],
+ data: [dataWithNull, allDataWithNull, filteredIndex, undefined],
+ test: result => {
+ const {layerData, layer} = result;
+
+ const expectedLayerData = {
+ data: [
+ {
+ data: rows[1]
+ },
+ {
+ data: rows[3]
+ }
+ ],
+ getPosition: () => {},
+ getColor: () => {},
+ getRadius: () => {}
+ };
+ t.deepEqual(
+ layer.config.colorDomain,
+ [1, 3, 5],
+ 'should update layer color domain'
+ );
+ t.deepEqual(
+ Object.keys(layerData),
+ ['data', 'getPosition', 'getColor', 'getRadius'],
+ 'layerData should have 4 keys'
+ );
+ t.deepEqual(
+ layerData.data,
+ expectedLayerData.data,
+ 'should filter out nulls, format correct point layerData'
+ );
+ t.ok(
+ ['getPosition', 'getColor', 'getRadius'].every(
+ k => typeof layerData[k] === 'function'
+ ),
+ 'should have getPosition, getColor, getRadius accessor as function'
+ );
+ t.deepEqual(
+ layerData.getPosition(layerData.data[0]),
+ [31.2461142, 29.9927699, 0],
+ 'getPosition should return correct lat lng'
+ );
+ t.deepEqual(
+ layer.meta,
+ expectedLayerMeta,
+ 'should format correct grid layerData'
+ );
+ t.deepEqual(
+ layerData.getColor(layerData.data[0]),
+ [144, 12, 63],
+ 'getColor should return correct lat lng'
+ );
+ t.equal(
+ layerData.getRadius(layerData.data[0]),
+ 2,
+ 'getRadius should return fixed radius'
+ );
+ }
+ }
+ ];
+
+ testFormatLayerDataCases(t, PointLayer, TEST_CASES);
+ t.end();
+});
diff --git a/test/node/reducers/composer-state-test.js b/test/node/reducers/composer-state-test.js
new file mode 100644
index 000000000..536c1a589
--- /dev/null
+++ b/test/node/reducers/composer-state-test.js
@@ -0,0 +1,113 @@
+// Copyright (c) 2018 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 test from 'tape';
+import keplerGlReducer from 'reducers';
+import {addDataToMapComposed} from 'reducers/composers';
+import {keplerGlInit} from 'actions/actions';
+import {coreReducerFactory} from 'reducers/core';
+import {registerEntry} from 'actions/identity-actions';
+
+const mockRawData = {
+ fields: [
+ {
+ name: 'start_point_lat',
+ type: 'real',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'start_point_lng',
+ type: 'real',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'end_point_lat',
+ type: 'real',
+ tableFieldIndex: 4
+ },
+ {
+ name: 'end_point_lng',
+ type: 'real',
+ tableFieldIndex: 2
+ }
+ ],
+ rows: [
+ [12.25, 37.75, 45.21, 100.12],
+ [null, 35.2, 45.0, 21.3],
+ [12.29, 37.64, 46.21, 99.127],
+ [null, null, 33.1, 29.34]
+ ]
+};
+
+test('#composerStateReducer - addDataToMapComposed: mapStyle', t => {
+ // init kepler.gl root and instance
+ const state = keplerGlReducer({}, registerEntry('test')).test;
+
+ const newState = addDataToMapComposed(state, {
+ payload: {
+ datasets: {
+ data: mockRawData,
+ info: {
+ id: 'foo'
+ }
+ },
+ options: null,
+ config: {
+ mapStyle: {
+ styleType: 'light'
+ }
+ }
+ }
+ });
+
+ t.equal(newState.mapStyle.styleType, 'light', 'Map style is set correctly');
+
+ t.end();
+});
+
+test('#composerStateReducer - addDataToMapComposed: mapState should not be centered', t => {
+ // init kepler.gl root and instance
+ const state = keplerGlReducer({}, registerEntry('test')).test;
+ const mapStateProperties = {
+ latitude: 33.88608913680742,
+ longitude: -84.43459130456425
+ };
+ const newState = addDataToMapComposed(state, {
+ payload: {
+ datasets: {
+ data: mockRawData,
+ info: {
+ id: 'foo'
+ }
+ },
+ options: {
+ centerMap: true
+ },
+ config: {
+ mapState: mapStateProperties
+ }
+ }
+ });
+
+ t.equal(newState.mapState.latitude, mapStateProperties.latitude, 'mapstate latitude is set correctly');
+ t.equal(newState.mapState.longitude, mapStateProperties.longitude, 'mapstate longitude is set correctly');
+
+ t.end()
+});
diff --git a/test/node/reducers/map-state-test.js b/test/node/reducers/map-state-test.js
new file mode 100644
index 000000000..8efc5cb5b
--- /dev/null
+++ b/test/node/reducers/map-state-test.js
@@ -0,0 +1,243 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import {
+ updateMap,
+ togglePerspective,
+ fitBounds,
+ toggleSplitMap
+} from 'actions/map-state-actions';
+
+import {receiveMapConfig} from 'actions/actions';
+
+import reducer, {mapStateReducerFactory, INITIAL_MAP_STATE} from 'reducers/map-state';
+
+const InitialMapState = reducer(undefined, {});
+test('#mapStateReducer', t => {
+ const newState = reducer(undefined, {});
+
+ t.deepEqual(newState, {...INITIAL_MAP_STATE, initialState: {}}, 'should return the initial state');
+
+ t.end();
+});
+
+test('#mapStateReducerFactory', t => {
+ const mapStateReducer = mapStateReducerFactory({dragRotate: true});
+ const newState = mapStateReducer(undefined, {});
+
+ t.deepEqual(newState, {...INITIAL_MAP_STATE, dragRotate: true, initialState: {dragRotate: true}}, 'should return the initial state');
+
+ t.end();
+});
+
+test('#mapStateReducer -> UPDATE_MAP', t => {
+ const mapUpdate = {
+ latitude: 24.123,
+ longitude: 120.839,
+ zoom: 2.3
+ };
+ const expectedState = {...InitialMapState, ...mapUpdate};
+
+ const newState = reducer(undefined, updateMap(mapUpdate));
+
+ t.deepEqual(
+ newState,
+ expectedState,
+ 'should update map longitude and latitude'
+ );
+
+ t.end();
+});
+
+test('#mapStateReducer -> TOGGLE_PERSPECTIVE', t => {
+ const newState = reducer(undefined, {});
+ t.equal(newState.dragRotate, false, 'dragRotate should default to false');
+
+ const newState2 = reducer(undefined, togglePerspective());
+ t.equal(
+ newState2.dragRotate,
+ true,
+ 'dragRotate toggle should set it to true'
+ );
+ t.equal(newState2.pitch, 50, 'pitch should set to default');
+ t.equal(newState2.bearing, 24, 'bearing should set to default');
+
+ const newState3 = reducer(newState2, togglePerspective());
+ t.equal(
+ newState3.dragRotate,
+ false,
+ 'dragRotate 2nd toggle should set it to false'
+ );
+ t.equal(newState3.pitch, 0, 'pitch should set to zero');
+ t.equal(newState3.bearing, 0, 'bearing should set to zero');
+
+ t.end();
+});
+
+test('#mapStateReducer -> FIT_BOUNDS', t => {
+ // default input and output in @mapbox/geo-viewport
+ // https://github.com/mapbox/geo-viewport
+
+ const bounds = [
+ 5.668343999999995,
+ 45.111511000000014,
+ 5.852471999999996,
+ 45.26800200000002
+ ];
+
+ const mapUpdate = {
+ width: 640,
+ height: 480
+ };
+
+ const expected = {
+ center: [5.7604079999999955, 45.189756500000016],
+ zoom: 11
+ };
+
+ const stateWidthMapDimension = reducer(undefined, updateMap(mapUpdate));
+ const updatedState = reducer(stateWidthMapDimension, fitBounds(bounds));
+
+ t.equal(updatedState.latitude, expected.center[1], 'should fit latitude');
+ t.equal(updatedState.longitude, expected.center[0], 'should fit longitude');
+ t.equal(updatedState.zoom, expected.zoom, 'should fit zoom');
+
+ t.end();
+});
+
+test('#mapStateReducer -> SPLIT_MAP: toggle', t => {
+ let newState = reducer(INITIAL_MAP_STATE, toggleSplitMap());
+
+ const expectedState = {
+ ...INITIAL_MAP_STATE,
+ isSplit: true,
+ width: 400
+ };
+
+ // validate the first split
+ t.deepEqual(newState, expectedState, 'should validate toggle split view');
+
+ // go back to single view
+ newState = reducer(newState, toggleSplitMap());
+ t.deepEqual(
+ newState,
+ INITIAL_MAP_STATE,
+ 'should validate toggle back from split view'
+ );
+
+ t.end();
+});
+
+test('#mapStateReducer -> SPLIT_MAP: upload mapState config to update split map state', t => {
+ let state = {
+ ...INITIAL_MAP_STATE,
+ isSplit: true,
+ width: 400
+ };
+
+ // cases:
+
+ // 1. state split: true - isSplit: true
+ // do nothing
+ let newState = reducer(state, receiveMapConfig({mapState: {isSplit: true}}));
+ t.deepEqual(
+ newState,
+ state,
+ 'setting isSplit to true when state is already split should not change the state'
+ );
+
+ // 2. state split: false - isSplit: false
+ // do nothing
+ state = {
+ ...state,
+ isSplit: false,
+ width: 800
+ };
+ newState = reducer(state, receiveMapConfig({mapState: {isSplit: false}}));
+ t.deepEqual(
+ newState,
+ state,
+ 'setting isSplit to false when state is not split should not change the state'
+ );
+
+ // 3. state split: true - isSplit: false
+ // double width
+ state = {
+ ...state,
+ isSplit: true,
+ width: 400
+ };
+ newState = reducer(state, receiveMapConfig({mapState: {isSplit: false}}));
+ t.deepEqual(
+ newState,
+ {
+ ...state,
+ width: 800,
+ isSplit: false
+ },
+ 'setting isSplit to false when state is already split should double width'
+ );
+
+ // 4. state split: false - isSplit: true
+ // split width
+ state = {
+ ...state,
+ isSplit: false,
+ width: 800
+ };
+ newState = reducer(state, receiveMapConfig({mapState: {isSplit: true}}));
+ t.deepEqual(
+ newState,
+ {
+ ...state,
+ width: 400,
+ isSplit: true
+ },
+ 'setting isSplit to true when state is already split should reduce width by half'
+ );
+
+ t.end();
+
+});
+
+test('#mapStateReducer -> SPLIT_MAP: close map at specific point', t => {
+ let newState = reducer(INITIAL_MAP_STATE, toggleSplitMap());
+
+ const expectedState = {
+ ...INITIAL_MAP_STATE,
+ isSplit: true,
+ width: 400
+ };
+
+ // validate the first split
+ t.deepEqual(newState, expectedState, 'should validate toggle split view');
+
+ // go back to single view
+ newState = reducer(newState, toggleSplitMap(1));
+ t.deepEqual(
+ newState,
+ INITIAL_MAP_STATE,
+ 'should validate toggle back from split view'
+ );
+
+ t.end();
+});
diff --git a/test/node/reducers/ui-state-test.js b/test/node/reducers/ui-state-test.js
new file mode 100644
index 000000000..1b3f14263
--- /dev/null
+++ b/test/node/reducers/ui-state-test.js
@@ -0,0 +1,210 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import {
+ toggleSidePanel,
+ toggleModal,
+ openDeleteModal,
+ setResolution,
+ setRatio,
+ toggleLegend,
+ setExportSelectedDataset,
+ setExportDataType,
+ setExportFiltered
+} from 'actions/ui-state-actions';
+import reducer, {uiStateReducerFactory, INITIAL_UI_STATE} from 'reducers/ui-state';
+import {RATIOS, RESOLUTIONS, EXPORT_DATA_TYPE} from 'constants/default-settings';
+
+test('#uiStateReducer', t => {
+
+ t.deepEqual(reducer(undefined, {}), {...INITIAL_UI_STATE, initialState: {}},
+ 'should return the initial state');
+
+ t.end();
+});
+
+test('#uiStateReducerFactory', t => {
+ const uiStateReducer = uiStateReducerFactory({readOnly: true});
+
+ t.deepEqual(uiStateReducer(undefined, {}), {...INITIAL_UI_STATE, readOnly: true, initialState: {readOnly: true}},
+ 'should return the initial state');
+
+ t.end();
+});
+
+test('#uiStateReducer -> TOGGLE_SIDE_PANEL', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, toggleSidePanel('foo'));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ activeSidePanel: 'foo'
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should update side panel');
+
+ const nextState = reducer(expectedState, toggleSidePanel('copyConfig'));
+
+ const expectedNextState = {
+ ...expectedState,
+ currentModal: 'copyConfig'
+ };
+
+ t.deepEqual(nextState, expectedNextState, 'should open copy config');
+
+ const nextState2 = reducer(expectedState, toggleModal(null));
+
+ const expectedNextState2 = {
+ ...expectedState,
+ currentModal: null
+ };
+
+ t.deepEqual(nextState2, expectedNextState2, 'should close modal');
+
+ const nextState3 = reducer(expectedState, toggleSidePanel(null));
+
+ const expectedNextState3 = {
+ ...expectedState,
+ activeSidePanel: null
+ };
+
+ t.deepEqual(nextState3, expectedNextState3, 'should close panel');
+
+ t.end();
+});
+
+test('#uiStateReducer -> OPEN_DELETE_MODAL', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, openDeleteModal('chai'));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ currentModal: 'deleteData',
+ datasetKeyToRemove: 'chai'
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should open delete data modal and save key to remove');
+
+ t.end();
+});
+
+test('#uiStateReducer -> SET_RATIO', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, setRatio({ratio: RATIOS.SIXTEEN_BY_NINE}));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportImage: {
+ ...INITIAL_UI_STATE.exportImage,
+ ratio: RATIOS.SIXTEEN_BY_NINE
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the ratio to SIXTEEN_BY_NINE');
+
+ t.end();
+});
+
+test('#uiStateReducer -> SET_RESOLUTION', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, setResolution({resolution: RESOLUTIONS.TWO_X}));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportImage: {
+ ...INITIAL_UI_STATE.exportImage,
+ resolution: RESOLUTIONS.TWO_X
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the resolution to TWO_X');
+
+ t.end();
+});
+
+test('#uiStateReducer -> TOGGLE_LEGEND', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, toggleLegend());
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportImage: {
+ ...INITIAL_UI_STATE.exportImage,
+ legend: true
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the legend to true');
+
+ t.end();
+});
+
+test('#uiStateReducer -> SET_EXPORT_SELECTED_DATASET', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, setExportSelectedDataset({dataset: 'a'}));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportData: {
+ ...INITIAL_UI_STATE.exportData,
+ selectedDataset: 'a'
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the selectedDataset to a');
+
+ t.end();
+});
+
+test('#uiStateReducer -> SET_EXPORT_DATA_TYPE', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, setExportDataType({dataType: EXPORT_DATA_TYPE.JSON}));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportData: {
+ ...INITIAL_UI_STATE.exportData,
+ dataType: EXPORT_DATA_TYPE.JSON
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the dataType to json');
+
+ t.end();
+});
+
+test('#uiStateReducer -> SET_EXPORT_FILTERED', t => {
+
+ const newReducer = reducer(INITIAL_UI_STATE, setExportFiltered({filtered: false}));
+
+ const expectedState = {
+ ...INITIAL_UI_STATE,
+ exportData: {
+ ...INITIAL_UI_STATE.exportData,
+ filtered: false
+ }
+ };
+
+ t.deepEqual(newReducer, expectedState, 'should set the filtered to false');
+
+ t.end();
+});
diff --git a/test/node/reducers/vis-state-merger-test.js b/test/node/reducers/vis-state-merger-test.js
new file mode 100644
index 000000000..80c8a435d
--- /dev/null
+++ b/test/node/reducers/vis-state-merger-test.js
@@ -0,0 +1,907 @@
+// Copyright (c) 2018 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 test from 'tape';
+import cloneDeep from 'lodash.clonedeep';
+
+import {
+ mergeFilters,
+ mergeLayers,
+ mergeInteractions,
+ mergeLayerBlending
+} from 'reducers/vis-state-merger';
+import {Messages, Crosshairs} from 'components/common/icons';
+
+import SchemaManager from 'schemas';
+import visStateReducer from 'reducers/vis-state';
+import {updateVisData} from 'actions/vis-state-actions';
+import {receiveMapConfig} from 'actions/actions';
+
+// fixtures
+import {
+ savedStateV0,
+ mergedFilters as mergedFiltersV0,
+ mergedLayers as mergedLayersV0,
+ mergedInteractions as mergedInteractionsV0
+} from 'test/fixtures/state-saved-v0';
+import {
+ savedStateV1,
+ mergedFilters as mergedFiltersV1,
+ mergedLayers as mergedLayersV1,
+ mergedInteraction as MergedInteractionV1
+} from 'test/fixtures/state-saved-v1-1';
+import {
+ savedStateV1 as savedStateV1Split,
+ mergedLayers as mergedLayersV1Split,
+ mergedSplitMaps as mergedSplitMapsV1
+} from 'test/fixtures/state-saved-v1-3';
+/*
+import {
+ mergedFiltersV0,
+ expectedMergedLayers,
+ expectedMergedInteractions
+} from 'test/fixtures/app-state-parsed';
+
+import {
+ mergedFiltersV1,
+ mergedLayersV1,
+ mergedInteractionV1
+} from 'test/fixtures/app-state-parsed-v1';
+
+import {
+ mergedLayersV1Split,
+ mergedSplitMapsV1
+} from 'test/fixtures/app-state-parsed-v1-split';
+*/
+
+// helpers
+import {cmpFilters, cmpLayers} from 'test/helpers/comparison-utils';
+
+// mock app state
+import {
+ InitialState,
+ StateWFilters,
+ StateWFilesFiltersLayerColor
+} from 'test/helpers/mock-state';
+
+test('VisStateMerger.v0 -> mergeFilters -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV0);
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedFilters = parsedConfig.visState.filters;
+
+ const mergedState = mergeFilters(oldState.visState, parsedFilters);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'filterToBeMerged') {
+ t.deepEqual(
+ mergedState.filterToBeMerged,
+ parsedFilters,
+ 'Should save filters to filterToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed filters
+ cmpFilters(t, mergedFiltersV0, stateWData.filters);
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeFilters -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedFilters = parsedConfig.visState.filters;
+
+ const mergedState = mergeFilters(oldState.visState, parsedFilters);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'filterToBeMerged') {
+ t.deepEqual(
+ mergedState.filterToBeMerged,
+ parsedFilters,
+ 'Should save filters to filterToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed filters
+ cmpFilters(t, mergedFiltersV1, stateWData.filters);
+ t.end();
+});
+
+test('VisStateMerger.v0 -> mergeFilters -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV0);
+ const oldState = StateWFilters.toJS();
+
+ const oldVisState = oldState.visState;
+ const oldFilters = [...oldState.visState.filters];
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedFilters = parsedConfig.visState.filters;
+
+ const mergedState = mergeFilters(oldState.visState, parsedFilters);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'filterToBeMerged') {
+ t.deepEqual(
+ mergedState.filterToBeMerged,
+ parsedFilters,
+ 'Should save filters to filterToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed filters
+ cmpFilters(t, [...oldFilters, ...mergedFiltersV0], stateWData.filters);
+ t.deepEqual(
+ stateWData.filterToBeMerged,
+ [],
+ 'should clear up filterToBeMerged'
+ );
+
+ // should filter data
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeFilters -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const oldState = StateWFilters.toJS();
+
+ const oldVisState = oldState.visState;
+ const oldFilters = [...oldState.visState.filters];
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedFilters = parsedConfig.visState.filters;
+
+ const mergedState = mergeFilters(oldState.visState, parsedFilters);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'filterToBeMerged') {
+ t.deepEqual(
+ mergedState.filterToBeMerged,
+ parsedFilters,
+ 'Should save filters to filterToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed filters
+ cmpFilters(t, [...oldFilters, ...mergedFiltersV1], stateWData.filters);
+ t.deepEqual(
+ stateWData.filterToBeMerged,
+ [],
+ 'should clear up filterToBeMerged'
+ );
+
+ // should filter data
+ t.end();
+});
+
+test('VisStateMerger.current -> mergeLayers -> toEmptyState', t => {
+ const stateToSave = StateWFilesFiltersLayerColor.toJS();
+ const appStateToSave = SchemaManager.save(stateToSave);
+ const configToSave = appStateToSave.config;
+ const configParsed = SchemaManager.parseSavedConfig(configToSave);
+
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedLayers = configParsed.visState.layers;
+
+ // mergeLayers
+ const mergedState = mergeLayers(oldState.visState, parsedLayers);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'layerToBeMerged') {
+ t.deepEqual(
+ mergedState.layerToBeMerged,
+ parsedLayers,
+ 'Should save layers to layerToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+ const parsedData = SchemaManager.parseSavedData(appStateToSave.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed layers
+ const genericLayersByOrder = stateToSave.visState.layerOrder.map(
+ idx => stateToSave.visState.layers[idx]
+ );
+
+ cmpLayers(t, genericLayersByOrder, stateWData.layers, {id: true});
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeLayers -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);
+
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedLayers = parsedConfig.visState.layers;
+
+ // mergeLayers
+ const mergedState = mergeLayers(oldState.visState, parsedLayers);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'layerToBeMerged') {
+ t.deepEqual(
+ mergedState.layerToBeMerged,
+ parsedLayers,
+ 'Should save layers to layerToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+ const parsedData = SchemaManager.parseSavedData(savedStateV1.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed layers
+ cmpLayers(t, mergedLayersV1, stateWData.layers, {id: true});
+ t.end();
+});
+
+test('VisStateMerger.v1.split -> mergeLayers -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV1Split);
+ const parsedConfig = SchemaManager.parseSavedConfig(savedConfig.config);
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedLayers = parsedConfig.visState.layers;
+
+ // merge State
+ const mergedState = visStateReducer(
+ oldVisState,
+ receiveMapConfig(parsedConfig)
+ );
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'layerToBeMerged') {
+ t.deepEqual(
+ mergedState.layerToBeMerged,
+ parsedLayers,
+ 'Should save layers to layerToBeMerged before data loaded'
+ );
+ } else if (key === 'splitMaps') {
+ t.deepEqual(
+ mergedState.splitMaps,
+ mergedSplitMapsV1,
+ 'Should merge splitMaps'
+ );
+ } else if (key === 'interactionToBeMerged') {
+ t.deepEqual(
+ mergedState.interactionToBeMerged,
+ {tooltip: parsedConfig.visState.interactionConfig.tooltip},
+ 'Should save interactionConfig to interactionToBeMerged'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ `Should keep ${key} the same`
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test split Maps
+ t.deepEqual(
+ stateWData.splitMaps,
+ mergedSplitMapsV1,
+ 'should merge splitMaps'
+ );
+
+ // test parsed layers
+ cmpLayers(t, mergedLayersV1Split, stateWData.layers, {id: true});
+ t.end();
+});
+
+test('VisStateMerger.v0 -> mergeLayers -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV0);
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config
+ );
+
+ const oldState = StateWFilesFiltersLayerColor.toJS();
+ const oldVisState = oldState.visState;
+ const oldLayers = [...oldVisState.layers];
+
+ const parsedLayers = parsedConfig.visState.layers;
+
+ // mergeLayers
+ const mergedState = mergeLayers(oldState.visState, parsedLayers);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'layerToBeMerged') {
+ t.deepEqual(
+ mergedState.layerToBeMerged,
+ parsedLayers,
+ 'Should save layers to layerToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed layers
+ cmpLayers(t, [...oldLayers, ...mergedLayersV0], stateWData.layers);
+
+ t.deepEqual(
+ stateWData.layerOrder,
+ [3, 4, 5, 6, 7, 2, 0, 1],
+ 'should put new layers on top of old ones'
+ );
+ t.deepEqual(
+ stateWData.layerToBeMerged,
+ [],
+ 'should clean up layer to be merged'
+ );
+ t.equal(stateWData.layerData.length, 8, 'should calculate layer data');
+
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeLayers -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config
+ );
+
+ const oldState = StateWFilesFiltersLayerColor.toJS();
+ const oldVisState = oldState.visState;
+ const oldLayers = [...oldVisState.layers];
+
+ const parsedLayers = parsedConfig.visState.layers;
+
+ // mergeLayers
+ const mergedState = mergeLayers(oldState.visState, parsedLayers);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'layerToBeMerged') {
+ t.deepEqual(
+ mergedState.layerToBeMerged,
+ parsedLayers,
+ 'Should save layers to layerToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed filters
+ cmpLayers(t, [...oldLayers, ...mergedLayersV1], stateWData.layers);
+
+ t.deepEqual(
+ stateWData.layerOrder,
+ [3, 4, 2, 0, 1],
+ 'should put new layers on top of old ones'
+ );
+ t.deepEqual(
+ stateWData.layerToBeMerged,
+ [],
+ 'should clean up layer to be merged'
+ );
+ t.equal(stateWData.layerData.length, 5, 'should calculate layer data');
+
+ t.end();
+});
+
+test('VisStateMerger.v0 -> mergeInteractions -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV0);
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedInteraction = parsedConfig.visState.interactionConfig;
+
+ // merge interactions
+ const mergedState = mergeInteractions(oldState.visState, parsedInteraction);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'interactionToBeMerged') {
+ t.deepEqual(
+ mergedState.interactionToBeMerged,
+ {
+ tooltip: {
+ fieldsToShow: {
+ '9h10t7fyb': ['int_range', 'detail', 'type_boolean'],
+ v79816te8: ['ID', 'ZIP_CODE']
+ },
+ enabled: true
+ }
+ },
+ 'Should save interactions to interactionToBeMerged before data loaded'
+ );
+ } else if (key === 'interactionConfig') {
+ t.deepEqual(
+ mergedState.interactionConfig,
+ {
+ tooltip: {
+ id: 'tooltip',
+ enabled: true,
+ config: {
+ fieldsToShow: {}
+ },
+ iconComponent: Messages
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ config: {
+ size: 0.5
+ },
+ iconComponent: Crosshairs
+ }
+ },
+
+ 'Should disable interaction: null'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed interactions
+ t.deepEqual(
+ stateWData.interactionConfig,
+ mergedInteractionsV0,
+ 'should merge interactionConfig'
+ );
+ t.deepEqual(stateWData.interactionToBeMerged, {}, 'should clear interaction');
+
+ t.end();
+});
+
+test('VisStateMerger.v0 -> mergeInteractions -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV0);
+ const oldState = StateWFilesFiltersLayerColor.toJS();
+ const oldVisState = oldState.visState;
+
+ // add random items to interactionToBeMerged
+ oldVisState.interactionToBeMerged = {
+ ...oldVisState.interactionToBeMerged,
+ tooltip: {
+ fieldsToShow: {
+ milkshake: ['have', 'a', 'good', 'day']
+ }
+ }
+ };
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+
+ const parsedInteraction = parsedConfig.visState.interactionConfig;
+
+ // merge interactions
+ const mergedState = mergeInteractions(oldState.visState, parsedInteraction);
+
+ const expectedInteractionToBeMerged = {
+ tooltip: {
+ fieldsToShow: {
+ '9h10t7fyb': ['int_range', 'detail', 'type_boolean'],
+ v79816te8: ['ID', 'ZIP_CODE']
+ },
+ enabled: true
+ }
+ };
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'interactionToBeMerged') {
+ t.deepEqual(
+ mergedState.interactionToBeMerged,
+ expectedInteractionToBeMerged,
+ 'Should save interactions to interactionToBeMerged before data loaded'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ const expectedInteractions = {
+ tooltip: {
+ id: 'tooltip',
+ enabled: true,
+ iconComponent: Messages,
+ config: {
+ fieldsToShow: {
+ '190vdll3di': [
+ 'gps_data.utc_timestamp',
+ 'gps_data.types',
+ 'epoch',
+ 'has_result',
+ 'id'
+ ],
+ ieukmgne: ['OBJECTID', 'ZIP_CODE', 'ID', 'TRIPS', 'RATE'],
+ '9h10t7fyb': ['int_range', 'detail', 'type_boolean'],
+ v79816te8: ['ID', 'ZIP_CODE']
+ }
+ }
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ iconComponent: Crosshairs,
+ config: {size: 0.5}
+ }
+ };
+
+ // test parsed interactions
+ t.deepEqual(
+ stateWData.interactionConfig,
+ expectedInteractions,
+ 'should merge interactionconfig'
+ );
+ t.deepEqual(stateWData.interactionToBeMerged, {}, 'should clear interaction');
+
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeInteractions -> toEmptyState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const oldState = InitialState.toJS();
+ const oldVisState = oldState.visState;
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+ const parsedInteraction = parsedConfig.visState.interactionConfig;
+
+ // merge interactions
+ const mergedState = mergeInteractions(oldState.visState, parsedInteraction);
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'interactionToBeMerged') {
+ t.deepEqual(
+ mergedState.interactionToBeMerged,
+ {
+ tooltip: {
+ fieldsToShow: {
+ a5ybmwl2d: ['a_zip', 'str_type', 'int_type']
+ },
+ enabled: false
+ }
+ },
+ 'Should save nothing interactions to interactionToBeMerged before data loaded'
+ );
+ } else if (key === 'interactionConfig') {
+ t.deepEqual(
+ mergedState.interactionConfig,
+ {
+ tooltip: {
+ id: 'tooltip',
+ enabled: false,
+ config: {
+ fieldsToShow: {}
+ },
+ iconComponent: Messages
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ config: {
+ size: 1
+ },
+ iconComponent: Crosshairs
+ }
+ },
+
+ 'Should disable interaction: null'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ // test parsed interactions
+ t.deepEqual(
+ stateWData.interactionConfig,
+ MergedInteractionV1,
+ 'should merge interactionConfig'
+ );
+ t.deepEqual(stateWData.interactionToBeMerged, {}, 'should clear interaction');
+
+ t.end();
+});
+
+test('VisStateMerger.v1 -> mergeInteractions -> toWorkingState', t => {
+ const savedConfig = cloneDeep(savedStateV1);
+ const oldState = StateWFilesFiltersLayerColor.toJS();
+ const oldVisState = oldState.visState;
+
+ // add random items to interactionToBeMerged
+ oldVisState.interactionToBeMerged = {
+ ...oldVisState.interactionToBeMerged,
+ tooltip: {
+ fieldsToShow: {
+ milkshake: ['have', 'a', 'good', 'day']
+ }
+ }
+ };
+
+ const parsedConfig = SchemaManager.parseSavedConfig(
+ savedConfig.config,
+ oldState
+ );
+
+ const parsedInteraction = parsedConfig.visState.interactionConfig;
+
+ // merge interactions
+ const mergedState = mergeInteractions(oldState.visState, parsedInteraction);
+
+ const expectedInteractionToBeMerged = {
+ tooltip: {
+ fieldsToShow: {
+ a5ybmwl2d: ['a_zip', 'str_type', 'int_type']
+ },
+ enabled: false
+ }
+ };
+
+ Object.keys(oldVisState).forEach(key => {
+ if (key === 'interactionToBeMerged') {
+ t.deepEqual(
+ mergedState.interactionToBeMerged,
+ expectedInteractionToBeMerged,
+ 'Should save interactions to interactionToBeMerged before data loaded'
+ );
+ } else if (key === 'interactionConfig') {
+ t.deepEqual(
+ mergedState.interactionConfig,
+ {
+ tooltip: {
+ id: 'tooltip',
+ iconComponent: Messages,
+ enabled: false,
+ config: {
+ fieldsToShow: {
+ '190vdll3di': [
+ 'gps_data.utc_timestamp',
+ 'gps_data.types',
+ 'epoch',
+ 'has_result',
+ 'id'
+ ],
+ ieukmgne: ['OBJECTID', 'ZIP_CODE', 'ID', 'TRIPS', 'RATE']
+ }
+ }
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ iconComponent: Crosshairs,
+ config: {
+ size: 1
+ }
+ }
+ },
+
+ 'Should disable interaction: null'
+ );
+ } else {
+ t.deepEqual(
+ mergedState[key],
+ oldVisState[key],
+ 'Should keep the rest of state same'
+ );
+ }
+ });
+
+ const parsedData = SchemaManager.parseSavedData(savedConfig.datasets);
+
+ // load data into reducer
+ const stateWData = visStateReducer(mergedState, updateVisData(parsedData));
+
+ const expectedInteractions = {
+ tooltip: {
+ id: 'tooltip',
+ enabled: false,
+ iconComponent: Messages,
+ config: {
+ fieldsToShow: {
+ '190vdll3di': [
+ 'gps_data.utc_timestamp',
+ 'gps_data.types',
+ 'epoch',
+ 'has_result',
+ 'id'
+ ],
+ ieukmgne: ['OBJECTID', 'ZIP_CODE', 'ID', 'TRIPS', 'RATE'],
+ a5ybmwl2d: ['a_zip', 'str_type', 'int_type']
+ }
+ }
+ },
+ brush: {
+ id: 'brush',
+ enabled: false,
+ iconComponent: Crosshairs,
+ config: {size: 1}
+ }
+ };
+
+ // test parsed interactions
+ t.deepEqual(
+ stateWData.interactionConfig,
+ expectedInteractions,
+ 'should merge interactionconfig'
+ );
+ t.deepEqual(stateWData.interactionToBeMerged, {}, 'should clear interaction');
+
+ t.end();
+});
+
+test('VisStateMerger - mergeLayerBlending', t => {
+ const preState = {
+ layerBlending: 'additive'
+ };
+
+ t.deepEqual(
+ mergeLayerBlending(preState, 'normal'),
+ {layerBlending: 'normal'},
+ 'should merge layerBlending'
+ );
+ t.deepEqual(
+ mergeLayerBlending(preState, undefined),
+ {layerBlending: 'additive'},
+ 'should merge layerBlending'
+ );
+ t.deepEqual(
+ mergeLayerBlending(preState, 'not_exist'),
+ {layerBlending: 'additive'},
+ 'should merge layerBlending'
+ );
+ t.deepEqual(
+ mergeLayerBlending(preState, null),
+ {layerBlending: 'additive'},
+ 'should merge layerBlending'
+ );
+
+ t.end();
+});
diff --git a/test/node/reducers/vis-state-test.js b/test/node/reducers/vis-state-test.js
new file mode 100644
index 000000000..d31125538
--- /dev/null
+++ b/test/node/reducers/vis-state-test.js
@@ -0,0 +1,2681 @@
+// Copyright (c) 2018 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 test from 'tape-catch';
+import CloneDeep from 'lodash.clonedeep';
+
+import * as VisStateActions from 'actions/vis-state-actions';
+import * as MapStateActions from 'actions/map-state-actions';
+import reducer from 'reducers/vis-state';
+
+import {INITIAL_VIS_STATE} from 'reducers/vis-state-updaters';
+
+import {getLightSettingsFromBounds} from 'utils/layer-utils/layer-utils';
+import {filterData, getDefaultfilter} from 'utils/filter-utils';
+import {processCsvData, processGeojson} from 'processors/data-processor';
+
+import {Layer, KeplerGlLayers} from 'layers';
+const {ArcLayer, PointLayer, GeojsonLayer, LineLayer} = KeplerGlLayers;
+// fixtures
+import testData, {testFields, testAllData} from 'test/fixtures/test-csv-data';
+import {
+ geojsonData,
+ geoBounds,
+ geoLghtSettings,
+ fields as geojsonFields
+} from 'test/fixtures/geojson';
+
+// test helpers
+import {
+ cmpFilters,
+ cmpLayers,
+ cmpDatasets,
+ cmpDataset
+} from 'test/helpers/comparison-utils';
+import {LAYER_VIS_CONFIGS} from 'layers/layer-factory';
+
+const mockData = {
+ fields: [
+ {
+ name: 'start_point_lat',
+ type: 'real'
+ },
+ {
+ name: 'start_point_lng',
+ type: 'real'
+ },
+ {
+ name: 'end_point_lat',
+ type: 'real'
+ },
+ {
+ name: 'end_point_lng',
+ type: 'real'
+ }
+ ],
+ data: [
+ [12.25, 37.75, 45.21, 100.12],
+ [null, 35.2, 45.0, 21.3],
+ [12.29, 37.64, 46.21, 99.127],
+ [null, null, 33.1, 29.34]
+ ]
+};
+
+const expectedFields = [
+ {
+ name: 'start_point_lat',
+ id: 'start_point_lat',
+ type: 'real',
+ tableFieldIndex: 1,
+ format: ''
+ },
+ {
+ name: 'start_point_lng',
+ id: 'start_point_lng',
+ type: 'real',
+ tableFieldIndex: 2,
+ format: ''
+ },
+ {
+ name: 'end_point_lat',
+ id: 'end_point_lat',
+ type: 'real',
+ tableFieldIndex: 3,
+ format: ''
+ },
+ {
+ name: 'end_point_lng',
+ id: 'end_point_lng',
+ type: 'real',
+ tableFieldIndex: 4,
+ format: ''
+ }
+];
+
+const mockFilter = {
+ fieldIdx: 0,
+ name: mockData.fields[0].name,
+ type: 'range',
+ fieldType: 'real',
+ value: [12.25, 12.28]
+};
+
+const mockRawData = {
+ fields: [
+ {
+ name: 'start_point_lat',
+ type: 'real',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'start_point_lng',
+ type: 'real',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'end_point_lat',
+ type: 'real',
+ tableFieldIndex: 4
+ },
+ {
+ name: 'end_point_lng',
+ type: 'real',
+ tableFieldIndex: 2
+ }
+ ],
+ rows: [
+ [12.25, 37.75, 45.21, 100.12],
+ [null, 35.2, 45.0, 21.3],
+ [12.29, 37.64, 46.21, 99.127],
+ [null, null, 33.1, 29.34]
+ ]
+};
+
+const InitialVisState = reducer(undefined, {});
+test('#visStateReducer', t => {
+ reducer(undefined, {});
+
+ t.deepEqual(
+ reducer(undefined, {}),
+ {...INITIAL_VIS_STATE, initialState: {}},
+ 'should return the initial state'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> ADD_FILTER', t => {
+ const dataId = 'kitten';
+ const newFilter = getDefaultfilter(dataId);
+ const newReducer = reducer(
+ {filters: [mockFilter]},
+ VisStateActions.addFilter(dataId)
+ );
+
+ const expectedReducer = {filters: [mockFilter, newFilter]};
+
+ t.equal(
+ newReducer.filters.length,
+ expectedReducer.filters.length,
+ 'should add a default filter'
+ );
+
+ t.deepEqual(
+ newReducer.filters[0],
+ expectedReducer.filters[0],
+ 'should add a default filter'
+ );
+
+ cmpFilters(t, newReducer.filters[1], expectedReducer.filters[1]);
+ t.end();
+});
+
+test('#visStateReducer -> ADD_LAYER.1', t => {
+ const oldState = {
+ ...InitialVisState,
+ datasets: {
+ puppy: {
+ data: mockData.data,
+ fields: mockData.fields
+ }
+ },
+ layers: [{id: 'existing_layer'}],
+ layerData: [[{data: [1, 2, 3]}, {data: [4, 5, 6]}]],
+ layerOrder: [0],
+ splitMaps: [
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ },
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ }
+ ]
+ };
+
+ const newReducer = reducer(oldState, VisStateActions.addLayer());
+ const newId = newReducer.layers[1].id;
+ const expectedSplitMaps = [
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ [newId]: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ [newId]: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ }
+ ];
+
+ t.equal(newReducer.layers.length, 2, 'should have 2 layers');
+ t.equal(
+ newReducer.layers[1].config.isVisible,
+ true,
+ 'newLayer visibility should be set to true'
+ );
+ t.equal(
+ newReducer.layers[1].config.isConfigActive,
+ true,
+ 'newLayer isConfigActive should be set to true'
+ );
+ t.equal(
+ newReducer.layers[1].config.dataId,
+ 'puppy',
+ 'newLayer dataId should be set to default'
+ );
+ t.deepEqual(
+ newReducer.layerData,
+ [oldState.layerData[0], {}],
+ 'newState should have empty layer datat'
+ );
+ t.deepEqual(newReducer.layerOrder, [0, 1], 'should add to layerOrder');
+ t.deepEqual(
+ newReducer.splitMaps,
+ expectedSplitMaps,
+ 'should add to SplitMaps'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> LAYER_TYPE_CHANGE.1', t => {
+ const layer = new Layer({id: 'more_layer'});
+ const oldState = {
+ ...InitialVisState,
+ datasets: {
+ puppy: {
+ data: mockData.data,
+ fields: mockData.fields
+ }
+ },
+ layers: [{id: 'existing_layer'}, layer],
+ layerData: [[{data: [1, 2, 3]}, {data: [4, 5, 6]}]],
+ layerOrder: [1, 0],
+ splitMaps: [
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ more_layer: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ more_layer: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ }
+ ]
+ };
+
+ const nextState = reducer(
+ oldState,
+ VisStateActions.layerTypeChange(layer, 'point')
+ );
+ const newId = nextState.layers[1].id;
+ const expectedSplitMaps = [
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ [newId]: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: false
+ },
+ [newId]: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ }
+ ];
+
+ t.ok(nextState.layers[1].id !== 'more_layer', 'should update layer id');
+
+ t.equal(nextState.layers[1].type, 'point', 'should update type to point');
+
+ t.deepEqual(
+ nextState.splitMaps,
+ expectedSplitMaps,
+ 'should add newId to SplitMaps, and replace old id'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> LAYER_TYPE_CHANGE.2', t => {
+ const pointLayer = new PointLayer({id: 'a', dataId: 'smoothie'});
+ const mockColorRange = {
+ name: 'abc',
+ isReversed: true,
+ colors: ['a', 'b', 'c']
+ };
+ const oldState = {
+ ...InitialVisState,
+ datasets: {
+ smoothie: {
+ allData: testAllData,
+ data: testAllData.slice(),
+ fields: testFields,
+ id: 'smoothie'
+ }
+ },
+ layers: [pointLayer],
+ layerData: []
+ };
+
+ // set point layer colorField to a string field
+ const stringField = testFields.find(f => f.type === 'string');
+ let nextState = reducer(
+ oldState,
+ VisStateActions.layerVisualChannelConfigChange(
+ pointLayer,
+ {colorField: stringField},
+ 'color'
+ )
+ );
+ nextState = reducer(
+ nextState,
+ VisStateActions.layerVisConfigChange(nextState.layers[0], {
+ colorRange: mockColorRange
+ })
+ );
+ const newLayer = nextState.layers[0];
+ t.equal(newLayer.config.colorField, stringField, 'should update colorField');
+ t.equal(newLayer.config.colorScale, 'ordinal', 'should scale to ordinal');
+ t.deepEqual(
+ newLayer.config.colorDomain,
+ ['driver_analytics', 'driver_gps'],
+ 'should calculate color domain'
+ );
+ t.equal(
+ newLayer.config.visConfig.colorRange,
+ mockColorRange,
+ 'should update color range'
+ );
+
+ // set point layer sizeField to a int field
+ const intField = testFields.find(f => f.type === 'integer');
+ let nextState2 = reducer(
+ nextState,
+ VisStateActions.layerVisualChannelConfigChange(
+ newLayer,
+ {sizeField: intField},
+ 'size'
+ )
+ );
+ nextState2 = reducer(
+ nextState2,
+ VisStateActions.layerVisConfigChange(nextState2.layers[0], {
+ radiusRange: [5, 10]
+ })
+ );
+ const newLayer2 = nextState2.layers[0];
+ t.equal(newLayer2.config.sizeField, intField, 'should update sizeField');
+ t.equal(newLayer2.config.sizeScale, 'sqrt', 'should scale to linear');
+ t.deepEqual(
+ newLayer2.config.sizeDomain,
+ [1, 12124],
+ 'should calculate size domain'
+ );
+ t.deepEqual(
+ newLayer2.config.visConfig.radiusRange,
+ [5, 10],
+ 'should update size range'
+ );
+
+ // change point layer type to hexagon
+ const nextState3 = reducer(
+ nextState2,
+ VisStateActions.layerTypeChange(newLayer2, 'hexagon')
+ );
+
+ const newLayer3 = nextState3.layers[0];
+ t.equal(newLayer3.type, 'hexagon', 'should change type to hexagon');
+ t.equal(
+ newLayer3.config.colorField,
+ null,
+ 'should set colorField back to null'
+ );
+ t.deepEqual(
+ newLayer3.config.colorDomain,
+ [0, 1],
+ 'should set colorDomain back to default'
+ );
+ t.equal(
+ newLayer3.config.colorScale,
+ 'quantile',
+ 'should set colorScale to default'
+ );
+ t.equal(
+ newLayer3.config.sizeScale,
+ 'linear',
+ 'should set sizeScale to default'
+ );
+ t.deepEqual(
+ newLayer3.config.sizeDomain,
+ [0, 1],
+ 'should set sizeDomain to default'
+ );
+ t.equal(newLayer3.config.sizeField, intField, 'should keep sizeField');
+ t.notEqual(newLayer3.id, newLayer2.id, 'should change id');
+ t.equal(
+ newLayer3.config.visConfig.colorRange,
+ mockColorRange,
+ 'should not deep copy colorRange'
+ );
+ t.equal(
+ newLayer3.config.visConfig.sizeRange,
+ LAYER_VIS_CONFIGS.elevationRange.defaultValue,
+ 'should set sizeRange back to default'
+ );
+
+ // change point layer type to icon
+ const nextState4 = reducer(
+ nextState2,
+ VisStateActions.layerTypeChange(newLayer2, 'icon')
+ );
+ const newLayer4 = nextState4.layers[0];
+ t.equal(newLayer4.type, 'icon', 'should change type to icon');
+ t.notEqual(newLayer4.id, newLayer2.id, 'should change id');
+ t.equal(
+ newLayer4.config.colorField,
+ stringField,
+ 'should keep colorField'
+ );
+ t.deepEqual(
+ newLayer4.config.colorDomain,
+ ['driver_analytics', 'driver_gps'],
+ 'should calculate color domain'
+ );
+ t.equal(newLayer4.config.colorScale, 'ordinal', 'should keep color scale');
+ t.equal(newLayer4.config.sizeField, intField, 'should keep sizeField');
+ t.equal(newLayer4.config.sizeScale, 'sqrt', 'should scale to linear');
+ t.deepEqual(
+ newLayer4.config.sizeDomain,
+ [1, 12124],
+ 'should keep size domain'
+ );
+ t.deepEqual(
+ newLayer4.config.visConfig.radiusRange,
+ [5, 10],
+ 'should keep size range'
+ );
+ t.equal(
+ newLayer4.config.visConfig.colorRange,
+ mockColorRange,
+ 'should not deep copy colorRange'
+ );
+ t.end();
+});
+
+test('#visStateReducer -> REORDER_LAYER', t => {
+ const newReducer = reducer(
+ {layers: [], layerOrder: [0, 1, 2]},
+ VisStateActions.reorderLayer([0, 2, 1])
+ );
+
+ t.deepEqual(
+ newReducer,
+ {layers: [], layerOrder: [0, 2, 1]},
+ 'should re order layers'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_LAYER_BLENDING', t => {
+ const newReducer = reducer(
+ {layerBlending: 'none'},
+ VisStateActions.updateLayerBlending('additive')
+ );
+
+ t.deepEqual(
+ newReducer,
+ {layerBlending: 'additive'},
+ 'should update layerBlending'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> REMOVE_FILTER', t => {
+ const currentFilters = [
+ {
+ fieldIdx: 0,
+ dataId: 'smoothie',
+ name: mockData.fields[0].name,
+ type: 'range',
+ value: [12.25, 12.29]
+ },
+ {
+ fieldIdx: 1,
+ dataId: 'milkshake',
+ name: mockData.fields[1].name,
+ type: 'range',
+ value: [35.3, 37.75]
+ }
+ ];
+
+ const oldState = {
+ filters: currentFilters,
+ datasets: {
+ milkshake: {
+ allData: mockData.data,
+ data: filterData(mockData.data, 'milkshake', currentFilters).data,
+ filteredIndex: filterData(mockData.data, 'milkshake', currentFilters)
+ .filteredIndex
+ },
+ smoothie: {
+ allData: mockData.data,
+ data: filterData(mockData.data, 'smoothie', currentFilters).data,
+ filteredIndex: filterData(mockData.data, 'milkshake', currentFilters)
+ .filteredIndex
+ }
+ },
+
+ layers: [],
+ layerData: []
+ };
+
+ // remove smoothie filter
+ const newReducer = reducer(oldState, VisStateActions.removeFilter(0));
+
+ t.deepEqual(
+ newReducer,
+ {
+ filters: [
+ {
+ fieldIdx: 1,
+ dataId: 'milkshake',
+ name: mockData.fields[1].name,
+ type: 'range',
+ value: [35.3, 37.75]
+ }
+ ],
+ datasets: {
+ milkshake: {
+ allData: mockData.data,
+ data: [mockData.data[0], mockData.data[2]],
+ filteredIndex: [0, 2]
+ },
+ smoothie: {
+ allData: mockData.data,
+ data: mockData.data,
+ filteredIndex: [0, 1, 2, 3]
+ }
+ },
+
+ layers: [],
+ layerData: []
+ },
+ 'should remove filter and recalculate data only for associated dataset'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> REMOVE_LAYER', t => {
+ const layer1 = new PointLayer({id: 'a'});
+ const layer2 = new PointLayer({id: 'b'});
+ const oldState = {
+ layers: [layer1, layer2],
+ layerData: [{data: 1}, {data: 2}],
+ layerOrder: [1, 0],
+ hoverInfo: {
+ layer: {props: {id: 'b'}},
+ picked: true
+ },
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: []
+ };
+
+ const newReducer = reducer(oldState, VisStateActions.removeLayer(1));
+
+ t.deepEqual(
+ newReducer,
+ {
+ layers: [layer1],
+ layerData: [{data: 1}],
+ layerOrder: [0],
+ hoverInfo: undefined,
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: []
+ },
+ 'should remove layer and layerData'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_VIS_DATA.1', t => {
+ const oldState = {
+ datasets: {},
+ layers: [{name: 'a'}, {name: 'b'}],
+ layerData: [{data: 1}, {data: 2}]
+ };
+
+ t.deepEqual(
+ reducer(
+ oldState,
+ VisStateActions.updateVisData([{info: null, data: null}])
+ ),
+ oldState,
+ 'should return current state if no data'
+ );
+
+ t.deepEqual(
+ reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: {
+ fields: null,
+ rows: [1, 2]
+ }
+ }
+ ])
+ ),
+ oldState,
+ 'should return current state if no fields'
+ );
+
+ t.deepEqual(
+ reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: {
+ fields: [{name: 'a'}],
+ rows: null
+ }
+ }
+ ])
+ ),
+ oldState,
+ 'should return current state if no rows'
+ );
+
+ t.end();
+});
+
+/* eslint-disable max-statements */
+test('#visStateReducer -> UPDATE_VIS_DATA.2', t => {
+ const oldState = InitialVisState;
+
+ const testState1 = reducer(
+ oldState,
+ VisStateActions.updateVisData({
+ data: mockRawData,
+ info: {id: 'smoothie', label: 'exciting dataset 1'}
+ })
+ );
+
+ t.deepEqual(
+ Object.keys(testState1.datasets),
+ ['smoothie'],
+ 'should save data to smoothie'
+ );
+
+ const newState = reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: mockRawData,
+ info: {id: 'smoothie', label: 'exciting dataset'}
+ }
+ ])
+ );
+
+ const newStateLayers = CloneDeep(newState.layers);
+
+ const expectedDatasets = {
+ smoothie: {
+ fields: expectedFields,
+ filteredIndex: mockRawData.rows.map((_, i) => i),
+ allData: mockRawData.rows,
+ data: mockRawData.rows,
+ color: 'donnot test me',
+ id: 'smoothie',
+ label: 'exciting dataset',
+ fieldPairs: [
+ {
+ defaultName: 'start point',
+ pair: {
+ lat: {
+ value: 'start_point_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'start_point_lng',
+ fieldIdx: 1
+ }
+ },
+ suffix: ['lat', 'lng']
+ },
+ {
+ defaultName: 'end point',
+ pair: {
+ lat: {
+ value: 'end_point_lat',
+ fieldIdx: 2
+ },
+ lng: {
+ value: 'end_point_lng',
+ fieldIdx: 3
+ }
+ },
+ suffix: ['lat', 'lng']
+ }
+ ]
+ }
+ };
+
+ const expectedArcLayer = new ArcLayer({
+ dataId: 'smoothie',
+ label: 'start point -> end point arc',
+ columns: {
+ lat0: {fieldIdx: 0, value: 'start_point_lat'},
+ lng0: {fieldIdx: 1, value: 'start_point_lng'},
+ lat1: {fieldIdx: 2, value: 'end_point_lat'},
+ lng1: {fieldIdx: 3, value: 'end_point_lng'}
+ }
+ });
+
+ const expectedLineLayer = new LineLayer({
+ dataId: 'smoothie',
+ label: 'start point -> end point line',
+ columns: {
+ lat0: {fieldIdx: 0, value: 'start_point_lat'},
+ lng0: {fieldIdx: 1, value: 'start_point_lng'},
+ lat1: {fieldIdx: 2, value: 'end_point_lat'},
+ lng1: {fieldIdx: 3, value: 'end_point_lng'}
+ }
+ });
+
+ const expectedPointLayer1 = new PointLayer({
+ dataId: 'smoothie',
+ label: 'start point',
+ columns: {
+ lat: {fieldIdx: 0, value: 'start_point_lat'},
+ lng: {fieldIdx: 1, value: 'start_point_lng'},
+ altitude: {fieldIdx: -1, value: null, optional: true}
+ },
+ isVisible: true
+ });
+
+ expectedPointLayer1.meta = {
+ bounds: [35.2, 12.25, 37.75, 12.29],
+ lightSettings: getLightSettingsFromBounds([35.2, 12.25, 37.75, 12.29])
+ };
+
+ const expectedPointLayer2 = new PointLayer({
+ dataId: 'smoothie',
+ label: 'end point',
+ columns: {
+ lat: {fieldIdx: 2, value: 'end_point_lat'},
+ lng: {fieldIdx: 3, value: 'end_point_lng'},
+ altitude: {fieldIdx: -1, value: null, optional: true}
+ }
+ });
+
+ expectedPointLayer2.meta = {
+ bounds: [21.3, 33.1, 100.12, 46.21],
+ lightSettings: getLightSettingsFromBounds([21.3, 33.1, 100.12, 46.21])
+ };
+
+ const expectedLayers = [
+ expectedPointLayer1,
+ expectedPointLayer2,
+ expectedArcLayer,
+ expectedLineLayer
+ ];
+ t.deepEqual(
+ Object.keys(newState.datasets),
+ ['smoothie'],
+ 'should save data to smoothie'
+ );
+
+ cmpDatasets(t, expectedDatasets, newState.datasets);
+ cmpLayers(t, expectedLayers, newStateLayers);
+
+ t.equal(newState.layerData.length, expectedLayers.length, 'should calculate layerdata');
+ t.deepEqual(newState.layerOrder, [0, 1, 2, 3], 'should calculate layerOrder');
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_VIS_DATA.3', t => {
+ const mockLayer = new PointLayer({
+ dataId: 'snowflake',
+ columns: {
+ lat: {
+ value: 'start_point_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'start_point_lng',
+ fieldIdx: 1
+ }
+ }
+ });
+
+ const oldState = {
+ ...InitialVisState,
+ layers: [mockLayer],
+ layerData: [[1, 2], [3, 4], [5, 6], [7, 8]],
+ datasets: {
+ snowflake: {
+ fields: [{id: 'a'}, {id: 'b'}],
+ allData: [['something'], ['something_else']],
+ data: [['something']]
+ }
+ },
+ filters: [{name: 'hello'}, {name: 'world'}],
+ interactionConfig: {
+ tooltip: {
+ id: 'tooltip',
+ enabled: true,
+ icon: 'messages',
+ config: {
+ fieldsToShow: {snowflake: ['a']}
+ }
+ }
+ },
+ layerOrder: [0],
+ layerBlending: 'additive',
+ splitMaps: []
+ };
+
+ const expectedDatasets = {
+ snowflake: {
+ fields: [{id: 'a'}, {id: 'b'}],
+ allData: [['something'], ['something_else']],
+ data: [['something']]
+ },
+ smoothie: {
+ fields: expectedFields,
+ allData: mockRawData.rows,
+ data: mockRawData.rows,
+ color: 'donnot test me',
+ filteredIndex: mockRawData.rows.map((_, i) => i),
+ id: 'smoothie',
+ label: 'smoothie and milkshake',
+ fieldPairs: [
+ {
+ defaultName: 'start point',
+ pair: {
+ lat: {
+ value: 'start_point_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'start_point_lng',
+ fieldIdx: 1
+ }
+ },
+ suffix: ['lat', 'lng']
+ },
+ {
+ defaultName: 'end point',
+ pair: {
+ lat: {
+ value: 'end_point_lat',
+ fieldIdx: 2
+ },
+ lng: {
+ value: 'end_point_lng',
+ fieldIdx: 3
+ }
+ },
+ suffix: ['lat', 'lng']
+ }
+ ]
+ }
+ };
+
+ const expectedInteractionTooltip = {
+ fieldsToShow: {snowflake: ['a'], smoothie: []}
+ };
+
+ const newState = reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: mockRawData,
+ info: {id: 'smoothie', label: 'smoothie and milkshake'}
+ }
+ ])
+ );
+
+ Object.keys(expectedDatasets).forEach(key =>
+ cmpDataset(t, expectedDatasets[key], newState.datasets[key])
+ );
+ t.equal(newState.layers.length, 5, 'should find 1 arc aline and 2 point layers');
+ t.deepEqual(
+ newState.layerOrder,
+ [1, 2, 3, 4, 0],
+ 'should add new layer index to layer order, put them on top'
+ );
+ t.equal(
+ newState.layers[1].config.dataId,
+ 'smoothie',
+ 'should save dataId to layer'
+ );
+ t.equal(
+ newState.layers[2].config.dataId,
+ 'smoothie',
+ 'should save dataId to layer'
+ );
+ t.equal(
+ newState.layers[3].config.dataId,
+ 'smoothie',
+ 'should save dataId to layer'
+ );
+ t.equal(newState.layerData.length, 5, 'should calculate layerData');
+ t.equal(newState.filters.length, 2, 'should keep original filters');
+ t.deepEqual(
+ newState.interactionConfig.tooltip.config,
+ expectedInteractionTooltip,
+ 'should set interaction config back to default'
+ );
+ t.equal(newState.layerBlending, 'additive', 'should keep layerBlending');
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_VIS_DATA.4.Geojson', t => {
+ const initialVisState = CloneDeep(INITIAL_VIS_STATE);
+
+ const {fields, rows} = processGeojson(CloneDeep(geojsonData));
+
+ const payload = [
+ {
+ info: {
+ id: 'milkshake',
+ label: 'king milkshake'
+ },
+ data: {fields, rows}
+ }
+ ];
+
+ // receive data
+ const initialState = reducer(
+ initialVisState,
+ VisStateActions.updateVisData(payload)
+ );
+
+ const expectedDatasets = {
+ id: 'milkshake',
+ label: 'king milkshake',
+ color: 'donnot test me',
+ allData: rows,
+ data: rows,
+ filteredIndex: rows.map((_, i) => i),
+ fields: fields.map(f => ({...f, id: f.name})),
+ fieldPairs: []
+ };
+
+ const dataToFeature = geojsonData.features.reduce(
+ (accu, f, i) => ({
+ ...accu,
+ [i]: {
+ ...f,
+ properties: {...f.properties, index: i}
+ }
+ }),
+ {}
+ );
+
+ const expectedLayer = new GeojsonLayer({
+ label: 'king milkshake',
+ dataId: 'milkshake',
+ columns: {geojson: {fieldIdx: 0, value: '_geojson'}},
+ isVisible: true
+ });
+
+ expectedLayer.dataToFeature = dataToFeature;
+ expectedLayer.meta = {
+ bounds: geoBounds,
+ lightSettings: geoLghtSettings,
+ fp64: false,
+ fixedRadius: false,
+ featureTypes: {
+ polygon: true
+ }
+ };
+
+ const expectedLayerData = {
+ data: geojsonData.features.map((f, i) => ({
+ ...f,
+ properties: {...f.properties, index: i}
+ }))
+ };
+
+ t.deepEqual(
+ Object.keys(initialState.datasets),
+ ['milkshake'],
+ 'should save geojson to datasets'
+ );
+ cmpDataset(
+ t,
+ expectedDatasets,
+ initialState.datasets.milkshake,
+ 'should save correct geojson to datasets'
+ );
+
+ t.equal(initialState.layers.length, 1, 'should find 1 geojson layer');
+ cmpLayers(
+ t,
+ expectedLayer,
+ initialState.layers[0],
+ 'should save dataFeature to geojson layer'
+ );
+
+ t.deepEqual(
+ initialState.layerData[0].data,
+ expectedLayerData.data,
+ 'should save geojson to datasets'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_VIS_DATA -> mergeFilters', t => {
+ const oldState = CloneDeep(INITIAL_VIS_STATE);
+ oldState.filterToBeMerged = [
+ {
+ dataId: 'smoothie',
+ id: '38chejr',
+ enlarged: true,
+ name: mockFilter.name,
+ type: mockFilter.type,
+ value: mockFilter.value
+ },
+ {
+ dataId: 'nothing_here',
+ id: 'vuey55d',
+ enlarged: true,
+ name: 'test_test',
+ type: 'select',
+ value: true
+ }
+ ];
+
+ const expectedFilter = {
+ dataId: 'smoothie',
+ domain: [12.25, 12.29],
+ enlarged: true,
+ fieldIdx: 0,
+ id: '38chejr',
+ fieldType: 'real',
+ freeze: true,
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ histogram: [1],
+ enlargedHistogram: [1],
+ isAnimating: false,
+ name: mockFilter.name,
+ speed: 1,
+ step: 0.001,
+ type: mockFilter.type,
+ typeOptions: ['range'],
+ value: mockFilter.value
+ };
+
+ const filteredData = [mockData.data[0]];
+
+ const newState = reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: mockRawData,
+ info: {id: 'smoothie', label: 'smoothie and milkshake'}
+ }
+ ])
+ );
+
+ const expectedDatasets = {
+ smoothie: {
+ fields: expectedFields,
+ filteredIndex: [0],
+ allData: mockRawData.rows,
+ data: filteredData,
+ color: 'donnot test me',
+ id: 'smoothie',
+ label: 'smoothie and milkshake',
+ fieldPairs: [
+ {
+ defaultName: 'start point',
+ pair: {
+ lat: {
+ value: 'start_point_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'start_point_lng',
+ fieldIdx: 1
+ }
+ },
+ suffix: ['lat', 'lng']
+ },
+ {
+ defaultName: 'end point',
+ pair: {
+ lat: {
+ value: 'end_point_lat',
+ fieldIdx: 2
+ },
+ lng: {
+ value: 'end_point_lng',
+ fieldIdx: 3
+ }
+ },
+ suffix: ['lat', 'lng']
+ }
+ ]
+ }
+ };
+
+ const expectedState = {
+ filterToBeMerged: [
+ {
+ dataId: 'nothing_here',
+ id: 'vuey55d',
+ enlarged: true,
+ name: 'test_test',
+ type: 'select',
+ value: true
+ }
+ ],
+ filters: [expectedFilter],
+ datasets: expectedDatasets
+ };
+
+ cmpFilters(t, expectedState.filters, newState.filters);
+
+ t.deepEqual(
+ newState.filterToBeMerged,
+ expectedState.filterToBeMerged,
+ 'should saved unmerged filter to filterToBeMerged'
+ );
+
+ cmpDatasets(t, expectedState.datasets, newState.datasets);
+
+ t.end();
+});
+
+test('#visStateReducer -> UPDATE_VIS_DATA.SPLIT_MAPS', t => {
+ const layer0 = new PointLayer({
+ dataId: 'snowflake',
+ id: 'a',
+ isVisible: true
+ });
+
+ const layer1 = new PointLayer({
+ dataId: 'milkshake',
+ id: 'b',
+ isVisible: true
+ });
+
+ const layer2 = new PointLayer({
+ dataId: 'milkshake',
+ id: 'b',
+ isVisible: false
+ });
+
+ const oldState = {
+ ...InitialVisState,
+ layers: [layer0, layer1, layer2],
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: true
+ },
+ b: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: false
+ },
+ b: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ }
+ ],
+ interactionConfig: {
+ tooltip: {
+ config: {
+ fieldsToShow: {
+ milkshake: []
+ }
+ }
+ }
+ },
+ layerData: [],
+ layerOrder: [2, 1, 0]
+ };
+
+ const newState = reducer(
+ oldState,
+ VisStateActions.updateVisData([
+ {
+ data: mockRawData,
+ info: {id: 'smoothie', label: 'smoothie and milkshake'}
+ }
+ ])
+ );
+
+ // first visible layer should be point
+ const id1 = newState.layers[3].id;
+
+ const expectedSplitMaps = [
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: true
+ },
+ b: {
+ isAvailable: true,
+ isVisible: false
+ },
+ [id1]: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: false
+ },
+ b: {
+ isAvailable: true,
+ isVisible: true
+ },
+ [id1]: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ }
+ ];
+
+ t.equal(newState.layers.length, 7, 'should create 1 arc 1 line and 2 point layers');
+ t.deepEqual(
+ newState.layerOrder,
+ [3, 4, 5, 6, 2, 1, 0],
+ 'should move new layers to front'
+ );
+ t.deepEqual(
+ newState.splitMaps,
+ expectedSplitMaps,
+ 'should add new layers to splitmaps'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> setFilter', t => {
+ // get test data
+ const {fields, rows} = processCsvData(testData);
+ const payload = [
+ {
+ info: {
+ id: 'smoothie',
+ label: 'queen smoothie'
+ },
+ data: {fields, rows}
+ }
+ ];
+
+ // receive data
+ const initialState = reducer(
+ INITIAL_VIS_STATE,
+ VisStateActions.updateVisData(payload)
+ );
+
+ const expectedLayer1 = new PointLayer({
+ isVisible: true,
+ dataId: 'smoothie',
+ label: 'gps data',
+ columns: {
+ lat: {value: 'gps_data.lat', fieldIdx: 1},
+ lng: {value: 'gps_data.lng', fieldIdx: 2},
+ altitude: {value: null, fieldIdx: -1, optional: true}
+ }
+ });
+
+ expectedLayer1.meta = {
+ bounds: [31.2148748, 29.9870074, 31.2590542, 30.0614122],
+ lightSettings: getLightSettingsFromBounds([
+ 31.2148748,
+ 29.9870074,
+ 31.2590542,
+ 30.0614122
+ ])
+ };
+
+ const expectedLayers = [expectedLayer1];
+ // test default layer
+ t.equal(initialState.layers.length, 1, 'should find two layers');
+
+ cmpLayers(t, expectedLayers, initialState.layers);
+
+ // add filter
+ const stateWithFilter = reducer(
+ initialState,
+ VisStateActions.addFilter('smoothie')
+ );
+
+ const expectedFilter = {
+ dataId: 'smoothie',
+ freeze: false,
+ id: 'donnot test me yet',
+ name: null,
+ type: null,
+ fieldIdx: null,
+ domain: null,
+ value: null,
+ enlarged: false,
+ isAnimating: false,
+ plotType: 'histogram',
+ yAxis: null,
+ speed: 1,
+ interval: null
+ };
+
+ cmpFilters(t, expectedFilter, stateWithFilter.filters[0]);
+ const filterId = stateWithFilter.filters[0].id;
+
+ // set filter 'name'
+ const stateWithFilterName = reducer(
+ stateWithFilter,
+ VisStateActions.setFilter(0, 'name', 'date')
+ );
+
+ const expectedFilterWName = {
+ dataId: 'smoothie',
+ freeze: true,
+ id: filterId,
+ name: 'date',
+ type: 'multiSelect',
+ fieldIdx: 10,
+ domain: ['2016-09-23', '2016-09-24', '2016-10-10'],
+ value: [],
+ enlarged: false,
+ isAnimating: false,
+ fieldType: 'date',
+ plotType: 'histogram',
+ yAxis: null,
+ speed: 1,
+ interval: null
+ };
+
+ // test filter
+ cmpFilters(t, expectedFilterWName, stateWithFilterName.filters[0]);
+
+ const updatedField = {
+ ...initialState.datasets.smoothie.fields[10],
+ filterProp: {
+ type: 'multiSelect',
+ value: [],
+ fieldType: 'date',
+ domain: ['2016-09-23', '2016-09-24', '2016-10-10']
+ }
+ };
+
+ const {allData} = initialState.datasets.smoothie;
+ // test dataset
+ const expectedDataset = {
+ id: 'smoothie',
+ label: 'queen smoothie',
+ color: 'donnot test me',
+ allData,
+ data: [],
+ fields: [
+ ...initialState.datasets.smoothie.fields.slice(0, 10),
+ updatedField
+ ],
+ filteredIndex: [],
+ fieldPairs: [
+ {
+ defaultName: 'gps data',
+ pair: {
+ lat: {
+ value: 'gps_data.lat',
+ fieldIdx: 1
+ },
+ lng: {
+ value: 'gps_data.lng',
+ fieldIdx: 2
+ }
+ },
+ suffix: ['lat', 'lng']
+ }
+ ]
+ };
+
+ cmpDataset(t, expectedDataset, stateWithFilterName.datasets.smoothie);
+
+ // set filter value
+ const stateWithFilterValue = reducer(
+ stateWithFilterName,
+ VisStateActions.setFilter(0, 'value', ['2016-10-10'])
+ );
+
+ const expectedFilterWValue = {
+ ...expectedFilterWName,
+ value: ['2016-10-10']
+ };
+
+ // test filter
+ cmpFilters(t, expectedFilterWValue, stateWithFilterValue.filters[0]);
+
+ const expectedFilteredDataset = {
+ ...expectedDataset,
+ allData,
+ data: [
+ allData[17],
+ allData[18],
+ allData[19],
+ allData[20],
+ allData[21],
+ allData[22]
+ ],
+ filteredIndex: [17, 18, 19, 20, 21, 22]
+ };
+
+ const expectedLayerData1 = {
+ data: [
+ {
+ data: [
+ '2016-09-17 00:26:29',
+ 30.0538936,
+ 31.2165983,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 43,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:59:53+00:00',
+ '2016-10-01 16:59:53+00:00',
+ '2016-10-10'
+ ]
+ },
+ {
+ data: [
+ '2016-09-17 00:27:31',
+ 30.060911,
+ 31.2148748,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 4,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:57:11+00:00',
+ '2016-10-01 16:57:11+00:00',
+ '2016-10-10'
+ ]
+ },
+ {
+ data: [
+ '2016-09-17 00:28:35',
+ 30.060334,
+ 31.2212278,
+ 'driver_analytics',
+ 1472774400000,
+ null,
+ 5,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:59:27+00:00',
+ '2016-10-01 16:59:27+00:00',
+ '2016-10-10'
+ ]
+ },
+ {
+ data: [
+ '2016-09-17 00:29:40',
+ 30.0554663,
+ 31.2288985,
+ 'driver_analytics',
+ 1472774400000,
+ true,
+ null,
+ '2016-09-23T07:00:00.000Z',
+ '2016-10-01 09:46:36+00:00',
+ '2016-10-01 16:46:36+00:00',
+ '2016-10-10'
+ ]
+ },
+ {
+ data: [
+ '2016-09-17 00:30:03',
+ 30.0614122,
+ 31.2187021,
+ 'driver_gps',
+ 1472774400000,
+ true,
+ 6,
+ '2016-09-23T08:00:00.000Z',
+ '2016-10-01 09:54:31+00:00',
+ '2016-10-01 16:54:31+00:00',
+ '2016-10-10'
+ ]
+ },
+ {
+ data: [
+ '2016-09-17 00:30:03',
+ 30.0612697,
+ 31.2191059,
+ 'driver_gps',
+ 1472774400000,
+ true,
+ 7,
+ '2016-09-23T08:00:00.000Z',
+ '2016-10-01 09:53:35+00:00',
+ '2016-10-01 16:53:35+00:00',
+ '2016-10-10'
+ ]
+ }
+ ],
+ getPosition: () => {},
+ getColor: () => {},
+ getRadius: () => {}
+ };
+
+ cmpDataset(
+ t,
+ expectedFilteredDataset,
+ stateWithFilterValue.datasets.smoothie
+ );
+
+ t.deepEqual(
+ stateWithFilterValue.layerData[0].data,
+ expectedLayerData1.data,
+ 'should format layer data correctly'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> setFilter.geojson', t => {
+ const {fields, rows} = processGeojson(CloneDeep(geojsonData));
+ const payload = [
+ {
+ info: {
+ id: 'milkshake',
+ label: 'king milkshake'
+ },
+ data: {fields, rows}
+ }
+ ];
+
+ // receive data
+ const initialState = reducer(
+ INITIAL_VIS_STATE,
+ VisStateActions.updateVisData(payload)
+ );
+
+ // add filter
+ const stateWithFilter = reducer(
+ initialState,
+ VisStateActions.addFilter('milkshake')
+ );
+
+ // set filter 'name'
+ const stateWithFilterName = reducer(
+ stateWithFilter,
+ VisStateActions.setFilter(0, 'name', 'TRIPS')
+ );
+
+ const expectedHistogram = [
+ {count: 1, x0: 4, x1: 4.5},
+ {count: 0, x0: 4.5, x1: 5},
+ {count: 0, x0: 5, x1: 5.5},
+ {count: 0, x0: 5.5, x1: 6},
+ {count: 0, x0: 6, x1: 6.5},
+ {count: 0, x0: 6.5, x1: 7},
+ {count: 0, x0: 7, x1: 7.5},
+ {count: 0, x0: 7.5, x1: 8},
+ {count: 0, x0: 8, x1: 8.5},
+ {count: 0, x0: 8.5, x1: 9},
+ {count: 0, x0: 9, x1: 9.5},
+ {count: 0, x0: 9.5, x1: 10},
+ {count: 0, x0: 10, x1: 10.5},
+ {count: 0, x0: 10.5, x1: 11},
+ {count: 1, x0: 11, x1: 11.5},
+ {count: 0, x0: 11.5, x1: 12},
+ {count: 0, x0: 12, x1: 12.5},
+ {count: 0, x0: 12.5, x1: 13},
+ {count: 0, x0: 13, x1: 13.5},
+ {count: 0, x0: 13.5, x1: 14},
+ {count: 0, x0: 14, x1: 14.5},
+ {count: 0, x0: 14.5, x1: 15},
+ {count: 0, x0: 15, x1: 15.5},
+ {count: 0, x0: 15.5, x1: 16},
+ {count: 0, x0: 16, x1: 16.5},
+ {count: 0, x0: 16.5, x1: 17},
+ {count: 0, x0: 17, x1: 17.5},
+ {count: 0, x0: 17.5, x1: 18},
+ {count: 0, x0: 18, x1: 18.5},
+ {count: 0, x0: 18.5, x1: 19},
+ {count: 0, x0: 19, x1: 19.5},
+ {count: 0, x0: 19.5, x1: 20},
+ {count: 1, x0: 20, x1: 20}
+ ];
+
+ const expectedEnlarged = [
+ {count: 1, x0: 4, x1: 4.2},
+ {count: 0, x0: 4.2, x1: 4.4},
+ {count: 0, x0: 4.4, x1: 4.6},
+ {count: 0, x0: 4.6, x1: 4.8},
+ {count: 0, x0: 4.8, x1: 5},
+ {count: 0, x0: 5, x1: 5.2},
+ {count: 0, x0: 5.2, x1: 5.4},
+ {count: 0, x0: 5.4, x1: 5.6},
+ {count: 0, x0: 5.6, x1: 5.8},
+ {count: 0, x0: 5.8, x1: 6},
+ {count: 0, x0: 6, x1: 6.2},
+ {count: 0, x0: 6.2, x1: 6.4},
+ {count: 0, x0: 6.4, x1: 6.6},
+ {count: 0, x0: 6.6, x1: 6.8},
+ {count: 0, x0: 6.8, x1: 7},
+ {count: 0, x0: 7, x1: 7.2},
+ {count: 0, x0: 7.2, x1: 7.4},
+ {count: 0, x0: 7.4, x1: 7.6},
+ {count: 0, x0: 7.6, x1: 7.8},
+ {count: 0, x0: 7.8, x1: 8},
+ {count: 0, x0: 8, x1: 8.2},
+ {count: 0, x0: 8.2, x1: 8.4},
+ {count: 0, x0: 8.4, x1: 8.6},
+ {count: 0, x0: 8.6, x1: 8.8},
+ {count: 0, x0: 8.8, x1: 9},
+ {count: 0, x0: 9, x1: 9.2},
+ {count: 0, x0: 9.2, x1: 9.4},
+ {count: 0, x0: 9.4, x1: 9.6},
+ {count: 0, x0: 9.6, x1: 9.8},
+ {count: 0, x0: 9.8, x1: 10},
+ {count: 0, x0: 10, x1: 10.2},
+ {count: 0, x0: 10.2, x1: 10.4},
+ {count: 0, x0: 10.4, x1: 10.6},
+ {count: 0, x0: 10.6, x1: 10.8},
+ {count: 0, x0: 10.8, x1: 11},
+ {count: 1, x0: 11, x1: 11.2},
+ {count: 0, x0: 11.2, x1: 11.4},
+ {count: 0, x0: 11.4, x1: 11.6},
+ {count: 0, x0: 11.6, x1: 11.8},
+ {count: 0, x0: 11.8, x1: 12},
+ {count: 0, x0: 12, x1: 12.2},
+ {count: 0, x0: 12.2, x1: 12.4},
+ {count: 0, x0: 12.4, x1: 12.6},
+ {count: 0, x0: 12.6, x1: 12.8},
+ {count: 0, x0: 12.8, x1: 13},
+ {count: 0, x0: 13, x1: 13.2},
+ {count: 0, x0: 13.2, x1: 13.4},
+ {count: 0, x0: 13.4, x1: 13.6},
+ {count: 0, x0: 13.6, x1: 13.8},
+ {count: 0, x0: 13.8, x1: 14},
+ {count: 0, x0: 14, x1: 14.2},
+ {count: 0, x0: 14.2, x1: 14.4},
+ {count: 0, x0: 14.4, x1: 14.6},
+ {count: 0, x0: 14.6, x1: 14.8},
+ {count: 0, x0: 14.8, x1: 15},
+ {count: 0, x0: 15, x1: 15.2},
+ {count: 0, x0: 15.2, x1: 15.4},
+ {count: 0, x0: 15.4, x1: 15.6},
+ {count: 0, x0: 15.6, x1: 15.8},
+ {count: 0, x0: 15.8, x1: 16},
+ {count: 0, x0: 16, x1: 16.2},
+ {count: 0, x0: 16.2, x1: 16.4},
+ {count: 0, x0: 16.4, x1: 16.6},
+ {count: 0, x0: 16.6, x1: 16.8},
+ {count: 0, x0: 16.8, x1: 17},
+ {count: 0, x0: 17, x1: 17.2},
+ {count: 0, x0: 17.2, x1: 17.4},
+ {count: 0, x0: 17.4, x1: 17.6},
+ {count: 0, x0: 17.6, x1: 17.8},
+ {count: 0, x0: 17.8, x1: 18},
+ {count: 0, x0: 18, x1: 18.2},
+ {count: 0, x0: 18.2, x1: 18.4},
+ {count: 0, x0: 18.4, x1: 18.6},
+ {count: 0, x0: 18.6, x1: 18.8},
+ {count: 0, x0: 18.8, x1: 19},
+ {count: 0, x0: 19, x1: 19.2},
+ {count: 0, x0: 19.2, x1: 19.4},
+ {count: 0, x0: 19.4, x1: 19.6},
+ {count: 0, x0: 19.6, x1: 19.8},
+ {count: 0, x0: 19.8, x1: 20},
+ {count: 1, x0: 20, x1: 20}
+ ];
+
+ const expectedFilterWName = {
+ dataId: 'milkshake',
+ freeze: true,
+ id: stateWithFilter.filters[0].id,
+ name: 'TRIPS',
+ type: 'range',
+ fieldIdx: 4,
+ domain: [4, 20],
+ step: 0.01,
+ value: [4, 20],
+ enlarged: false,
+ histogram: [],
+ enlargedHistogram: [],
+ isAnimating: false,
+ fieldType: 'integer',
+ typeOptions: ['range'],
+ plotType: 'histogram',
+ yAxis: null,
+ interval: null,
+ speed: 1
+ };
+
+ // test filter
+ cmpFilters(t, expectedFilterWName, stateWithFilterName.filters[0]);
+
+ // set filter value
+ const stateWithFilterValue = reducer(
+ stateWithFilterName,
+ VisStateActions.setFilter(0, 'value', [8, 20])
+ );
+
+ const expectedFilterWValue = {
+ ...expectedFilterWName,
+ value: [8, 20]
+ };
+
+ // test filter
+ cmpFilters(t, expectedFilterWValue, stateWithFilterValue.filters[0]);
+
+ const expectedFilteredDataset = {
+ ...initialState.datasets.milkshake,
+ data: [
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 1,
+ ZIP_CODE: 94107,
+ ID: 94107,
+ TRIPS: 11,
+ RATE: 'a',
+ index: 0
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.401159718585049, 37.782024266952142],
+ [-122.400374366843309, 37.782644515545172],
+ [-122.400019020063766, 37.782925153640136],
+ [-122.399891477967842, 37.783025880124256],
+ [-122.398930331092998, 37.783784933304034],
+ [-122.397811613142864, 37.784666586003652],
+ [-122.396705177550587, 37.785542130425938],
+ [-122.395895701657864, 37.784896929203114],
+ [-122.395160622349934, 37.78431101230386],
+ [-122.394398389309941, 37.783701667981575],
+ [-122.401159718585049, 37.782024266952142]
+ ]
+ ]
+ }
+ },
+ 1,
+ 94107,
+ 94107,
+ 11,
+ 'a'
+ ],
+ [
+ {
+ type: 'Feature',
+ properties: {
+ OBJECTID: 3,
+ ZIP_CODE: 94109,
+ ID: 94109,
+ TRIPS: 20,
+ index: 2
+ },
+ geometry: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [-122.39249932896719, 37.793768814133983],
+ [-122.391890260341384, 37.794278544568918],
+ [-122.391788865572423, 37.794170982455135],
+ [-122.39173429034625, 37.79420276052317],
+ [-122.391666728649753, 37.794132425256194],
+ [-122.391723034266192, 37.79410061945832],
+ [-122.391673228351905, 37.794047854124599],
+ [-122.391982015107928, 37.793871906128679],
+ [-122.39249932896719, 37.793768814133983]
+ ]
+ ]
+ }
+ },
+ 3,
+ 94109,
+ 94109,
+ 20,
+ null
+ ]
+ ],
+
+ // receive Vis Data will add id to fields
+ // filter will add filterProps to fields
+ fields: geojsonFields.map(
+ f =>
+ f.name === 'TRIPS'
+ ? {
+ ...f,
+ id: f.name,
+ filterProp: {
+ domain: [4, 20],
+ fieldType: 'integer',
+ histogram: expectedHistogram,
+ enlargedHistogram: expectedEnlarged,
+ step: 0.01,
+ type: 'range',
+ typeOptions: ['range'],
+ value: [4, 20]
+ }
+ }
+ : {...f, id: f.name}
+ ),
+ filteredIndex: [0, 2]
+ };
+
+ const actualTripFeild = stateWithFilterValue.datasets.milkshake.fields[4];
+ const expectetField = expectedFilteredDataset.fields[4];
+
+ t.deepEqual(
+ Object.keys(actualTripFeild).sort(),
+ Object.keys(expectetField).sort(),
+ 'trip field keys should be same'
+ );
+ Object.keys(actualTripFeild).forEach(k => {
+ t.deepEqual(
+ actualTripFeild[k],
+ expectetField[k],
+ `trip field ${k} should be same`
+ );
+ });
+ cmpDataset(
+ t,
+ expectedFilteredDataset,
+ stateWithFilterValue.datasets.milkshake
+ );
+
+ t.end();
+});
+/* eslint-enable max-statements */
+
+test('#visStateReducer -> setFilterPlot', t => {
+ // get test data
+ const {fields, rows} = processCsvData(testData);
+ const payload = [
+ {
+ info: {
+ id: 'smoothie',
+ label: 'queen smoothie'
+ },
+ data: {fields, rows}
+ }
+ ];
+
+ // receive data
+ const initialState = reducer(
+ INITIAL_VIS_STATE,
+ VisStateActions.updateVisData(payload)
+ );
+
+ // add filter
+ const stateWithFilter = reducer(
+ initialState,
+ VisStateActions.addFilter('smoothie')
+ );
+ const filterId = stateWithFilter.filters[0].id;
+
+ // set filter 'name'
+ const stateWithFilterName = reducer(
+ stateWithFilter,
+ VisStateActions.setFilter(0, 'name', 'gps_data.utc_timestamp')
+ );
+
+ // find id which is an integer field
+ const yAxisField = stateWithFilterName.datasets.smoothie.fields.find(
+ f => f.id === 'id'
+ );
+
+ // set filterPlot
+ const stateWithFilterPlot = reducer(
+ stateWithFilterName,
+ VisStateActions.setFilterPlot(0, {yAxis: yAxisField})
+ );
+
+ const expectedFilterWName = {
+ dataId: 'smoothie',
+ freeze: true,
+ id: filterId,
+ name: 'gps_data.utc_timestamp',
+ type: 'timeRange',
+ fieldIdx: 0,
+ domain: [1474070995000, 1474072208000],
+ value: [1474070995000, 1474072208000],
+ step: 1000,
+ plotType: 'lineChart',
+ yAxis: {
+ type: 'integer',
+ name: 'id',
+ id: 'id',
+ format: '',
+ tableFieldIndex: 7
+ },
+ interval: null,
+ lineChart: {
+ series: [
+ {x: 1474070995000, y: 1},
+ {x: 1474071056000, y: 2},
+ {x: 1474071116000, y: 3},
+ {x: 1474071178000, y: 4},
+ {x: 1474071240000, y: 5},
+ {x: 1474071301000, y: 12124},
+ {x: 1474071363000, y: 222},
+ {x: 1474071425000, y: 345},
+ {x: 1474071864000, y: 1},
+ {x: 1474071989000, y: 43},
+ {x: 1474072051000, y: 4},
+ {x: 1474072115000, y: 5},
+ {x: 1474072203000, y: 6},
+ {x: 1474072203000, y: 7}
+ ],
+ yDomain: [1, 12124],
+ xDomain: [1474070995000, 1474072203000]
+ },
+ speed: 1,
+ mappedValue: [
+ 1474070995000,
+ 1474071056000,
+ 1474071116000,
+ 1474071178000,
+ 1474071240000,
+ 1474071301000,
+ 1474071363000,
+ 1474071425000,
+ 1474071489000,
+ 1474071552000,
+ 1474071567000,
+ 1474071614000,
+ 1474071677000,
+ 1474071740000,
+ 1474071802000,
+ 1474071864000,
+ 1474071928000,
+ 1474071989000,
+ 1474072051000,
+ 1474072115000,
+ 1474072180000,
+ 1474072203000,
+ 1474072203000,
+ 1474072208000
+ ],
+ histogram: [],
+ enlargedHistogram: [],
+ enlarged: true,
+ isAnimating: false,
+ fieldType: 'timestamp'
+ };
+
+ // test filter
+ cmpFilters(t, expectedFilterWName, stateWithFilterPlot.filters[0]);
+ t.end();
+});
+
+test('#visStateReducer -> REMOVE_DATASET', t => {
+ const layer0 = new ArcLayer({id: 'a', dataId: 'puppy_0'});
+ const layer1 = new PointLayer({id: 'b', dataId: 'puppy_0'});
+ const layer2 = new GeojsonLayer({id: 'c', dataId: 'puppy_1'});
+ const layer3 = new PointLayer({id: 'd', dataId: 'puppy_2'});
+
+ const oldState = {
+ datasets: {
+ puppy_0: {},
+ puppy_1: {},
+ puppy_2: {}
+ },
+ layers: [layer0, layer1, layer2, layer3],
+ layerData: [{data: 1}, {data: 2}, {data: 3}, {data: 4}],
+ layerOrder: [2, 3, 1, 0],
+ filters: [{dataId: 'puppy_0'}, {dataId: 'puppy_1'}, {dataId: 'puppy_2'}],
+ interactionConfig: {
+ tooltip: {
+ config: {
+ fieldsToShow: {
+ puppy_0: {},
+ puppy_1: {},
+ puppy_2: {}
+ }
+ }
+ }
+ },
+ hoverInfo: undefined,
+ clicked: undefined,
+ splitMaps: []
+ };
+
+ const newReducer = reducer(
+ oldState,
+ VisStateActions.removeDataset('puppy_1')
+ );
+
+ t.deepEqual(
+ newReducer,
+ {
+ datasets: {
+ puppy_0: {},
+ puppy_2: {}
+ },
+ layers: [layer0, layer1, layer3],
+ layerData: [{data: 1}, {data: 2}, {data: 4}],
+ layerOrder: [2, 1, 0],
+ filters: [{dataId: 'puppy_0'}, {dataId: 'puppy_2'}],
+ interactionConfig: {
+ tooltip: {
+ config: {
+ fieldsToShow: {
+ puppy_0: {},
+ puppy_2: {}
+ }
+ }
+ }
+ },
+ hoverInfo: undefined,
+ clicked: undefined,
+ splitMaps: []
+ },
+ 'should remove dataset, layer and layerData'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: TOGGLE', t => {
+ const layer0 = new ArcLayer({id: 'a', dataId: 'puppy_0', isVisible: true});
+
+ const oldState = {
+ layers: [layer0],
+ splitMaps: []
+ };
+
+ const newReducer = reducer(oldState, MapStateActions.toggleSplitMap());
+
+ t.deepEqual(
+ newReducer,
+ {
+ layers: [layer0],
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ }
+ ]
+ },
+ 'should split map'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: REMOVE_LAYER', t => {
+ const layer1 = new PointLayer({id: 'a'});
+ const layer2 = new PointLayer({id: 'b'});
+ const oldState = {
+ layers: [layer1, layer2],
+ layerData: [{data: 1}, {data: 2}],
+ layerOrder: [1, 0],
+ hoverInfo: {
+ layer: {props: {id: 'b'}},
+ picked: true
+ },
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ const newReducer = reducer(oldState, VisStateActions.removeLayer(1));
+
+ t.deepEqual(
+ newReducer,
+ {
+ layers: [layer1],
+ layerData: [{data: 1}],
+ layerOrder: [0],
+ hoverInfo: undefined,
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ },
+ 'should remove layer and layerData in split mode'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: REMOVE_DATASET', t => {
+ const layer0 = new ArcLayer({id: 'a', dataId: 'puppy_0'});
+ const layer1 = new PointLayer({id: 'b', dataId: 'puppy_0'});
+ const layer2 = new GeojsonLayer({id: 'c', dataId: 'puppy_1'});
+ const layer3 = new PointLayer({id: 'd', dataId: 'puppy_2'});
+
+ const oldState = {
+ datasets: {
+ puppy_0: {},
+ puppy_1: {},
+ puppy_2: {}
+ },
+ layers: [layer0, layer1, layer2, layer3],
+ layerData: [{data: 1}, {data: 2}, {data: 3}, {data: 4}],
+ layerOrder: [2, 3, 1, 0],
+ filters: [{dataId: 'puppy_0'}, {dataId: 'puppy_1'}, {dataId: 'puppy_2'}],
+ interactionConfig: {
+ tooltip: {
+ config: {
+ fieldsToShow: {
+ puppy_0: {},
+ puppy_1: {},
+ puppy_2: {}
+ }
+ }
+ }
+ },
+ hoverInfo: undefined,
+ clicked: undefined,
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ },
+ c: {
+ isVisible: true,
+ isAvailable: true
+ },
+ d: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ },
+ c: {
+ isVisible: true,
+ isAvailable: true
+ },
+ d: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ const newReducer = reducer(
+ oldState,
+ VisStateActions.removeDataset('puppy_1')
+ );
+
+ const expectedState = {
+ datasets: {
+ puppy_0: {},
+ puppy_2: {}
+ },
+ layers: [layer0, layer1, layer3],
+ layerData: [{data: 1}, {data: 2}, {data: 4}],
+ layerOrder: [2, 1, 0],
+ filters: [{dataId: 'puppy_0'}, {dataId: 'puppy_2'}],
+ interactionConfig: {
+ tooltip: {
+ config: {
+ fieldsToShow: {
+ puppy_0: {},
+ puppy_2: {}
+ }
+ }
+ }
+ },
+ hoverInfo: undefined,
+ clicked: undefined,
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ },
+ d: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ },
+ d: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ t.deepEqual(
+ newReducer,
+ expectedState,
+ 'should remove dataset, layer and layerData in split mode'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: ADD_LAYER', t => {
+ const oldState = {
+ datasets: {
+ puppy: {
+ data: mockData.data,
+ fields: mockData.fields
+ }
+ },
+ layers: [{id: 'existing_layer'}],
+ layerData: [[{data: [1, 2, 3]}, {data: [4, 5, 6]}]],
+ layerOrder: [0],
+ splitMaps: [
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ existing_layer: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ }
+ ]
+ };
+
+ const newReducer = reducer(oldState, VisStateActions.addLayer());
+
+ t.equal(
+ newReducer.layers[1].config.isVisible,
+ true,
+ 'newLayer visibility should be set to true'
+ );
+ t.equal(
+ newReducer.layers[1].config.isConfigActive,
+ true,
+ 'newLayer isConfigActive should be set to true'
+ );
+ t.equal(
+ newReducer.layers[1].config.dataId,
+ 'puppy',
+ 'newLayer dataId should be set to default'
+ );
+ t.equal(
+ newReducer.splitMaps.length,
+ 2,
+ 'newLayer was added into splitMaps layers'
+ );
+ t.deepEqual(
+ newReducer.splitMaps[0].layers[newReducer.layers[1].id],
+ {
+ isAvailable: true,
+ isVisible: true
+ },
+ 'newLayer map meta data settings are correct'
+ );
+ t.deepEqual(
+ newReducer.splitMaps[1].layers[newReducer.layers[1].id],
+ {
+ isAvailable: true,
+ isVisible: true
+ },
+ 'newLayer map meta data settings are correct'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: TOGGLE_SPLIT_MAP', t => {
+ const layer0 = new ArcLayer({id: 'a', dataId: 'puppy_0', isVisible: true});
+ const layer1 = new PointLayer({id: 'b', dataId: 'puppy_0', isVisible: true});
+
+ const oldState = {
+ layers: [layer0, layer1],
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: false
+ },
+ b: {
+ isAvailable: true,
+ isVisible: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isAvailable: true,
+ isVisible: true
+ },
+ b: {
+ isAvailable: true,
+ isVisible: false
+ }
+ }
+ }
+ ]
+ };
+
+ const newReducer = reducer(oldState, MapStateActions.toggleSplitMap(0));
+
+ t.equal(newReducer.layers.length, 2, 'should have 2 global layers');
+ t.equal(
+ newReducer.layers[0].config.isVisible,
+ true,
+ 'global layer should have changed to reflect specific map meta info'
+ );
+ t.equal(
+ newReducer.layers[1].config.isVisible,
+ false,
+ 'global layer should have changed to reflect specific map meta info'
+ );
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: SET VISIBLE LAYERS IN MAP', t => {
+ const layer1 = new PointLayer({id: 'a'});
+ const layer2 = new PointLayer({id: 'b'});
+ const oldState = {
+ layers: [layer1, layer2],
+ layerData: [{data: 1}, {data: 2}],
+ layerOrder: [1, 0],
+ hoverInfo: {
+ layer: {props: {id: 'b'}},
+ picked: true
+ },
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ const newState = reducer(
+ oldState,
+ VisStateActions.setVisibleLayersForMap(1, ['a'])
+ );
+
+ const expectedState = {
+ layers: [layer1, layer2],
+ layerData: [{data: 1}, {data: 2}],
+ layerOrder: [1, 0],
+ hoverInfo: {
+ layer: {props: {id: 'b'}},
+ picked: true
+ },
+ clicked: {
+ layer: {props: {id: 'a'}},
+ picked: true
+ },
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ },
+ b: {
+ isVisible: false,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ t.deepEqual(
+ newState,
+ expectedState,
+ 'should hide layer B in split map using set visible layers'
+ );
+
+ t.end();
+});
+
+test('#visStateReducer -> SPLIT_MAP: HIDE LAYER', t => {
+ const layer1 = new PointLayer({id: 'a'});
+ // const layer2 = new PointLayer({id: 'b'});
+ const oldState = {
+ layers: [layer1],
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ const newState = reducer(oldState, VisStateActions.toggleLayerForMap(1, 'a'));
+
+ const expectedState = {
+ layers: [layer1],
+ splitMaps: [
+ {
+ layers: {
+ a: {
+ isVisible: true,
+ isAvailable: true
+ }
+ }
+ },
+ {
+ layers: {
+ a: {
+ isVisible: false,
+ isAvailable: true
+ }
+ }
+ }
+ ]
+ };
+
+ t.deepEqual(newState, expectedState, 'should hide layer B in split map');
+
+ t.end();
+});
diff --git a/test/node/schemas/dataset-schema-test.js b/test/node/schemas/dataset-schema-test.js
new file mode 100644
index 000000000..e48d61cef
--- /dev/null
+++ b/test/node/schemas/dataset-schema-test.js
@@ -0,0 +1,186 @@
+// Copyright (c) 2018 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 test from 'tape';
+import cloneDeep from 'lodash.clonedeep';
+import SchemaManager from 'schemas';
+
+// fixtures
+import {
+ savedStateV0,
+ expectedInfo0,
+ expectedFields0,
+ expectedFields1,
+ expectedInfo1
+} from 'test/fixtures/state-saved-v0';
+import {
+ savedStateV1,
+ v0ExpectedInfo,
+ v0ExpectedFields
+} from 'test/fixtures/state-saved-v1-1';
+
+import {
+ stateSavedV1_2,
+ v1expectedInfo_2,
+ v1expectedFields_2
+} from "test/fixtures/state-saved-v1-2";
+
+/* eslint-disable max-statements */
+test('#DatasetSchema -> SchemaManager.parseSavedData', t => {
+ const dataSaved = cloneDeep(savedStateV0).datasets;
+ const parsedValid = SchemaManager.parseSavedData(dataSaved);
+
+ const expectedRows0 = dataSaved[0].data.allData;
+
+ const expectedDataset0 = {
+ info: expectedInfo0,
+ data: {
+ fields: expectedFields0,
+ rows: expectedRows0
+ }
+ };
+
+ const expectedRows1 = dataSaved[1].data.allData;
+
+ const expectedDataset1 = {
+ info: expectedInfo1,
+ data: {
+ fields: expectedFields1,
+ rows: expectedRows1
+ }
+ };
+
+ t.equal(parsedValid.length, 2, 'should have 2 datasets');
+ t.deepEqual(
+ parsedValid[0],
+ expectedDataset0,
+ 'should parse dataset correctly'
+ );
+ t.deepEqual(
+ parsedValid[0].info,
+ expectedInfo0,
+ 'should parse info correctly'
+ );
+ t.deepEqual(
+ parsedValid[0].data.fields,
+ expectedFields0,
+ 'should parse fields correctly'
+ );
+ t.deepEqual(
+ parsedValid[0].data.rows,
+ expectedRows0,
+ 'should parse fields correctly'
+ );
+
+ t.deepEqual(
+ parsedValid[1],
+ expectedDataset1,
+ 'should parse dataset correctly'
+ );
+ t.deepEqual(
+ parsedValid[1].info,
+ expectedInfo1,
+ 'should parse info correctly'
+ );
+ t.deepEqual(
+ parsedValid[1].data.fields,
+ expectedFields1,
+ 'should parse fields correctly'
+ );
+ t.deepEqual(
+ parsedValid[1].data.rows,
+ expectedRows1,
+ 'should parse fields correctly'
+ );
+
+ t.end();
+});
+/* eslint-enable max-statements */
+
+test('#DatasetSchema -> SchemaManager.parseSavedData.v1', t => {
+ const dataSaved = cloneDeep(savedStateV1).datasets;
+ const parsedValid = SchemaManager.parseSavedData(dataSaved);
+
+ const expectedRows = dataSaved[0].data.allData;
+
+ const expectedDataset = {
+ info: v0ExpectedInfo,
+ data: {
+ fields: v0ExpectedFields,
+ rows: expectedRows
+ }
+ };
+
+ t.equal(parsedValid.length, 1, 'should have 1 dataset');
+
+ t.deepEqual(
+ parsedValid[0],
+ expectedDataset,
+ 'should parse dataset correctly'
+ );
+ t.deepEqual(parsedValid[0].info, v0ExpectedInfo, 'should parse info correctly');
+ t.deepEqual(
+ parsedValid[0].data.fields,
+ v0ExpectedFields,
+ 'should parse fields correctly'
+ );
+ t.deepEqual(
+ parsedValid[0].data.rows,
+ expectedRows,
+ 'should parse fields correctly'
+ );
+
+ t.end();
+});
+
+test('#DatasetSchema -> SchemaManager.parseSavedData.v1 with ts', t => {
+ const dataSaved = cloneDeep(stateSavedV1_2).datasets;
+ const parsedValid = SchemaManager.parseSavedData(dataSaved);
+
+ const expectedRows = dataSaved[0].data.allData;
+ const expectedDataset = {
+ info: v1expectedInfo_2,
+ data: {
+ fields: v1expectedFields_2,
+ rows: expectedRows
+ }
+ };
+
+ t.equal(parsedValid.length, 1, 'should have 1 dataset');
+
+ t.deepEqual(
+ parsedValid[0],
+ expectedDataset,
+ 'should parse dataset correctly'
+ );
+ t.deepEqual(parsedValid[0].info, v1expectedInfo_2, 'should parse info correctly');
+ t.deepEqual(
+ parsedValid[0].data.fields,
+ v1expectedFields_2,
+ 'should parse fields correctly'
+ );
+ t.deepEqual(
+ parsedValid[0].data.rows,
+ expectedRows,
+ 'should parse fields correctly'
+ );
+
+ t.end();
+});
diff --git a/test/node/schemas/map-state-schema-test.js b/test/node/schemas/map-state-schema-test.js
new file mode 100644
index 000000000..5ad5127f9
--- /dev/null
+++ b/test/node/schemas/map-state-schema-test.js
@@ -0,0 +1,51 @@
+// Copyright (c) 2018 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 test from 'tape';
+import SchemaManager from 'schemas';
+import {InitialState} from 'test/helpers/mock-state';
+
+test('#mapStateSchema -> v1 -> save load mapState', t => {
+ const initialState = InitialState.toJS();
+ const savedState = SchemaManager.getConfigToSave(initialState);
+
+ // save state
+ const msToSave = savedState.config.mapState;
+ const msLoaded = SchemaManager.parseSavedConfig(savedState).mapState;
+
+ t.deepEqual(Object.keys(msToSave),
+ ['bearing', 'dragRotate', 'latitude', 'longitude', 'pitch', 'zoom', 'isSplit'],
+ 'mapState should have all 6 entries');
+
+ const expected = {
+ pitch: 0,
+ bearing: 0,
+ latitude: 37.75043,
+ longitude: -122.34679,
+ zoom: 9,
+ dragRotate: false,
+ isSplit: false
+ };
+
+ t.deepEqual(msToSave, expected, 'save mapState should be current');
+ t.deepEqual(msLoaded, expected, 'load mapState should be current');
+
+ t.end();
+});
diff --git a/test/node/schemas/map-style-schema-test.js b/test/node/schemas/map-style-schema-test.js
new file mode 100644
index 000000000..23403c3e0
--- /dev/null
+++ b/test/node/schemas/map-style-schema-test.js
@@ -0,0 +1,47 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import SchemaManager from 'schemas';
+import {InitialState} from 'test/helpers/mock-state';
+
+test('#mapStyleSchema -> v1 -> save load mapStyle', t => {
+ const initialState = InitialState.toJS();
+ const savedState = SchemaManager.getConfigToSave(initialState);
+
+ // save state
+ const msToSave = savedState.config.mapStyle;
+ const msLoaded = SchemaManager.parseSavedConfig(savedState).mapStyle;
+
+ t.deepEqual(Object.keys(msToSave),
+ ['styleType', 'topLayerGroups', 'visibleLayerGroups'],
+ 'mapStyle should have all 6 entries');
+
+ const expectedSaved = {
+ styleType: 'dark',
+ topLayerGroups: {},
+ visibleLayerGroups: {}
+ };
+
+ t.deepEqual(msToSave, expectedSaved, 'saved mapStyle should be current');
+ t.deepEqual(msLoaded, expectedSaved, 'loaded mapStyle should be current');
+ t.end();
+});
diff --git a/test/node/schemas/schema-conversion-test.js b/test/node/schemas/schema-conversion-test.js
new file mode 100644
index 000000000..6abd23f3b
--- /dev/null
+++ b/test/node/schemas/schema-conversion-test.js
@@ -0,0 +1,87 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import SchemaManager from 'schemas';
+import {cmpParsedAppConfigs} from 'test/helpers/comparison-utils';
+import {console as Console} from 'global/window';
+import {
+ savedConfigV0 as savedConfig0,
+ parsedConfigV0 as parsedConfig0
+} from 'test/fixtures/config_v0_arc_cluster_point';
+
+import {
+ savedConfigV0 as savedConfig1,
+ parsedConfigV0 as parsedConfig1
+} from 'test/fixtures/config_v0_geojson_poly_fill_ele';
+
+import {
+ savedConfigV0 as savedConfig2,
+ parsecConfigV0 as parsedConfig2
+} from 'test/fixtures/config_v0_geojson_point';
+
+import {
+ savedConfigV0 as savedConfig3,
+ parsedConfigV0 as parsecConfig3
+} from 'test/fixtures/config_v0_geojson_polygon';
+
+const TEST_CASES = [
+ {
+ name: 'v0 -> v1',
+ cases: [
+ {
+ name: 'load config with arc cluster point layer',
+ saved: savedConfig0,
+ parsed: parsedConfig0
+ },
+ {
+ name: 'load config with geojson layer',
+ saved: savedConfig1,
+ parsed: parsedConfig1
+ },
+ {
+ name: 'load config with geojson contains points',
+ saved: savedConfig2,
+ parsed: parsedConfig2
+ },
+ {
+ name: 'load config with geojson contains 3d and stroked polygon',
+ saved: savedConfig3,
+ parsed: parsecConfig3
+ }
+ ]
+ }
+];
+
+test('#appSchema -> Convert Saved Configs', t => {
+ TEST_CASES.forEach(({name, cases}) => {
+ Console.log(`---> test: ${name}`);
+
+ cases.forEach(cs => {
+ Console.log(`------> test: ${cs.name}`);
+
+ const parsed = SchemaManager.parseSavedConfig(cs.saved);
+ cmpParsedAppConfigs(t, cs.parsed, parsed, {name: cs.name});
+ });
+ });
+
+ t.end();
+});
diff --git a/test/node/schemas/vis-state-schema-test.js b/test/node/schemas/vis-state-schema-test.js
new file mode 100644
index 000000000..b19729a02
--- /dev/null
+++ b/test/node/schemas/vis-state-schema-test.js
@@ -0,0 +1,166 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import {cmpFilters, cmpSavedLayers} from 'test/helpers/comparison-utils';
+import SchemaManager from 'schemas';
+
+import {StateWFilesFiltersLayerColor,
+ expectedSavedLayer0,
+ expectedLoadedLayer0,
+ expectedSavedLayer1,
+ expectedLoadedLayer1,
+ expectedSavedLayer2,
+ expectedLoadedLayer2
+} from 'test/helpers/mock-state';
+
+test('#visStateSchema -> v1 -> save layers', t => {
+ const initialState = StateWFilesFiltersLayerColor.toJS();
+
+ // save state
+ const vsToSave = SchemaManager.getConfigToSave(initialState).config.visState;
+
+ t.deepEqual(Object.keys(vsToSave),
+ ['filters', 'layers', 'interactionConfig', 'layerBlending', 'splitMaps'],
+ 'visState should have all 5 entries');
+
+ const exptectedSavedLayers = [
+ expectedSavedLayer0,
+ expectedSavedLayer1,
+ expectedSavedLayer2
+ ];
+
+ const layersToSave = vsToSave.layers;
+
+ cmpSavedLayers(t, exptectedSavedLayers, layersToSave);
+ t.end();
+});
+
+test('#visStateSchema -> v1 -> load layers', t => {
+ const initialState = StateWFilesFiltersLayerColor.toJS();
+
+ // save state
+ const savedState = SchemaManager.getConfigToSave(initialState);
+ const vsLoaded = SchemaManager.parseSavedConfig(savedState).visState;
+
+ t.deepEqual(Object.keys(vsLoaded),
+ ['filters', 'layers', 'interactionConfig', 'layerBlending', 'splitMaps'],
+ 'visState should have all 5 entries');
+
+ const loadedLayers = vsLoaded.layers;
+
+ const expectedLoadedLayers = [
+ expectedLoadedLayer0,
+ expectedLoadedLayer1,
+ expectedLoadedLayer2
+ ];
+
+ cmpSavedLayers(t, expectedLoadedLayers, loadedLayers, {id: true});
+ t.end();
+});
+
+test('#visStateSchema -> v1 -> save load filters', t => {
+ const initialState = StateWFilesFiltersLayerColor.toJS();
+ const savedState = SchemaManager.getConfigToSave(initialState);
+
+ // save state
+ const vsToSave = savedState.config.visState;
+ const vsLoaded = SchemaManager.parseSavedConfig(savedState).visState;
+ const loadedFilters = vsLoaded.filters;
+
+ // test saved filters
+ const filtersToSave = vsToSave.filters;
+
+ const expectedSavedFilters = [{
+ dataId: '190vdll3di',
+ id: 'hjpn8frza',
+ name: 'time',
+ type: 'timeRange',
+ value: [1474606800000, 1474617600000],
+ enlarged: true,
+ plotType: 'histogram',
+ yAxis: null
+ }, {
+ dataId: 'ieukmgne',
+ id: 'vpk2466o',
+ name: 'RATE',
+ type: 'multiSelect',
+ value: ['a'],
+ enlarged: false,
+ plotType: 'histogram',
+ yAxis: null
+ }];
+
+ cmpFilters(t, expectedSavedFilters, filtersToSave);
+ cmpFilters(t, expectedSavedFilters, loadedFilters);
+
+ t.end();
+});
+
+test('#visStateSchema -> v1 -> save load interaction', t => {
+ const initialState = StateWFilesFiltersLayerColor.toJS();
+ const savedState = SchemaManager.getConfigToSave(initialState);
+
+ // save state
+ const interactionToSave = savedState.config.visState.interactionConfig;
+ const interactionLoaded = SchemaManager.parseSavedConfig(savedState).visState.interactionConfig;
+
+ const expectedSaved = {
+ tooltip: {
+ enabled: true,
+ fieldsToShow: {
+ '190vdll3di': [
+ 'gps_data.utc_timestamp',
+ 'gps_data.types',
+ 'epoch',
+ 'has_result',
+ 'id'
+ ],
+ ieukmgne: [
+ 'OBJECTID', 'ZIP_CODE', 'ID', 'TRIPS', 'RATE'
+ ]}},
+ brush: {
+ enabled: false,
+ size: 0.5
+ }
+ };
+
+ t.deepEqual(interactionToSave, expectedSaved);
+ t.deepEqual(interactionLoaded, expectedSaved);
+
+ t.end();
+});
+
+test('#visStateSchema -> v1 -> save load layerBlending', t => {
+ const initialState = StateWFilesFiltersLayerColor.toJS();
+ const savedState = SchemaManager.getConfigToSave(initialState);
+
+ // save state
+ const layerBlendingToSave = savedState.config.visState.layerBlending;
+ const layerBlendingLoaded = SchemaManager.parseSavedConfig(savedState).visState.layerBlending;
+
+ const expectedSaved = 'normal';
+
+ t.deepEqual(layerBlendingToSave, expectedSaved);
+ t.deepEqual(layerBlendingLoaded, expectedSaved);
+
+ t.end();
+});
diff --git a/test/node/test-utils/layer-utils.js b/test/node/test-utils/layer-utils.js
new file mode 100644
index 000000000..4dc35f586
--- /dev/null
+++ b/test/node/test-utils/layer-utils.js
@@ -0,0 +1,88 @@
+// Copyright (c) 2018 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.
+
+export function testCreateLayer(t, LayerClass, props = {}) {
+ let layer;
+
+ t.doesNotThrow(() => {
+ layer = new LayerClass(props);
+ t.ok(layer instanceof LayerClass, `${layer.type} layer created`);
+ }, `creating layer should not fail`);
+
+ return layer;
+}
+
+export function testFormatLayerData(t, layer, dataArgs) {
+ let result;
+
+ t.doesNotThrow(() => {
+ 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;
+}
+
+export function testCreateCases(t, LayerClass, testCases) {
+ testCases.forEach(tc => {
+ const layer = testCreateLayer(t, LayerClass, tc.props);
+ if (layer && tc.test) {
+ tc.test(layer);
+ }
+ });
+}
+
+export function testUpdateLayer(t, layer, updateMethod, updateArgs) {
+ let result;
+
+ t.doesNotThrow(() => {
+ result = layer[updateMethod](...updateArgs);
+ t.ok(layer, `layer ${updateMethod} called`);
+ }, 'update layer should not fail');
+
+ return {result, layer};
+}
+
+export function testFormatLayerDataCases(t, LayerClass, testCases) {
+ testCases.forEach(tc => {
+ const layer = testCreateLayer(t, LayerClass, tc.props);
+ let updatedLayer = layer;
+
+ // if provided updates
+ if (layer && 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);
+ updatedLayer = updated.layer;
+ });
+ }
+
+ if (updatedLayer) {
+ const result = testFormatLayerData(t, updatedLayer, tc.data);
+ if (result && tc.test) {
+ tc.test({layerData: result, layer: updatedLayer});
+ }
+ }
+ });
+}
diff --git a/test/node/utils/data-processor-test.js b/test/node/utils/data-processor-test.js
new file mode 100644
index 000000000..40ec2867a
--- /dev/null
+++ b/test/node/utils/data-processor-test.js
@@ -0,0 +1,276 @@
+// Copyright (c) 2018 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 test from 'tape';
+import testData, {dataWithNulls, parsedDataWithNulls, testFields, testAllData, wktCsv, wktCsvFields} from 'test/fixtures/test-csv-data';
+import {geojsonData, fields as geojsonFields, rows as geojsonRows} from 'test/fixtures/geojson';
+
+import {
+ getFieldsFromData,
+ getSampleForTypeAnalyze,
+ parseCsvDataByFieldType,
+ processCsvData,
+ processGeojson
+} from 'processors/data-processor';
+
+import {
+ ALL_FIELD_TYPES
+} from 'constants/default-settings';
+
+test('Processor -> getFieldsFromData', t => {
+ const data = [{
+ time: '2016-09-17 00:09:55',
+ trip_epoch: '1472688000000',
+ time_str: 'January 1st 2017 11:00pm ',
+ value: '4',
+ surge: '1.2',
+ isTrip: 'true'
+ }, {
+ time: '2016-09-17 00:30:08',
+ trip_epoch: '1472860800000',
+ time_str: 'January 1st 2017 11:01pm ',
+ value: '3',
+ surge: null,
+ isTrip: 'false'
+ }, {
+ time: null,
+ trip_epoch: null,
+ time_str: 'January 1st, 2017 11:02pm ',
+ value: '2',
+ surge: '1.3',
+ isTrip: null
+ }, {
+ time: null,
+ trip_epoch: null,
+ time_str: 'January 1st, 2017 11:02pm ',
+ value: '0',
+ surge: '1.4',
+ isTrip: null
+ }];
+
+ const headerRow = Object.keys(data[0]);
+ const fields = getFieldsFromData(data, headerRow);
+ const expectedFieldTypes =
+ ['timestamp', 'timestamp', 'timestamp', 'integer', 'real', 'boolean'];
+
+ fields.forEach((f, i) =>
+ t.equal(f.type, expectedFieldTypes[i],
+ `should find field type as ${expectedFieldTypes[i]}`)
+ );
+ t.end();
+});
+
+test('Processor -> processCsvData', t => {
+
+ // load sample dataset csv as text
+ const {fields, rows} = processCsvData(testData);
+
+ t.equal(rows.length, testAllData.length, `should return ${testAllData.length} rows`);
+
+ t.deepEqual(fields, testFields, 'should parse fields correctly');
+ t.deepEqual(rows, testAllData, 'should parse rows correctly');
+
+ fields.forEach((f, i) => {
+ t.deepEqual(f, testFields[i], `should parse correct field ${testFields[i].name}`);
+ });
+
+ rows.forEach((r, i) => {
+ t.deepEqual(r, testAllData[i], `should parse row ${i} correctly`);
+ });
+
+ t.end();
+});
+
+test('Processor -> processCsvData -> with nulls', t => {
+ const {fields, rows} = processCsvData(dataWithNulls);
+ t.deepEqual(fields, testFields, 'should parse fields correctly');
+
+ fields.forEach((f, i) => {
+ t.deepEqual(f, testFields[i], `should parse correct field ${testFields[i].name}`);
+ });
+
+ t.deepEqual(rows, parsedDataWithNulls, 'should parse rows correctly');
+ rows.forEach((r, i) => {
+ t.deepEqual(r, parsedDataWithNulls[i], `should parse row ${i} correctly`);
+ });
+ t.end();
+});
+
+test('Processor -> processCsv.wkt', t => {
+ const {fields} = processCsvData(wktCsv);
+
+ t.deepEqual(fields, wktCsvFields, 'should find geometry fields as type:geojson');
+
+ t.end();
+});
+
+test('Processor => processGeojson', t => {
+
+ const {fields, rows} = processGeojson(geojsonData);
+
+ t.deepEqual(fields, geojsonFields, 'should format geojson fields');
+ t.deepEqual(rows, geojsonRows, 'should format geojson rows');
+
+ t.end();
+});
+
+
+test('Processor -> parseCsvDataByFieldType -> real', t => {
+
+ const field = {
+ type: ALL_FIELD_TYPES.real
+ };
+
+ const rows = [
+ ['0.0'],
+ ['1.0'],
+ ['-1.0'],
+ ['155.0'],
+ ['1.55e3'],
+ ['1.55e-3'],
+ [' 1.55e-3 '],
+ [' 1.55e+3 xyz']
+ ];
+
+ const expected = [
+ [0.0],
+ [1.0],
+ [-1.0],
+ [155.0],
+ [1550.0],
+ [0.00155],
+ [0.00155],
+ [1550.0]
+ ];
+
+ parseCsvDataByFieldType(rows, field, 0);
+ t.same(rows, expected, 'should parsed reals properly');
+ t.end();
+});
+
+test('Processor -> parseCsvDataByFieldType -> integer', t => {
+
+ const field = {
+ type: ALL_FIELD_TYPES.integer
+ };
+
+ const rows = [
+ ['0'],
+ ['1'],
+ ['-1'],
+ ['155'],
+ [' 155 '],
+ [' 155 xyz']
+ ];
+
+ const expected = [
+ [0],
+ [1],
+ [-1],
+ [155],
+ [155],
+ [155]
+ ];
+
+ parseCsvDataByFieldType(rows, field, 0);
+ t.same(rows, expected, 'should parsed ints properly');
+ t.end();
+});
+
+test('Processor -> parseCsvDataByFieldType -> boolean', t => {
+
+ const field = {
+ type: ALL_FIELD_TYPES.boolean
+ };
+
+ const rows = [
+ [null],
+ ['0'],
+ ['1'],
+ ['True'],
+ ['False'],
+ ['0'],
+ ['1'],
+ ['true']
+ ];
+
+ // is parsing '' meaningful, why not false
+ const expected = [
+ [null],
+ [false],
+ [true],
+ [true],
+ [false],
+ [false],
+ [true],
+ [true]
+ ];
+
+ parseCsvDataByFieldType(rows, field, 0);
+ t.same(rows, expected, 'should parsed boolean properly');
+ t.end();
+});
+
+test('dataUtils -> getSampleForTypeAnalyze', t => {
+ const fields =['string','int','bool','time'];
+
+ const allData = [
+ ['a', 0, true, null],
+ ['b', 2, false, null],
+ ['c', 3, true, '2017-01-01'],
+ [null, 1, false, '2017-01-02'],
+ ['d', 6, false, '2017-01-03'],
+ ['e', 4, true, null],
+ ['f', 5, true, undefined],
+ ['g', null, true, null],
+ ['h', undefined, true, '2017-01-04']
+ ];
+
+ const sample = getSampleForTypeAnalyze({fields, allData, sampleCount: 5});
+ const expected = [{
+ string: 'a',
+ int: 0,
+ bool: true,
+ time: '2017-01-01'
+ }, {
+ string: 'b',
+ int: 2,
+ bool: false,
+ time: '2017-01-02'
+ }, {
+ string: 'c',
+ int: 3,
+ bool: true,
+ time: '2017-01-03'
+ }, {
+ string: 'd',
+ int: 1,
+ bool: false,
+ time: '2017-01-04'
+ }, {
+ string: 'e',
+ int: 6,
+ bool: false,
+ time: null
+ }];
+
+ t.deepEqual(sample, expected, 'Should find correct sample for type analyzer');
+ t.end();
+});
diff --git a/test/node/utils/data-scale-utils-test.js b/test/node/utils/data-scale-utils-test.js
new file mode 100644
index 000000000..fb7e4983f
--- /dev/null
+++ b/test/node/utils/data-scale-utils-test.js
@@ -0,0 +1,94 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {
+ getOrdinalDomain,
+ getQuantileDomain,
+ getLinearDomain
+} from 'utils/data-scale-utils';
+
+function numberSort(a, b) {
+ return a - b;
+}
+
+test('DataScaleUtils -> getOrdinalDomain', t => {
+ t.plan(2);
+
+ const data = ['a', 'a', 'b', undefined, null, 0];
+ function valueAccessor(d) {
+ return d.value;
+ }
+
+ const values = [{value: 'a'}, {value: 'b'}, {value: 'b'}];
+
+ t.deepEqual(getOrdinalDomain(data), ['a', 'b', 0],
+ 'should get correct ordinal domain');
+
+ t.deepEqual(getOrdinalDomain(values, valueAccessor), ['a', 'b'],
+ 'should get correct ordinal domain');
+});
+
+test('DataScaleUtils -> getQuantileDomain', t => {
+ t.plan(3);
+
+ const data = ['a', 'b', 'c', 'b', undefined, null];
+ const quanData = [1, 4, 2, 3, 1, undefined, null, 0];
+ function valueAccessor(d) {
+ return d.value;
+ }
+
+ const values = [{value: 'a'}, {value: 'b'}, {value: 'b'}];
+
+ t.deepEqual(getQuantileDomain(data, undefined, undefined),
+ ['a', 'b', 'b', 'c'], 'should get correct quantile domain');
+
+ t.deepEqual(getQuantileDomain(quanData, undefined, numberSort),
+ [0, 1, 1, 2, 3, 4], 'should get correct quantile domain');
+
+ t.deepEqual(getQuantileDomain(values, valueAccessor), ['a', 'b', 'b'],
+ 'should get correct quantile domain');
+});
+
+test('DataScaleUtils -> getLinearDomain', t => {
+ t.plan(5);
+
+ const quanData = [1, 4, 2, 3, 1, undefined, null, 0];
+ function valueAccessor(d) {
+ return d.value;
+ }
+
+ const values = [{value: 1}, {value: 0}, {value: -3}];
+
+ t.deepEqual(getLinearDomain(quanData, undefined),
+ [0, 4], 'should get correct Linear domain');
+
+ t.deepEqual(getLinearDomain([10, 10]),
+ [10, 10], 'should get correct Linear domain');
+
+ t.deepEqual(getLinearDomain([10, undefined]),
+ [10, 10], 'should get correct Linear domain');
+
+ t.deepEqual(getLinearDomain([undefined, undefined, null]),
+ [0, 1], 'should get correct Linear domain');
+
+ t.deepEqual(getLinearDomain(values, valueAccessor), [-3, 1],
+ 'should get correct Linear domain');
+});
diff --git a/test/node/utils/data-utils-test.js b/test/node/utils/data-utils-test.js
new file mode 100644
index 000000000..c3b326e6c
--- /dev/null
+++ b/test/node/utils/data-utils-test.js
@@ -0,0 +1,80 @@
+// Copyright (c) 2018 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 test from 'tape';
+
+import {
+ getRoundingDecimalFromStep,
+ preciseRound,
+ roundValToStep
+} from 'utils/data-utils';
+
+test('dataUtils -> preciseRound', t => {
+
+ t.equal(preciseRound(1.234, 2), '1.23', 'should round 1.234 correctly');
+ t.equal(preciseRound(13.234, 0), '13', 'should round 13.234 correctly');
+ t.equal(preciseRound(13, 2), '13.00', 'should round 13 correctly');
+ t.equal(preciseRound(1.437, 2), '1.44', 'should round 1.437 correctly');
+ t.equal(preciseRound(0.09999999999999987, 8), '0.10000000',
+ 'should round 0.10000000 correctly');
+ t.end();
+});
+
+test('dataUtils -> getRoundingDecimalFromStep', t => {
+
+ t.equal(getRoundingDecimalFromStep(1), 0, 'decimal of step=int should be 0');
+ t.equal(getRoundingDecimalFromStep(0.1), 1,
+ 'decimal of step=0.1 should be 1');
+ t.equal(getRoundingDecimalFromStep(0.01), 2,
+ 'decimal of step=0.01 should be 2');
+ t.equal(getRoundingDecimalFromStep(0.2), 1,
+ 'decimal of step=0.2 should be 1');
+ t.equal(getRoundingDecimalFromStep(0.001), 3,
+ 'decimal of step=0.001 should be 3');
+ t.equal(getRoundingDecimalFromStep(10), 0,
+ 'decimal of step=10 should be 0');
+ t.equal(getRoundingDecimalFromStep(0.5), 1,
+ 'decimal of step=0.5 should be 0');
+ t.equal(getRoundingDecimalFromStep(1.5), 1,
+ 'decimal of step=1.5 should be 1');
+ t.end();
+
+});
+
+test('dataUtils -> getRoundingDecimalFromStep', t => {
+
+ t.equal(roundValToStep(0, 0.1, 0.11), 0.1, 'should round 0.11 to 0.1');
+ t.equal(roundValToStep(0, 0.1, 0.1), 0.1, 'should round 0.1 to 0.1');
+ t.equal(roundValToStep(1, 0.1, 1.16), 1.2, 'should round 1.16 to 1.2');
+ t.equal(roundValToStep(1, 1, 1.6), 2, 'should round 1.6 to 2');
+ t.equal(roundValToStep(1, 1, 1.32), 1, 'should round 1.32 to 1');
+ t.equal(roundValToStep(1, 0.01, 1.435), 1.44, 'should round 1.435 to 1.44');
+ t.equal(roundValToStep(1, 0.001, 1.4357), 1.436,
+ 'should round 1.4357 to 1.436');
+ t.equal(roundValToStep(0, 0.2, 1.5), 1.6, 'should round 1.5 to 1.6');
+ t.equal(roundValToStep(0, 0.5, 20.25), 20.5, 'should round 20.25 to 20.5');
+ t.equal(roundValToStep(0.3, 0.3, 12.77), 12.9, 'should round 12.77 to 12.9');
+ t.equal(roundValToStep(-13, 0.1, -10.77), -10.8,
+ 'should round -10.77 to -10.8');
+ t.equal(roundValToStep(-30, 1, -14.5), -14,
+ 'should round -14.5 to -14');
+ t.end();
+
+});
diff --git a/test/node/utils/filter-utils-test.js b/test/node/utils/filter-utils-test.js
new file mode 100644
index 000000000..274d79d70
--- /dev/null
+++ b/test/node/utils/filter-utils-test.js
@@ -0,0 +1,672 @@
+// Copyright (c) 2018 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 test from 'tape';
+import moment from 'moment';
+import testData, {testFields} from 'test/fixtures/test-csv-data';
+
+import {
+ FILTER_TYPES,
+ adjustValueToFilterDomain,
+ isDataMatchFilter,
+ getFieldDomain,
+ getTimestampFieldDomain,
+ getDefaultfilter
+} from 'utils/filter-utils';
+
+import {processCsvData} from 'processors/data-processor';
+
+/* eslint-disable max-statements */
+test('filterUtils -> adjustValueToFilterDomain', t => {
+ // TODO: needs id
+ const rangeFilter = getDefaultfilter();
+ rangeFilter.type = FILTER_TYPES.range;
+ rangeFilter.domain = [0, 1];
+
+ t.deepEqual(
+ adjustValueToFilterDomain([0, 0.5], rangeFilter),
+ [0, 0.5],
+ 'should return value matched to range filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain([-1, 0.5], rangeFilter),
+ [0, 0.5],
+ 'should return value adjust to range filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain([0.1, 1.5], rangeFilter),
+ [0.1, 1],
+ 'should return value adjust to range filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain([1.1, 2], rangeFilter),
+ [0, 1],
+ 'should return value adjust to range filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain(null, rangeFilter),
+ [0, 1],
+ 'should return value adjust to range filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain([undefined, 0.5], rangeFilter),
+ [0, 0.5],
+ 'should return value adjust to range filter'
+ );
+
+ // TODO needs id
+ const multiSelectFilter = getDefaultfilter();
+ multiSelectFilter.type = FILTER_TYPES.multiSelect;
+ multiSelectFilter.domain = ['a', 'b', 'c'];
+
+ t.deepEqual(
+ adjustValueToFilterDomain(['a', 'b'], multiSelectFilter),
+ ['a', 'b'],
+ 'should return value matched to multiSelect filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain(['a', 'b', 'd'], multiSelectFilter),
+ ['a', 'b'],
+ 'should return value matched to multiSelect filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain(['a', 'b', null], multiSelectFilter),
+ ['a', 'b'],
+ 'should return value matched to multiSelect filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain(null, multiSelectFilter),
+ [],
+ 'should return [] if nothing matched to multiSelect filter'
+ );
+
+ t.deepEqual(
+ adjustValueToFilterDomain([1, 2], multiSelectFilter),
+ [],
+ 'should return [] if nothing matched to multiSelect filter'
+ );
+
+ // TODO needs id
+ const selectFilter = getDefaultfilter();
+ selectFilter.type = FILTER_TYPES.select;
+ selectFilter.domain = ['a', 'b', 'c'];
+
+ t.equal(
+ adjustValueToFilterDomain('a', selectFilter),
+ 'a',
+ 'should return value matched to select filter'
+ );
+
+ t.equal(
+ adjustValueToFilterDomain(['a', 'b'], selectFilter),
+ true,
+ 'should return true if nothing matched to select filter'
+ );
+
+ t.equal(
+ adjustValueToFilterDomain(null, selectFilter),
+ true,
+ 'should return true if nothing matched to select filter'
+ );
+
+ t.end();
+});
+
+test('filterUtils -> getFieldDomain.time', async t => {
+ const data = testData;
+ const expectedFields = testFields;
+
+ const {fields, rows} = await processCsvData(data);
+
+ t.deepEqual(fields, expectedFields, 'should get corrent field type');
+ testGetTimeFieldDomain(rows, fields, t);
+ testIsTimeDataMatchFilter(rows, t);
+
+ t.end();
+});
+
+function testGetTimeFieldDomain(rows, allFields, t) {
+ const test_cases = [
+ {
+ name: 'default',
+ input: getFieldDomain(rows, allFields[0]).domain,
+ output: [
+ moment.utc('2016-09-17 00:09:55').valueOf(),
+ moment.utc('2016-09-17 00:30:08').valueOf()
+ ],
+ msg: '2016-09-17 00:30:08'
+ },
+ {
+ name: 'epoch',
+ input: getFieldDomain(rows, allFields[4]).domain,
+ output: [
+ moment.utc(1472688000000).valueOf(),
+ moment.utc(1472774400000).valueOf()
+ ],
+ msg: 1472688000000
+ },
+ {
+ name: 'T',
+ input: getFieldDomain(rows, allFields[7]).domain,
+ output: [
+ moment.utc('2016-09-23T00:00:00.000Z').valueOf(),
+ moment.utc('2016-09-23T08:00:00.000Z').valueOf()
+ ],
+ msg: '2016-09-23T00:00:00.000Z'
+ },
+ {
+ name: 'UTC',
+ input: getFieldDomain(rows, allFields[8]).domain,
+ output: [
+ moment.utc('2016-10-01 09:41:39+00:00').valueOf(),
+ moment.utc('2016-10-01 10:01:54+00:00').valueOf()
+ ],
+ msg: '2016-10-01 09:41:39+00:00'
+ },
+ {
+ name: 'local',
+ input: getFieldDomain(rows, allFields[9]).domain,
+ output: [
+ moment.utc('2016-10-01 09:41:39+00:00').valueOf(),
+ moment.utc('2016-10-01 17:01:54+00:00').valueOf()
+ ],
+ msg: '2016-10-01 09:41:39+00:00'
+ }
+ ];
+
+ test_cases.forEach(tc =>
+ t.deepEqual(
+ tc.input,
+ tc.output,
+ `should process correct domian for timestamp ${tc.msg}`
+ )
+ );
+}
+
+function testIsTimeDataMatchFilter(rows, t) {
+ const timeStringFilter = {
+ fieldIdx: 0,
+ type: FILTER_TYPES.timeRange,
+ value: [
+ moment.utc('2016-09-17 00:09:55').valueOf(),
+ moment.utc('2016-09-17 00:20:08').valueOf()
+ ]
+ };
+
+ t.equal(
+ isDataMatchFilter(rows[10], timeStringFilter),
+ true,
+ `${rows[10][0]} should be inside the range`
+ );
+
+ t.equal(
+ isDataMatchFilter(rows[15], timeStringFilter),
+ false,
+ `${rows[15][0]} should be outside the range`
+ );
+
+ const epochFilter = {
+ fieldIdx: 4,
+ type: FILTER_TYPES.timeRange,
+ value: [
+ moment.utc(1472688000000).valueOf(),
+ moment.utc(1472734400000).valueOf()
+ ]
+ };
+
+ t.equal(
+ isDataMatchFilter(rows[10], epochFilter),
+ true,
+ `${rows[10][1]} should be inside the range`
+ );
+
+ t.equal(
+ isDataMatchFilter(rows[15], epochFilter),
+ false,
+ `${rows[15][1]} should be outside the range`
+ );
+
+ const tzFilter = {
+ fieldIdx: 7,
+ type: FILTER_TYPES.timeRange,
+ value: [
+ moment.utc('2016-09-23T00:00:00.000Z').valueOf(),
+ moment.utc('2016-09-23T06:00:00.000Z').valueOf()
+ ]
+ };
+
+ t.equal(
+ isDataMatchFilter(rows[10], tzFilter),
+ true,
+ `${rows[10][7]} should be inside the range`
+ );
+
+ t.equal(
+ isDataMatchFilter(rows[23], tzFilter),
+ false,
+ `${rows[23][7]} should be outside the range`
+ );
+
+ const utcFilter = {
+ fieldIdx: 8,
+ type: FILTER_TYPES.timeRange,
+ value: [
+ moment.utc('2016-10-01 09:45:39+00:00').valueOf(),
+ moment.utc('2016-10-01 10:00:00+00:00').valueOf()
+ ]
+ };
+
+ t.equal(
+ isDataMatchFilter(rows[6], utcFilter),
+ false,
+ `${rows[0][8]} should be outside the range`
+ );
+
+ t.equal(
+ isDataMatchFilter(rows[4], utcFilter),
+ true,
+ `${rows[4][8]} should be inside the range`
+ );
+
+ t.equal(
+ isDataMatchFilter(rows[23], utcFilter),
+ false,
+ `${rows[23][8]} should be outside the range`
+ );
+}
+
+test('filterUtils -> getTimestampFieldDomain', t => {
+ /* eslint-disable func-style */
+ const valueAccessor = d => moment.utc(d).valueOf();
+ /* eslint-enable func-style */
+
+ const timeData = {
+ no: {
+ input: 0.5,
+ expect: {
+ domain: [0, 1],
+ step: 0.05,
+ histogram: [
+ {count: 0, x0: 0, x1: 0.05},
+ {count: 0, x0: 0.05, x1: 0.1},
+ {count: 0, x0: 0.1, x1: 0.15},
+ {count: 0, x0: 0.15, x1: 0.2},
+ {count: 0, x0: 0.2, x1: 0.25},
+ {count: 0, x0: 0.25, x1: 0.3},
+ {count: 0, x0: 0.3, x1: 0.35},
+ {count: 0, x0: 0.35, x1: 0.4},
+ {count: 0, x0: 0.4, x1: 0.45},
+ {count: 0, x0: 0.45, x1: 0.5},
+ {count: 0, x0: 0.5, x1: 0.55},
+ {count: 0, x0: 0.55, x1: 0.6},
+ {count: 0, x0: 0.6, x1: 0.65},
+ {count: 0, x0: 0.65, x1: 0.7},
+ {count: 0, x0: 0.7, x1: 0.75},
+ {count: 0, x0: 0.75, x1: 0.8},
+ {count: 0, x0: 0.8, x1: 0.85},
+ {count: 0, x0: 0.85, x1: 0.9},
+ {count: 0, x0: 0.9, x1: 0.95},
+ {count: 0, x0: 0.95, x1: 1},
+ {count: 0, x0: 1, x1: 1}
+ ],
+ enlargedHistogram: [
+ {count: 0, x0: 0, x1: 0.01},
+ {count: 0, x0: 0.01, x1: 0.02},
+ {count: 0, x0: 0.02, x1: 0.03},
+ {count: 0, x0: 0.03, x1: 0.04},
+ {count: 0, x0: 0.04, x1: 0.05},
+ {count: 0, x0: 0.05, x1: 0.06},
+ {count: 0, x0: 0.06, x1: 0.07},
+ {count: 0, x0: 0.07, x1: 0.08},
+ {count: 0, x0: 0.08, x1: 0.09},
+ {count: 0, x0: 0.09, x1: 0.1},
+ {count: 0, x0: 0.1, x1: 0.11},
+ {count: 0, x0: 0.11, x1: 0.12},
+ {count: 0, x0: 0.12, x1: 0.13},
+ {count: 0, x0: 0.13, x1: 0.14},
+ {count: 0, x0: 0.14, x1: 0.15},
+ {count: 0, x0: 0.15, x1: 0.16},
+ {count: 0, x0: 0.16, x1: 0.17},
+ {count: 0, x0: 0.17, x1: 0.18},
+ {count: 0, x0: 0.18, x1: 0.19},
+ {count: 0, x0: 0.19, x1: 0.2},
+ {count: 0, x0: 0.2, x1: 0.21},
+ {count: 0, x0: 0.21, x1: 0.22},
+ {count: 0, x0: 0.22, x1: 0.23},
+ {count: 0, x0: 0.23, x1: 0.24},
+ {count: 0, x0: 0.24, x1: 0.25},
+ {count: 0, x0: 0.25, x1: 0.26},
+ {count: 0, x0: 0.26, x1: 0.27},
+ {count: 0, x0: 0.27, x1: 0.28},
+ {count: 0, x0: 0.28, x1: 0.29},
+ {count: 0, x0: 0.29, x1: 0.3},
+ {count: 0, x0: 0.3, x1: 0.31},
+ {count: 0, x0: 0.31, x1: 0.32},
+ {count: 0, x0: 0.32, x1: 0.33},
+ {count: 0, x0: 0.33, x1: 0.34},
+ {count: 0, x0: 0.34, x1: 0.35},
+ {count: 0, x0: 0.35, x1: 0.36},
+ {count: 0, x0: 0.36, x1: 0.37},
+ {count: 0, x0: 0.37, x1: 0.38},
+ {count: 0, x0: 0.38, x1: 0.39},
+ {count: 0, x0: 0.39, x1: 0.4},
+ {count: 0, x0: 0.4, x1: 0.41},
+ {count: 0, x0: 0.41, x1: 0.42},
+ {count: 0, x0: 0.42, x1: 0.43},
+ {count: 0, x0: 0.43, x1: 0.44},
+ {count: 0, x0: 0.44, x1: 0.45},
+ {count: 0, x0: 0.45, x1: 0.46},
+ {count: 0, x0: 0.46, x1: 0.47},
+ {count: 0, x0: 0.47, x1: 0.48},
+ {count: 0, x0: 0.48, x1: 0.49},
+ {count: 0, x0: 0.49, x1: 0.5},
+ {count: 0, x0: 0.5, x1: 0.51},
+ {count: 0, x0: 0.51, x1: 0.52},
+ {count: 0, x0: 0.52, x1: 0.53},
+ {count: 0, x0: 0.53, x1: 0.54},
+ {count: 0, x0: 0.54, x1: 0.55},
+ {count: 0, x0: 0.55, x1: 0.56},
+ {count: 0, x0: 0.56, x1: 0.57},
+ {count: 0, x0: 0.57, x1: 0.58},
+ {count: 0, x0: 0.58, x1: 0.59},
+ {count: 0, x0: 0.59, x1: 0.6},
+ {count: 0, x0: 0.6, x1: 0.61},
+ {count: 0, x0: 0.61, x1: 0.62},
+ {count: 0, x0: 0.62, x1: 0.63},
+ {count: 0, x0: 0.63, x1: 0.64},
+ {count: 0, x0: 0.64, x1: 0.65},
+ {count: 0, x0: 0.65, x1: 0.66},
+ {count: 0, x0: 0.66, x1: 0.67},
+ {count: 0, x0: 0.67, x1: 0.68},
+ {count: 0, x0: 0.68, x1: 0.69},
+ {count: 0, x0: 0.69, x1: 0.7},
+ {count: 0, x0: 0.7, x1: 0.71},
+ {count: 0, x0: 0.71, x1: 0.72},
+ {count: 0, x0: 0.72, x1: 0.73},
+ {count: 0, x0: 0.73, x1: 0.74},
+ {count: 0, x0: 0.74, x1: 0.75},
+ {count: 0, x0: 0.75, x1: 0.76},
+ {count: 0, x0: 0.76, x1: 0.77},
+ {count: 0, x0: 0.77, x1: 0.78},
+ {count: 0, x0: 0.78, x1: 0.79},
+ {count: 0, x0: 0.79, x1: 0.8},
+ {count: 0, x0: 0.8, x1: 0.81},
+ {count: 0, x0: 0.81, x1: 0.82},
+ {count: 0, x0: 0.82, x1: 0.83},
+ {count: 0, x0: 0.83, x1: 0.84},
+ {count: 0, x0: 0.84, x1: 0.85},
+ {count: 0, x0: 0.85, x1: 0.86},
+ {count: 0, x0: 0.86, x1: 0.87},
+ {count: 0, x0: 0.87, x1: 0.88},
+ {count: 0, x0: 0.88, x1: 0.89},
+ {count: 0, x0: 0.89, x1: 0.9},
+ {count: 0, x0: 0.9, x1: 0.91},
+ {count: 0, x0: 0.91, x1: 0.92},
+ {count: 0, x0: 0.92, x1: 0.93},
+ {count: 0, x0: 0.93, x1: 0.94},
+ {count: 0, x0: 0.94, x1: 0.95},
+ {count: 0, x0: 0.95, x1: 0.96},
+ {count: 0, x0: 0.96, x1: 0.97},
+ {count: 0, x0: 0.97, x1: 0.98},
+ {count: 0, x0: 0.98, x1: 0.99},
+ {count: 0, x0: 0.99, x1: 1},
+ {count: 0, x0: 1, x1: 1}
+ ],
+ mappedValue: []
+ }
+ },
+ zero: {
+ input: ['2016-10-01 09:45:39', '2016-10-01 09:45:39'],
+ expect: {
+ domain: [1475315139000, 1475315139000],
+ mappedValue: [1475315139000, 1475315139000],
+ histogram: [{count: 2, x0: 1475315139000, x1: 1475315139000}],
+ enlargedHistogram: [{count: 2, x0: 1475315139000, x1: 1475315139000}],
+ step: 0.05
+ }
+ },
+ tiny: {
+ input: [
+ '2016-10-01 09:45:39.001',
+ '2016-10-01 09:45:39.002',
+ '2016-10-01 09:45:39.003'
+ ],
+ expect: {
+ domain: [1475315139001, 1475315139003],
+ mappedValue: [1475315139001, 1475315139002, 1475315139003],
+ histogram: [
+ {count: 1, x0: 1475315139000, x1: 1475315139200},
+ {count: 0, x0: 1475315139200, x1: 1475315139400},
+ {count: 0, x0: 1475315139400, x1: 1475315139600},
+ {count: 0, x0: 1475315139600, x1: 1475315139800},
+ {count: 0, x0: 1475315139800, x1: 1475315140000},
+ {count: 0, x0: 1475315140000, x1: 1475315140200},
+ {count: 0, x0: 1475315140200, x1: 1475315140400},
+ {count: 0, x0: 1475315140400, x1: 1475315140600},
+ {count: 0, x0: 1475315140600, x1: 1475315140800},
+ {count: 0, x0: 1475315140800, x1: 1475315141000},
+ {count: 0, x0: 1475315141000, x1: 1475315141200},
+ {count: 0, x0: 1475315141200, x1: 1475315141400},
+ {count: 0, x0: 1475315141400, x1: 1475315141600},
+ {count: 0, x0: 1475315141600, x1: 1475315141800},
+ {count: 0, x0: 1475315141800, x1: 1475315142000},
+ {count: 0, x0: 1475315142000, x1: 1475315142200},
+ {count: 0, x0: 1475315142200, x1: 1475315142400},
+ {count: 0, x0: 1475315142400, x1: 1475315142600},
+ {count: 0, x0: 1475315142600, x1: 1475315142800},
+ {count: 0, x0: 1475315142800, x1: 1475315143000},
+ {count: 0, x0: 1475315143000, x1: 1475315143200},
+ {count: 0, x0: 1475315143200, x1: 1475315143400},
+ {count: 0, x0: 1475315143400, x1: 1475315143600},
+ {count: 0, x0: 1475315143600, x1: 1475315143800},
+ {count: 0, x0: 1475315143800, x1: 1475315144000},
+ {count: 0, x0: 1475315144000, x1: 1475315144200},
+ {count: 0, x0: 1475315144200, x1: 1475315144400},
+ {count: 0, x0: 1475315144400, x1: 1475315144600},
+ {count: 0, x0: 1475315144600, x1: 1475315144800},
+ {count: 0, x0: 1475315144800, x1: 1475315145000},
+ {count: 1, x0: 1475315145000, x1: 1475315145000}
+ ],
+ enlargedHistogram: [
+ {count: 1, x0: 1475315139001, x1: 1475315139001.02},
+ {count: 0, x0: 1475315139001.02, x1: 1475315139001.04},
+ {count: 0, x0: 1475315139001.04, x1: 1475315139001.06},
+ {count: 0, x0: 1475315139001.06, x1: 1475315139001.08},
+ {count: 0, x0: 1475315139001.08, x1: 1475315139001.1},
+ {count: 0, x0: 1475315139001.1, x1: 1475315139001.12},
+ {count: 0, x0: 1475315139001.12, x1: 1475315139001.14},
+ {count: 0, x0: 1475315139001.14, x1: 1475315139001.16},
+ {count: 0, x0: 1475315139001.16, x1: 1475315139001.18},
+ {count: 0, x0: 1475315139001.18, x1: 1475315139001.2},
+ {count: 0, x0: 1475315139001.2, x1: 1475315139001.22},
+ {count: 0, x0: 1475315139001.22, x1: 1475315139001.24},
+ {count: 0, x0: 1475315139001.24, x1: 1475315139001.26},
+ {count: 0, x0: 1475315139001.26, x1: 1475315139001.28},
+ {count: 0, x0: 1475315139001.28, x1: 1475315139001.3},
+ {count: 0, x0: 1475315139001.3, x1: 1475315139001.32},
+ {count: 0, x0: 1475315139001.32, x1: 1475315139001.34},
+ {count: 0, x0: 1475315139001.34, x1: 1475315139001.36},
+ {count: 0, x0: 1475315139001.36, x1: 1475315139001.38},
+ {count: 0, x0: 1475315139001.38, x1: 1475315139001.4},
+ {count: 0, x0: 1475315139001.4, x1: 1475315139001.42},
+ {count: 0, x0: 1475315139001.42, x1: 1475315139001.44},
+ {count: 0, x0: 1475315139001.44, x1: 1475315139001.46},
+ {count: 0, x0: 1475315139001.46, x1: 1475315139001.48},
+ {count: 0, x0: 1475315139001.48, x1: 1475315139001.5},
+ {count: 0, x0: 1475315139001.5, x1: 1475315139001.52},
+ {count: 0, x0: 1475315139001.52, x1: 1475315139001.54},
+ {count: 0, x0: 1475315139001.54, x1: 1475315139001.56},
+ {count: 0, x0: 1475315139001.56, x1: 1475315139001.58},
+ {count: 0, x0: 1475315139001.58, x1: 1475315139001.6},
+ {count: 0, x0: 1475315139001.6, x1: 1475315139001.62},
+ {count: 0, x0: 1475315139001.62, x1: 1475315139001.64},
+ {count: 0, x0: 1475315139001.64, x1: 1475315139001.66},
+ {count: 0, x0: 1475315139001.66, x1: 1475315139001.68},
+ {count: 0, x0: 1475315139001.68, x1: 1475315139001.7},
+ {count: 0, x0: 1475315139001.7, x1: 1475315139001.72},
+ {count: 0, x0: 1475315139001.72, x1: 1475315139001.74},
+ {count: 0, x0: 1475315139001.74, x1: 1475315139001.76},
+ {count: 0, x0: 1475315139001.76, x1: 1475315139001.78},
+ {count: 0, x0: 1475315139001.78, x1: 1475315139001.8},
+ {count: 0, x0: 1475315139001.8, x1: 1475315139001.82},
+ {count: 0, x0: 1475315139001.82, x1: 1475315139001.84},
+ {count: 0, x0: 1475315139001.84, x1: 1475315139001.86},
+ {count: 0, x0: 1475315139001.86, x1: 1475315139001.88},
+ {count: 0, x0: 1475315139001.88, x1: 1475315139001.9},
+ {count: 0, x0: 1475315139001.9, x1: 1475315139001.92},
+ {count: 0, x0: 1475315139001.92, x1: 1475315139001.94},
+ {count: 0, x0: 1475315139001.94, x1: 1475315139001.96},
+ {count: 0, x0: 1475315139001.96, x1: 1475315139001.98},
+ {count: 0, x0: 1475315139001.98, x1: 1475315139002},
+ {count: 1, x0: 1475315139002, x1: 1475315139002.02},
+ {count: 0, x0: 1475315139002.02, x1: 1475315139002.04},
+ {count: 0, x0: 1475315139002.04, x1: 1475315139002.06},
+ {count: 0, x0: 1475315139002.06, x1: 1475315139002.08},
+ {count: 0, x0: 1475315139002.08, x1: 1475315139002.1},
+ {count: 0, x0: 1475315139002.1, x1: 1475315139002.12},
+ {count: 0, x0: 1475315139002.12, x1: 1475315139002.14},
+ {count: 0, x0: 1475315139002.14, x1: 1475315139002.16},
+ {count: 0, x0: 1475315139002.16, x1: 1475315139002.18},
+ {count: 0, x0: 1475315139002.18, x1: 1475315139002.2},
+ {count: 0, x0: 1475315139002.2, x1: 1475315139002.22},
+ {count: 0, x0: 1475315139002.22, x1: 1475315139002.24},
+ {count: 0, x0: 1475315139002.24, x1: 1475315139002.26},
+ {count: 0, x0: 1475315139002.26, x1: 1475315139002.28},
+ {count: 0, x0: 1475315139002.28, x1: 1475315139002.3},
+ {count: 0, x0: 1475315139002.3, x1: 1475315139002.32},
+ {count: 0, x0: 1475315139002.32, x1: 1475315139002.34},
+ {count: 0, x0: 1475315139002.34, x1: 1475315139002.36},
+ {count: 0, x0: 1475315139002.36, x1: 1475315139002.38},
+ {count: 0, x0: 1475315139002.38, x1: 1475315139002.4},
+ {count: 0, x0: 1475315139002.4, x1: 1475315139002.42},
+ {count: 0, x0: 1475315139002.42, x1: 1475315139002.44},
+ {count: 0, x0: 1475315139002.44, x1: 1475315139002.46},
+ {count: 0, x0: 1475315139002.46, x1: 1475315139002.48},
+ {count: 0, x0: 1475315139002.48, x1: 1475315139002.5},
+ {count: 0, x0: 1475315139002.5, x1: 1475315139002.52},
+ {count: 0, x0: 1475315139002.52, x1: 1475315139002.54},
+ {count: 0, x0: 1475315139002.54, x1: 1475315139002.56},
+ {count: 0, x0: 1475315139002.56, x1: 1475315139002.58},
+ {count: 0, x0: 1475315139002.58, x1: 1475315139002.6},
+ {count: 0, x0: 1475315139002.6, x1: 1475315139002.62},
+ {count: 0, x0: 1475315139002.62, x1: 1475315139002.64},
+ {count: 0, x0: 1475315139002.64, x1: 1475315139002.66},
+ {count: 0, x0: 1475315139002.66, x1: 1475315139002.68},
+ {count: 0, x0: 1475315139002.68, x1: 1475315139002.7},
+ {count: 0, x0: 1475315139002.7, x1: 1475315139002.72},
+ {count: 0, x0: 1475315139002.72, x1: 1475315139002.74},
+ {count: 0, x0: 1475315139002.74, x1: 1475315139002.76},
+ {count: 0, x0: 1475315139002.76, x1: 1475315139002.78},
+ {count: 0, x0: 1475315139002.78, x1: 1475315139002.8},
+ {count: 0, x0: 1475315139002.8, x1: 1475315139002.82},
+ {count: 0, x0: 1475315139002.82, x1: 1475315139002.84},
+ {count: 0, x0: 1475315139002.84, x1: 1475315139002.86},
+ {count: 0, x0: 1475315139002.86, x1: 1475315139002.88},
+ {count: 0, x0: 1475315139002.88, x1: 1475315139002.9},
+ {count: 0, x0: 1475315139002.9, x1: 1475315139002.92},
+ {count: 0, x0: 1475315139002.92, x1: 1475315139002.94},
+ {count: 0, x0: 1475315139002.94, x1: 1475315139002.96},
+ {count: 0, x0: 1475315139002.96, x1: 1475315139002.98},
+ {count: 0, x0: 1475315139002.98, x1: 1475315139003},
+ {count: 1, x0: 1475315139003, x1: 1475315139003}
+ ],
+ step: 0.1
+ }
+ },
+ small: {
+ input: [
+ '2016-10-01 09:45:39.010',
+ '2016-10-01 09:45:39.020',
+ '2016-10-01 09:45:39.030'
+ ],
+ expect: {
+ domain: [1475315139010, 1475315139030],
+ mappedValue: [1475315139010, 1475315139020, 1475315139030],
+ histogram: [],
+ enlargedHistogram: [],
+ step: 1
+ }
+ },
+ medium: {
+ input: [
+ '2016-10-01 09:45:39.100',
+ '2016-10-01 09:45:39.200',
+ '2016-10-01 09:45:39.300'
+ ],
+ expect: {
+ domain: [1475315139100, 1475315139300],
+ mappedValue: [1475315139100, 1475315139200, 1475315139300],
+ histogram: [],
+ enlargedHistogram: [],
+ step: 5
+ }
+ },
+ large: {
+ input: ['2016-10-01 09:45:39', '2016-10-01 09:45:45'],
+ expect: {
+ domain: [1475315139000, 1475315145000],
+ mappedValue: [1475315139000, 1475315145000],
+ histogram: [],
+ enlargedHistogram: [],
+ step: 1000
+ }
+ }
+ };
+
+ Object.keys(timeData).forEach(key => {
+ const tsFieldDomain = getTimestampFieldDomain(
+ timeData[key].input,
+ valueAccessor
+ );
+ t.deepEqual(
+ Object.keys(tsFieldDomain).sort(),
+ Object.keys(timeData[key].expect).sort(),
+ 'Should domain should have same keys'
+ );
+
+ Object.keys(timeData[key].expect).forEach(k => {
+
+ // histogram is created by d3, only need to test they exist
+ if (k === 'histogram' || k === 'enlargedHistogram') {
+ t.ok(
+ tsFieldDomain[k].length,
+ `should create ${k}`
+ );
+ } else {
+ t.deepEqual(
+ tsFieldDomain[k],
+ timeData[key].expect[k],
+ `time domain ${k} should be the same`
+ );
+ }
+ });
+ });
+
+ t.end();
+});
+/* eslint-enable max-statements */
diff --git a/test/node/utils/interaction-utils-test.js b/test/node/utils/interaction-utils-test.js
new file mode 100644
index 000000000..f1640d46c
--- /dev/null
+++ b/test/node/utils/interaction-utils-test.js
@@ -0,0 +1,101 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {findFieldsToShow} from 'utils/interaction-utils';
+import {DEFAULT_TOOLTIP_FIELDS} from 'constants/default-settings';
+
+const fields = [
+ {
+ name: 'lat'
+ },
+ {
+ name: '_lat'
+ },
+ {
+ name: 'se.longitude'
+ },
+ {
+ name: 'p longitude'
+ },
+ {
+ name: 'hex_id'
+ },
+ {
+ name: 'all_points',
+ type: 'geojson'
+ },
+ {
+ name: 'a'
+ },
+ {
+ name: 'b'
+ },
+ {
+ name: 'c'
+ },
+ {
+ name: 'd'
+ },
+ {
+ name: 'e'
+ },
+ {
+ name: 'f'
+ }
+];
+
+test('interactionUtil -> findFieldsToShow', t => {
+ const dataId = 'random_stuff';
+
+ const someFields = [
+ ...DEFAULT_TOOLTIP_FIELDS.slice(0, 2).map(d => ({name: d})),
+ ...[
+ {
+ name: 'random'
+ },
+ {
+ name: 'something_else'
+ }
+ ]
+ ];
+
+ const expectedFields = ['random', 'something_else'];
+
+ t.deepEqual(
+ findFieldsToShow({fields: someFields, id: dataId}),
+ {random_stuff: expectedFields},
+ 'should find 2 default trip layers'
+ );
+
+ t.end();
+});
+
+test('interactionUtil -> autoFindTooltipFields', t => {
+ const expectedFields = {test: ['hex_id', 'a', 'b', 'c', 'd']};
+
+ t.deepEqual(
+ findFieldsToShow({fields, id: 'test'}),
+ expectedFields,
+ 'should filter out all default geometry fields and return first 5'
+ );
+
+ t.end();
+});
diff --git a/test/node/utils/layer-utils-test.js b/test/node/utils/layer-utils-test.js
new file mode 100644
index 000000000..a25fd23ba
--- /dev/null
+++ b/test/node/utils/layer-utils-test.js
@@ -0,0 +1,614 @@
+// Copyright (c) 2018 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 test from 'tape';
+import {findDefaultLayer} from 'utils/layer-utils/layer-utils';
+
+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;
+
+import {wktCsv} from 'test/fixtures/test-csv-data';
+import {cmpLayers} from 'test/helpers/comparison-utils';
+
+test('layerUtils -> findDefaultLayer.1', t => {
+ const inputFields = [
+ // layer 1
+ {
+ name: 'one_lat',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'one_lng',
+ tableFieldIndex: 2
+ },
+ // layer 2
+ {
+ name: 'two_two.lng',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'two_two.lat',
+ tableFieldIndex: 4
+ },
+ // layer 3
+ {
+ name: 'three longitude',
+ tableFieldIndex: 5
+ },
+ {
+ name: 'three latitude',
+ tableFieldIndex: 6
+ },
+ // layer 4
+ {
+ name: 'four._.lon',
+ tableFieldIndex: 7
+ },
+ {
+ name: 'four._.lat',
+ tableFieldIndex: 8
+ },
+ // layer 5
+ {
+ name: 'lat',
+ tableFieldIndex: 9
+ },
+ {
+ name: 'lon',
+ tableFieldIndex: 10
+ },
+ // non layer
+ //
+ {
+ name: 'non_layer_longitude.alt',
+ tableFieldIndex: 11
+ },
+ {
+ name: 'non_layer_latitude.alt',
+ tableFieldIndex: 12
+ }
+ ];
+
+ const dataId = 'testtest';
+
+ const outputLayers = [
+ new PointLayer({
+ label: 'one',
+ dataId,
+ isVisible: true,
+ columns: {
+ lat: {
+ value: 'one_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'one_lng',
+ fieldIdx: 1
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new PointLayer({
+ label: 'two two',
+ dataId,
+ columns: {
+ lat: {
+ value: 'two_two.lat',
+ fieldIdx: 3
+ },
+ lng: {
+ value: 'two_two.lng',
+ fieldIdx: 2
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new PointLayer({
+ label: 'three',
+ dataId,
+ columns: {
+ lat: {
+ value: 'three latitude',
+ fieldIdx: 5
+ },
+ lng: {
+ value: 'three longitude',
+ fieldIdx: 4
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new PointLayer({
+ label: 'four',
+ dataId,
+ columns: {
+ lat: {
+ value: 'four._.lat',
+ fieldIdx: 7
+ },
+ lng: {
+ value: 'four._.lon',
+ fieldIdx: 6
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new PointLayer({
+ label: 'Point',
+ dataId,
+ columns: {
+ lat: {
+ value: 'lat',
+ fieldIdx: 8
+ },
+ lng: {
+ value: 'lon',
+ fieldIdx: 9
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new ArcLayer({
+ label: 'one -> two two arc',
+ dataId,
+ columns: {
+ lat0: {
+ value: 'one_lat',
+ fieldIdx: 0
+ },
+ lng0: {
+ value: 'one_lng',
+ fieldIdx: 1
+ },
+ lat1: {
+ value: 'two_two.lat',
+ fieldIdx: 3
+ },
+ lng1: {
+ value: 'two_two.lng',
+ fieldIdx: 2
+ }
+ }
+ }),
+ new LineLayer({
+ label: 'one -> two two line',
+ dataId,
+ columns: {
+ lat0: {
+ value: 'one_lat',
+ fieldIdx: 0
+ },
+ lng0: {
+ value: 'one_lng',
+ fieldIdx: 1
+ },
+ lat1: {
+ value: 'two_two.lat',
+ fieldIdx: 3
+ },
+ lng1: {
+ value: 'two_two.lng',
+ fieldIdx: 2
+ }
+ }
+ })
+ ];
+
+ const fieldPairs = findPointFieldPairs(inputFields);
+ 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));
+
+ t.end();
+});
+
+test('layerUtils -> findDefaultLayer.2', t => {
+
+ const inputFields = [
+ // layer 1
+ {
+ name: 'all_points',
+ tableFieldIndex: 1
+ }
+ ];
+ const dataId = 'milkshake';
+ const fieldPairs = findPointFieldPairs(inputFields);
+
+ const dataset = {
+ id: dataId,
+ fields: inputFields,
+ fieldPairs,
+ label: 'sf_zip_geo'
+ };
+
+ const outputLayers = [
+ new GeojsonLayer({
+ label: 'sf_zip_geo',
+ isVisible: true,
+ dataId,
+ columns: {
+ geojson: {
+ value: 'all_points',
+ fieldIdx: 0
+ }
+ }
+ })
+ ];
+
+ const layers = findDefaultLayer(dataset, KeplerGlLayers);
+
+ t.equal(layers.length, 1, 'number of layers found');
+ cmpLayers(t, outputLayers[0], layers[0]);
+
+ t.end();
+});
+
+test('layerUtils -> findDefaultLayer.3', t => {
+ const dataId = 'cool';
+
+ const inputFields = [
+ // layer 1 & 2
+ {
+ name: 'begintrip_lat',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'begintrip_lng',
+ tableFieldIndex: 2
+ }
+ ];
+
+ const outputLayers = [
+ new PointLayer({
+ label: 'begintrip',
+ dataId,
+ isVisible: true,
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 1
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ })
+ ];
+
+ const fieldPairs = findPointFieldPairs(inputFields);
+ 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));
+
+ t.end();
+});
+
+test('layerUtils -> findDefaultLayer.4', t => {
+
+ // Since all defaults layers are scanned and they
+ // share field names or patterns. This set produces
+ // multiple layers.
+ // Order determined by the order
+ // the defaults are scanned inside the function under test.
+ const inputFields = [
+ // layer 1 (grid), 2 (arc), 3 (point)
+ {
+ name: 'begintrip_lat',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'begintrip_lng',
+ tableFieldIndex: 2
+ },
+ // layer 2 (arc), 4 (point)
+ {
+ name: 'dropoff_lat',
+ tableFieldIndex: 3
+ },
+ {
+ name: 'dropoff_lng',
+ tableFieldIndex: 4
+ }
+ ];
+
+ const dataId = 'yololo';
+ const outputLayers = [
+ new PointLayer({
+ label: 'begintrip',
+ dataId,
+ isVisible: true,
+ columns: {
+ lat: {
+ value: 'begintrip_lat',
+ fieldIdx: 0
+ },
+ lng: {
+ value: 'begintrip_lng',
+ fieldIdx: 1
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new PointLayer({
+ label: 'dropoff',
+ dataId,
+ columns: {
+ lat: {
+ value: 'dropoff_lat',
+ fieldIdx: 2
+ },
+ lng: {
+ value: 'dropoff_lng',
+ fieldIdx: 3
+ },
+ altitude: {
+ value: null,
+ fieldIdx: -1,
+ optional: true
+ }
+ }
+ }),
+ new ArcLayer({
+ label: 'begintrip -> dropoff arc',
+ dataId,
+ columns: {
+ lat0: {
+ value: 'begintrip_lat',
+ fieldIdx: 0
+ },
+ lng0: {
+ value: 'begintrip_lng',
+ fieldIdx: 1
+ },
+ lat1: {
+ value: 'dropoff_lat',
+ fieldIdx: 2
+ },
+ lng1: {
+ value: 'dropoff_lng',
+ fieldIdx: 3
+ }
+ }
+ }),
+ new LineLayer({
+ label: 'begintrip -> dropoff line',
+ dataId,
+ columns: {
+ lat0: {
+ value: 'begintrip_lat',
+ fieldIdx: 0
+ },
+ lng0: {
+ value: 'begintrip_lng',
+ fieldIdx: 1
+ },
+ lat1: {
+ value: 'dropoff_lat',
+ fieldIdx: 2
+ },
+ lng1: {
+ value: 'dropoff_lng',
+ fieldIdx: 3
+ }
+ }
+ })
+ ];
+
+ const fieldPairs = findPointFieldPairs(inputFields);
+ 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));
+
+ t.end();
+});
+
+test('layerUtils -> findDefaultLayer.5', t => {
+
+ const inputFields = [
+ // layer 1
+ {
+ name: 'one_late',
+ tableFieldIndex: 1
+ },
+ {
+ name: 'one_lng',
+ tableFieldIndex: 2
+ }
+ ];
+
+ const fieldPairs = findPointFieldPairs(inputFields);
+ const layers = findDefaultLayer({fields: inputFields, fieldPairs, id: 'yo'}, KeplerGlLayers);
+
+ t.equal(layers.length, 0, 'number of layers found');
+
+ t.end();
+});
+
+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,
+ label: 'what',
+ id: 'smoothie',
+ fieldPairs: []
+ }, KeplerGlLayers);
+
+ const expectedGeojsonLayers = [
+ new GeojsonLayer({
+ label: 'what',
+ dataId: 'smoothie',
+ isVisible: true,
+ columns: {
+ geojson: {value: GEOJSON_FIELDS.geojson[0], fieldIdx: 4}
+ }
+ }),
+ new GeojsonLayer({
+ label: 'what',
+ dataId: 'smoothie',
+ isVisible: true,
+ columns: {
+ geojson: {value: GEOJSON_FIELDS.geojson[1], fieldIdx: 5}
+ }
+ })
+ ];
+
+ cmpLayers(t, expectedGeojsonLayers, geojsonLayers);
+ t.end();
+});
+
+test('layerUtils -> findDefaultLayer:GeojsonLayer.wkt', t => {
+ const {fields} = processCsvData(wktCsv);
+ const dataId = '0dj3h';
+ const label = 'some geometry file';
+
+ const geojsonLayers = findDefaultLayer({fields, id: dataId, label, fieldPairs: []}, KeplerGlLayers);
+
+ 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}
+ }
+ })
+ ];
+
+ cmpLayers(t, expectedLayers, 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 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');
+
+ const fieldsWithIcon = [...inputFields, ...eventIcon];
+ const fieldPairsWIcon = findPointFieldPairs(fieldsWithIcon);
+
+ 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');
+ t.equal(iconLayers[0].config.label, 'event icon', 'should find 1 icon layer');
+
+ const fieldsWith2Icon = [...inputFields, ...nameIcon, ...eventIcon];
+ const fieldPairsW2Icon = findPointFieldPairs(fieldsWith2Icon);
+
+ iconLayers = findDefaultLayer({
+ fields: fieldsWith2Icon,
+ fieldPairs: fieldPairsW2Icon,
+ id: 'meow'}, KeplerGlLayers
+ ).filter(l => l.type === 'icon');
+
+ t.equal(iconLayers.length, 2, 'should find 2 icon layers');
+ t.equal(iconLayers[0].config.label, 'name icon', 'should find 2 icon layer');
+
+ t.end();
+});
diff --git a/test/setup-browser-env.js b/test/setup-browser-env.js
new file mode 100644
index 000000000..f84cda847
--- /dev/null
+++ b/test/setup-browser-env.js
@@ -0,0 +1,41 @@
+// Copyright (c) 2018 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.
+
+/* setup.js */
+import 'babel-polyfill';
+
+import {JSDOM} from 'jsdom';
+import global from 'global';
+
+const dom = new JSDOM('<!doctype html><html><body></body></html>');
+const {window} = dom;
+
+global.window = window;
+global.document = window.document;
+
+Object.keys(global.window).forEach(property => {
+ if (typeof global[property] === 'undefined') {
+ global[property] = global.window[property];
+ }
+});
+
+global.navigator = {
+ userAgent: 'node.js'
+};