Skip to content

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

(chore) Correctly update the copy changes to actrions.js (#914)

Jon Sadka1cc6f9366a7e
diff --git a/src/actions/actions.js b/src/actions/actions.js
index c31e96128..b40e64ce6 100644
--- a/src/actions/actions.js
+++ b/src/actions/actions.js
@@ -21,86 +21,86 @@
import ActionTypes from 'constants/action-types';
import {createAction} from 'redux-actions';
- /**
- * Add data to kepler.gl reducer, prepare map with preset configuration if config is passed.
- * Kepler.gl provides a handy set of utils to parse data from different format to the `data` object required in dataset. You rarely need to manually format the data obejct.
- *
- * Use `KeplerGlSchema.getConfigToSave` to generate a json blob of the currents instance config.
- * The config object value will always have higher precedence than the options properties.
- *
- * Kepler.gl uses `dataId` in the config to match with loaded dataset. If you pass a config object, you need
- * to match the `info.id` of your dataset to the `dataId` in each `layer`, `filter` and `interactionConfig.tooltips.fieldsToShow`
- *
- * @memberof main
- * @param {Object} data
- * @param {Array<Object>|Object} data.datasets - ***required** datasets can be a dataset or an array of datasets
- * Each dataset object needs to have `info` and `data` property.
- * @param {Object} data.datasets.info -info of a dataset
- * @param {string} data.datasets.info.id - id of this dataset. If config is defined, `id` should matches the `dataId` in config.
- * @param {string} data.datasets.info.label - A display name of this dataset
- * @param {Object} data.datasets.data - ***required** The data object, in a tabular format with 2 properties `fields` and `rows`
- * @param {Array<Object>} data.datasets.data.fields - ***required** Array of fields,
- * @param {string} data.datasets.data.fields.name - ***required** Name of the field,
- * @param {Array<Array>} data.datasets.data.rows - ***required** Array of rows, in a tabular format with `fields` and `rows`
- *
- * @param {Object} data.options
- * @param {boolean} data.options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
- * place the map view within the data points boundaries. `options.centerMap` will override `config.mapState` if passed in.
- * @param {boolean} data.options.readOnly `default: false` if `readOnly` is set to `true`
- * the left setting panel will be hidden
- * @param {boolean} data.options.keepExistingConfig whether to keep exiting map data and associated layer filter interaction config `default: false`.
- * @param {Object} data.config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
- * @public
- * @example
- *
- * // app.js
- * import {addDataToMap} from 'kepler.gl/actions';
- *
- * const sampleTripData = {
- * fields: [
- * {name: 'tpep_pickup_datetime', format: 'YYYY-M-D H:m:s', type: 'timestamp'},
- * {name: 'pickup_longitude', format: '', type: 'real'},
- * {name: 'pickup_latitude', format: '', type: 'real'}
- * ],
- * rows: [
- * ['2015-01-15 19:05:39 +00:00', -73.99389648, 40.75011063],
- * ['2015-01-15 19:05:39 +00:00', -73.97642517, 40.73981094],
- * ['2015-01-15 19:05:40 +00:00', -73.96870422, 40.75424576],
- * ]
- * };
- *
- * const sampleConfig = {
- * visState: {
- * filters: [
- * {
- * id: 'me',
- * dataId: 'test_trip_data',
- * name: 'tpep_pickup_datetime',
- * type: 'timeRange',
- * enlarged: true
- * }
- * ]
- * }
- * }
- *
- * this.props.dispatch(
- * addDataToMap({
- * datasets: {
- * info: {
- * label: 'Sample Taxi Trips in New York City',
- * id: 'test_trip_data'
- * },
- * data: sampleTripData
- * },
- * option: {
- * centerMap: true,
- * readOnly: false,
- * keepExistingConfig: false
- * },
- * config: sampleConfig
- * })
- * );
- */
+/**
+ * Add data to kepler.gl reducer, prepare map with preset configuration if config is passed.
+ * Kepler.gl provides a handy set of utils to parse data from different formats to the `data` object required in dataset. You rarely need to manually format the data obejct.
+ *
+ * Use `KeplerGlSchema.getConfigToSave` to generate a json blob of the currents instance config.
+ * The config object value will always have higher precedence than the options properties.
+ *
+ * Kepler.gl uses `dataId` in the config to match with loaded dataset. If you pass a config object, you need
+ * to match the `info.id` of your dataset to the `dataId` in each `layer`, `filter` and `interactionConfig.tooltips.fieldsToShow`
+ *
+ * @memberof main
+ * @param {Object} data
+ * @param {Array<Object>|Object} data.datasets - ***required** datasets can be a dataset or an array of datasets
+ * Each dataset object needs to have `info` and `data` property.
+ * @param {Object} data.datasets.info -info of a dataset
+ * @param {string} data.datasets.info.id - id of this dataset. If config is defined, `id` should matches the `dataId` in config.
+ * @param {string} data.datasets.info.label - A display name of this dataset
+ * @param {Object} data.datasets.data - ***required** The data object, in a tabular format with 2 properties `fields` and `rows`
+ * @param {Array<Object>} data.datasets.data.fields - ***required** Array of fields,
+ * @param {string} data.datasets.data.fields.name - ***required** Name of the field,
+ * @param {Array<Array>} data.datasets.data.rows - ***required** Array of rows, in a tabular format with `fields` and `rows`
+ *
+ * @param {Object} data.options
+ * @param {boolean} data.options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
+ * place the map view within the data points boundaries. `options.centerMap` will override `config.mapState` if passed in.
+ * @param {boolean} data.options.readOnly `default: false` if `readOnly` is set to `true`
+ * the left setting panel will be hidden
+ * @param {boolean} data.options.keepExistingConfig whether to keep exiting map data and associated layer filter interaction config `default: false`.
+ * @param {Object} data.config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
+ * @public
+ * @example
+ *
+ * // app.js
+ * import {addDataToMap} from 'kepler.gl/actions';
+ *
+ * const sampleTripData = {
+ * fields: [
+ * {name: 'tpep_pickup_datetime', format: 'YYYY-M-D H:m:s', type: 'timestamp'},
+ * {name: 'pickup_longitude', format: '', type: 'real'},
+ * {name: 'pickup_latitude', format: '', type: 'real'}
+ * ],
+ * rows: [
+ * ['2015-01-15 19:05:39 +00:00', -73.99389648, 40.75011063],
+ * ['2015-01-15 19:05:39 +00:00', -73.97642517, 40.73981094],
+ * ['2015-01-15 19:05:40 +00:00', -73.96870422, 40.75424576],
+ * ]
+ * };
+ *
+ * const sampleConfig = {
+ * visState: {
+ * filters: [
+ * {
+ * id: 'me',
+ * dataId: 'test_trip_data',
+ * name: 'tpep_pickup_datetime',
+ * type: 'timeRange',
+ * enlarged: true
+ * }
+ * ]
+ * }
+ * }
+ *
+ * this.props.dispatch(
+ * addDataToMap({
+ * datasets: {
+ * info: {
+ * label: 'Sample Taxi Trips in New York City',
+ * id: 'test_trip_data'
+ * },
+ * data: sampleTripData
+ * },
+ * option: {
+ * centerMap: true,
+ * readOnly: false,
+ * keepExistingConfig: false
+ * },
+ * config: sampleConfig
+ * })
+ * );
+ */
export const addDataToMap = createAction(
ActionTypes.ADD_DATA_TO_MAP,
data => data
@@ -111,9 +111,7 @@ export const addDataToMap = createAction(
* @memberof main
* @public
*/
-export const resetMapConfig = createAction(
- ActionTypes.RESET_MAP_CONFIG
-);
+export const resetMapConfig = createAction(ActionTypes.RESET_MAP_CONFIG);
/**
* Pass config to kepler.gl instance, prepare the state with preset configs.
@@ -158,7 +156,11 @@ export const receiveMapConfig = createAction(
*/
export const keplerGlInit = createAction(
ActionTypes.INIT,
- ({mapboxApiAccessToken, mapboxApiUrl, mapStylesReplaceDefault} = {}) => ({mapboxApiAccessToken, mapboxApiUrl, mapStylesReplaceDefault})
+ ({mapboxApiAccessToken, mapboxApiUrl, mapStylesReplaceDefault} = {}) => ({
+ mapboxApiAccessToken,
+ mapboxApiUrl,
+ mapStylesReplaceDefault
+ })
);
/**