Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] export more utils and schema #1280

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/processors/data-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ export function getFieldsFromData(data, fieldOrder) {
// add a check for epoch timestamp
const metadata = Analyzer.computeColMeta(
data,
[{regex: /.*geojson|all_points/g, dataType: 'GEOMETRY'}],
[
{regex: /.*geojson|all_points/g, dataType: 'GEOMETRY'},
{regex: /.*census/g, dataType: 'STRING'}
],
{ignoredDataTypes: IGNORE_DATA_TYPES}
);

Expand Down
2 changes: 1 addition & 1 deletion src/reducers/vis-state-updaters.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const INITIAL_VIS_STATE = {
* @type {typeof import('./vis-state-updaters').updateStateWithLayerAndData}
*
*/
function updateStateWithLayerAndData(state, {layerData, layer, idx}) {
export function updateStateWithLayerAndData(state, {layerData, layer, idx}) {
return {
...state,
layers: state.layers.map((lyr, i) => (i === idx ? layer : lyr)),
Expand Down
11 changes: 10 additions & 1 deletion src/schemas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ export {
KeplerGLSchema as KeplerGLSchemaClass
} from './schema-manager';
export {CURRENT_VERSION, VERSIONS} from './versions';
export {default as visStateSchema} from './vis-state-schema';
export {
visStateSchemaV1,
FilterSchemaV0,
LayerSchemaV0,
InteractionSchemaV1,
DimensionFieldSchema,
SplitMapsSchema,
filterPropsV1,
default as visStateSchema
} from './vis-state-schema';
export {default as datasetSchema} from './dataset-schema';
export {default as mapStyleSchema} from './map-style-schema';
export {default as mapStateSchema} from './map-state-schema';
Expand Down
6 changes: 3 additions & 3 deletions src/schemas/vis-state-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export const layerPropsV1 = {
})
};

class LayerSchemaV0 extends Schema {
export class LayerSchemaV0 extends Schema {
key = 'layers';

save(layers, parents) {
Expand All @@ -503,7 +503,7 @@ class LayerSchemaV0 extends Schema {
}
}

class FilterSchemaV0 extends Schema {
export class FilterSchemaV0 extends Schema {
key = 'filters';
save(filters) {
return {
Expand Down Expand Up @@ -559,7 +559,7 @@ class InteractionSchemaV0 extends Schema {

const interactionPropsV1 = [...interactionPropsV0, 'geocoder', 'coordinate'];

class InteractionSchemaV1 extends Schema {
export class InteractionSchemaV1 extends Schema {
key = 'interactionConfig';

save(interactionConfig) {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export {findPointFieldPairs, createNewDataEntry} from './dataset-utils';
export {hexToRgb} from './color-utils';
export {errorNotification} from './notifications-utils';
export {dataURItoBlob} from './export-utils';
export {calculateLayerData} from './layer-utils';
export {applyFilterFieldName, applyFiltersToDatasets} from 'utils/filter-utils';

// REDUCER UTILS
export {updateAllLayerDomainData} from '../reducers/vis-state-updaters';
Expand Down