Skip to content

Commit

Permalink
revert enums from types
Browse files Browse the repository at this point in the history
Signed-off-by: Ihor Dykhta <[email protected]>
  • Loading branch information
igorDykhta committed Dec 20, 2024
1 parent a7f9dd0 commit 4eeb434
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 35 deletions.
3 changes: 1 addition & 2 deletions src/components/src/hooks/use-fetch-vector-tile-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {useCallback, useEffect, useState} from 'react';
import {MVTSource, TileJSON} from '@loaders.gl/mvt';
import {PMTilesSource, PMTilesMetadata} from '@loaders.gl/pmtiles';

import {VectorTileType} from '@kepler.gl/types';
import {VectorTileMetadata} from '@kepler.gl/layers';
import {VectorTileMetadata, VectorTileType} from '@kepler.gl/layers';

type FetchVectorTileMetadataProps = {
url: string | null;
Expand Down
2 changes: 1 addition & 1 deletion src/components/src/modals/export-data-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '../common/styled-components';
import {StyledWarning} from './export-map-modal/components';
import {injectIntl, IntlShape} from 'react-intl';
import {DatasetType} from '@kepler.gl/types';
import {DatasetType} from '@kepler.gl/layers';
import {FormattedMessage} from '@kepler.gl/localization';
import {Datasets} from '@kepler.gl/table';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import React, {useCallback, useEffect, useState, useMemo} from 'react';
import styled from 'styled-components';

import {getMetaUrl, parseVectorMetadata, VectorTileMetadata} from '@kepler.gl/layers';
import {
getMetaUrl,
parseVectorMetadata,
VectorTileMetadata,
DatasetType,
VectorTileType
} from '@kepler.gl/layers';
import {TileJSON} from '@loaders.gl/mvt';
import {PMTilesMetadata} from '@loaders.gl/pmtiles';
import {DatasetType, VectorTileType} from '@kepler.gl/types';

import {default as useFetchVectorTileMetadata} from '../../hooks/use-fetch-vector-tile-metadata';
import {DatasetCreationAttributes, MetaResponse, StyledInput} from './common';
Expand Down
3 changes: 2 additions & 1 deletion src/components/src/side-panel/common/dataset-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import React from 'react';
import styled from 'styled-components';
import {format} from 'd3-format';

import {DatasetType} from '@kepler.gl/layers';
import {FormattedMessage} from '@kepler.gl/localization';
import {DataContainerInterface} from '@kepler.gl/utils';
import {DatasetType} from '@kepler.gl/types';

const numFormat = format(',');

Expand Down
10 changes: 8 additions & 2 deletions src/layers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ import {default as VectorTileLayer} from './vector-tile/vector-tile-layer';
export {
getMetaUrl,
parseVectorMetadata,
matchDatasetType
matchDatasetType,
DatasetType,
TileType,
VectorTileType
} from './vector-tile/utils/vector-tile-utils';
export type {
VectorTileDatasetMetadata,
VectorTileMetadata
} from './vector-tile/utils/vector-tile-utils';
export type {VectorTileMetadata} from './vector-tile/utils/vector-tile-utils';
export {default as VectorTileIcon} from './vector-tile/vector-tile-icon';
export {default as VectorTileLayer} from './vector-tile/vector-tile-layer';

Expand Down
22 changes: 21 additions & 1 deletion src/layers/src/vector-tile/utils/vector-tile-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,31 @@ import {
StringFieldFilterProps,
KeplerTable as KeplerDataset
} from '@kepler.gl/table';
import {DatasetType, Field as KeplerField} from '@kepler.gl/types';
import {Field as KeplerField} from '@kepler.gl/types';
import {clamp, formatNumberByStep, getNumericStepSize, timeToUnixMilli} from '@kepler.gl/utils';

import {default as BaseLayer} from '../../base-layer';

export enum DatasetType {
LOCAL = 'local',
VECTOR_TILE = 'vectorTile'
}

export enum TileType {
VECTOR_TILE = 'vectorTile'
}

export enum VectorTileType {
REMOTE = 'remote',
PMTILES = 'pmtiles'
}

export type VectorTileDatasetMetadata = {
type: VectorTileType.REMOTE;
tilesetDataUrl: string;
tilesetMetadataUrl?: string;
};

export const getLoaderOptions = () => {
return {
mvt: {
Expand Down
15 changes: 9 additions & 6 deletions src/layers/src/vector-tile/vector-tile-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ import {
DEFAULT_COLOR_UI,
LAYER_VIS_CONFIGS
} from '@kepler.gl/constants';
import {Layer as KeplerLayer, VisualChannel} from '@kepler.gl/layers';
import {
Layer as KeplerLayer,
VisualChannel,
DatasetType,
TileType,
VectorTileType,
VectorTileDatasetMetadata
} from '@kepler.gl/layers';
import {
KeplerTable as KeplerDataset,
Datasets as KeplerDatasets,
Expand All @@ -33,11 +40,7 @@ import {
BindedLayerCallbacks,
VisConfigRange,
VisConfigNumber,
DatasetType,
VectorTileType,
VectorTileDatasetMetadata,
DomainStops,
TileType
DomainStops
} from '@kepler.gl/types';
import {DataContainerInterface} from '@kepler.gl/utils';

Expand Down
20 changes: 0 additions & 20 deletions src/types/datasets.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project

export enum DatasetType {
LOCAL = 'local',
VECTOR_TILE = 'vectorTile'
}

export enum TileType {
VECTOR_TILE = 'vectorTile'
}

export enum VectorTileType {
REMOTE = 'remote',
PMTILES = 'pmtiles'
}

export type VectorTileDatasetMetadata = {
type: VectorTileType.REMOTE;
tilesetDataUrl: string;
tilesetMetadataUrl?: string;
};

export type ZoomStops = number[][];

export type DomainStops = {
Expand Down

0 comments on commit 4eeb434

Please sign in to comment.