An open source alternative to Tableau. Embeddable visual analytic
TypeScript bidatadata-analysisdata-miningdata-visualizationedak6skanarieslow-codepivot-tablereacttableautableau-alternativetypescriptvegavega-litevisualization
Refactor: split dataSource from graphic walker (#149)
islxyqwe395dc66cb74b
diff --git a/packages/graphic-walker/.gitignore b/packages/graphic-walker/.gitignoreindex e985853e..6f7ac7b2 100644--- a/packages/graphic-walker/.gitignore+++ b/packages/graphic-walker/.gitignore@@ -1 +1,2 @@.vercel+coveragediff --git a/packages/graphic-walker/jest.config.js b/packages/graphic-walker/jest.config.jsnew file mode 100644index 00000000..b413e106--- /dev/null+++ b/packages/graphic-walker/jest.config.js@@ -0,0 +1,5 @@+/** @type {import('ts-jest').JestConfigWithTsJest} */+module.exports = {+ preset: 'ts-jest',+ testEnvironment: 'node',+};\ No newline at end of filediff --git a/packages/graphic-walker/package.json b/packages/graphic-walker/package.jsonindex fdf90d5d..d0f5cec3 100644--- a/packages/graphic-walker/package.json+++ b/packages/graphic-walker/package.json@@ -7,7 +7,8 @@"build": "tsc && vite build","build:app": "vite build --config vite-app.config.ts","serve": "vite preview",- "type": "tsc src/lib.ts --declaration --emitDeclarationOnly --jsx react --esModuleInterop --outDir dist"+ "type": "tsc src/lib.ts --declaration --emitDeclarationOnly --jsx react --esModuleInterop --outDir dist",+ "test": "jest"},"files": ["dist",@@ -39,6 +40,7 @@"@kanaries/react-beautiful-dnd": "^0.0.3","@kanaries/web-data-loader": "^0.1.7","@tailwindcss/forms": "^0.5.4",+ "@types/jest": "^29.5.3","autoprefixer": "^10.3.5","canvas-size": "^1.2.6","d3-format": "^3.1.0",@@ -47,6 +49,7 @@"i18next": "^21.9.1","i18next-browser-languagedetector": "^6.1.5","immer": "^9.0.15",+ "jest": "^29.6.2","leaflet": "^1.9.4","mobx": "^6.3.3","mobx-react-lite": "^3.2.1",@@ -62,6 +65,7 @@"react-shadow": "^20.0.0","rxjs": "^7.3.0","tailwindcss": "^3.2.4",+ "ts-jest": "^29.1.1","topojson-client": "^3.1.0","vega": "^5.22.1","vega-embed": "^6.21.0",@@ -83,7 +87,7 @@"@vercel/analytics": "^0.1.8","@vitejs/plugin-react": "^3.1.0","styled-components": "^5.3.6",- "typescript": "^4.3.2",+ "typescript": "^5.1.6","vite": "^4.1.1"},"peerDependencies": {diff --git a/packages/graphic-walker/public/stoinfo_v2.json b/packages/graphic-walker/public/stoinfo_v2.jsonnew file mode 100644index 00000000..b5383c70--- /dev/null+++ b/packages/graphic-walker/public/stoinfo_v2.json@@ -0,0 +1,103 @@+{+ "$schema": "http://json-schema.org/draft-07/schema#",+ "properties": {+ "datasets": {+ "items": {+ "properties": {+ "data": {+ "items": {+ "additionalProperties": {},+ "type": "object"+ },+ "type": "array"+ },+ "id": {+ "type": "string"+ },+ "metaId": {+ "type": "string"+ },+ "name": {+ "type": "string"+ }+ },+ "type": "object",+ "required": [+ "id",+ "metaId",+ "name",+ "data"+ ]+ },+ "type": "array"+ },+ "metaDict": {+ "additionalProperties": {+ "items": {+ "properties": {+ "analyticType": {+ "enum": [+ "dimension",+ "measure"+ ],+ "type": "string"+ },+ "basename": {+ "type": "string"+ },+ "disable": {+ "type": "boolean"+ },+ "fid": {+ "type": "string"+ },+ "key": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "path": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "semanticType": {+ "enum": [+ "nominal",+ "ordinal",+ "quantitative",+ "temporal"+ ],+ "type": "string"+ }+ },+ "type": "object",+ "required": [+ "fid",+ "semanticType",+ "analyticType"+ ]+ },+ "type": "array"+ },+ "type": "object"+ },+ "specDict": {+ "additionalProperties": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "type": "object"+ }+ },+ "type": "object",+ "required": [+ "metaDict",+ "datasets",+ "specDict"+ ]+}\ No newline at end of filediff --git a/packages/graphic-walker/src/App.tsx b/packages/graphic-walker/src/App.tsxindex 225c3125..015d3c24 100644--- a/packages/graphic-walker/src/App.tsx+++ b/packages/graphic-walker/src/App.tsx@@ -1,23 +1,20 @@-import React, { useEffect, useRef, useMemo, useState, useCallback } from 'react';+import React, { useEffect, useMemo, useRef, useCallback } from 'react';import { observer } from 'mobx-react-lite';import { useTranslation } from 'react-i18next';import { LightBulbIcon } from "@heroicons/react/24/outline";-import { IGeographicData, IComputationFunction, IDarkMode, IMutField, IRow, ISegmentKey, IThemeKey, Specification, IGeoDataItem, VegaGlobalConfig, IChannelScales } from './interfaces';+import { IGeographicData, IComputationFunction, ISegmentKey, IThemeKey, IMutField, IGeoDataItem, VegaGlobalConfig, IChannelScales } from './interfaces';import type { IReactVegaHandler } from './vis/react-vega';import VisualSettings from './visualSettings';import PosFields from './fields/posFields';import AestheticFields from './fields/aestheticFields';import DatasetFields from './fields/datasetFields/index';import ReactiveRenderer from './renderer/index';-import DataSourceSegment from './dataSource/index';-import { IGlobalStore, useGlobalStore } from './store';+import { ComputationContext, VizStoreWrapper, useVizStore, withTimeout } from './store';import VisNav from './segments/visNav';import { mergeLocaleRes, setLocaleLanguage } from './locales/i18n';import FilterField from './fields/filterField';-import { guardDataKeys } from './utils/dataPrep';import SegmentNav from './segments/segmentNav';import DatasetConfig from './dataSource/datasetConfig';-import { useCurrentMediaTheme } from './utils/media';import CodeExport from './components/codeExport';import VisualConfig from './components/visualConfig';import ExplainData from './components/explainData';@@ -25,32 +22,23 @@ import GeoConfigPanel from './components/leafletRenderer/geoConfigPanel';import type { ToolbarItemProps } from './components/toolbar';import ClickMenu from './components/clickMenu';import AskViz from './components/askViz';+import { VizSpecStore } from './store/visualSpecStore';+import FieldsContextWrapper from './fields/fieldsContext';+import { guardDataKeys } from './utils/dataPrep';import { getComputation } from './computation/clientComputation';import LogPanel from './fields/datasetFields/logPanel';import BinPanel from './fields/datasetFields/binPanel';import { ErrorContext } from './utils/reportError';-import { ErrorBoundary } from "react-error-boundary";+import { ErrorBoundary } from 'react-error-boundary';import Errorpanel from './components/errorpanel';import { GWGlobalConfig } from './vis/theme';-export interface IGWProps {- dataSource?: IRow[];- rawFields?: IMutField[];- spec?: Specification;- hideDataSourceConfig?: boolean;+export interface BaseVizProps {i18nLang?: string;i18nResources?: { [lang: string]: Record<string, string | any> };- keepAlive?: boolean | string;- /**- * auto parse field key into a safe string. default is true- */- fieldKeyGuard?: boolean;- /** @default "vega" */themeKey?: IThemeKey;+ darkMode?: 'light' | 'dark';themeConfig?: GWGlobalConfig;- dark?: IDarkMode;- storeRef?: React.MutableRefObject<IGlobalStore | null>;- computation?: IComputationFunction;toolbar?: {extra?: ToolbarItemProps[];exclude?: string[];@@ -62,35 +50,29 @@ export interface IGWProps {header?: Record<string, string>;features?: {askviz?: string | boolean;- }+ };};+ dataSelection?: React.ReactChild;+ computation?: IComputationFunction;computationTimeout?: number;onError?: (err: Error) => void;geoList?: IGeoDataItem[];channelScales?: IChannelScales;}-const App = observer<IGWProps>(function App(props) {+export const VizApp = observer(function VizApp(props: BaseVizProps) {const {- dataSource = [],- rawFields = [],- spec,+ computation,+ darkMode = 'light',i18nLang = 'en-US',+ enhanceAPI,i18nResources,- hideDataSourceConfig,- fieldKeyGuard = true,themeKey = 'vega',themeConfig,- dark = 'media',- computation,toolbar,geographicData,- enhanceAPI,- computationTimeout,+ computationTimeout = 60000,} = props;- const { commonStore, vizStore } = useGlobalStore();-- const { datasets, segmentKey, vizEmbededMenu } = commonStore;const { t, i18n } = useTranslation();const curLang = i18n.language;@@ -107,177 +89,199 @@ const App = observer<IGWProps>(function App(props) {}}, [i18nLang, curLang]);- const [sampleRemoteData, setSampleRemoteData] = useState<IRow[]>([]);- const remoteDataContext = useRef(0);-- useEffect(() => {- if (!computation) return;- async () => {- const ts = Date.now();- remoteDataContext.current = ts;- const resp = await computation({ workflow: [{ type: 'view', query: [{ op: 'raw', fields: ['*'] }] }], limit: 1 });- if (remoteDataContext.current === ts) {- setSampleRemoteData(resp);- }- };- }, [computation]);-- const remoteDataSource = dataSource.length > 0 ? dataSource : sampleRemoteData;-- const safeDataset = useMemo(() => {- let safeData = remoteDataSource;- let safeMetas = rawFields;- if (fieldKeyGuard) {- const { safeData: _safeData, safeMetas: _safeMetas } = guardDataKeys(remoteDataSource, rawFields);- safeData = _safeData;- safeMetas = _safeMetas;- }- return {- safeData,- safeMetas,- };- }, [rawFields, remoteDataSource, computation, fieldKeyGuard]);-- // use as an embeding module, use outside datasource from props.- useEffect(() => {- if (safeDataset.safeData.length > 0 && safeDataset.safeMetas.length > 0) {- commonStore.addAndUseDS({- name: 'context dataset',- dataSource: safeDataset.safeData,- rawFields: safeDataset.safeMetas,- });- }- }, [safeDataset]);-- useEffect(() => {- if (safeDataset.safeData.length > 0 && safeDataset.safeMetas.length > 0 && spec) {- vizStore.renderSpec(spec);- }- }, [spec, safeDataset]);+ const vizStore = useVizStore();useEffect(() => {- if (geographicData) {- vizStore.setGeographicData(geographicData, geographicData.key);+ if (props.geographicData) {+ vizStore.setGeographicData(props.geographicData, props.geographicData.key);}}, [geographicData]);-- useEffect(() => {- if (computation) {- vizStore.setComputationFunction(computation, computationTimeout);- } else {- vizStore.setComputationFunction(getComputation(commonStore.currentDataset.dataSource));- }- }, [vizStore, computation ?? commonStore.currentDataset.dataSource, computationTimeout]);-- const darkMode = useCurrentMediaTheme(dark);const rendererRef = useRef<IReactVegaHandler>(null);const downloadCSVRef = useRef<{ download: () => void }>({download() {}});- const reportError = useCallback((msg: string, code?: number) => {- const err = new Error(`Error${code ? `(${code})`: ''}: ${msg}`);- console.error(err);- props.onError?.(err);- if (code) {- commonStore.updateShowErrorResolutionPanel(code);- }- }, [props.onError]);+ const reportError = useCallback(+ (msg: string, code?: number) => {+ const err = new Error(`Error${code ? `(${code})` : ''}: ${msg}`);+ console.error(err);+ props.onError?.(err);+ if (code) {+ vizStore.updateShowErrorResolutionPanel(code);+ }+ },+ [vizStore, props.onError]+ );+ const { segmentKey, vizEmbededMenu } = vizStore;++ const c = useMemo(() => (computation ? withTimeout(computation, computationTimeout) : async () => []), [computation, computationTimeout]);return (- <ErrorContext value={{reportError}}>- <ErrorBoundary fallback={<div>Something went wrong</div>} onError={props.onError} >- <div- className={`${- darkMode === 'dark' ? 'dark' : ''- } App font-sans bg-white dark:bg-zinc-900 dark:text-white m-0 p-0`}- >- {/* <div className="grow-0">- <PageNav />- </div> */}- <div className="bg-white dark:bg-zinc-900 dark:text-white">- {!hideDataSourceConfig && <DataSourceSegment />}- <div className="px-2 mx-2">- <SegmentNav />- {segmentKey === ISegmentKey.vis && <VisNav />}- </div>- {segmentKey === ISegmentKey.vis && (- <div- style={{ marginTop: '0em', borderTop: 'none' }}- className="m-4 p-4 border border-gray-200 dark:border-gray-700"- >- {enhanceAPI?.features?.askviz && (- <AskViz api={typeof enhanceAPI.features.askviz === 'string' ? enhanceAPI.features.askviz : ''} headers={enhanceAPI?.header} />- )}- <VisualSettings csvHandler={downloadCSVRef} rendererHandler={rendererRef} darkModePreference={dark} exclude={toolbar?.exclude} extra={toolbar?.extra} />- <CodeExport />- <ExplainData themeKey={themeKey} dark={darkMode}/>- <VisualConfig />- <Errorpanel />- <LogPanel />- <BinPanel/>- {commonStore.showGeoJSONConfigPanel && <GeoConfigPanel geoList={props.geoList} />}- <div className="sm:grid sm:grid-cols-12 xl:grid-cols-6">- <div className="sm:col-span-3 xl:col-span-1">- <DatasetFields />- </div>- <div className="sm:col-span-2 xl:col-span-1">- <FilterField />- <AestheticFields />+ <ErrorContext value={{ reportError }}>+ <ErrorBoundary fallback={<div>Something went wrong</div>} onError={props.onError}>+ <ComputationContext.Provider value={c}>+ <div className={`${darkMode === 'dark' ? 'dark' : ''} App font-sans bg-white dark:bg-zinc-900 dark:text-white m-0 p-0`}>+ <div className="bg-white dark:bg-zinc-900 dark:text-white">+ {props.dataSelection}+ <div className="px-2 mx-2">+ <SegmentNav />+ {segmentKey === ISegmentKey.vis && <VisNav />}</div>- <div className="sm:col-span-7 xl:col-span-4">- <div>- <PosFields />- </div>- <div- className="m-0.5 p-1 border border-gray-200 dark:border-gray-700"- style={{ minHeight: '600px', overflow: 'auto' }}- onMouseLeave={() => {- vizEmbededMenu.show && commonStore.closeEmbededMenu();- }}- onClick={() => {- vizEmbededMenu.show && commonStore.closeEmbededMenu();- }}- >- {datasets.length > 0 && (- <ReactiveRenderer csvRef={downloadCSVRef} ref={rendererRef} themeKey={themeKey} themeConfig={themeConfig} dark={dark} computationFunction={vizStore.computationFunction} channelScales={props.channelScales} />+ {segmentKey === ISegmentKey.vis && (+ <div style={{ marginTop: '0em', borderTop: 'none' }} className="m-4 p-4 border border-gray-200 dark:border-gray-700">+ {enhanceAPI?.features?.askviz && (+ <AskViz+ api={typeof enhanceAPI.features.askviz === 'string' ? enhanceAPI.features.askviz : ''}+ headers={enhanceAPI?.header}+ />)}- {vizEmbededMenu.show && (- <ClickMenu x={vizEmbededMenu.position[0]} y={vizEmbededMenu.position[1]}>+ <VisualSettings+ csvHandler={downloadCSVRef} rendererHandler={rendererRef}+ darkModePreference={darkMode}+ exclude={toolbar?.exclude}+ extra={toolbar?.extra}+ />+ <CodeExport />+ <ExplainData themeKey={themeKey} dark={darkMode} />+ <VisualConfig />+ <Errorpanel />+ <LogPanel />+ <BinPanel />+ {vizStore.showGeoJSONConfigPanel && <GeoConfigPanel geoList={props.geoList} />}+ <div className="sm:grid sm:grid-cols-12 xl:grid-cols-6">+ <div className="sm:col-span-3 xl:col-span-1">+ <DatasetFields />+ </div>+ <div className="sm:col-span-2 xl:col-span-1">+ <FilterField />+ <AestheticFields />+ </div>+ <div className="sm:col-span-7 xl:col-span-4">+ <div>+ <PosFields />+ </div><div- className="flex items-center whitespace-nowrap py-1 px-4 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer"+ className="m-0.5 p-1 border border-gray-200 dark:border-gray-700"+ style={{ minHeight: '600px', overflow: 'auto' }}+ onMouseLeave={() => {+ vizEmbededMenu.show && vizStore.closeEmbededMenu();+ }}onClick={() => {- commonStore.closeEmbededMenu();- commonStore.setShowInsightBoard(true);+ vizEmbededMenu.show && vizStore.closeEmbededMenu();}}>- <span className="flex-1 pr-2">- {t("App.labels.data_interpretation")}- </span>- <LightBulbIcon className="ml-1 w-3 flex-grow-0 flex-shrink-0" />+ {computation && (+ <ReactiveRenderer csvRef={downloadCSVRef}+ ref={rendererRef}+ themeKey={themeKey}+ dark={darkMode}+ themeConfig={themeConfig}+ computationFunction={computation}+ channelScales={props.channelScales}+ />+ )}+ {vizEmbededMenu.show && (+ <ClickMenu x={vizEmbededMenu.position[0]} y={vizEmbededMenu.position[1]}>+ <div+ className="flex items-center whitespace-nowrap py-1 px-4 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer"+ onClick={() => {+ vizStore.closeEmbededMenu();+ vizStore.setShowInsightBoard(true);+ }}+ >+ <span className="flex-1 pr-2">{t('App.labels.data_interpretation')}</span>+ <LightBulbIcon className="ml-1 w-3 flex-grow-0 flex-shrink-0" />+ </div>+ </ClickMenu>+ )}</div>- </ClickMenu>- )}+ </div>+ </div></div>- </div>+ )}+ {segmentKey === ISegmentKey.data && (+ <div className="m-4 p-4 border border-gray-200 dark:border-gray-700" style={{ marginTop: '0em', borderTop: 'none' }}>+ <DatasetConfig />+ </div>+ )}</div></div>- )}- {segmentKey === ISegmentKey.data && (- <div- className="m-4 p-4 border border-gray-200 dark:border-gray-700"- style={{ marginTop: '0em', borderTop: 'none' }}- >- <DatasetConfig />- </div>- )}- </div>- </div>- </ErrorBoundary>+ </ComputationContext.Provider>+ </ErrorBoundary></ErrorContext>);});-export default App;+export type VizProps = {+ i18nLang?: string;+ i18nResources?: { [lang: string]: Record<string, string | any> };+ themeKey?: IThemeKey;+ darkMode?: 'light' | 'dark';+ toolbar?: {+ extra?: ToolbarItemProps[];+ exclude?: string[];+ };+ enhanceAPI?: {+ header?: Record<string, string>;+ features?: {+ askviz?: string | boolean;+ };+ };+ keepAlive?: boolean | string;+ storeRef?: React.MutableRefObject<VizSpecStore | null>;+ rawFields: IMutField[];+ onMetaChange?: (fid: string, meta: Partial<IMutField>) => void;+ computationTimeout?: number;+} & (+ | {+ /**+ * auto parse field key into a safe string. default is true+ */+ fieldKeyGuard?: boolean;+ dataSource: any[];+ }+ | {+ fieldKeyGuard?: undefined;+ dataSource?: undefined;+ computation: IComputationFunction;+ }+);++export function VizAppWithContext(props: VizProps) {+ const { computation, safeMetas } = useMemo(() => {+ if (props.dataSource) {+ if (props.fieldKeyGuard) {+ const { safeData, safeMetas } = guardDataKeys(props.dataSource, props.rawFields);+ return {+ safeMetas,+ computation: getComputation(safeData),+ };+ }+ return {+ safeMetas: props.rawFields,+ computation: getComputation(props.dataSource),+ };+ }+ return {+ safeMetas: props.rawFields,+ computation: props.computation,+ };+ }, [props.rawFields, props.dataSource ? props.dataSource : props.computation, props.fieldKeyGuard]);-export type { ToolbarItemProps };+ return (+ <VizStoreWrapper onMetaChange={props.onMetaChange} meta={safeMetas} keepAlive={props.keepAlive} storeRef={props.storeRef}>+ <FieldsContextWrapper>+ <VizApp+ darkMode={props.darkMode}+ enhanceAPI={props.enhanceAPI}+ i18nLang={props.i18nLang}+ i18nResources={props.i18nResources}+ themeKey={props.themeKey}+ toolbar={props.toolbar}+ computation={computation}+ computationTimeout={props.computationTimeout}+ />+ </FieldsContextWrapper>+ </VizStoreWrapper>+ );+}diff --git a/packages/graphic-walker/src/FullApp.tsx b/packages/graphic-walker/src/FullApp.tsxnew file mode 100644index 00000000..bae8a3a2--- /dev/null+++ b/packages/graphic-walker/src/FullApp.tsx@@ -0,0 +1,75 @@+import React from 'react';+import { observer } from 'mobx-react-lite';+import { IChannelScales, IDarkMode, IGeoDataItem, IGeographicData, IThemeKey } from './interfaces';+import DataSourceSegment from './dataSource/index';+import { StoreWrapper, VisContext, useGlobalStore } from './store';+import { useCurrentMediaTheme } from './utils/media';+import type { ToolbarItemProps } from './components/toolbar';+import { VizApp } from './App';+import { CommonStore } from './store/commonStore';+import FieldsContextWrapper from './fields/fieldsContext';++export interface IGWProps {+ hideDataSourceConfig?: boolean;+ i18nLang?: string;+ i18nResources?: { [lang: string]: Record<string, string | any> };+ keepAlive?: boolean | string;+ /** @default "vega" */+ themeKey?: IThemeKey;+ dark?: IDarkMode;+ toolbar?: {+ extra?: ToolbarItemProps[];+ exclude?: string[];+ };+ enhanceAPI?: {+ header?: Record<string, string>;+ features?: {+ askviz?: string | boolean;+ };+ };+ storeRef?: React.MutableRefObject<CommonStore | null>;+ geographicData?: IGeographicData & {+ key: string;+ };+ onError?: (err: Error) => void;+ geoList?: IGeoDataItem[];+ channelScales?: IChannelScales;+}++export const AppContent = observer<Omit<IGWProps, 'storeRef' | 'keepAlive'>>(function App(props) {+ const { i18nLang = 'en-US', i18nResources, themeKey = 'vega', dark = 'media', toolbar, enhanceAPI } = props;+ const commonStore = useGlobalStore();++ const { dataStore } = commonStore;++ const darkMode = useCurrentMediaTheme(dark);++ return (+ <VisContext.Provider value={dataStore.visSpecStore}>+ <FieldsContextWrapper>+ <div className={`${darkMode === 'dark' ? 'dark' : ''} App font-sans bg-white dark:bg-zinc-900 dark:text-white m-0 p-0`}>+ <VizApp+ dataSelection={<DataSourceSegment />}+ computation={dataStore.computation}+ darkMode={darkMode}+ enhanceAPI={enhanceAPI}+ i18nLang={i18nLang}+ i18nResources={i18nResources}+ themeKey={themeKey}+ toolbar={toolbar}+ />+ </div>+ </FieldsContextWrapper>+ </VisContext.Provider>+ );+});++export const App = observer<IGWProps>(function App(props) {+ return (+ <StoreWrapper storeRef={props.storeRef} keepAlive={props.keepAlive}>+ <AppContent {...props} />+ </StoreWrapper>+ );+});++export default App;diff --git a/packages/graphic-walker/src/components/askViz/index.tsx b/packages/graphic-walker/src/components/askViz/index.tsxindex 1d447bd9..e80af259 100644--- a/packages/graphic-walker/src/components/askViz/index.tsx+++ b/packages/graphic-walker/src/components/askViz/index.tsx@@ -1,16 +1,14 @@import { observer } from 'mobx-react-lite';import React, { useCallback, useState } from 'react';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import { PaperAirplaneIcon } from '@heroicons/react/24/outline';import Spinner from '../spinner';import { IViewField } from '../../interfaces';-import { VisSpecWithHistory } from '../../models/visSpecHistory';-import { visSpecDecoder, forwardVisualConfigs } from '../../utils/save';import { useTranslation } from 'react-i18next';type VEGALite = any;-const api = import.meta.env.DEV ? 'http://localhost:2023/api/vis/text2gw' : 'https://enhanceai.kanaries.net/api/vis/text2gw'+const api = import.meta.env.DEV ? 'http://localhost:2023/api/vis/text2gw' : 'https://enhanceai.kanaries.net/api/vis/text2gw';async function vizQuery(api: string, metas: IViewField[], query: string, headers: Record<string, string>) {const res = await fetch(api, {@@ -42,10 +40,10 @@ async function vizQuery(api: string, metas: IViewField[], query: string, headers}}-const AskViz: React.FC<{api?: string; headers?: Record<string, string>}> = (props) => {+const AskViz: React.FC<{ api?: string; headers?: Record<string, string> }> = (props) => {const [query, setQuery] = useState<string>('');const [loading, setLoading] = useState<boolean>(false);- const { vizStore } = useGlobalStore();+ const vizStore = useVizStore();const {t} = useTranslation();const allFields = vizStore.allFields;@@ -54,10 +52,7 @@ const AskViz: React.FC<{api?: string; headers?: Record<string, string>}> = (propsetLoading(true);vizQuery(props.api ?? api, allFields, query, props.headers ?? {}).then((data) => {- vizStore.visList.push(new VisSpecWithHistory(visSpecDecoder(forwardVisualConfigs([data]))[0]));- vizStore.selectVisualization(vizStore.visList.length - 1);- // const liteGW = parseGW(spec);- // vizStore.renderSpec(liteGW);+ vizStore.appendFromOld(data);}).finally(() => {setLoading(false);diff --git a/packages/graphic-walker/src/components/codeExport/index.tsx b/packages/graphic-walker/src/components/codeExport/index.tsxindex ac75000d..6e879b31 100644--- a/packages/graphic-walker/src/components/codeExport/index.tsx+++ b/packages/graphic-walker/src/components/codeExport/index.tsx@@ -1,7 +1,7 @@import React, { useEffect, useState } from "react";import Modal from "../modal";import { observer } from "mobx-react-lite";-import { useGlobalStore } from "../../store";+import { useVizStore } from "../../store";import DefaultButton from "../button/default";import PrimaryButton from "../button/primary";import { useTranslation } from "react-i18next";@@ -39,8 +39,8 @@ const syntaxHighlight = (json: any) => {};const CodeExport: React.FC = observer((props) => {- const { commonStore, vizStore } = useGlobalStore();- const { showCodeExportPanel } = commonStore;+ const vizStore = useVizStore();+ const { showCodeExportPanel } = vizStore;const { t } = useTranslation();const [tabKey, setTabKey] = useState<string>("graphic-walker");const [code, setCode] = useState<any>("");@@ -60,7 +60,7 @@ const CodeExport: React.FC = observer((props) => {useEffect(() => {if (showCodeExportPanel) {if (tabKey === "graphic-walker") {- const res = vizStore.exportViewSpec();+ const res = vizStore.exportCode();setCode(res);} else {setCode("vega code");@@ -71,7 +71,7 @@ const CodeExport: React.FC = observer((props) => {<Modalshow={showCodeExportPanel}onClose={() => {- commonStore.setShowCodeExportPanel(false);+ vizStore.setShowCodeExportPanel(false);}}><div>@@ -95,14 +95,14 @@ const CodeExport: React.FC = observer((props) => {text="Copy to Clipboard"onClick={() => {navigator.clipboard.writeText(JSON.stringify(code));- commonStore.setShowCodeExportPanel(false);+ vizStore.setShowCodeExportPanel(false);}}/><DefaultButtontext={t("actions.cancel")}className="mr-2 px-6"onClick={() => {- commonStore.setShowCodeExportPanel(false);+ vizStore.setShowCodeExportPanel(false);}}/></div>diff --git a/packages/graphic-walker/src/components/dataTable/index.tsx b/packages/graphic-walker/src/components/dataTable/index.tsxindex 5c951540..aefde4a0 100644--- a/packages/graphic-walker/src/components/dataTable/index.tsx+++ b/packages/graphic-walker/src/components/dataTable/index.tsx@@ -4,8 +4,7 @@ import { observer } from 'mobx-react-lite';import type { IMutField, IRow, DataSet, IComputationFunction } from '../../interfaces';import { useTranslation } from 'react-i18next';import LoadingLayer from "../loadingLayer";-import { useComputationFunc } from "../../renderer/hooks";-import { dataReadRawServer } from "../../computation/serverComputation";+import { dataReadRaw } from "../../computation";import Pagination from './pagination';import { ChevronUpDownIcon } from '@heroicons/react/24/outline';import DropdownContext from '../dropdownContext';@@ -15,8 +14,8 @@ interface DataTableProps {size?: number;/** total count of rows */total: number;- dataset: DataSet;- computation?: IComputationFunction;+ metas: IMutField[];+ computation: IComputationFunction;onMetaChange: (fid: string, fIndex: number, meta: Partial<IMutField>) => void;loading?: boolean;}@@ -118,11 +117,10 @@ const getHeaderKey = (f: wrapMutField) => {};const DataTable: React.FC<DataTableProps> = (props) => {- const { size = 10, onMetaChange, dataset, computation, total, loading: statLoading } = props;+ const { size = 10, onMetaChange, metas, computation, total, loading: statLoading } = props;const [pageIndex, setPageIndex] = useState(0);const { t } = useTranslation();- const defaultComputation = useComputationFunc();- const computationFunction = computation ?? defaultComputation;+ const computationFunction = computation;const analyticTypeList = useMemo<{ value: string; label: string }[]>(() => {return ANALYTIC_TYPE_LIST.map((at) => ({@@ -148,7 +146,7 @@ const DataTable: React.FC<DataTableProps> = (props) => {useEffect(() => {setDataLoading(true);const taskId = ++taskIdRef.current;- dataReadRawServer(computationFunction, size, pageIndex).then(data => {+ dataReadRaw(computationFunction, size, pageIndex).then(data => {if (taskId === taskIdRef.current) {setDataLoading(false);setRows(data);@@ -167,8 +165,6 @@ const DataTable: React.FC<DataTableProps> = (props) => {const loading = statLoading || dataLoading;- const metas = dataset.rawFields;-const headers = useMemo(() => getHeaders(metas), [metas]);return (@@ -226,7 +222,7 @@ const DataTable: React.FC<DataTableProps> = (props) => {><spanclassName={- 'cursor-pointer inline-flex px-2.5 py-0.5 text-xs font-medium mt-1 rounded-full text-xs text-white ' ++ 'cursor-pointer inline-flex px-2.5 py-0.5 text-xs font-medium mt-1 rounded-full text-white ' +(f.value.analyticType === 'dimension'? 'bg-blue-500': 'bg-purple-500')@@ -248,7 +244,7 @@ const DataTable: React.FC<DataTableProps> = (props) => {><spanclassName={- 'cursor-pointer inline-flex px-2.5 py-0.5 text-xs font-medium mt-1 rounded-full text-xs ' ++ 'cursor-pointer inline-flex px-2.5 py-0.5 text-xs font-medium mt-1 rounded-full ' +getSemanticColors(f.value)}>diff --git a/packages/graphic-walker/src/components/errorpanel/index.tsx b/packages/graphic-walker/src/components/errorpanel/index.tsxindex 829274e9..145375c4 100644--- a/packages/graphic-walker/src/components/errorpanel/index.tsx+++ b/packages/graphic-walker/src/components/errorpanel/index.tsx@@ -1,14 +1,14 @@import { observer } from 'mobx-react-lite';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import React from 'react';import Modal from '../smallModal';import { useTranslation } from 'react-i18next';import DefaultButton from '../button/default';export default observer(function ErrorPanel() {- const { commonStore, vizStore } = useGlobalStore();+ const vizStore = useVizStore();const { t } = useTranslation();- switch (commonStore.showErrorResolutionPanel) {+ switch (vizStore.showErrorResolutionPanel) {case 0:return null;case 500:@@ -22,8 +22,8 @@ export default observer(function ErrorPanel() {<aclassName="mx-2 cursor-pointer font-semibold text-indigo-600 hover:text-indigo-500"onClick={() => {- vizStore.setChartLayout({ mode: 'fixed', width: 800, height: 600 });- commonStore.updateShowErrorResolutionPanel(0);+ vizStore.setVisualLayout('size', { mode: 'fixed', width: 800, height: 600 });+ vizStore.updateShowErrorResolutionPanel(0);}}>Set Now@@ -34,8 +34,8 @@ export default observer(function ErrorPanel() {<aclassName="mx-2 cursor-pointer font-semibold text-indigo-600 hover:text-indigo-500"onClick={() => {- vizStore.setVisualConfig('useSvg', true);- commonStore.updateShowErrorResolutionPanel(0);+ vizStore.setVisualLayout('useSvg', true);+ vizStore.updateShowErrorResolutionPanel(0);}}>Set Now@@ -48,7 +48,7 @@ export default observer(function ErrorPanel() {text={`Close`}className="mr-2 px-2"onClick={() => {- commonStore.updateShowErrorResolutionPanel(0);+ vizStore.updateShowErrorResolutionPanel(0);return;}}/>diff --git a/packages/graphic-walker/src/components/explainData/index.tsx b/packages/graphic-walker/src/components/explainData/index.tsxindex 89e5d8d3..74bc9fab 100644--- a/packages/graphic-walker/src/components/explainData/index.tsx+++ b/packages/graphic-walker/src/components/explainData/index.tsx@@ -1,7 +1,7 @@import React, { useEffect, useState, useRef, useMemo } from "react";import Modal from "../modal";import { observer } from "mobx-react-lite";-import { useGlobalStore } from "../../store";+import { useCompututaion, useGlobalStore, useVizStore } from "../../store";import { useTranslation } from "react-i18next";import { getMeaAggKey } from '../../utils';import styled from 'styled-components';@@ -44,9 +44,9 @@ const ExplainData: React.FC<{dark: IDarkMode,themeKey: IThemeKey}> = observer(({dark, themeKey}) => {- const { vizStore, commonStore } = useGlobalStore();- const { allFields, viewMeasures, viewDimensions, viewFilters, computationFunction } = vizStore;- const { showInsightBoard, selectedMarkObject } = commonStore;+ const vizStore = useVizStore();+ const computationFunction = useCompututaion();+ const { allFields, viewMeasures, viewDimensions, viewFilters, showInsightBoard, selectedMarkObject } = vizStore;const [ explainDataInfoList, setExplainDataInfoList ] = useState<{score: number;measureField: IField;@@ -167,7 +167,7 @@ const ExplainData: React.FC<{<Modalshow={showInsightBoard}onClose={() => {- commonStore.setShowInsightBoard(false);+ vizStore.setShowInsightBoard(false);setSelectedInfoIndex(0);}}>diff --git a/packages/graphic-walker/src/components/leafletRenderer/geoConfigPanel.tsx b/packages/graphic-walker/src/components/leafletRenderer/geoConfigPanel.tsxindex aa3cc1e9..8dae78fd 100644--- a/packages/graphic-walker/src/components/leafletRenderer/geoConfigPanel.tsx+++ b/packages/graphic-walker/src/components/leafletRenderer/geoConfigPanel.tsx@@ -1,8 +1,9 @@import { observer } from 'mobx-react-lite';import React, { useEffect, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import { runInAction } from 'mobx';+import { useVizStore } from '../../store';import Spinner from '../spinner';-import { useGlobalStore } from '../../store';import Modal from '../modal';import PrimaryButton from '../button/primary';import DefaultButton from '../button/default';@@ -14,10 +15,9 @@ import { GeojsonRenderer } from './geojsonRenderer';const emptyList = [];const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) => {- const { commonStore, vizStore } = useGlobalStore();- const { showGeoJSONConfigPanel } = commonStore;- const { visualConfig } = vizStore;- const { geoKey, geojson, geoUrl } = visualConfig;+ const vizStore = useVizStore();+ const { layout, showGeoJSONConfigPanel } = vizStore;+ const { geoKey, geojson, geoUrl } = layout;const { t: tGlobal } = useTranslation('translation');const { t } = useTranslation('translation', { keyPrefix: 'main.tabpanel.settings' });@@ -79,17 +79,17 @@ const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) =if (!item) {vizStore.clearGeographicData();} else {- vizStore.setGeographicUrl({+ vizStore.setVisualLayout('geoUrl', {type: item.type,url: item.url,});}- commonStore.setShowGeoJSONConfigPanel(false);+ vizStore.setShowGeoJSONConfigPanel(false);return;}try {if (!(dataMode === 'GeoJSON' ? geoJSON : topoJSON) && loadedUrl) {- commonStore.setShowGeoJSONConfigPanel(false);+ vizStore.setShowGeoJSONConfigPanel(false);return;}const json = JSON.parse(dataMode === 'GeoJSON' ? geoJSON : topoJSON);@@ -113,14 +113,19 @@ const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) =loadedUrl?.type === 'GeoJSON' ? loadedUrl : undefined);}- commonStore.setShowGeoJSONConfigPanel(false);+ vizStore.setShowGeoJSONConfigPanel(false);} catch (err) {console.error(err);}};return (- <Modal containerStyle={{ overflow: 'visible' }} show={showGeoJSONConfigPanel} onClose={() => commonStore.setShowGeoJSONConfigPanel(false)}>+ <Modal+ containerStyle={{ overflow: 'visible' }} show={showGeoJSONConfigPanel}+ onClose={() => {+ vizStore.setShowGeoJSONConfigPanel(false);+ }}+ ><div><h2 className="text-lg mb-4">{t('geography')}</h2><div>@@ -265,7 +270,7 @@ const GeoConfigPanel = ({ geoList = emptyList }: { geoList?: IGeoDataItem[] }) =text={tGlobal('actions.cancel')}className="mr-2"onClick={() => {- commonStore.setShowGeoJSONConfigPanel(false);+ vizStore.setShowGeoJSONConfigPanel(false);}}/></div>diff --git a/packages/graphic-walker/src/components/leafletRenderer/index.tsx b/packages/graphic-walker/src/components/leafletRenderer/index.tsxindex 9914808f..eaf4256d 100644--- a/packages/graphic-walker/src/components/leafletRenderer/index.tsx+++ b/packages/graphic-walker/src/components/leafletRenderer/index.tsx@@ -1,5 +1,5 @@import React, { forwardRef, useMemo } from "react";-import type { DeepReadonly, DraggableFieldState, IRow, IVisualConfig, VegaGlobalConfig } from "../../interfaces";+import type { DraggableFieldState, IRow, IVisualConfigNew, IVisualLayout, VegaGlobalConfig } from "../../interfaces";import POIRenderer from "./POIRenderer";import ChoroplethRenderer from "./ChoroplethRenderer";@@ -7,8 +7,9 @@ import ChoroplethRenderer from "./ChoroplethRenderer";export interface ILeafletRendererProps {name?: string;vegaConfig?: VegaGlobalConfig;- draggableFieldState: DeepReadonly<DraggableFieldState>;- visualConfig: DeepReadonly<IVisualConfig>;+ draggableFieldState: DraggableFieldState;+ visualConfig: IVisualConfigNew;+ visualLayout: IVisualLayout;data: IRow[];}@@ -18,9 +19,10 @@ export const LEAFLET_DEFAULT_WIDTH = 800;export const LEAFLET_DEFAULT_HEIGHT = 600;const LeafletRenderer = forwardRef<ILeafletRendererRef, ILeafletRendererProps>(function LeafletRenderer (props, ref) {- const { name, draggableFieldState, data, visualConfig, vegaConfig = {} } = props;+ const { name, draggableFieldState, data, visualConfig, visualLayout, vegaConfig = {} } = props;const { latitude: [lat], longitude: [lng], geoId: [geoId], dimensions, measures, size: [size], color: [color], opacity: [opacity], text: [text], details } = draggableFieldState;- const { defaultAggregated, geoms: [markType], geojson, geoKey = '', geoUrl, scaleIncludeUnmatchedChoropleth = false } = visualConfig;+ const { defaultAggregated, geoms: [markType], } = visualConfig;+ const { geojson, geoKey = '', geoUrl, scaleIncludeUnmatchedChoropleth = false } = visualLayout;const allFields = useMemo(() => [...dimensions, ...measures], [dimensions, measures]);const latField = useMemo(() => allFields.find((f) => f.geoRole === 'latitude'), [allFields]);const lngField = useMemo(() => allFields.find((f) => f.geoRole === 'longitude'), [allFields]);diff --git a/packages/graphic-walker/src/components/pivotTable/index.tsx b/packages/graphic-walker/src/components/pivotTable/index.tsxindex a68f7576..1a6ade1e 100644--- a/packages/graphic-walker/src/components/pivotTable/index.tsx+++ b/packages/graphic-walker/src/components/pivotTable/index.tsx@@ -1,18 +1,25 @@import React, { useEffect, useMemo, useState, useRef } from 'react';-import { useGlobalStore } from '../../store';import { buildPivotTableService } from '../../services';import { toWorkflow } from '../../utils/workflow';-import { dataQueryServer } from '../../computation/serverComputation';+import { dataQuery } from '../../computation';import { useAppRootContext } from '../../components/appRoot';-import { observer } from 'mobx-react-lite';import LeftTree from './leftTree';import TopTree from './topTree';-import { DeepReadonly, DraggableFieldState, IComputationFunction, IDarkMode, IRow, IThemeKey, IViewField, IVisualConfig } from '../../interfaces';+import {+ DeepReadonly,+ DraggableFieldState,+ IDarkMode,+ IRow,+ IThemeKey,+ IViewField,+ IVisualConfigNew,+ IVisualLayout,+} from '../../interfaces';import { INestNode } from './inteface';import { unstable_batchedUpdates } from 'react-dom';import MetricTable from './metricTable';-import { toJS } from 'mobx';import LoadingLayer from '../loadingLayer';+import { useCompututaion, useVizStore } from '../../store';import { fold2 } from '../../lib/op/fold';interface PivotTableProps {@@ -21,32 +28,37 @@ interface PivotTableProps {data: IRow[];loading: boolean;draggableFieldState: DeepReadonly<DraggableFieldState>;- visualConfig: DeepReadonly<IVisualConfig>;- computationFunction: IComputationFunction;+ visualConfig: IVisualConfigNew;+ layout: IVisualLayout;}-const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableComponent(props) {- const { data, visualConfig, loading, computationFunction } = props;+const emptyMap = new Map();++const PivotTable: React.FC<PivotTableProps> = function PivotTableComponent(props) {+ const { data, visualConfig, loading, layout, draggableFieldState } = props;+ const computation = useCompututaion();const appRef = useAppRootContext();const [leftTree, setLeftTree] = useState<INestNode | null>(null);const [topTree, setTopTree] = useState<INestNode | null>(null);const [metricTable, setMetricTable] = useState<any[][]>([]);const [isLoading, setIsLoading] = useState<boolean>(false);- const { vizStore, commonStore } = useGlobalStore();- const { allFields, viewFilters, viewMeasures, sort, limit, draggableFieldState } = vizStore;+ const vizStore = useVizStore();+ const enableCollapse = !!vizStore;+ const { allFields, viewMeasures } = vizStore;+ const tableCollapsedHeaderMap = vizStore?.tableCollapsedHeaderMap ?? emptyMap;const { rows, columns } = draggableFieldState;- const { showTableSummary, defaultAggregated, folds } = visualConfig;- const { tableCollapsedHeaderMap } = commonStore;+ const { defaultAggregated, folds } = visualConfig;+ const { showTableSummary } = layoutconst aggData = useRef<IRow[]>([]);const [topTreeHeaderRowNum, setTopTreeHeaderRowNum] = useState<number>(0);const dimsInRow = useMemo(() => {- return toJS(rows).filter((f) => f.analyticType === 'dimension');+ return rows.filter((f) => f.analyticType === 'dimension');}, [rows]);const dimsInColumn = useMemo(() => {- return toJS(columns).filter((f) => f.analyticType === 'dimension');+ return columns.filter((f) => f.analyticType === 'dimension');}, [columns]);const measInRow = useMemo(() => {@@ -58,10 +70,14 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableCompon}, [columns]);useEffect(() => {- if (tableCollapsedHeaderMap.size > 0) {+ if (!enableCollapse) {+ generateNewTable();+ return;+ }+ if (vizStore.tableCollapsedHeaderMap.size > 0) {// If some visual configs change, clear the collapse state// As tableCollapsedHeaderMap is also listened, data will be reaggregated later.- commonStore.resetTableCollapsedHeader();+ vizStore.resetTableCollapsedHeader();// This forces data to be reaggregated if showTableSummary is on, as aggregation will be skipped later.if (showTableSummary) {aggregateGroupbyData();@@ -69,16 +85,16 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableCompon} else {aggregateThenGenerate();}- }, [data]);+ }, [data, enableCollapse]);useEffect(() => {- if (showTableSummary) {+ if (!enableCollapse || showTableSummary) {// If showTableSummary is on, there is no need to generate extra queries. Directly generate new table.generateNewTable();} else {aggregateThenGenerate();}- }, [tableCollapsedHeaderMap]);+ }, [enableCollapse, vizStore?.tableCollapsedHeaderMap]);const aggregateThenGenerate = async () => {await aggregateGroupbyData();@@ -129,8 +145,8 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableComponsetIsLoading(true);appRef.current?.updateRenderStatus('computing');const groupbyPromises: Promise<IRow[]>[] = groupbyCombList.map((dimComb) => {- const workflow = toWorkflow(viewFilters, allFields, dimComb, viewMeasures, defaultAggregated, sort, folds ?? [], limit > 0 ? limit : undefined);- return dataQueryServer(computationFunction, workflow, limit > 0 ? limit : undefined)+ const workflow = toWorkflow(vizStore.viewFilters, vizStore.allFields, dimComb, vizStore.viewMeasures, defaultAggregated, vizStore.sort, folds ?? [], vizStore.limit > 0 ? vizStore.limit : undefined);+ return dataQuery(computation, workflow, vizStore.limit > 0 ? vizStore.limit : undefined).then((res) => fold2(res, defaultAggregated, allFields, viewMeasures, dimComb, folds)).catch((err) => {appRef.current?.updateRenderStatus('error');@@ -196,7 +212,8 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableCompondata={leftTree}dimsInRow={dimsInRow}measInRow={measInRow}- onHeaderCollapse={commonStore.updateTableCollapsedHeader.bind(commonStore)}+ onHeaderCollapse={n => vizStore?.updateTableCollapsedHeader(n)}+ enableCollapse={enableCollapse}/>)}</table>@@ -206,8 +223,9 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableCompondata={topTree}dimsInCol={dimsInColumn}measInCol={measInColumn}- onHeaderCollapse={commonStore.updateTableCollapsedHeader.bind(commonStore)}+ onHeaderCollapse={n => vizStore?.updateTableCollapsedHeader(n)}onTopTreeHeaderRowNumChange={(num) => setTopTreeHeaderRowNum(num)}+ enableCollapse={enableCollapse}/>)}{metricTable && <MetricTable matrix={metricTable} meaInColumns={measInColumn} meaInRows={measInRow} />}@@ -215,6 +233,6 @@ const PivotTable: React.FC<PivotTableProps> = observer(function PivotTableCompon</div></div>);-});+};export default PivotTable;diff --git a/packages/graphic-walker/src/components/pivotTable/leftTree.tsx b/packages/graphic-walker/src/components/pivotTable/leftTree.tsxindex c0a81e3f..d7652347 100644--- a/packages/graphic-walker/src/components/pivotTable/leftTree.tsx+++ b/packages/graphic-walker/src/components/pivotTable/leftTree.tsx@@ -18,7 +18,7 @@ function getChildCount(node: INestNode): number {* @param cellRows* @returns*/-function renderTree(node: INestNode, dimsInRow: IField[], depth: number, cellRows: ReactNode[][], meaNumber: number, onHeaderCollapse: (node: INestNode) => void) {+function renderTree(node: INestNode, dimsInRow: IField[], depth: number, cellRows: ReactNode[][], meaNumber: number, onHeaderCollapse: (node: INestNode) => void, enableCollapse: boolean) {const childrenSize = getChildCount(node);const { isCollapsed } = node;if (depth > dimsInRow.length) {@@ -33,7 +33,7 @@ function renderTree(node: INestNode, dimsInRow: IField[], depth: number, cellRow><div className="flex"><div>{node.value}</div>- {node.height > 0 && node.key !== "__total" && (+ {node.height > 0 && node.key !== "__total" && enableCollapse && (<>{isCollapsed && <PlusCircleIcon className="w-3 ml-1 self-center cursor-pointer" onClick={() => onHeaderCollapse(node)} />}{!isCollapsed && <MinusCircleIcon className="w-3 ml-1 self-center cursor-pointer" onClick={() => onHeaderCollapse(node)} />}@@ -45,7 +45,7 @@ function renderTree(node: INestNode, dimsInRow: IField[], depth: number, cellRowif (isCollapsed) returnfor (let i = 0; i < node.children.length; i++) {const child = node.children[i];- renderTree(child, dimsInRow, depth + 1, cellRows, meaNumber, onHeaderCollapse);+ renderTree(child, dimsInRow, depth + 1, cellRows, meaNumber, onHeaderCollapse, enableCollapse);if (i < node.children.length - 1) {cellRows.push([]);}@@ -57,12 +57,13 @@ export interface TreeProps {dimsInRow: IField[];measInRow: IField[];onHeaderCollapse: (node: INestNode) => void;+ enableCollapse: boolean}const LeftTree: React.FC<TreeProps> = (props) => {const { data, dimsInRow, measInRow, onHeaderCollapse } = props;const nodeCells: ReactNode[] = useMemo(() => {const cellRows: ReactNode[][] = [[]];- renderTree(data, dimsInRow, 0, cellRows, measInRow.length, onHeaderCollapse);+ renderTree(data, dimsInRow, 0, cellRows, measInRow.length, onHeaderCollapse, props.enableCollapse);cellRows[0].shift();if (measInRow.length > 0) {const ans: ReactNode[][] = [];diff --git a/packages/graphic-walker/src/components/pivotTable/topTree.tsx b/packages/graphic-walker/src/components/pivotTable/topTree.tsxindex db0172cf..2b6ce13e 100644--- a/packages/graphic-walker/src/components/pivotTable/topTree.tsx+++ b/packages/graphic-walker/src/components/pivotTable/topTree.tsx@@ -18,7 +18,7 @@ function getChildCount(node: INestNode): number {* @param cellRows* @returns*/-function renderTree(node: INestNode, dimsInCol: IField[], depth: number, cellRows: ReactNode[][], meaNumber: number, onHeaderCollapse: (node: INestNode) => void) {+function renderTree(node: INestNode, dimsInCol: IField[], depth: number, cellRows: ReactNode[][], meaNumber: number, onHeaderCollapse: (node: INestNode) => void, enableCollapse: boolean) {const childrenSize = getChildCount(node);const { isCollapsed } = node;if (depth > dimsInCol.length) {@@ -33,7 +33,7 @@ function renderTree(node: INestNode, dimsInCol: IField[], depth: number, cellRow><div className="flex"><div>{node.value}</div>- {node.height > 0 && node.key !== "__total" && (+ {node.height > 0 && node.key !== "__total" && enableCollapse && (<>{isCollapsed && <PlusCircleIcon className="w-3 ml-1 self-center cursor-pointer" onClick={() => onHeaderCollapse(node)} />}{!isCollapsed && <MinusCircleIcon className="w-3 ml-1 self-center cursor-pointer" onClick={() => onHeaderCollapse(node)} />}@@ -45,7 +45,7 @@ function renderTree(node: INestNode, dimsInCol: IField[], depth: number, cellRowif (isCollapsed) return;for (let i = 0; i < node.children.length; i++) {const child = node.children[i];- renderTree(child, dimsInCol, depth + 1, cellRows, meaNumber, onHeaderCollapse);+ renderTree(child, dimsInCol, depth + 1, cellRows, meaNumber, onHeaderCollapse, enableCollapse);}}@@ -55,12 +55,13 @@ export interface TreeProps {measInCol: IField[];onHeaderCollapse: (node: INestNode) => void;onTopTreeHeaderRowNumChange: (num: number) => void;+ enableCollapse: boolean;}const TopTree: React.FC<TreeProps> = (props) => {const { data, dimsInCol, measInCol, onHeaderCollapse, onTopTreeHeaderRowNumChange } = props;const nodeCells: ReactNode[][] = useMemo(() => {const cellRows: ReactNode[][] = new Array(dimsInCol.length + 1).fill(0).map(() => []);- renderTree(data, dimsInCol, 0, cellRows, measInCol.length, onHeaderCollapse);+ renderTree(data, dimsInCol, 0, cellRows, measInCol.length, onHeaderCollapse, props.enableCollapse);const totalChildrenSize = getChildCount(data);// if all children in one layer are collapsed, then we need to reset the rowSpan of all children to 1diff --git a/packages/graphic-walker/src/components/removeConfirm.tsx b/packages/graphic-walker/src/components/removeConfirm.tsxindex 13683987..95a31fef 100644--- a/packages/graphic-walker/src/components/removeConfirm.tsx+++ b/packages/graphic-walker/src/components/removeConfirm.tsx@@ -1,7 +1,7 @@import React from 'react';import Modal from './modal';import { observer } from 'mobx-react-lite';-import { useGlobalStore } from '../store';+import { useVizStore } from '../store';import DefaultButton from './button/default';import PrimaryButton from './button/primary';import { useTranslation } from 'react-i18next';@@ -9,9 +9,9 @@ import { useTranslation } from 'react-i18next';const RemoveConfirm = observer(function RemoveConfirm() {const { t } = useTranslation();- const { vizStore } = useGlobalStore();+ const viz = useVizStore();return (- <Modal onClose={() => vizStore.closeRemoveConfirmModal()} show={vizStore.removeConfirmIdx !== null}>+ <Modal onClose={() => viz.closeRemoveConfirmModal()} show={viz.removeConfirmIdx !== null}><div><span className="block text-sm font-medium leading-6">{t('main.tablist.remove_confirm')}</span><div className="mt-4 flex justify-end">@@ -19,15 +19,15 @@ const RemoveConfirm = observer(function RemoveConfirm() {className="mr-2"text={t('actions.cancel')}onClick={() => {- vizStore.closeRemoveConfirmModal();+ viz.closeRemoveConfirmModal();}}/><PrimaryButtonclassName="bg-red-600 hover:bg-red-700"text={t('actions.confirm')}onClick={() => {- vizStore.removeVisualization(vizStore.removeConfirmIdx!);- vizStore.closeRemoveConfirmModal();+ viz.removeVisualization(viz.removeConfirmIdx!);+ viz.closeRemoveConfirmModal();}}/></div>@@ -36,4 +36,4 @@ const RemoveConfirm = observer(function RemoveConfirm() {);});-export default RemoveConfirm;+export default RemoveConfirm;\ No newline at end of filediff --git a/packages/graphic-walker/src/components/visualConfig/index.tsx b/packages/graphic-walker/src/components/visualConfig/index.tsxindex 4c9e4d46..15c86b69 100644--- a/packages/graphic-walker/src/components/visualConfig/index.tsx+++ b/packages/graphic-walker/src/components/visualConfig/index.tsx@@ -4,9 +4,9 @@ import { runInAction, toJS } from 'mobx';import { useTranslation } from 'react-i18next';import { SketchPicker } from 'react-color';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import { GLOBAL_CONFIG } from '../../config';-import { IConfigScale, IVisualConfig } from '../../interfaces';+import { IConfigScale, IVisualConfig, IVisualLayout } from '../../interfaces';import PrimaryButton from '../button/primary';import DefaultButton from '../button/default';@@ -16,6 +16,7 @@ import DropdownSelect from '../dropdownSelect';import { ColorSchemes, extractRGBA } from './colorScheme';import { RangeScale } from './range-scale';import { ConfigItemContainer, ConfigItemContent, ConfigItemHeader, ConfigItemTitle } from './config-item';+import { KVTuple } from '../../models/utils';const DEFAULT_COLOR_SCHEME = ['#5B8FF9', '#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF'];@@ -67,33 +68,32 @@ function useScale(minRange: number, maxRange: number, defaultMinRange?: number,}const VisualConfigPanel: React.FC = (props) => {- const { commonStore, vizStore } = useGlobalStore();- const { showVisualConfigPanel } = commonStore;- const { visualConfig } = vizStore;+ const vizStore = useVizStore();+ const { config, layout, showVisualConfigPanel } = vizStore;const {coordSystem,geoms: [markType],- } = visualConfig;+ } = config;const isChoropleth = coordSystem === 'geographic' && markType === 'choropleth';const { t } = useTranslation();const formatConfigList: (keyof IVisualConfig['format'])[] = ['numberFormat', 'timeFormat', 'normalizedNumberFormat'];const [format, setFormat] = useState<IVisualConfig['format']>({- numberFormat: visualConfig.format.numberFormat,- timeFormat: visualConfig.format.timeFormat,- normalizedNumberFormat: visualConfig.format.normalizedNumberFormat,+ numberFormat: layout.format.numberFormat,+ timeFormat: layout.format.timeFormat,+ normalizedNumberFormat: layout.format.normalizedNumberFormat,});const [resolve, setResolve] = useState<IVisualConfig['resolve']>({- x: visualConfig.resolve.x,- y: visualConfig.resolve.y,- color: visualConfig.resolve.color,- opacity: visualConfig.resolve.opacity,- shape: visualConfig.resolve.shape,- size: visualConfig.resolve.size,+ x: layout.resolve.x,+ y: layout.resolve.y,+ color: layout.resolve.color,+ opacity: layout.resolve.opacity,+ shape: layout.resolve.shape,+ size: layout.resolve.size,});- const [zeroScale, setZeroScale] = useState<boolean>(visualConfig.zeroScale);- const [svg, setSvg] = useState<boolean>(visualConfig.useSvg ?? false);- const [scaleIncludeUnmatchedChoropleth, setScaleIncludeUnmatchedChoropleth] = useState<boolean>(visualConfig.scaleIncludeUnmatchedChoropleth ?? false);- const [background, setBackground] = useState<string | undefined>(visualConfig.background);+ const [zeroScale, setZeroScale] = useState<boolean>(layout.zeroScale);+ const [svg, setSvg] = useState<boolean>(layout.useSvg ?? false);+ const [scaleIncludeUnmatchedChoropleth, setScaleIncludeUnmatchedChoropleth] = useState<boolean>(layout.scaleIncludeUnmatchedChoropleth ?? false);+ const [background, setBackground] = useState<string | undefined>(layout.background);const [defaultColor, setDefaultColor] = useState({ r: 91, g: 143, b: 249, a: 1 });const [colorEdited, setColorEdited] = useState(false);const [displayColorPicker, setDisplayColorPicker] = useState(false);@@ -102,27 +102,27 @@ const VisualConfigPanel: React.FC = (props) => {const sizeValue = useScale(0, 100);useEffect(() => {- setZeroScale(visualConfig.zeroScale);- setBackground(visualConfig.background);- setResolve(toJS(visualConfig.resolve));- setDefaultColor(extractRGBA(visualConfig.primaryColor));+ setZeroScale(layout.zeroScale);+ setBackground(layout.background);+ setResolve(layout.resolve);+ setDefaultColor(extractRGBA(layout.primaryColor));setColorEdited(false);- setScaleIncludeUnmatchedChoropleth(visualConfig.scaleIncludeUnmatchedChoropleth ?? false);+ setScaleIncludeUnmatchedChoropleth(layout.scaleIncludeUnmatchedChoropleth ?? false);setFormat({- numberFormat: visualConfig.format.numberFormat,- timeFormat: visualConfig.format.timeFormat,- normalizedNumberFormat: visualConfig.format.normalizedNumberFormat,+ numberFormat: layout.format.numberFormat,+ timeFormat: layout.format.timeFormat,+ normalizedNumberFormat: layout.format.normalizedNumberFormat,});- setColorPalette(visualConfig.colorPalette ?? '');- opacityValue.setValue(visualConfig.scale?.opacity ?? {});- sizeValue.setValue(visualConfig.scale?.size ?? {});+ setColorPalette(layout.colorPalette ?? '');+ opacityValue.setValue(layout.scale?.opacity ?? {});+ sizeValue.setValue(layout.scale?.size ?? {});}, [showVisualConfigPanel]);return (<Modalshow={showVisualConfigPanel}onClose={() => {- commonStore.setShowVisualConfigPanel(false);+ vizStore.setShowVisualConfigPanel(false);}}><div@@ -197,7 +197,9 @@ const VisualConfigPanel: React.FC = (props) => {/></div><div>- <label className="block text-xs font-medium leading-6">{t('config.background')} {t(`config.color`)}</label>+ <label className="block text-xs font-medium leading-6">+ {t('config.background')} {t(`config.color`)}+ </label><inputtype="text"className="block w-full text-gray-700 dark:text-gray-200 rounded-md border-0 py-1 px-2 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 placeholder:text-gray-400 focus:ring-1 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 dark:bg-zinc-900 "@@ -261,12 +263,6 @@ const VisualConfigPanel: React.FC = (props) => {<ConfigItemContainer><ConfigItemHeader><ConfigItemTitle>{t('config.independence')}</ConfigItemTitle>- <p className="text-xs">- {t(`config.formatGuidesDocs`)}:{' '}- <a target="_blank" className="underline text-blue-500" href="https://docs.kanaries.net">- {t(`config.readHere`)}- </a>- </p></ConfigItemHeader><ConfigItemContent><div className="flex space-x-6">@@ -336,18 +332,25 @@ const VisualConfigPanel: React.FC = (props) => {className="mr-2"onClick={() => {runInAction(() => {- vizStore.setVisualConfig('format', format);- vizStore.setVisualConfig('zeroScale', zeroScale);- vizStore.setVisualConfig('scaleIncludeUnmatchedChoropleth', scaleIncludeUnmatchedChoropleth);- vizStore.setVisualConfig('background', background);- vizStore.setVisualConfig('resolve', resolve);- if (colorEdited) {- vizStore.setVisualConfig('primaryColor', `rgba(${defaultColor.r},${defaultColor.g},${defaultColor.b},${defaultColor.a})`);- }- vizStore.setVisualConfig('colorPalette', colorPalette);- vizStore.setVisualConfig('useSvg', svg);- vizStore.setVisualConfig('scale', { opacity: opacityValue.value, size: sizeValue.value });- commonStore.setShowVisualConfigPanel(false);+ vizStore.setVisualLayout(+ ['format', format],+ ['zeroScale', zeroScale],+ ['scaleIncludeUnmatchedChoropleth', scaleIncludeUnmatchedChoropleth],+ ['background', background],+ ['resolve', resolve],+ ['colorPalette', colorPalette],+ ['useSvg', svg],+ ['scale', { opacity: opacityValue.value, size: sizeValue.value }],+ ...(colorEdited+ ? [+ [+ 'primaryColor',+ `rgba(${defaultColor.r},${defaultColor.g},${defaultColor.b},${defaultColor.a})`,+ ] as KVTuple<IVisualLayout>,+ ]+ : [])+ );+ vizStore.setShowVisualConfigPanel(false);});}}/>@@ -355,7 +358,7 @@ const VisualConfigPanel: React.FC = (props) => {text={t('actions.cancel')}className="mr-2"onClick={() => {- commonStore.setShowVisualConfigPanel(false);+ vizStore.setShowVisualConfigPanel(false);}}/></div>diff --git a/packages/graphic-walker/src/computation/clientComputation.ts b/packages/graphic-walker/src/computation/clientComputation.tsindex c8bad340..04aa5ceb 100644--- a/packages/graphic-walker/src/computation/clientComputation.ts+++ b/packages/graphic-walker/src/computation/clientComputation.ts@@ -7,6 +7,9 @@ export const dataQueryClient = async (offset?: number,limit?: number,): Promise<IRow[]> => {+ if (process.env.NODE_ENV !== "production") {+ console.log('local query triggered');+ }let res = rawData;for await (const step of workflow) {switch (step.type) {diff --git a/packages/graphic-walker/src/computation/serverComputation.ts b/packages/graphic-walker/src/computation/index.tssimilarity index 91%rename from packages/graphic-walker/src/computation/serverComputation.tsrename to packages/graphic-walker/src/computation/index.tsindex fd370799..79f42493 100644--- a/packages/graphic-walker/src/computation/serverComputation.ts+++ b/packages/graphic-walker/src/computation/index.ts@@ -1,7 +1,7 @@import type { IComputationFunction, IDataQueryPayload, IDataQueryWorkflowStep, IDatasetStats, IFieldStats, IRow } from '../interfaces';import { getTimeFormat } from '../lib/inferMeta';-export const datasetStatsServer = async (service: IComputationFunction): Promise<IDatasetStats> => {+export const datasetStats = async (service: IComputationFunction): Promise<IDatasetStats> => {const res = (await service({workflow: [{@@ -27,7 +27,7 @@ export const datasetStatsServer = async (service: IComputationFunction): Promise};};-export const dataReadRawServer = async (service: IComputationFunction, pageSize: number, pageOffset = 0): Promise<IRow[]> => {+export const dataReadRaw = async (service: IComputationFunction, pageSize: number, pageOffset = 0): Promise<IRow[]> => {const res = await service({workflow: [{@@ -46,7 +46,7 @@ export const dataReadRawServer = async (service: IComputationFunction, pageSize:return res;};-export const dataQueryServer = async (service: IComputationFunction, workflow: IDataQueryWorkflowStep[], limit?: number): Promise<IRow[]> => {+export const dataQuery = async (service: IComputationFunction, workflow: IDataQueryWorkflowStep[], limit?: number): Promise<IRow[]> => {if (workflow.length === 1 &&workflow[0].type === 'view' &&@@ -63,7 +63,7 @@ export const dataQueryServer = async (service: IComputationFunction, workflow: Ireturn res;};-export const fieldStatServer = async (service: IComputationFunction, field: string, options: { values?: boolean; range?: boolean }): Promise<IFieldStats> => {+export const fieldStat = async (service: IComputationFunction, field: string, options: { values?: boolean; range?: boolean }): Promise<IFieldStats> => {const { values = true, range = true } = options;const COUNT_ID = `count_${field}`;const MIN_ID = `min_${field}`;@@ -139,6 +139,7 @@ export const fieldStatServer = async (service: IComputationFunction, field: stri};};+export async function getSample(service: IComputationFunction, field: string) {const res = await service({workflow: [diff --git a/packages/graphic-walker/src/config.ts b/packages/graphic-walker/src/config.tsindex b889207e..8e845c5b 100644--- a/packages/graphic-walker/src/config.ts+++ b/packages/graphic-walker/src/config.ts@@ -1,6 +1,6 @@import { DraggableFieldState, IAggregator, ICoordMode, IStackMode, IVisualConfig } from './interfaces';-const GEMO_TYPES: Record<ICoordMode, string[]> = {+const GEOM_TYPES: Record<ICoordMode, string[]> = {generic: ['auto', 'bar', 'line', 'area', 'trail', 'point', 'circle', 'tick', 'rect', 'arc', 'text', 'boxplot', 'table'],geographic: ['poi', 'choropleth'],};@@ -49,7 +49,7 @@ export const GLOBAL_CONFIG = {CHART_LAYOUT_TYPE,COLORS,COORD_TYPES,- GEMO_TYPES,+ GEOM_TYPES,MAX_HISTORY_SIZE: 20,STACK_MODE,META_FIELD_KEYS,diff --git a/packages/graphic-walker/src/dataSource/config.ts b/packages/graphic-walker/src/dataSource/config.tsindex 41c23070..f9308159 100644--- a/packages/graphic-walker/src/dataSource/config.ts+++ b/packages/graphic-walker/src/dataSource/config.ts@@ -1,4 +1,4 @@-export const DemoDataAssets = process.env.NODE_ENV === 'production' ? {+export const DemoDataAssets = true ? {CARS: "https://chspace.oss-cn-hongkong.aliyuncs.com/api/ds-cars-service.json",STUDENTS: "https://chspace.oss-cn-hongkong.aliyuncs.com/api/ds-students-service.json",BTC_GOLD: "https://chspace.oss-cn-hongkong.aliyuncs.com/api/ds_btc_gold_service.json",diff --git a/packages/graphic-walker/src/dataSource/dataSelection/csvData.tsx b/packages/graphic-walker/src/dataSource/dataSelection/csvData.tsxindex 1d5cfdcb..da25f5cb 100644--- a/packages/graphic-walker/src/dataSource/dataSelection/csvData.tsx+++ b/packages/graphic-walker/src/dataSource/dataSelection/csvData.tsx@@ -1,18 +1,18 @@-import React, { useRef, useCallback, useState } from "react";-import { FileReader } from "@kanaries/web-data-loader";-import { IRow } from "../../interfaces";-import Table from "../table";-import styled from "styled-components";-import { useGlobalStore } from "../../store";-import { observer } from "mobx-react-lite";-import { useTranslation } from "react-i18next";-import DefaultButton from "../../components/button/default";-import PrimaryButton from "../../components/button/primary";-import DropdownSelect from "../../components/dropdownSelect";-import { SUPPORTED_FILE_TYPES, charsetOptions } from "./config";-import { classNames } from "../../utils";-import { RadioGroup } from "@headlessui/react";-import { jsonReader } from "./utils";+import React, { useRef, useCallback, useState } from 'react';+import { FileReader } from '@kanaries/web-data-loader';+import { IRow } from '../../interfaces';+import Table from '../table';+import styled from 'styled-components';+import { useGlobalStore } from '../../store';+import { observer } from 'mobx-react-lite';+import { useTranslation } from 'react-i18next';+import DefaultButton from '../../components/button/default';+import PrimaryButton from '../../components/button/primary';+import DropdownSelect from '../../components/dropdownSelect';+import { SUPPORTED_FILE_TYPES, charsetOptions } from './config';+import { classNames } from '../../utils';+import { RadioGroup } from '@headlessui/react';+import { jsonReader } from './utils';const Container = styled.div`overflow-x: auto;@@ -22,50 +22,47 @@ const Container = styled.div`interface ICSVData {}const CSVData: React.FC<ICSVData> = (props) => {const fileRef = useRef<HTMLInputElement>(null);- const { commonStore } = useGlobalStore();+ const commonStore = useGlobalStore();const { tmpDSName, tmpDataSource, tmpDSRawFields } = commonStore;- const [encoding, setEncoding] = useState<string>("utf-8");- const [fileType, setFileType] = useState<string>("csv");+ const [encoding, setEncoding] = useState<string>('utf-8');+ const [fileType, setFileType] = useState<string>('csv');const onSubmitData = useCallback(() => {commonStore.commitTempDS();}, []);- const { t } = useTranslation("translation", { keyPrefix: "DataSource.dialog.file" });+ const { t } = useTranslation('translation', { keyPrefix: 'DataSource.dialog.file' });const fileLoaded = tmpDataSource.length > 0 && tmpDSRawFields.length > 0;- const fileUpload = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {- const files = e.target.files;- if (files !== null) {- const file = files[0];- if (fileType === 'csv') {- FileReader.csvReader({- file,- config: { type: "reservoirSampling", size: Infinity },- onLoading: () => {},- encoding,- }).then((data) => {- commonStore.updateTempDS(data as IRow[]);- });- } else {- jsonReader(file).then((data) => {- commonStore.updateTempDS(data as IRow[]);- });+ const fileUpload = useCallback(+ (e: React.ChangeEvent<HTMLInputElement>) => {+ const files = e.target.files;+ if (files !== null) {+ const file = files[0];+ if (fileType === 'csv') {+ FileReader.csvReader({+ file,+ config: { type: 'reservoirSampling', size: Infinity },+ onLoading: () => {},+ encoding,+ }).then((data) => {+ commonStore.updateTempDS(data as IRow[]);+ });+ } else {+ jsonReader(file).then((data) => {+ commonStore.updateTempDS(data as IRow[]);+ });+ }}- }- }, [fileType, encoding]);+ },+ [fileType, encoding]+ );return (<Container>{!fileLoaded && (<div className="text-center">- <svg- className="mx-auto h-12 w-12 text-gray-400"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- aria-hidden="true"- >+ <svg className="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><pathvectorEffect="non-scaling-stroke"strokeLinecap="round"@@ -74,11 +71,11 @@ const CSVData: React.FC<ICSVData> = (props) => {d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></svg>- <h3 className="mt-2 text-sm font-semibold text-gray-900 dark:text-gray-50">{t("choose_file")}</h3>- <p className="mt-1 text-sm text-gray-500">{t("get_start_desc")}</p>+ <h3 className="mt-2 text-sm font-semibold text-gray-900 dark:text-gray-50">{t('choose_file')}</h3>+ <p className="mt-1 text-sm text-gray-500">{t('get_start_desc')}</p></div>)}- <input style={{ display: "none" }} type="file" ref={fileRef} onChange={fileUpload} />+ <input style={{ display: 'none' }} type="file" ref={fileRef} onChange={fileUpload} />{!fileLoaded && (<div className="my-1"><div className="flex justify-center">@@ -92,9 +89,9 @@ const CSVData: React.FC<ICSVData> = (props) => {className={({ active, checked }) =>classNames(checked- ? "bg-indigo-600 text-white hover:bg-indigo-500"- : "ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800",- "flex cursor-pointer items-center justify-center rounded py-1 px-8 text-sm font-semibold uppercase sm:flex-1"+ ? 'bg-indigo-600 text-white hover:bg-indigo-500'+ : 'ring-1 ring-inset ring-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800',+ 'flex cursor-pointer items-center justify-center rounded py-1 px-8 text-sm font-semibold uppercase sm:flex-1')}>@@ -112,7 +109,7 @@ const CSVData: React.FC<ICSVData> = (props) => {fileRef.current.click();}}}- text={t("open")}+ text={t('open')}/><div className="inline-block relative"><DropdownSelect@@ -129,12 +126,10 @@ const CSVData: React.FC<ICSVData> = (props) => {)}{fileLoaded && (<div className="mb-2 mt-6">- <label className="block text-xs text-gray-800 dark:text-gray-200 mb-1 font-bold">- {t("dataset_name")}- </label>+ <label className="block text-xs text-gray-800 dark:text-gray-200 mb-1 font-bold">{t('dataset_name')}</label><inputtype="text"- placeholder={t("dataset_name")}+ placeholder={t('dataset_name')}value={tmpDSName}onChange={(e) => {commonStore.updateTempName(e.target.value);@@ -143,7 +138,7 @@ const CSVData: React.FC<ICSVData> = (props) => {/><PrimaryButtonclassName="mr-2"- text={t("submit")}+ text={t('submit')}disabled={tmpDataSource.length === 0}onClick={() => {onSubmitData();diff --git a/packages/graphic-walker/src/dataSource/dataSelection/gwFile.tsx b/packages/graphic-walker/src/dataSource/dataSelection/gwFile.tsxindex 8c06167a..55aefb32 100644--- a/packages/graphic-walker/src/dataSource/dataSelection/gwFile.tsx+++ b/packages/graphic-walker/src/dataSource/dataSelection/gwFile.tsx@@ -7,7 +7,7 @@ interface GWFileProps {fileRef: React.RefObject<HTMLInputElement>;}const GWFile: React.FC<GWFileProps> = (props) => {- const { vizStore } = useGlobalStore();+ const { dataStore } = useGlobalStore();return (<input@@ -19,7 +19,7 @@ const GWFile: React.FC<GWFileProps> = (props) => {if (files !== null) {const file = files[0];file.text().then(res => {- vizStore.importRaw(res)+ dataStore.importData(JSON.parse(res))})}}}diff --git a/packages/graphic-walker/src/dataSource/dataSelection/publicData.tsx b/packages/graphic-walker/src/dataSource/dataSelection/publicData.tsxindex 1f7f7a23..5215420a 100644--- a/packages/graphic-walker/src/dataSource/dataSelection/publicData.tsx+++ b/packages/graphic-walker/src/dataSource/dataSelection/publicData.tsx@@ -12,7 +12,7 @@ interface IPublicDataProps {}const PublicData: React.FC<IPublicDataProps> = props => {- const { commonStore } = useGlobalStore();+ const commonStore= useGlobalStore();const { tmpDataSource } = commonStore;const { t } = useTranslation('translation', { keyPrefix: 'DataSource.dialog.public' });diff --git a/packages/graphic-walker/src/dataSource/dataSelection/utils.ts b/packages/graphic-walker/src/dataSource/dataSelection/utils.tsindex ba32eec8..becde3fc 100644--- a/packages/graphic-walker/src/dataSource/dataSelection/utils.ts+++ b/packages/graphic-walker/src/dataSource/dataSelection/utils.ts@@ -1,4 +1,4 @@-import { IDataSetInfo, IRow } from "../../interfaces";+import { IRow } from "../../interfaces";export function jsonReader (file: File): Promise<IRow[]> {return new Promise((resolve, reject) => {@@ -17,12 +17,3 @@ export function jsonReader (file: File): Promise<IRow[]> {reader.readAsText(file);});}--// export function jsonArray2DatasetInfo (data: IRow[]): IDataSetInfo {-// const fields = Object.keys(data[0]);-// return {-// name: 'New Dataset',-// rawFields: fields.map(f => ({ name: f, type: 'number' })),-// dataSource: data-// }-// }\ No newline at end of filediff --git a/packages/graphic-walker/src/dataSource/datasetConfig/index.tsx b/packages/graphic-walker/src/dataSource/datasetConfig/index.tsxindex 0eb7f8e1..6ad3e891 100644--- a/packages/graphic-walker/src/dataSource/datasetConfig/index.tsx+++ b/packages/graphic-walker/src/dataSource/datasetConfig/index.tsx@@ -1,15 +1,12 @@-import React, { useEffect, useRef, useState } from "react";-import DatasetTable from "../../components/dataTable";-import { observer } from "mobx-react-lite";-import { useGlobalStore } from "../../store";-import { useComputationFunc } from "../../renderer/hooks";-import { datasetStatsServer } from "../../computation/serverComputation";+import React, { useEffect, useRef, useState } from 'react';+import DatasetTable from '../../components/dataTable';+import { observer } from 'mobx-react-lite';+import { useCompututaion, useVizStore } from '../../store';+import { datasetStats } from '../../computation';const DatasetConfig: React.FC = () => {- const { commonStore } = useGlobalStore();- const { currentDataset } = commonStore;-- const computationFunction = useComputationFunc();+ const vizStore = useVizStore();+ const computation = useCompututaion();const [count, setCount] = useState(0);const taskIdRef = useRef(0);@@ -18,32 +15,36 @@ const DatasetConfig: React.FC = () => {useEffect(() => {const taskId = ++taskIdRef.current;setLoading(true);- datasetStatsServer(computationFunction).then(res => {- if (taskId !== taskIdRef.current) {- return;- }- setCount(res.rowCount);- setLoading(false);- }).catch(err => {- if (taskId !== taskIdRef.current) {- return;- }- console.error(err);- setLoading(false);- });+ datasetStats(computation)+ .then((res) => {+ if (taskId !== taskIdRef.current) {+ return;+ }+ setCount(res.rowCount);+ setLoading(false);+ })+ .catch((err) => {+ if (taskId !== taskIdRef.current) {+ return;+ }+ console.error(err);+ setLoading(false);+ });return () => {taskIdRef.current++;};- }, [computationFunction]);+ }, [computation]);return (<div className="relative">- <DatasetTable size={100}+ <DatasetTable+ size={100}total={count}- dataset={currentDataset}+ metas={vizStore.meta}loading={loading}+ computation={computation}onMetaChange={(fid, fIndex, diffMeta) => {- commonStore.updateCurrentDatasetMetas(fid, diffMeta)+ vizStore.updateCurrentDatasetMetas(fid, diffMeta);}}/></div>diff --git a/packages/graphic-walker/src/dataSource/index.tsx b/packages/graphic-walker/src/dataSource/index.tsxindex b1b5f589..4b15bed3 100644--- a/packages/graphic-walker/src/dataSource/index.tsx+++ b/packages/graphic-walker/src/dataSource/index.tsx@@ -1,26 +1,24 @@-import React, { useRef } from "react";-import { observer } from "mobx-react-lite";-import { CheckCircleIcon, ArrowPathIcon } from "@heroicons/react/24/outline";-import { useTranslation } from "react-i18next";-import Modal from "../components/modal";-import { useGlobalStore } from "../store";-import { download } from "../utils/save";-import GwFile from "./dataSelection/gwFile";-import DataSelection from "./dataSelection";-import DefaultButton from "../components/button/default";-import DropdownSelect from "../components/dropdownSelect";-import PrimaryButton from "../components/button/primary";+import React, { useRef } from 'react';+import { observer } from 'mobx-react-lite';+import { useTranslation } from 'react-i18next';+import Modal from '../components/modal';+import { useGlobalStore } from '../store';+import { download } from '../utils/save';+import GwFile from './dataSelection/gwFile';+import DataSelection from './dataSelection';+import DefaultButton from '../components/button/default';+import DropdownSelect from '../components/dropdownSelect';+import PrimaryButton from '../components/button/primary';-interface DSSegmentProps {-}+interface DSSegmentProps {}const DataSourceSegment: React.FC<DSSegmentProps> = (props) => {- const { commonStore, vizStore } = useGlobalStore();+ const commonStore = useGlobalStore();const gwFileRef = useRef<HTMLInputElement>(null);const { t } = useTranslation();- const { currentDataset, datasets, showDSPanel } = commonStore;-+ const { dataStore, showDSPanel } = commonStore;+ const { currentDataset, dataSources } = dataStore;return (<div className="flex items-center m-4 p-4 border border-gray-200 dark:border-gray-700"><GwFile fileRef={gwFileRef} />@@ -29,33 +27,33 @@ const DataSourceSegment: React.FC<DSSegmentProps> = (props) => {</label> */}<div className="mr-2"><DropdownSelect- options={datasets.map((d) => ({ label: d.name, value: d.id }))}+ options={dataSources.map((d) => ({ label: d.name, value: d.id }))}selectedKey={currentDataset.id}onSelect={(dsKey) => {- commonStore.useDS(dsKey);+ dataStore.useDS(dsKey);}}- placeholder={t("DataSource.labels.cur_dataset")}+ placeholder={t('DataSource.labels.cur_dataset')}/></div><PrimaryButtonclassName="mr-2"- text={t("DataSource.buttons.create_dataset")}+ text={t('DataSource.buttons.create_dataset')}onClick={() => {commonStore.startDSBuildingTask();}}/><DefaultButtonclassName="mr-2"- text={t("DataSource.buttons.export_as_file")}+ text={t('DataSource.buttons.export_as_file')}onClick={() => {- const res = vizStore.exportAsRaw();- download(res, "graphic-walker-notebook.json", "text/plain");+ const res = JSON.stringify(dataStore.exportData());+ download(res, 'graphic-walker-notebook.json', 'text/plain');}}/><DefaultButtonclassName="mr-2"- text={t("DataSource.buttons.import_file")}+ text={t('DataSource.buttons.import_file')}onClick={() => {if (gwFileRef.current) {gwFileRef.current.click();@@ -63,14 +61,14 @@ const DataSourceSegment: React.FC<DSSegmentProps> = (props) => {}}/><Modal- title={t("DataSource.dialog.create_data_source")}- onClose={() => {- commonStore.setShowDSPanel(false);- }}- show={showDSPanel}- >- <DataSelection />- </Modal>+ title={t('DataSource.dialog.create_data_source')}+ onClose={() => {+ commonStore.setShowDSPanel(false);+ }}+ show={showDSPanel}+ >+ <DataSelection />+ </Modal></div>);};diff --git a/packages/graphic-walker/src/dataSource/table.tsx b/packages/graphic-walker/src/dataSource/table.tsxindex f598af6d..5ce17592 100644--- a/packages/graphic-walker/src/dataSource/table.tsx+++ b/packages/graphic-walker/src/dataSource/table.tsx@@ -11,20 +11,17 @@ interface TableProps {const Table: React.FC<TableProps> = (props) => {const { size = 10 } = props;- const { commonStore } = useGlobalStore();+ const commonStore = useGlobalStore();const { tmpDSRawFields, tmpDataSource } = commonStore;+ const metas = React.useMemo(() => toJS(tmpDSRawFields), [ tmpDSRawFields]);+const computation = React.useMemo(() => getComputation(tmpDataSource), [tmpDataSource])return (<DataTablesize={size}- dataset={{- id: "tmp",- name: "tmp",- dataSource: tmpDataSource,- rawFields: toJS(tmpDSRawFields),- }}+ metas={metas}computation={computation}total={tmpDataSource.length}onMetaChange={(fid, fIndex, diffMeta) => {diff --git a/packages/graphic-walker/src/fields/aestheticFields.tsx b/packages/graphic-walker/src/fields/aestheticFields.tsxindex da51a9d9..5b37f64e 100644--- a/packages/graphic-walker/src/fields/aestheticFields.tsx+++ b/packages/graphic-walker/src/fields/aestheticFields.tsx@@ -1,17 +1,22 @@import React, { useMemo } from 'react';-import { Droppable } from "@kanaries/react-beautiful-dnd";+import { Droppable } from '@kanaries/react-beautiful-dnd';import { DRAGGABLE_STATE_KEYS } from './fieldsContext';-import { AestheticFieldContainer } from './components'+import { AestheticFieldContainer } from './components';import SingleEncodeEditor from './encodeFields/singleEncodeEditor';import { observer } from 'mobx-react-lite';-import { useGlobalStore } from '../store';+import { useVizStore } from '../store';-const aestheticFields = DRAGGABLE_STATE_KEYS.filter(f => ['color', 'opacity', 'size', 'shape', 'details', 'text'].includes(f.id));+type aestheticFields = 'color' | 'opacity' | 'size' | 'shape' | 'details' | 'text';-const AestheticFields: React.FC = props => {- const { vizStore } = useGlobalStore();- const { visualConfig } = vizStore;- const { geoms } = visualConfig;+const aestheticFields = DRAGGABLE_STATE_KEYS.filter((f) => ['color', 'opacity', 'size', 'shape', 'details', 'text'].includes(f.id)) as {+ id: aestheticFields;+ mode: 0 | 1;+}[];++const AestheticFields: React.FC = (props) => {+ const vizStore = useVizStore();+ const { config } = vizStore;+ const { geoms } = config;const channels = useMemo(() => {switch (geoms[0]) {@@ -21,31 +26,33 @@ const AestheticFields: React.FC = props => {case 'line':case 'area':case 'boxplot':- return aestheticFields.filter(f => f.id !== 'shape');+ return aestheticFields.filter((f) => f.id !== 'shape');case 'text':- return aestheticFields.filter(f => f.id === 'text' || f.id === 'color' || f.id === 'size' || f.id === 'opacity');+ return aestheticFields.filter((f) => f.id === 'text' || f.id === 'color' || f.id === 'size' || f.id === 'opacity');case 'table':- return []+ return [];case 'poi':- return aestheticFields.filter(f => f.id === 'color' || f.id === 'opacity' || f.id === 'size' || f.id === 'details');+ return aestheticFields.filter((f) => f.id === 'color' || f.id === 'opacity' || f.id === 'size' || f.id === 'details');case 'choropleth':- return aestheticFields.filter(f => f.id === 'color' || f.id === 'opacity' || f.id === 'text' || f.id === 'details');+ return aestheticFields.filter((f) => f.id === 'color' || f.id === 'opacity' || f.id === 'text' || f.id === 'details');default:- return aestheticFields.filter(f => f.id !== 'text');- }- }, [geoms[0]])- return <div>- {- channels.map((dkey, i, { length }) => <AestheticFieldContainer name={dkey.id} key={dkey.id} style={{ position: 'relative', zIndex: length - i }}>- <Droppable droppableId={dkey.id} direction="horizontal">- {(provided, snapshot) => (- // <OBFieldContainer dkey={dkey} provided={provided} />- <SingleEncodeEditor dkey={dkey} provided={provided} snapshot={snapshot} />- )}- </Droppable>- </AestheticFieldContainer>)+ return aestheticFields.filter((f) => f.id !== 'text');}- </div>-}+ }, [geoms[0]]);+ return (+ <div>+ {channels.map((dkey, i, { length }) => (+ <AestheticFieldContainer name={dkey.id} key={dkey.id} style={{ position: 'relative', zIndex: length - i }}>+ <Droppable droppableId={dkey.id} direction="horizontal">+ {(provided, snapshot) => (+ // <OBFieldContainer dkey={dkey} provided={provided} />+ <SingleEncodeEditor dkey={dkey} provided={provided} snapshot={snapshot} />+ )}+ </Droppable>+ </AestheticFieldContainer>+ ))}+ </div>+ );+};-export default observer(AestheticFields);\ No newline at end of file+export default observer(AestheticFields);diff --git a/packages/graphic-walker/src/fields/datasetFields/binPanel.tsx b/packages/graphic-walker/src/fields/datasetFields/binPanel.tsxindex f178ab47..56ee7d8f 100644--- a/packages/graphic-walker/src/fields/datasetFields/binPanel.tsx+++ b/packages/graphic-walker/src/fields/datasetFields/binPanel.tsx@@ -1,6 +1,6 @@import { observer } from 'mobx-react-lite';import React, { useEffect, useState } from 'react';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import SmallModal from '../../components/smallModal';import PrimaryButton from '../../components/button/primary';import DefaultButton from '../../components/button/default';@@ -8,8 +8,8 @@ import { useTranslation } from 'react-i18next';import { ICreateField } from '../../interfaces';const FieldScalePanel: React.FC = (props) => {- const { commonStore, vizStore } = useGlobalStore();- const { showBinSettingPanel, setShowBinSettingPanel } = commonStore;+ const vizStore = useVizStore();+ const { showBinSettingPanel, setShowBinSettingPanel } = vizStore;const { t } = useTranslation();const [chosenOption, setChosenOption] = useState<'widths' | 'counts'>('widths');const [value, setValue] = useState<string>('');@@ -24,7 +24,7 @@ const FieldScalePanel: React.FC = (props) => {<SmallModalshow={showBinSettingPanel}onClose={() => {- commonStore.setShowBinSettingPanel(false);+ setShowBinSettingPanel(false);}}><div className="flex flex-col justify-center items-start text-xs">@@ -71,9 +71,9 @@ const FieldScalePanel: React.FC = (props) => {className="mr-2 px-2 "text="Confirm"onClick={() => {- const field = commonStore.createField as ICreateField;+ const field = vizStore.createField as ICreateField;vizStore.createBinField(field.channel, field.index, chosenOption === 'widths' ? 'bin' : 'binCount', Number(value));- commonStore.setShowBinSettingPanel(false);+ vizStore.setShowBinSettingPanel(false);return;}}/>@@ -81,7 +81,7 @@ const FieldScalePanel: React.FC = (props) => {text={t('actions.cancel')}className="mr-2 px-2"onClick={() => {- commonStore.setShowBinSettingPanel(false);+ vizStore.setShowBinSettingPanel(false);return;}}/>diff --git a/packages/graphic-walker/src/fields/datasetFields/dimFields.tsx b/packages/graphic-walker/src/fields/datasetFields/dimFields.tsxindex 26afb4d8..5460c64c 100644--- a/packages/graphic-walker/src/fields/datasetFields/dimFields.tsx+++ b/packages/graphic-walker/src/fields/datasetFields/dimFields.tsx@@ -1,11 +1,11 @@-import React from "react";+import React from 'react';import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";-import { Draggable, DroppableProvided } from "@kanaries/react-beautiful-dnd";-import { observer } from "mobx-react-lite";-import { useGlobalStore } from "../../store";-import DataTypeIcon from "../../components/dataTypeIcon";+import { Draggable, DroppableProvided } from '@kanaries/react-beautiful-dnd';+import { observer } from 'mobx-react-lite';+import { useVizStore } from '../../store';+import DataTypeIcon from '../../components/dataTypeIcon';import ActionMenu from "../../components/actionMenu";-import { FieldPill } from "./fieldPill";+import { FieldPill } from './fieldPill';import { useMenuActions } from "./utils";interface Props {@@ -13,8 +13,8 @@ interface Props {}const DimFields: React.FC<Props> = (props) => {const { provided } = props;- const { vizStore } = useGlobalStore();- const dimensions = vizStore.draggableFieldState.dimensions;+ const vizStore = useVizStore();+ const { dimensions } = vizStore;const menuActions = useMenuActions('dimensions');return (<div {...provided.droppableProps} ref={provided.innerRef}>@@ -30,7 +30,7 @@ const DimFields: React.FC<Props> = (props) => {><FieldPillclassName={`flex dark:text-white pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-blue-100 dark:hover:bg-blue-800 rounded-full truncate border border-transparent ${- snapshot.isDragging ? "bg-blue-100 dark:bg-blue-800" : ""+ snapshot.isDragging ? 'bg-blue-100 dark:bg-blue-800' : ''}`}ref={provided.innerRef}isDragging={snapshot.isDragging}@@ -46,7 +46,7 @@ const DimFields: React.FC<Props> = (props) => {{<FieldPillclassName={`dark:text-white pt-0.5 pb-0.5 pl-2 pr-2 mx-0 m-1 text-xs hover:bg-blue-100 dark:hover:bg-blue-800 rounded-full border-blue-400 border truncate ${- snapshot.isDragging ? "bg-blue-100 dark:bg-blue-800 flex" : "hidden"+ snapshot.isDragging ? 'bg-blue-100 dark:bg-blue-800 flex' : 'hidden'}`}isDragging={snapshot.isDragging}>diff --git a/packages/graphic-walker/src/fields/datasetFields/logPanel.tsx b/packages/graphic-walker/src/fields/datasetFields/logPanel.tsxindex a99de66e..accab660 100644--- a/packages/graphic-walker/src/fields/datasetFields/logPanel.tsx+++ b/packages/graphic-walker/src/fields/datasetFields/logPanel.tsx@@ -1,15 +1,15 @@import { observer } from 'mobx-react-lite';import React, { useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useGlobalStore } from '../../store';+import { useGlobalStore, useVizStore } from '../../store';import SmallModal from '../../components/smallModal';import PrimaryButton from '../../components/button/primary';import DefaultButton from '../../components/button/default';import { ICreateField } from '../../interfaces';const FieldScalePanel: React.FC = (props) => {- const { commonStore, vizStore } = useGlobalStore();- const { showLogSettingPanel } = commonStore;+ const vizStore = useVizStore();+ const { showLogSettingPanel } = vizStore;const [baseNum, setBaseNum] = useState<string>('');const { t } = useTranslation();useEffect(() => {@@ -19,7 +19,7 @@ const FieldScalePanel: React.FC = (props) => {<SmallModalshow={showLogSettingPanel}onClose={() => {- commonStore.setShowLogSettingPanel(false);+ vizStore.setShowLogSettingPanel(false);}}><div className="flex flex-col justify-center items-start text-xs">@@ -43,16 +43,16 @@ const FieldScalePanel: React.FC = (props) => {className="mr-2 px-2 "// text="Confirm"onClick={() => {- const field = commonStore.createField as ICreateField;+ const field = vizStore.createField as ICreateField;vizStore.createLogField(field.channel, field.index, 'log', Number(baseNum));- commonStore.setShowLogSettingPanel(false);+ vizStore.setShowLogSettingPanel(false);}}/><DefaultButtontext={t('actions.cancel')}className="mr-2 px-2"onClick={() => {- commonStore.setShowLogSettingPanel(false);+ vizStore.setShowLogSettingPanel(false);}}/></div>diff --git a/packages/graphic-walker/src/fields/datasetFields/meaFields.tsx b/packages/graphic-walker/src/fields/datasetFields/meaFields.tsxindex 6a65afd6..52408b28 100644--- a/packages/graphic-walker/src/fields/datasetFields/meaFields.tsx+++ b/packages/graphic-walker/src/fields/datasetFields/meaFields.tsx@@ -1,8 +1,8 @@-import React from 'react';+import React, { useCallback, useMemo } from 'react';import { Draggable, DroppableProvided } from '@kanaries/react-beautiful-dnd';import { observer } from 'mobx-react-lite';import { EllipsisVerticalIcon } from '@heroicons/react/24/outline';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import DataTypeIcon from '../../components/dataTypeIcon';import ActionMenu from '../../components/actionMenu';import { useMenuActions } from './utils';@@ -14,8 +14,8 @@ interface Props {}const MeaFields: React.FC<Props> = (props) => {const { provided } = props;- const { vizStore } = useGlobalStore();- const measures = vizStore.draggableFieldState.measures;+ const vizStore = useVizStore();+ const { measures } = vizStore;const menuActions = useMenuActions('measures');diff --git a/packages/graphic-walker/src/fields/datasetFields/utils.ts b/packages/graphic-walker/src/fields/datasetFields/utils.tsindex 74416918..75f2593d 100644--- a/packages/graphic-walker/src/fields/datasetFields/utils.ts+++ b/packages/graphic-walker/src/fields/datasetFields/utils.ts@@ -1,10 +1,9 @@import { useMemo } from "react";import { useTranslation } from "react-i18next";-import { useGlobalStore } from "../../store";+import { useCompututaion, useVizStore } from "../../store";import type { IActionMenuItem } from "../../components/actionMenu/list";import { COUNT_FIELD_ID, DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS } from "../../constants";-import { useComputationFunc } from "../../renderer/hooks";-import { getSample } from "../../computation/serverComputation";+import { getSample } from "../../computation";import { getTimeFormat } from "../../lib/inferMeta";@@ -13,10 +12,10 @@ const keepTrue = <T extends string | number | object | Function | symbol>(array:};export const useMenuActions = (channel: "dimensions" | "measures"): IActionMenuItem[][] => {- const { vizStore, commonStore } = useGlobalStore();- const fields = vizStore.draggableFieldState[channel];+ const vizStore = useVizStore();+ const fields = vizStore.currentVis.encodings[channel];const { t } = useTranslation('translation', { keyPrefix: "field_menu" });- const computation = useComputationFunc();+ const computation = useCompututaion();return useMemo<IActionMenuItem[][]>(() => {return fields.map((f, index) => {@@ -26,14 +25,14 @@ export const useMenuActions = (channel: "dimensions" | "measures"): IActionMenuIchannel === 'dimensions' && {label: t('to_mea'),onPress() {- vizStore.moveField("dimensions", index, "measures", vizStore.draggableFieldState.measures.length);+ vizStore.moveField("dimensions", index, "measures", vizStore.viewMeasures.length);},},channel === 'measures' && {label: t('to_dim'),disabled: f.fid === COUNT_FIELD_ID,onPress() {- vizStore.moveField("measures", index, "dimensions", vizStore.draggableFieldState.dimensions.length);+ vizStore.moveField("measures", index, "dimensions", vizStore.viewDimensions.length);},},{@@ -71,16 +70,16 @@ export const useMenuActions = (channel: "dimensions" | "measures"): IActionMenuIlabel:t('binCustom'),disabled: f.semanticType === 'nominal' || f.semanticType === 'ordinal',onPress(){- commonStore.setShowBinSettingPanel(true);- commonStore.setCreateField({channel:channel,index:index});+ vizStore.setShowBinSettingPanel(true);+ vizStore.setCreateField({channel:channel,index:index});}},{label:t('logCustom'),disabled: f.semanticType === 'nominal' || f.semanticType === 'ordinal',onPress(){- commonStore.setShowLogSettingPanel(true);- commonStore.setCreateField({channel:channel,index:index})+ vizStore.setShowLogSettingPanel(true);+ vizStore.setCreateField({channel:channel,index:index})}},@@ -101,12 +100,12 @@ export const useMenuActions = (channel: "dimensions" | "measures"): IActionMenuIlabel: t('drill.name'),children: DATE_TIME_DRILL_LEVELS.map(level => ({label: t(`drill.levels.${level}`),- disabled: isDateTimeDrilled && f.expression.params.find(p => p.type === 'value')?.value === level,+ disabled: isDateTimeDrilled && f.expression?.params.find(p => p.type === 'value')?.value === level,onPress() {const originField = (isDateTimeDrilled ? vizStore.allFields.find(field => field.fid === f.expression?.params.find(p => p.type === 'field')?.value) : null) ?? f;const originChannel = originField.analyticType === 'dimension' ? 'dimensions' : 'measures';const originIndex = vizStore.allFields.findIndex(x => x.fid === originField.fid);- getSample(computation, originField.fid).then(getTimeFormat).then(format => vizStore.createDateTimeDrilledField(originChannel, originIndex, 'dateTimeDrill',level, `${t(`drill.levels.${level}`)} (${originField.name || originField.fid})`, format));+ getSample(computation, originField.fid).then(getTimeFormat).then(format => vizStore.createDateTimeDrilledField(originChannel, originIndex, level, `${t(`drill.levels.${level}`)} (${originField.name || originField.fid})`, format));},})),},@@ -114,12 +113,12 @@ export const useMenuActions = (channel: "dimensions" | "measures"): IActionMenuIlabel: t('drill.feature_name'),children: DATE_TIME_FEATURE_LEVELS.map(level => ({label: t(`drill.levels.${level}`),- disabled: isDateTimeDrilled && f.expression.params.find(p => p.type === 'value')?.value === level,+ disabled: isDateTimeDrilled && f.expression?.params.find(p => p.type === 'value')?.value === level,onPress() {const originField = (isDateTimeDrilled ? vizStore.allFields.find(field => field.fid === f.expression?.params.find(p => p.type === 'field')?.value) : null) ?? f;const originChannel = originField.analyticType === 'dimension' ? 'dimensions' : 'measures';const originIndex = vizStore.allFields.findIndex(x => x.fid === originField.fid);- getSample(computation, originField.fid).then(getTimeFormat).then(format => vizStore.createDateTimeDrilledField(originChannel, originIndex, 'dateTimeFeature', level,`${t(`drill.levels.${level}`)} [${originField.name || originField.fid}]`, format));+ getSample(computation, originField.fid).then(getTimeFormat).then(format => vizStore.createDateFeatureField(originChannel, originIndex, level,`${t(`drill.levels.${level}`)} [${originField.name || originField.fid}]`, format));},})),},diff --git a/packages/graphic-walker/src/fields/encodeFields/singleEncodeEditor.tsx b/packages/graphic-walker/src/fields/encodeFields/singleEncodeEditor.tsxindex c727550c..c0242e0d 100644--- a/packages/graphic-walker/src/fields/encodeFields/singleEncodeEditor.tsx+++ b/packages/graphic-walker/src/fields/encodeFields/singleEncodeEditor.tsx@@ -1,7 +1,7 @@import React, { useMemo } from 'react';-import { IDraggableStateKey } from '../../interfaces';+import { DraggableFieldState, IAggregator, IDraggableStateKey } from '../../interfaces';import { observer } from 'mobx-react-lite';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import { DroppableProvided } from 'react-beautiful-dnd';import { ChevronUpDownIcon, TrashIcon } from '@heroicons/react/24/outline';import { useTranslation } from 'react-i18next';@@ -18,16 +18,18 @@ const PillActions = styled.div``;interface SingleEncodeEditorProps {- dkey: IDraggableStateKey;+ dkey: {+ id: keyof Omit<DraggableFieldState, 'filters'>+ };provided: DroppableProvided;snapshot: DroppableStateSnapshot;}const SingleEncodeEditor: React.FC<SingleEncodeEditorProps> = (props) => {const { dkey, provided, snapshot } = props;- const { vizStore } = useGlobalStore();- const { draggableFieldState, visualConfig, allFields } = vizStore;- const folds = visualConfig.folds ?? [];- const channelItem = draggableFieldState[dkey.id][0];+ const vizStore = useVizStore();+ const { allEncodings, config, allFields } = vizStore;+ const folds = config.folds ?? [];+ const channelItem = allEncodings[dkey.id][0];const { t } = useTranslation();const aggregationOptions = useMemo(() => {@@ -48,9 +50,13 @@ const SingleEncodeEditor: React.FC<SingleEncodeEditorProps> = (props) => {return (<div className="p-1 select-none relative" {...provided.droppableProps} ref={provided.innerRef}><div+className={`p-1.5 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 flex item-center justify-center grow text-gray-500 dark:text-gray-400 ${+(channelItem && !snapshot.draggingFromThisWith) || snapshot.isDraggingOver ? 'opacity-0' : 'opacity-100'+} relative z-0`}+>{t('actions.drop_field')}</div>@@ -86,11 +92,11 @@ const SingleEncodeEditor: React.FC<SingleEncodeEditorProps> = (props) => {</SelectContext>)}{channelItem.fid !== MEA_KEY_ID && <span className="flex-1 truncate">{channelItem.name}</span>}{' '}- {channelItem.analyticType === 'measure' && channelItem.fid !== COUNT_FIELD_ID && visualConfig.defaultAggregated && (+ {channelItem.analyticType === 'measure' && channelItem.fid !== COUNT_FIELD_ID && config.defaultAggregated && (<DropdownContextoptions={aggregationOptions}onSelect={(value) => {- vizStore.setFieldAggregator(dkey.id, 0, value);+ vizStore.setFieldAggregator(dkey.id, 0, value as IAggregator);}}><span className="bg-transparent text-gray-700 dark:text-gray-200 float-right focus:outline-none focus:border-gray-500 dark:focus:border-gray-400 flex items-center ml-2">diff --git a/packages/graphic-walker/src/fields/fieldsContext.tsx b/packages/graphic-walker/src/fields/fieldsContext.tsxindex 538de364..ccbba8f3 100644--- a/packages/graphic-walker/src/fields/fieldsContext.tsx+++ b/packages/graphic-walker/src/fields/fieldsContext.tsx@@ -6,12 +6,12 @@ import {ResponderProvided,DraggableLocation,} from "@kanaries/react-beautiful-dnd";-import { useGlobalStore } from '../store';+import { useVizStore } from '../store';window['__react-beautiful-dnd-disable-dev-warnings'] = true;export const FieldsContextWrapper: React.FC = props => {- const { vizStore } = useGlobalStore();+ const vizStore = useVizStore();const onDragEnd = useCallback((result: DropResult, provided: ResponderProvided) => {if (!result.destination) {vizStore.removeField(result.source.droppableId as keyof DraggableFieldState, result.source.index)@@ -28,7 +28,7 @@ export const FieldsContextWrapper: React.FC = props => {.droppableId as keyof DraggableFieldState;vizStore.moveField(sourceKey, result.source.index, targetKey, destination.index)}- }, [])+ }, [vizStore])return <DragDropContext onDragEnd={onDragEnd}onDragStart={() => {}}onDragUpdate={() => {}}diff --git a/packages/graphic-walker/src/fields/filterField/filterEditDialog.tsx b/packages/graphic-walker/src/fields/filterField/filterEditDialog.tsxindex 3e4cf0c7..81e12477 100644--- a/packages/graphic-walker/src/fields/filterField/filterEditDialog.tsx+++ b/packages/graphic-walker/src/fields/filterField/filterEditDialog.tsx@@ -1,43 +1,42 @@-import { observer } from "mobx-react-lite";-import React from "react";-import { useTranslation } from "react-i18next";+import { observer } from 'mobx-react-lite';+import React from 'react';+import { useTranslation } from 'react-i18next';import { toJS } from 'mobx';-import Modal from "../../components/modal";-import type { IFilterField, IFilterRule } from "../../interfaces";-import { useGlobalStore } from "../../store";-import Tabs, { RuleFormProps } from "./tabs";-import DefaultButton from "../../components/button/default";-import PrimaryButton from "../../components/button/primary";-import DropdownSelect from "../../components/dropdownSelect";--const QuantitativeRuleForm: React.FC<RuleFormProps> = ({ dataset, field, onChange }) => {- return <Tabs field={field} onChange={onChange} tabs={["range", "one of"]} dataset={dataset} />;+import Modal from '../../components/modal';+import type { IFilterField, IFilterRule } from '../../interfaces';+import { useVizStore } from '../../store';+import Tabs, { RuleFormProps } from './tabs';+import DefaultButton from '../../components/button/default';+import PrimaryButton from '../../components/button/primary';+import DropdownSelect from '../../components/dropdownSelect';++const QuantitativeRuleForm: React.FC<RuleFormProps> = ({ rawFields, field, onChange }) => {+ return <Tabs field={field} onChange={onChange} tabs={['range', 'one of']} rawFields={rawFields} />;};-const NominalRuleForm: React.FC<RuleFormProps> = ({ dataset, field, onChange }) => {- return <Tabs field={field} onChange={onChange} tabs={["one of"]} dataset={dataset} />;+const NominalRuleForm: React.FC<RuleFormProps> = ({ rawFields, field, onChange }) => {+ return <Tabs field={field} onChange={onChange} tabs={['one of']} rawFields={rawFields} />;};-const OrdinalRuleForm: React.FC<RuleFormProps> = ({ dataset, field, onChange }) => {- return <Tabs field={field} onChange={onChange} tabs={["range", "one of"]} dataset={dataset} />;+const OrdinalRuleForm: React.FC<RuleFormProps> = ({ rawFields, field, onChange }) => {+ return <Tabs field={field} onChange={onChange} tabs={['range', 'one of']} rawFields={rawFields} />;};-const TemporalRuleForm: React.FC<RuleFormProps> = ({ dataset, field, onChange }) => {- return <Tabs field={field} onChange={onChange} tabs={["temporal range", "one of"]} dataset={dataset} />;+const TemporalRuleForm: React.FC<RuleFormProps> = ({ rawFields, field, onChange }) => {+ return <Tabs field={field} onChange={onChange} tabs={['temporal range', 'one of']} rawFields={rawFields} />;};const EmptyForm: React.FC<RuleFormProps> = () => <React.Fragment />;const FilterEditDialog: React.FC = observer(() => {- const { vizStore, commonStore } = useGlobalStore();- const { editingFilterIdx, draggableFieldState } = vizStore;- const { currentDataset } = commonStore;+ const vizStore = useVizStore();+ const { editingFilterIdx, viewFilters, dimensions, measures, meta, allFields } = vizStore;- const { t } = useTranslation("translation", { keyPrefix: "filters" });+ const { t } = useTranslation('translation', { keyPrefix: 'filters' });const field = React.useMemo(() => {- return editingFilterIdx !== null ? draggableFieldState.filters[editingFilterIdx] : null;- }, [editingFilterIdx, draggableFieldState]);+ return editingFilterIdx !== null ? viewFilters[editingFilterIdx] : null;+ }, [editingFilterIdx, viewFilters]);const [uncontrolledField, setUncontrolledField] = React.useState(field as IFilterField | null);const ufRef = React.useRef(uncontrolledField);@@ -45,7 +44,7 @@ const FilterEditDialog: React.FC = observer(() => {React.useEffect(() => {if (field !== ufRef.current) {- setUncontrolledField(toJS(field) );+ setUncontrolledField(field as IFilterField);}}, [field]);@@ -73,24 +72,25 @@ const FilterEditDialog: React.FC = observer(() => {}, [editingFilterIdx, uncontrolledField]);const allFieldOptions = React.useMemo(() => {- return [...draggableFieldState.dimensions, ...draggableFieldState.measures].map((d) => ({- label: d.name,+ return allFields.map((d) => ({+ label: d.name,value: d.fid,}));- }, [draggableFieldState]);+ }, [allFields]);const handleSelectFilterField = (fieldKey) => {- const existingFilterIdx = draggableFieldState.filters.findIndex((field) => field.fid === fieldKey)+ const existingFilterIdx = viewFilters.findIndex((field) => field.fid === fieldKey);if (existingFilterIdx >= 0) {vizStore.setFilterEditing(existingFilterIdx);} else {- const sourceKey = draggableFieldState.dimensions.find((field) => field.fid === fieldKey)- ? "dimensions"- : "measures"- const sourceIndex = sourceKey === "dimensions"- ? draggableFieldState.dimensions.findIndex((field) => field.fid === fieldKey)- : draggableFieldState.measures.findIndex((field) => field.fid === fieldKey);- vizStore.moveField(sourceKey, sourceIndex, "filters", 0);+ const sourceKey = dimensions.find((field) => field.fid === fieldKey) ? 'dimensions' : 'measures';+ const sourceIndex =+ sourceKey === 'dimensions'+ ? dimensions.findIndex((field) => field.fid === fieldKey)+ : measures.findIndex((field) => field.fid === fieldKey);+ if (editingFilterIdx !== null) {+ vizStore.modFilter(editingFilterIdx, sourceKey, sourceIndex);+ }}};@@ -104,9 +104,9 @@ const FilterEditDialog: React.FC = observer(() => {: EmptyForm;return uncontrolledField ? (- <Modal show={Boolean(uncontrolledField)} title={t("editing")} onClose={() => vizStore.closeFilterEditing()}>+ <Modal show={Boolean(uncontrolledField)} title={t('editing')} onClose={() => vizStore.closeFilterEditing()}><div className="px-4 py-1">- <div className="py-1">{t("form.name")}</div>+ <div className="py-1">{t('form.name')}</div><DropdownSelectbuttonClassName="w-96"className="mb-2"@@ -114,17 +114,10 @@ const FilterEditDialog: React.FC = observer(() => {selectedKey={uncontrolledField.fid}onSelect={handleSelectFilterField}/>- <Form dataset={currentDataset} field={uncontrolledField} onChange={handleChange} />+ <Form rawFields={meta} field={uncontrolledField} onChange={handleChange} /><div className="mt-4">- <PrimaryButton- onClick={handleSubmit}- text={t("btn.confirm")}- />- <DefaultButton- className="ml-2"- onClick={() => vizStore.closeFilterEditing()}- text={t("btn.cancel")}- />+ <PrimaryButton onClick={handleSubmit} text={t('btn.confirm')} />+ <DefaultButton className="ml-2" onClick={() => vizStore.closeFilterEditing()} text={t('btn.cancel')} /></div></div></Modal>diff --git a/packages/graphic-walker/src/fields/filterField/filterPill.tsx b/packages/graphic-walker/src/fields/filterField/filterPill.tsxindex d359321b..e68724a2 100644--- a/packages/graphic-walker/src/fields/filterField/filterPill.tsx+++ b/packages/graphic-walker/src/fields/filterField/filterPill.tsx@@ -4,7 +4,7 @@ import { DraggableProvided } from '@kanaries/react-beautiful-dnd';import { useTranslation } from 'react-i18next';import styled from 'styled-components';import { PencilSquareIcon } from '@heroicons/react/24/solid';-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';interface FilterPillProps {provided: DraggableProvided;@@ -56,10 +56,10 @@ const Pill = styled.div`const FilterPill: React.FC<FilterPillProps> = observer((props) => {const { provided, fIndex } = props;- const { vizStore } = useGlobalStore();- const { draggableFieldState } = vizStore;+ const vizStore = useVizStore();+ const { viewFilters } = vizStore;- const field = draggableFieldState.filters[fIndex];+ const field = viewFilters[fIndex];const { t } = useTranslation('translation', { keyPrefix: 'filters' });diff --git a/packages/graphic-walker/src/fields/filterField/index.tsx b/packages/graphic-walker/src/fields/filterField/index.tsxindex db33ed68..8b92394e 100644--- a/packages/graphic-walker/src/fields/filterField/index.tsx+++ b/packages/graphic-walker/src/fields/filterField/index.tsx@@ -5,7 +5,7 @@ import {Droppable, DroppableProvided,} from "@kanaries/react-beautiful-dnd";-import { useGlobalStore } from '../../store';+import { useVizStore } from '../../store';import { FilterFieldContainer, FilterFieldsContainer } from '../components';import FilterPill from './filterPill';import FilterEditDialog from './filterEditDialog';@@ -16,8 +16,8 @@ interface FieldContainerProps {}const FilterItemContainer: React.FC<FieldContainerProps> = observer(({ provided }) => {- const { vizStore } = useGlobalStore();- const { draggableFieldState: { filters } } = vizStore;+ const vizStore = useVizStore();+ const { viewFilters: filters } = vizStore;return (<FilterFieldsContainerdiff --git a/packages/graphic-walker/src/fields/filterField/tabs.tsx b/packages/graphic-walker/src/fields/filterField/tabs.tsxindex 6b673e3d..c3f3b6e6 100644--- a/packages/graphic-walker/src/fields/filterField/tabs.tsx+++ b/packages/graphic-walker/src/fields/filterField/tabs.tsx@@ -7,16 +7,15 @@ import {ChevronUpIcon,} from '@heroicons/react/24/outline';-import type { IFilterField, IFilterRule, DataSet, IFieldStats, IField, IViewField } from '../../interfaces';-import { useGlobalStore } from '../../store';+import type { IFilterField, IFilterRule, IFieldStats, IField, IViewField, IMutField, IComputationFunction } from '../../interfaces';+import { useCompututaion, useVizStore } from '../../store';import LoadingLayer from '../../components/loadingLayer';-import { useComputationFunc, useRenderer } from '../../renderer/hooks';-import { fieldStatServer, getTemporalRange } from '../../computation/serverComputation';+import { fieldStat, getTemporalRange } from '../../computation';import Slider from './slider';-+import { parseCmpFunction } from '../../utils';export type RuleFormProps = {- dataset: DataSet;+ rawFields: IMutField[];field: IFilterField;onChange: (rule: IFilterRule) => void;};@@ -42,7 +41,7 @@ const Container = styled.div`export const Button = styled.button`:hover {background-color: rgba(243, 244, 246, 0.5);- };+ }color: rgb(55, 65, 81);border: 1px solid rgb(226 232 240);border-radius: 0.5em;@@ -58,7 +57,7 @@ const Table = styled.div`grid-template-columns: 4em auto max-content;max-height: 30vh;overflow-y: scroll;-+& > * {padding-block: 0.6em;padding-inline: 0.2em;@@ -104,13 +103,13 @@ const TabPanel = styled.div``;const TabItem = styled.div``;-const StatusCheckbox: React.FC<{ currentNum: number; totalNum: number; onChange: () => void }> = props => {+const StatusCheckbox: React.FC<{ currentNum: number; totalNum: number; onChange: () => void }> = (props) => {const { currentNum, totalNum, onChange } = props;const checkboxRef = useRef(null);React.useEffect(() => {if (!checkboxRef.current) return;- const checkboxRefDOM = (checkboxRef.current as HTMLInputElement)+ const checkboxRefDOM = checkboxRef.current as HTMLInputElement;if (currentNum === totalNum) {checkboxRefDOM.checked = true;checkboxRefDOM.indeterminate = false;@@ -120,7 +119,7 @@ const StatusCheckbox: React.FC<{ currentNum: number; totalNum: number; onChange:checkboxRefDOM.checked = false;checkboxRefDOM.indeterminate = false;}- }, [currentNum, totalNum])+ }, [currentNum, totalNum]);return (<input@@ -129,19 +128,11 @@ const StatusCheckbox: React.FC<{ currentNum: number; totalNum: number; onChange:ref={checkboxRef}onChange={() => onChange()}/>- )-}+ );+};type FieldDistributionEntry = IFieldStats['values'][number];-const defaultValueComparator = (a: any, b: any) => {- if (typeof a === 'number' && typeof b === 'number') {- return a - b;- } else {- return String(a).localeCompare(String(b))- }-};-const countCmp = (a: FieldDistributionEntry, b: FieldDistributionEntry) => {return a.count - b.count;};@@ -149,78 +140,81 @@ const countCmp = (a: FieldDistributionEntry, b: FieldDistributionEntry) => {const useFieldStats = (field: IField,attributes: { values: boolean; range: boolean },- sortBy: 'value' | 'value_dsc' | 'count' | 'count_dsc' | 'none'-): IFieldStats | null => {+ sortBy: 'value' | 'value_dsc' | 'count' | 'count_dsc' | 'none',+ computation: IComputationFunction+): IFieldStats | null => {const { values, range } = attributes;- const { fid, cmp = defaultValueComparator } = field;- const valueCmp = React.useCallback<typeof countCmp>((a, b) => {- return cmp(a.value, b.value);- }, [cmp]);- const comparator = sortBy === "none" ? null : sortBy.startsWith("value") ? valueCmp : countCmp;- const sortMulti = sortBy.endsWith("dsc") ? -1 : 1;+ const { fid, cmp: cmpRaw } = field;+ const cmp = parseCmpFunction(cmpRaw);+ const valueCmp = React.useCallback<typeof countCmp>(+ (a, b) => {+ return cmp(a.value, b.value);+ },+ [cmp]+ );+ const comparator = sortBy === 'none' ? null : sortBy.startsWith('value') ? valueCmp : countCmp;+ const sortMulti = sortBy.endsWith('dsc') ? -1 : 1;const [loading, setLoading] = React.useState(true);const [stats, setStats] = React.useState<IFieldStats | null>(null);- const computationFunction = useComputationFunc();React.useEffect(() => {setLoading(true);let isCancelled = false;- fieldStatServer(computationFunction, fid, { values, range }).then(stats => {- if (isCancelled) {- return;- }- setStats(stats);- setLoading(false);- }).catch(reason => {- console.warn(reason);- if (isCancelled) {- return;- }- setStats(null);- setLoading(false);- });+ fieldStat(computation, fid, { values, range })+ .then((stats) => {+ if (isCancelled) {+ return;+ }+ setStats(stats);+ setLoading(false);+ })+ .catch((reason) => {+ console.warn(reason);+ if (isCancelled) {+ return;+ }+ setStats(null);+ setLoading(false);+ });return () => {isCancelled = true;};- }, [fid, computationFunction, values, range]);+ }, [fid, computation, values, range]);const sortedStats = React.useMemo<typeof stats>(() => {if (!stats || !comparator) {return stats;}const copy = { ...stats };- copy.values = copy.values.slice().sort((a,b) => sortMulti * comparator(a,b));+ copy.values = copy.values.slice().sort((a, b) => sortMulti * comparator(a, b));return copy;}, [stats, comparator, sortMulti]);return loading ? null : sortedStats;};-export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = observer(({- active,- field,- onChange,-}) => {-+export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = observer(({ active, field, onChange }) => {interface SortConfig {key: 'value' | 'count';ascending: boolean;}const [sortConfig, setSortConfig] = useState<SortConfig>({- key: "count",- ascending: true+ key: 'count',+ ascending: true,});const { t } = useTranslation('translation');- const stats = useFieldStats(field, { values: true, range: false }, `${sortConfig.key}${sortConfig.ascending ? '': '_dsc'}`);+ const computation = useCompututaion();++ const stats = useFieldStats(field, { values: true, range: false }, `${sortConfig.key}${sortConfig.ascending ? '' : '_dsc'}`, computation);const count = stats?.values;React.useEffect(() => {if (count && active && field.rule?.type !== 'one of') {onChange({type: 'one of',- value: new Set<string | number>(count.map(item => item.value)),+ value: new Set<string | number>(count.map((item) => item.value)),});}}, [active, onChange, field, count]);@@ -230,26 +224,22 @@ export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = obconst curSet = field.rule.value;onChange({type: 'one of',- value: new Set<number | string>(- curSet.size === count.length ? [] : count.map(c => c.value)- ),+ value: new Set<number | string>(curSet.size === count.length ? [] : count.map((c) => c.value)),});- }+ };const handleToggleReverseSet = () => {if (!field.rule || field.rule.type !== 'one of' || !count) return;const curSet = field.rule.value;onChange({type: 'one of',- value: new Set<number | string>(- count.map(c => c.value).filter(key => !curSet.has(key))- ),+ value: new Set<number | string>(count.map((c) => c.value).filter((key) => !curSet.has(key))),});- }+ };const handleSelectValue = (value: any, checked: boolean) => {if (!field.rule || field.rule?.type !== 'one of') return;const rule: IFilterRule = {type: 'one of',- value: new Set(field.rule.value)+ value: new Set(field.rule.value),};if (checked) {rule.value.add(value);@@ -257,14 +247,14 @@ export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = obrule.value.delete(value);}onChange(rule);- }+ };const selectedValueSum = useMemo(() => {if (!field.rule?.value || !count) return 0;return [...field.rule.value].reduce<number>((sum, key) => {- const s = count.find(c => c.value === key)?.count || 0;+ const s = count.find((c) => c.value === key)?.count || 0;return sum + s;- }, 0)+ }, 0);}, [field.rule?.value, count, field.fid]);if (!stats) {@@ -275,51 +265,35 @@ export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = ob);}- const SortButton: React.FC<{ currentKey: SortConfig["key"] }> = ({ currentKey }) => {+ const SortButton: React.FC<{ currentKey: SortConfig['key'] }> = ({ currentKey }) => {const isCurrentKey = sortConfig.key === currentKey;return (<span- className={`ml-2 flex-none rounded bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer ${isCurrentKey ? "text-indigo-600" : "text-gray-500"}`}- onClick={() => setSortConfig({ key: currentKey, ascending: (isCurrentKey ? !sortConfig.ascending : true) })}+ className={`ml-2 flex-none rounded bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer ${+ isCurrentKey ? 'text-indigo-600' : 'text-gray-500'+ }`}+ onClick={() => setSortConfig({ key: currentKey, ascending: isCurrentKey ? !sortConfig.ascending : true })}>- {isCurrentKey && !sortConfig.ascending- ? <ChevronDownIcon className="h-4 w-4" />- : <ChevronUpIcon className="h-4 w-4" />- }+ {isCurrentKey && !sortConfig.ascending ? <ChevronDownIcon className="h-4 w-4" /> : <ChevronUpIcon className="h-4 w-4" />}</span>);- }+ };return field.rule?.type === 'one of' ? (<Container><div>{t('constant.filter_type.one_of')}</div><div className="text-gray-500 dark:text-gray-300">{t('constant.filter_type.one_of_desc')}</div><div className="btn-grp">- <Button- className="dark:bg-zinc-900 dark:text-gray-200 dark:hover:bg-gray-800"- onClick={() => handleToggleFullOrEmptySet()}- disabled={!count}- >- {- field.rule.value.size === count?.length- ? t('filters.btn.unselect_all')- : t('filters.btn.select_all')- }+ <Button className="dark:bg-zinc-900 dark:text-gray-200 dark:hover:bg-gray-800" onClick={() => handleToggleFullOrEmptySet()} disabled={!count}>+ {field.rule.value.size === count?.length ? t('filters.btn.unselect_all') : t('filters.btn.select_all')}</Button>- <Button- className="dark:bg-zinc-900 dark:text-gray-200 dark:hover:bg-gray-800"- onClick={() => handleToggleReverseSet()}- >+ <Button className="dark:bg-zinc-900 dark:text-gray-200 dark:hover:bg-gray-800" onClick={() => handleToggleReverseSet()}>{t('filters.btn.reverse')}</Button></div><Table className="bg-slate-50 dark:bg-gray-800"><div className="flex justify-center items-center">- <StatusCheckbox- currentNum={field.rule.value.size}- totalNum={count?.length ?? 0}- onChange={handleToggleFullOrEmptySet}- />+ <StatusCheckbox currentNum={field.rule.value.size} totalNum={count?.length ?? 0} onChange={handleToggleFullOrEmptySet} /></div><label className="header text-gray-500 dark:text-gray-300 flex items-center">{t('filters.header.value')}@@ -332,48 +306,34 @@ export const FilterOneOfRule: React.FC<RuleFormProps & { active: boolean }> = ob</Table>{/* <hr /> */}<Table>- {- count?.map(({ value, count }, idx) => {- const id = `rule_checkbox_${idx}`;-- return (- <React.Fragment key={idx}>- <div className="flex justify-center items-center">- <input- type="checkbox"- className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"- checked={field.rule?.type === 'one of' && field.rule.value.has(value)}- id={id}- aria-describedby={`${id}_label`}- title={String(value)}- onChange={({ target: { checked } }) => handleSelectValue(value, checked)}- />- </div>- <label- id={`${id}_label`}- htmlFor={id}+ {count?.map(({ value, count }, idx) => {+ const id = `rule_checkbox_${idx}`;++ return (+ <React.Fragment key={idx}>+ <div className="flex justify-center items-center">+ <input+ type="checkbox"+ className="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"+ checked={field.rule?.type === 'one of' && field.rule.value.has(value)}+ id={id}+ aria-describedby={`${id}_label`}title={String(value)}- >- {`${value}`}- </label>- <label- htmlFor={id}- >- {count}- </label>- </React.Fragment>- );- })- }+ onChange={({ target: { checked } }) => handleSelectValue(value, checked)}+ />+ </div>+ <label id={`${id}_label`} htmlFor={id} title={String(value)}>+ {`${value}`}+ </label>+ <label htmlFor={id}>{count}</label>+ </React.Fragment>+ );+ })}</Table><Table className="text-gray-600"><label></label>- <label>- {t('filters.selected_keys', { count: field.rule.value.size })}- </label>- <label>- {selectedValueSum}- </label>+ <label>{t('filters.selected_keys', { count: field.rule.value.size })}</label>+ <label>{selectedValueSum}</label></Table></Container>) : null;@@ -386,18 +346,18 @@ interface CalendarInputProps {onChange: (value: number) => void;}-const CalendarInput: React.FC<CalendarInputProps> = props => {+const CalendarInput: React.FC<CalendarInputProps> = (props) => {const { min, max, value, onChange } = props;const dateStringFormatter = (timestamp: number) => {const date = new Date(timestamp);if (Number.isNaN(date.getTime())) return '';return date.toISOString().slice(0, 19);- }+ };const handleSubmitDate = (value: string) => {if (new Date(value).getTime() <= max && new Date(value).getTime() >= min) {- onChange(new Date(value).getTime())+ onChange(new Date(value).getTime());}- }+ };return (<inputclassName="block w-full rounded-md border-0 py-1 px-2 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 dark:bg-zinc-900 dark:border-gray-700 focus:ring-1 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"@@ -407,14 +367,14 @@ const CalendarInput: React.FC<CalendarInputProps> = props => {defaultValue={dateStringFormatter(value)}onChange={(e) => handleSubmitDate(e.target.value)}/>- )-}+ );+};export const FilterTemporalRangeRule: React.FC<RuleFormProps & { active: boolean }> = observer(({ active, field, onChange }) => {const { t } = useTranslation('translation');- const computationFunction = useComputationFunc();+ const computationFunction = useCompututaion();const [res, setRes] = useState<[number, number, boolean]>(() => [0, 0, false]);@@ -431,16 +391,7 @@ export const FilterTemporalRangeRule: React.FC<RuleFormProps & { active: booleanvalue: [min, max],});}- }, [onChange, field, min, max, active, loaded]);-- React.useEffect(() => {- if (active && loaded && field.rule?.type === 'temporal range' && field.rule.value[0] !== min && field.rule.value[1] !== max) {- onChange({- type: 'temporal range',- value: [min, max],- });- }- }, [field.rule, min, max, active, loaded]);+ }, [onChange, field, min, max, active]);const handleChange = React.useCallback((value: readonly [number, number]) => {onChange({@@ -486,14 +437,12 @@ export const FilterTemporalRangeRule: React.FC<RuleFormProps & { active: boolean});-export const FilterRangeRule: React.FC<RuleFormProps & { active: boolean }> = observer(({- active,- field,- onChange,-}) => {++export const FilterRangeRule: React.FC<RuleFormProps & { active: boolean }> = observer(({ active, field, onChange }) => {const { t } = useTranslation('translation', { keyPrefix: 'constant.filter_type' });+ const computation = useCompututaion();- const stats = useFieldStats(field, { values: false, range: true }, 'none');+ const stats = useFieldStats(field, { values: false, range: true }, 'none', computation);const range = stats?.range;React.useEffect(() => {@@ -524,35 +473,30 @@ export const FilterRangeRule: React.FC<RuleFormProps & { active: boolean }> = ob<Container><div>{t('range')}</div><div className="text-gray-500">{t('range_desc')}</div>- <Slider- min={range[0]}- max={range[1]}- value={field.rule.value}- onChange={handleChange}- />+ <Slider min={range[0]} max={range[1]} value={field.rule.value} onChange={handleChange} /></Container>) : null;});const filterTabs: Record<IFilterRule['type'], React.FC<RuleFormProps & { active: boolean }>> = {'one of': FilterOneOfRule,- 'range': FilterRangeRule,+ range: FilterRangeRule,'temporal range': FilterTemporalRangeRule,};const tabOptionDict = {- "one of": {- key: "one_of",- descKey: "one_of_desc"+ 'one of': {+ key: 'one_of',+ descKey: 'one_of_desc',},- "range": {- key: "range",- descKey: "range_desc"+ range: {+ key: 'range',+ descKey: 'range_desc',+ },+ 'temporal range': {+ key: 'temporal_range',+ descKey: 'temporal_range_desc',},- "temporal range": {- key: "temporal_range",- descKey: "temporal_range_desc"- }};export interface TabsProps extends RuleFormProps {@@ -560,77 +504,62 @@ export interface TabsProps extends RuleFormProps {}const Tabs: React.FC<TabsProps> = observer(({ field, onChange, tabs }) => {- const { vizStore, commonStore } = useGlobalStore();- const { draggableFieldState } = vizStore;- const { currentDataset } = commonStore;+ const vizStore = useVizStore();+ const { meta } = vizStore;const { t } = useTranslation('translation', { keyPrefix: 'constant.filter_type' });const [which, setWhich] = React.useState(field.rule?.type ?? tabs[0]!);React.useEffect(() => {if (!tabs.includes(which)) setWhich(tabs[0]);- }, [tabs])+ }, [tabs]);return (<TabsContainer><div>- {- tabs.map((option) => {- return (- <div className="flex my-2" key={option}>- <div className="align-top">- <input- type="radio"- className="h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600"- id={option}- checked={option === which}- onChange={e => setWhich((e.target as HTMLInputElement).value as typeof which)}- name="filter_type"- value={option}- />- </div>- <div className="ml-3">- <label htmlFor={option}>- {t(tabOptionDict[option].key)}- </label>- <div className="text-gray-500">- {t(tabOptionDict[option].descKey)}- </div>- </div>+ {tabs.map((option) => {+ return (+ <div className="flex my-2" key={option}>+ <div className="align-top">+ <input+ type="radio"+ className="h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600"+ id={option}+ checked={option === which}+ onChange={(e) => setWhich((e.target as HTMLInputElement).value as typeof which)}+ name="filter_type"+ value={option}+ /></div>- )- })- }+ <div className="ml-3">+ <label htmlFor={option}>{t(tabOptionDict[option].key)}</label>+ <div className="text-gray-500">{t(tabOptionDict[option].descKey)}</div>+ </div>+ </div>+ );+ })}</div><hr className="my-0.5" /><TabPanel>- {- tabs.map((tab, i) => {- const Component = filterTabs[tab];-- return draggableFieldState === null ? null : (- <TabItem- key={i}- id={`filter-panel-${tabOptionDict[tab]}`}- aria-labelledby={`filter-tab-${tabOptionDict[tab]}`}- role="tabpanel"- hidden={which !== tab}- tabIndex={0}- >- <Component- field={field}- onChange={onChange}- active={which === tab}- dataset={currentDataset}- />- </TabItem>- );- })- }+ {tabs.map((tab, i) => {+ const Component = filterTabs[tab];++ return (+ <TabItem+ key={i}+ id={`filter-panel-${tabOptionDict[tab]}`}+ aria-labelledby={`filter-tab-${tabOptionDict[tab]}`}+ role="tabpanel"+ hidden={which !== tab}+ tabIndex={0}+ >+ <Component field={field} onChange={onChange} active={which === tab} rawFields={meta} />+ </TabItem>+ );+ })}</TabPanel></TabsContainer>);});-export default Tabs;diff --git a/packages/graphic-walker/src/fields/obComponents/obFContainer.tsx b/packages/graphic-walker/src/fields/obComponents/obFContainer.tsxindex f56bbd9a..16a0f46b 100644--- a/packages/graphic-walker/src/fields/obComponents/obFContainer.tsx+++ b/packages/graphic-walker/src/fields/obComponents/obFContainer.tsx@@ -1,40 +1,34 @@import React from 'react';-import { observer } from 'mobx-react-lite'+import { observer } from 'mobx-react-lite';import { FieldsContainer } from '../components';-import { useGlobalStore } from '../../store';-import {- Draggable,- DroppableProvided-} from "@kanaries/react-beautiful-dnd";-import { IDraggableStateKey } from '../../interfaces';+import { useVizStore } from '../../store';+import { Draggable, DroppableProvided } from '@kanaries/react-beautiful-dnd';+import { IDraggableViewStateKey } from '../../interfaces';import OBPill from './obPill';interface FieldContainerProps {- provided: DroppableProvided+ provided: DroppableProvided;/*** draggable Field Id*/- dkey: IDraggableStateKey;+ dkey: IDraggableViewStateKey;}-const OBFieldContainer: React.FC<FieldContainerProps> = props => {+const OBFieldContainer: React.FC<FieldContainerProps> = (props) => {const { provided, dkey } = props;- const { vizStore} = useGlobalStore();- const { draggableFieldState } = vizStore;- return <FieldsContainer- {...provided.droppableProps}- ref={provided.innerRef}- >- {/* {provided.placeholder} */}- {draggableFieldState[dkey.id].map((f, index) => (- <Draggable key={f.dragId} draggableId={f.dragId} index={index}>- {(provided, snapshot) => {- return (- <OBPill dkey={dkey} fIndex={index} provided={provided} />- );- }}- </Draggable>- ))}- </FieldsContainer>-}+ const vizStore = useVizStore();+ const { allEncodings } = vizStore;+ return (+ <FieldsContainer {...provided.droppableProps} ref={provided.innerRef}>+ {/* {provided.placeholder} */}+ {allEncodings[dkey.id].map((f, index) => (+ <Draggable key={f.dragId} draggableId={f.dragId} index={index}>+ {(provided, snapshot) => {+ return <OBPill dkey={dkey} fIndex={index} provided={provided} />;+ }}+ </Draggable>+ ))}+ </FieldsContainer>+ );+};export default observer(OBFieldContainer);diff --git a/packages/graphic-walker/src/fields/obComponents/obPill.tsx b/packages/graphic-walker/src/fields/obComponents/obPill.tsxindex 66b3fbc1..965553b1 100644--- a/packages/graphic-walker/src/fields/obComponents/obPill.tsx+++ b/packages/graphic-walker/src/fields/obComponents/obPill.tsx@@ -4,8 +4,8 @@ import React, { useMemo } from 'react';import { useTranslation } from 'react-i18next';import { DraggableProvided } from '@kanaries/react-beautiful-dnd';import { COUNT_FIELD_ID, MEA_KEY_ID, MEA_VAL_ID } from '../../constants';-import { IDraggableStateKey } from '../../interfaces';-import { useGlobalStore } from '../../store';+import { IAggregator, IDraggableViewStateKey } from '../../interfaces';+import { useVizStore } from '../../store';import { Pill } from '../components';import { GLOBAL_CONFIG } from '../../config';import DropdownContext from '../../components/dropdownContext';@@ -14,13 +14,13 @@ import SelectContext, { type ISelectContextOption } from '../../components/selecinterface PillProps {provided: DraggableProvided;fIndex: number;- dkey: IDraggableStateKey;+ dkey: IDraggableViewStateKey;}const OBPill: React.FC<PillProps> = (props) => {const { provided, dkey, fIndex } = props;- const { vizStore } = useGlobalStore();- const { visualConfig, allFields } = vizStore;- const field = vizStore.draggableFieldState[dkey.id][fIndex];+ const vizStore = useVizStore();+ const { config, allFields } = vizStore;+ const field = vizStore.allEncodings[dkey.id][fIndex];const { t } = useTranslation('translation', { keyPrefix: 'constant.aggregator' });const aggregationOptions = useMemo(() => {@@ -38,7 +38,7 @@ const OBPill: React.FC<PillProps> = (props) => {}));}, [allFields]);- const folds = field.fid === MEA_KEY_ID ? visualConfig.folds ?? [] : null;+ const folds = field.fid === MEA_KEY_ID ? config.folds ?? [] : null;return (<Pill@@ -60,11 +60,11 @@ const OBPill: React.FC<PillProps> = (props) => {)}{!folds && <span className="flex-1 truncate">{field.name}</span>} - {field.analyticType === 'measure' && field.fid !== COUNT_FIELD_ID && visualConfig.defaultAggregated && (+ {field.analyticType === 'measure' && field.fid !== COUNT_FIELD_ID && config.defaultAggregated && (<DropdownContextoptions={aggregationOptions}onSelect={(value) => {- vizStore.setFieldAggregator(dkey.id, fIndex, value);+ vizStore.setFieldAggregator(dkey.id, fIndex, value as IAggregator);}}><span className="bg-transparent text-gray-700 float-right focus:outline-none focus:border-gray-500 dark:focus:border-gray-400 flex items-center ml-2">diff --git a/packages/graphic-walker/src/fields/posFields/index.tsx b/packages/graphic-walker/src/fields/posFields/index.tsxindex 5337160f..741059cf 100644--- a/packages/graphic-walker/src/fields/posFields/index.tsx+++ b/packages/graphic-walker/src/fields/posFields/index.tsx@@ -1,43 +1,44 @@import React, { useMemo } from 'react';import { observer } from 'mobx-react-lite';-import { Droppable } from "@kanaries/react-beautiful-dnd";-import { useGlobalStore } from '../../store';-import { FieldListContainer } from "../components";+import { Droppable } from '@kanaries/react-beautiful-dnd';+import { useVizStore } from '../../store';+import { FieldListContainer } from '../components';import { DRAGGABLE_STATE_KEYS } from '../fieldsContext';import OBFieldContainer from '../obComponents/obFContainer';const firstChannelStyle = {zIndex: 2,};+import { IDraggableViewStateKey } from '../../interfaces';-const PosFields: React.FC = props => {- const { vizStore } = useGlobalStore();- const { visualConfig } = vizStore;- const { geoms, coordSystem = 'generic' } = visualConfig;+const PosFields: React.FC = (props) => {+ const vizStore = useVizStore();+ const { config } = vizStore;+ const { geoms, coordSystem = 'generic' } = config;const channels = useMemo(() => {if (coordSystem === 'geographic') {if (geoms[0] === 'choropleth') {- return DRAGGABLE_STATE_KEYS.filter(f => f.id === 'geoId');+ return DRAGGABLE_STATE_KEYS.filter((f) => f.id === 'geoId') as IDraggableViewStateKey[];}- return DRAGGABLE_STATE_KEYS.filter(f => f.id === 'longitude' || f.id === 'latitude');+ return DRAGGABLE_STATE_KEYS.filter((f) => f.id === 'longitude' || f.id === 'latitude') as IDraggableViewStateKey[];}if (geoms[0] === 'arc') {- return DRAGGABLE_STATE_KEYS.filter(f => f.id === 'radius' || f.id === 'theta');+ return DRAGGABLE_STATE_KEYS.filter((f) => f.id === 'radius' || f.id === 'theta') as IDraggableViewStateKey[];}- return DRAGGABLE_STATE_KEYS.filter(f => f.id === 'columns' || f.id === 'rows');- }, [geoms[0], coordSystem])- return <div>- {- channels.map((dkey, i) => <FieldListContainer name={dkey.id} key={dkey.id} style={i === 0 ? firstChannelStyle : undefined}>- <Droppable droppableId={dkey.id} direction="horizontal">- {(provided, snapshot) => (- <OBFieldContainer dkey={dkey} provided={provided} />- )}- </Droppable>- </FieldListContainer>)- }- </div>-}+ return DRAGGABLE_STATE_KEYS.filter((f) => f.id === 'columns' || f.id === 'rows') as IDraggableViewStateKey[];+ }, [geoms[0], coordSystem]);+ return (+ <div>+ {channels.map((dkey, i) => (+ <FieldListContainer name={dkey.id} key={dkey.id} style={i === 0 ? firstChannelStyle : undefined}>+ <Droppable droppableId={dkey.id} direction="horizontal">+ {(provided, snapshot) => <OBFieldContainer dkey={dkey} provided={provided} />}+ </Droppable>+ </FieldListContainer>+ ))}+ </div>+ );+};-export default observer(PosFields);\ No newline at end of file+export default observer(PosFields);diff --git a/packages/graphic-walker/src/hooks/index.ts b/packages/graphic-walker/src/hooks/index.tsindex ac5c89ff..80db0635 100644--- a/packages/graphic-walker/src/hooks/index.ts+++ b/packages/graphic-walker/src/hooks/index.ts@@ -1,4 +1,4 @@-import { useState, useEffect } from 'react';+import { useState, useEffect, useRef } from 'react';export function useDebounceValue<T>(value: T, timeout = 200): T {const [innerValue, setInnerValue] = useState(value);@@ -12,7 +12,14 @@ export function useDebounceValue<T>(value: T, timeout = 200): T {export function useDebounceValueBind<T>(value: T, setter: (v: T) => void, timeout = 200): [T, (v: T) => void] {const [innerValue, setInnerValue] = useState(value);const valueToSet = useDebounceValue(innerValue, timeout);- useEffect(() => setInnerValue(value), [value])- useEffect(() => setter(valueToSet), [valueToSet]);+ const first = useRef(true);+ useEffect(() => setInnerValue(value), [value]);+ useEffect(() => {+ if (first.current) {+ first.current = false;+ } else {+ setter(valueToSet);+ }+ }, [valueToSet]);return [innerValue, setInnerValue];-}\ No newline at end of file+}diff --git a/packages/graphic-walker/src/index.tsx b/packages/graphic-walker/src/index.tsxindex 01e5225b..33673b05 100644--- a/packages/graphic-walker/src/index.tsx+++ b/packages/graphic-walker/src/index.tsx@@ -1,47 +1,72 @@-import React, { type ForwardedRef, forwardRef, useState } from "react";-import { DOMProvider } from "@kanaries/react-beautiful-dnd";-import { observer } from "mobx-react-lite";-import App, { IGWProps } from "./App";-import { StoreWrapper } from "./store/index";-import { FieldsContextWrapper } from "./fields/fieldsContext";-import { ShadowDom } from "./shadow-dom";-import AppRoot from "./components/appRoot";-import type { IGWHandler, IGWHandlerInsider } from "./interfaces";--import "./empty_sheet.css";--export const GraphicWalker = observer(forwardRef<IGWHandler, IGWProps>((props, ref) => {- const { storeRef } = props;-- const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);-- const handleMount = (shadowRoot: ShadowRoot) => {- setShadowRoot(shadowRoot);- };- const handleUnmount = () => {- setShadowRoot(null);- };-- return (- <StoreWrapper keepAlive={props.keepAlive} storeRef={storeRef}>+import React, { type ForwardedRef, forwardRef, useState } from 'react';+import { DOMProvider } from '@kanaries/react-beautiful-dnd';+import { observer } from 'mobx-react-lite';+import { VizAppWithContext, VizProps } from './App';+import { App, IGWProps } from './FullApp';++import { StoreWrapper } from './store/index';+import { ShadowDom } from './shadow-dom';+import AppRoot from './components/appRoot';+import type { IGWHandler, IGWHandlerInsider } from './interfaces';++import './empty_sheet.css';++export const GraphicWalker = observer(+ forwardRef<IGWHandler, IGWProps>((props, ref) => {+ const { storeRef } = props;+ const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);++ const handleMount = (shadowRoot: ShadowRoot) => {+ setShadowRoot(shadowRoot);+ };+ const handleUnmount = () => {+ setShadowRoot(null);+ };++ return (+ <StoreWrapper keepAlive={props.keepAlive} storeRef={storeRef}>+ <AppRoot ref={ref as ForwardedRef<IGWHandlerInsider>}>+ <ShadowDom onMount={handleMount} onUnmount={handleUnmount}>+ <DOMProvider value={{ head: shadowRoot ?? document.head, body: shadowRoot ?? document.body }}>+ <App {...props} />+ </DOMProvider>+ </ShadowDom>+ </AppRoot>+ </StoreWrapper>+ );+ })+);++export const SimpleGraphicWalker = observer(+ forwardRef<IGWHandler, VizProps>((props, ref) => {+ const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);++ const handleMount = (shadowRoot: ShadowRoot) => {+ setShadowRoot(shadowRoot);+ };+ const handleUnmount = () => {+ setShadowRoot(null);+ };++ return (<AppRoot ref={ref as ForwardedRef<IGWHandlerInsider>}><ShadowDom onMount={handleMount} onUnmount={handleUnmount}><DOMProvider value={{ head: shadowRoot ?? document.head, body: shadowRoot ?? document.body }}>- <FieldsContextWrapper>- <App {...props} />- </FieldsContextWrapper>+ <VizAppWithContext {...props} /></DOMProvider></ShadowDom></AppRoot>- </StoreWrapper>- );-}));+ );+ })+);export { default as PureRenderer } from './renderer/pureRenderer';export { embedGraphicWalker } from './vanilla';export type { IGWProps };export { ISegmentKey, ColorSchemes } from './interfaces';-export { resolveSpecFromStoInfo } from './utils/save';+export { resolveChart, convertChart } from './models/visSpecHistory';+export { resolveVisSpec } from './utils/save';export { getGlobalConfig } from './config';-export type { IGlobalStore } from './store/index';++export { getComputation } from './computation/clientComputation';export { addFilterForQuery } from './utils/workflow';\ No newline at end of filediff --git a/packages/graphic-walker/src/interfaces.ts b/packages/graphic-walker/src/interfaces.tsindex 94f2b00e..59626c26 100644--- a/packages/graphic-walker/src/interfaces.ts+++ b/packages/graphic-walker/src/interfaces.ts@@ -2,7 +2,6 @@ import { Config as VgConfig, View } from 'vega';import { Config as VlConfig } from 'vega-lite';import type { FeatureCollection } from 'geojson';import type { feature } from 'topojson-client';-import type { IViewQuery } from './lib/viewQuery';import { DATE_TIME_DRILL_LEVELS } from './constants';export type DeepReadonly<T extends Record<keyof any, any>> = {@@ -116,8 +115,8 @@ export interface IField {aggName?: string;semanticType: ISemanticType;analyticType: IAnalyticType;+ cmp?: string;geoRole?: IGeoRole;- cmp?: (a: any, b: any) => number;computed?: boolean;expression?: IExpression;timeUnit?: (typeof DATE_TIME_DRILL_LEVELS)[number];@@ -160,6 +159,7 @@ export interface IExplainProps {metas: IField[];}+/** @deprecated */export interface IDataSet {id: string;name: string;@@ -177,6 +177,8 @@ export interface IDataSetInfo {export interface IDataSource {id: string;+ metaId?: string;+ name?: string;data: IRow[];}@@ -213,6 +215,11 @@ export interface IDraggableStateKey {mode: number;}+export interface IDraggableViewStateKey {+ id: keyof Omit<DraggableFieldState, 'filters'>;+ mode: number;+}+export type IFilterRule =| {type: 'range';@@ -232,11 +239,11 @@ export type IStackMode = 'none' | 'stack' | 'normalize' | 'zero' | 'center';export type ICoordMode = 'generic' | 'geographic';export type IConfigScale = {- rangeMax?: number,- rangeMin?: number,- domainMin?: number,- domainMax?: number,-}+ rangeMax?: number;+ rangeMin?: number;+ domainMin?: number;+ domainMax?: number;+};export interface IVisualConfig {defaultAggregated: boolean;@@ -258,11 +265,11 @@ export interface IVisualConfig {timeFormat?: string;normalizedNumberFormat?: string;};- primaryColor?:string;+ primaryColor?: string;colorPalette?: string;scale?: {- opacity: IConfigScale,- size: IConfigScale+ opacity: IConfigScale;+ size: IConfigScale;};resolve: {x?: boolean;@@ -284,11 +291,60 @@ export interface IVisualConfig {folds?: string[];}+export interface IVisualLayout {+ showTableSummary: boolean;+ format: {+ numberFormat?: string;+ timeFormat?: string;+ normalizedNumberFormat?: string;+ };+ primaryColor?: string;+ colorPalette?: string;+ scale?: {+ opacity: IConfigScale;+ size: IConfigScale;+ };+ resolve: {+ x?: boolean;+ y?: boolean;+ color?: boolean;+ opacity?: boolean;+ shape?: boolean;+ size?: boolean;+ };+ size: {+ mode: 'auto' | 'fixed';+ width: number;+ height: number;+ };+ useSvg?: boolean;+ geojson?: FeatureCollection;+ geoKey?: string;+ geoUrl?: IGeoUrl;+ interactiveScale: boolean;+ stack: IStackMode;+ showActions: boolean;+ zeroScale: boolean;+ background?: string;+ /** @default false */+ scaleIncludeUnmatchedChoropleth?: boolean;+}++export interface IVisualConfigNew {+ defaultAggregated: boolean;+ geoms: string[];+ /** @default "generic" */+ coordSystem?: ICoordMode;+ limit: number;+ folds?: string[];+}+export interface IGeoUrl {type: 'GeoJSON' | 'TopoJSON';url: string;}+/** @deprecated */export interface IVisSpec {readonly visId: string;readonly name?: string;@@ -435,6 +491,11 @@ export type IVisFieldComputation = {type: IVisField['type'];};+export type IFieldTransform = {+ key: IVisFieldComputation['field'];+ expression: IVisFieldComputation['expression'];+};+export interface IVisFilter {fid: string;rule: SetToArray<IFilterRule>;@@ -447,10 +508,7 @@ export interface IFilterWorkflowStep {export interface ITransformWorkflowStep {type: 'transform';- transform: {- key: IVisFieldComputation['field'];- expression: IVisFieldComputation['expression'];- }[];+ transform: IFieldTransform[];}export interface IViewWorkflowStep {@@ -494,6 +552,50 @@ export type IResponse<T> =options?: Record<string, string>;};};+export interface IAggQuery {+ op: 'aggregate';+ groupBy: string[];+ measures: { field: string; agg: IAggregator; asFieldKey: string; format?: string }[];+}++export interface IFoldQuery {+ op: 'fold';+ foldBy: string[];+ newFoldKeyCol: string;+ newFoldValueCol: string;+}++export interface IBinQuery {+ op: 'bin';+ binBy: string;+ newBinCol: string;+ binSize: number;+}++export interface IRawQuery {+ op: 'raw';+ fields: string[];+}++export type IViewQuery = IAggQuery | IFoldQuery | IBinQuery | IRawQuery;++export interface IChart {+ visId: string;+ name?: string;+ encodings: DraggableFieldState;+ config: IVisualConfigNew;+ layout: IVisualLayout;+}++export interface PartialChart {+ visId?: string;+ name?: string;+ encodings?: Partial<DraggableFieldState>;+ config?: Partial<IVisualConfigNew>;+ layout?: Partial<IVisualLayout>;+}++export type IChartForExport = SetToArray<IChart>;export type Topology = Parameters<typeof feature>[0];diff --git a/packages/graphic-walker/src/workers/filter.worker.js b/packages/graphic-walker/src/lib/filter.tssimilarity index 61%rename from packages/graphic-walker/src/workers/filter.worker.jsrename to packages/graphic-walker/src/lib/filter.tsindex 1c1ad84f..e657d6ca 100644--- a/packages/graphic-walker/src/workers/filter.worker.js+++ b/packages/graphic-walker/src/lib/filter.ts@@ -1,18 +1,11 @@-/* eslint no-restricted-globals: 0 */-/* eslint-disable */+import { IRow, IFilterFiledSimple } from '../interfaces';-/**- * @param {import('../interfaces').IRow[]} dataSource- * @param {import('../interfaces').IFilterFiledSimple[]} filters- * @return {import('../interfaces').IRow[]}- */-const filter = (dataSource, filters) => {- return dataSource.filter(which => {+export const filter = (dataSource: IRow[], filters: IFilterFiledSimple[]) => {+ return dataSource.filter((which) => {for (const { rule, fid } of filters) {if (!rule) {continue;}-switch (rule.type) {case 'one of': {if (rule.value.has(which[fid])) {@@ -31,17 +24,13 @@ const filter = (dataSource, filters) => {case 'temporal range': {try {const time = new Date(which[fid]).getTime();-- if (- rule.value[0] <= time && time <= rule.value[1]- ) {+ if (rule.value[0] <= time && time <= rule.value[1]) {break;} else {return false;}} catch (error) {console.error(error);-return false;}}@@ -54,17 +43,4 @@ const filter = (dataSource, filters) => {return true;});-};--/**- * @param {MessageEvent<{ dataSource: import('../interfaces').IRow[]; filters: import('../interfaces').IFilterField[] }>} e- */-const main = e => {- const { dataSource, filters } = e.data;-- const filtered = filter(dataSource, filters);-- self.postMessage(filtered);-};--self.addEventListener('message', main, false);+};\ No newline at end of filediff --git a/packages/graphic-walker/src/lib/inferMeta.ts b/packages/graphic-walker/src/lib/inferMeta.tsindex 688010a5..3c660677 100644--- a/packages/graphic-walker/src/lib/inferMeta.ts+++ b/packages/graphic-walker/src/lib/inferMeta.ts@@ -89,8 +89,7 @@ export function inferMeta(props: { dataSource: IRow[]; fields: IUncertainMutFielconst { dataSource, fields } = props;const finalFieldMetas: IMutField[] = [];for (let field of fields) {- let semanticType: ISemanticType =- field.semanticType === '?' ? inferSemanticType(dataSource, field.path) : field.semanticType;+ let semanticType: ISemanticType = field.semanticType === '?' ? inferSemanticType(dataSource, field.path) : field.semanticType;let analyticType: IAnalyticType = inferAnalyticTypeFromSemanticType(semanticType);finalFieldMetas.push({diff --git a/packages/graphic-walker/src/lib/insights/explainBySelection.ts b/packages/graphic-walker/src/lib/insights/explainBySelection.tsindex a126748f..893ceaea 100644--- a/packages/graphic-walker/src/lib/insights/explainBySelection.ts+++ b/packages/graphic-walker/src/lib/insights/explainBySelection.ts@@ -1,13 +1,12 @@import { IAggregator, IExplainProps, IPredicate, IField, IRow, IViewField, IFilterField, IComputationFunction, IViewWorkflowStep } from '../../interfaces';import { filterByPredicates, getMeaAggKey } from '../../utils';import { compareDistribution, compareDistributionKL, compareDistributionJS, normalizeWithParent } from '../../utils/normalization';-import { IBinQuery } from '../interfaces';import { aggregate } from '../op/aggregate';import { bin } from '../op/bin';import { VizSpecStore } from "../../store/visualSpecStore";import { complementaryFields, groupByAnalyticTypes } from './utils';import { toWorkflow } from '../../utils/workflow';-import { dataQueryServer } from '../../computation/serverComputation';+import { dataQuery } from '../../computation/index';const QUANT_BIN_NUM = 10;@@ -50,10 +49,10 @@ export async function explainBySelection(props: {for (let mea of viewMeasures) {const overallWorkflow = toWorkflow(viewFilters, allFields, [extendDim], [mea], true, 'none');const fullOverallWorkflow = extraPreWorkflow ? [...extraPreWorkflow, ...overallWorkflow] : overallWorkflow- const overallData = await dataQueryServer(computationFunction, fullOverallWorkflow)+ const overallData = await dataQuery(computationFunction, fullOverallWorkflow)const viewWorkflow = toWorkflow(viewFilters, allFields, [...viewDimensions, extendDim], [mea], true, 'none');const fullViewWorkflow = extraPreWorkflow ? [...extraPreWorkflow, ...viewWorkflow] : viewWorkflow- const viewData = await dataQueryServer(computationFunction, fullViewWorkflow);+ const viewData = await dataQuery(computationFunction, fullViewWorkflow);const subData = filterByPredicates(viewData, predicates);let outlierNormalization = normalizeWithParent(subData,diff --git a/packages/graphic-walker/src/lib/insights/utils.ts b/packages/graphic-walker/src/lib/insights/utils.tsindex ebee97fa..a4329901 100644--- a/packages/graphic-walker/src/lib/insights/utils.ts+++ b/packages/graphic-walker/src/lib/insights/utils.ts@@ -1,5 +1,4 @@-import { IAggregator, IField } from '../../interfaces';-import { IAggQuery } from '../interfaces';+import { IField } from '../../interfaces';export function groupByAnalyticTypes(fields: IField[]) {const dimensions = fields.filter((f) => f.analyticType === 'dimension');@@ -11,7 +10,5 @@ export function groupByAnalyticTypes(fields: IField[]) {}export function complementaryFields(props: { selection: IField[]; all: IField[] }): IField[] {- return props.all- .filter((f) => f.analyticType === 'dimension')- .filter((f) => !props.selection.find((vf) => vf.fid === f.fid));+ return props.all.filter((f) => f.analyticType === 'dimension').filter((f) => !props.selection.find((vf) => vf.fid === f.fid));}diff --git a/packages/graphic-walker/src/lib/interfaces.ts b/packages/graphic-walker/src/lib/interfaces.tsdeleted file mode 100644index 96876d80..00000000--- a/packages/graphic-walker/src/lib/interfaces.ts+++ /dev/null@@ -1,32 +0,0 @@-import { IAggregator } from "../interfaces";--export interface IAggQuery {- op: 'aggregate';- groupBy: string[];- measures: { field: string; agg: IAggregator; asFieldKey: string; format?: string; }[];-}--// interface IFilterQuery {-// op: 'filter';-// filter: string;-// }--export interface IFoldQuery {- op: 'fold';- foldBy: string[];- newFoldKeyCol: string;- newFoldValueCol: string;-}--export interface IBinQuery {- op: 'bin';- binBy: string;- newBinCol: string;- binSize: number;-}---export interface IRawQuery {- op: 'raw';- fields: string[];-}diff --git a/packages/graphic-walker/src/lib/op/aggregate.ts b/packages/graphic-walker/src/lib/op/aggregate.tsindex c0d1f697..98e993ee 100644--- a/packages/graphic-walker/src/lib/op/aggregate.ts+++ b/packages/graphic-walker/src/lib/op/aggregate.ts@@ -1,6 +1,6 @@import { IRow } from "../../interfaces";import { getMeaAggKey } from "../../utils";-import { IAggQuery } from "../interfaces";+import { IAggQuery } from "../../interfaces";import { sum, mean, median, stdev, variance, max, min, count } from "./stat";const aggregatorMap = {diff --git a/packages/graphic-walker/src/lib/op/bin.ts b/packages/graphic-walker/src/lib/op/bin.tsindex c03b871a..fa8a356f 100644--- a/packages/graphic-walker/src/lib/op/bin.ts+++ b/packages/graphic-walker/src/lib/op/bin.ts@@ -1,5 +1,5 @@import { IRow } from "../../interfaces";-import { IBinQuery } from "../interfaces";+import { IBinQuery } from "../../interfaces";export function bin (dataSource: IRow[], query: IBinQuery): IRow[] {const { binBy, newBinCol, binSize } = query;diff --git a/packages/graphic-walker/src/lib/op/fold.ts b/packages/graphic-walker/src/lib/op/fold.tsindex d867bf77..502803d7 100644--- a/packages/graphic-walker/src/lib/op/fold.ts+++ b/packages/graphic-walker/src/lib/op/fold.ts@@ -1,7 +1,7 @@import { MEA_VAL_ID, MEA_KEY_ID } from '../../constants';import { IRow, IViewField } from '../../interfaces';import { getMeaAggKey } from '../../utils';-import { IFoldQuery } from '../interfaces';+import { IFoldQuery } from '../../interfaces';export function fold(data: IRow[], query: IFoldQuery): IRow[] {const { foldBy, newFoldKeyCol, newFoldValueCol } = query;diff --git a/packages/graphic-walker/src/workers/sort.ts b/packages/graphic-walker/src/lib/sort.tssimilarity index 100%rename from packages/graphic-walker/src/workers/sort.tsrename to packages/graphic-walker/src/lib/sort.tsdiff --git a/packages/graphic-walker/src/workers/transform.ts b/packages/graphic-walker/src/lib/transform.tssimilarity index 58%rename from packages/graphic-walker/src/workers/transform.tsrename to packages/graphic-walker/src/lib/transform.tsindex 410c3979..798cfff1 100644--- a/packages/graphic-walker/src/workers/transform.ts+++ b/packages/graphic-walker/src/lib/transform.ts@@ -1,7 +1,7 @@-import { ITransformWorkflowStep, IRow, IExpression } from "../interfaces";-import { dataframe2Dataset, dataset2DataFrame, execExpression } from "../lib/execExp";+import { IFieldTransform, IRow } from "../interfaces";+import { dataframe2Dataset, dataset2DataFrame, execExpression } from "./execExp";-export function transformData(data: IRow[], trans: { key: string, expression: IExpression }[]) {+export function transformData(data: IRow[], trans: IFieldTransform[]) {let df = dataset2DataFrame(data);for (let i = 0; i < trans.length; i++) {const field = trans[i];diff --git a/packages/graphic-walker/src/lib/viewQuery.ts b/packages/graphic-walker/src/lib/viewQuery.tsindex 4af97073..0d871c04 100644--- a/packages/graphic-walker/src/lib/viewQuery.ts+++ b/packages/graphic-walker/src/lib/viewQuery.ts@@ -1,12 +1,10 @@-import { IRow } from "../interfaces";-import { aggregate } from "./op/aggregate";-import { fold } from "./op/fold";-import { IAggQuery, IBinQuery, IFoldQuery, IRawQuery } from "./interfaces";-import { bin } from "./op/bin";+import { IRow } from '../interfaces';+import { aggregate } from './op/aggregate';+import { fold } from './op/fold';+import { bin } from './op/bin';+import { IViewQuery } from '../interfaces';-export type IViewQuery = IAggQuery | IFoldQuery | IBinQuery | IRawQuery;--export function queryView (rawData: IRow[], query: IViewQuery) {+export function queryView(rawData: IRow[], query: IViewQuery) {switch (query.op) {case 'aggregate':return aggregate(rawData, query);@@ -18,5 +16,4 @@ export function queryView (rawData: IRow[], query: IViewQuery) {default:return rawData;}--}\ No newline at end of file+}diff --git a/packages/graphic-walker/src/lib/vl2gw.ts b/packages/graphic-walker/src/lib/vl2gw.tsnew file mode 100644index 00000000..bc0e5e0c--- /dev/null+++ b/packages/graphic-walker/src/lib/vl2gw.ts@@ -0,0 +1,295 @@+import { nanoid } from 'nanoid';+import { IChart, IViewField } from '../interfaces';+import { fillChart } from '../models/visSpecHistory';++type markType =+ | 'area'+ | 'bar'+ | 'arc'+ | 'circle'+ | 'line'+ | 'point'+ | 'rect'+ | 'rule'+ | 'square'+ | 'text'+ | 'tick'+ | 'geoshape'+ | 'boxplot'+ | 'errorband'+ | 'errorbar';+type markChannel =+ | markType+ | {+ type: markType;+ };++type GWGeoms = 'auto' | 'bar' | 'line' | 'area' | 'trail' | 'point' | 'circle' | 'tick' | 'rect' | 'arc' | 'text' | 'boxplot' | 'table';++type EncodingChannels = 'column' | 'row' | 'color' | 'opacity' | 'shape' | 'size' | 'details' | 'theta' | 'x' | 'y' | 'facet' | 'order' | 'radius';+const encodingChannels = new Set(['column', 'row', 'color', 'opacity', 'shape', 'size', 'details', 'theta', 'x', 'y', 'facet', 'order', 'radius']);+const isSupportedChannel = (channelName: string): channelName is EncodingChannels => encodingChannels.has(channelName);+type AggregateName = 'sum' | 'count' | 'max' | 'min' | 'mean' | 'median' | 'variance' | 'stdev';+const aggNames = new Set(['sum', 'count', 'max', 'min', 'mean', 'median', 'variance', 'stdev']);+const isValidAggregate = (aggName?: string): aggName is AggregateName => !!aggName && aggNames.has(aggName);++const countField: IViewField = {+ dragId: 'gw_count_fid',+ fid: 'gw_count_fid',+ name: 'Row count',+ analyticType: 'measure',+ semanticType: 'quantitative',+ aggName: 'sum',+ computed: true,+ expression: {+ op: 'one',+ params: [],+ as: 'gw_count_fid',+ },+};++type dimensionType = 'facetX' | 'facetY' | 'row' | 'column' | 'opacity' | 'size' | 'shape' | 'radius' | 'theta' | 'color' | 'details' | 'text' | 'order';++type DimensionInfo = {+ dimension?: IViewField;+ binDimension?: IViewField;+ dimensionType?: dimensionType;+ sort?: 'descending' | 'ascending';+ aggregate?: AggregateName;+ stack?: 'stack' | 'normalize' | 'center' | 'none';+ analyticType?: 'auto' | 'measure' | 'dimension';+};++const stackTransform = (s: 'zero' | 'normalize' | 'center' | true | null) => {+ if (s === 'zero' || s === true) {+ return 'stack';+ }+ if (s === null) return 'none';+ return s;+};++function sortValueTransform(vlValue: { order: string } | string | null): 'descending' | 'ascending' | undefined {+ let order: string = 'none';+ if (typeof vlValue === 'string') {+ order = vlValue;+ } else if (vlValue && vlValue instanceof Object) {+ order = vlValue['order'] ?? 'ascending';+ }+ if (order !== 'none') {+ const channels: string[] = ['x', 'y', 'color', 'size', 'opacity'];+ // TODO: support all sorting config in vl+ if (order.startsWith('-') || order === 'descending') return 'descending';+ if (channels.indexOf(order) > -1 || order === 'ascending') return 'ascending';+ }+ return;+}++const dimensionTypeMap = {+ row: 'facetY',+ facet: 'facetY',+ column: 'facetX',+ x: 'column',+ y: 'row',+ opacity: 'opacity',+ size: 'size',+ shape: 'shape',+ radius: 'radius',+ theta: 'theta',+ details: 'details',+ text: 'text',+ color: 'color',+} as const;++const analogChannels = new Set(['theta', 'x', 'y']);++function createBinField(field: IViewField): IViewField {+ const newId = `gw_${nanoid(4)}`;+ return {+ fid: newId,+ dragId: newId,+ name: `bin(${field.name})`,+ semanticType: 'ordinal',+ analyticType: 'dimension',+ computed: true,+ expression: {+ op: 'bin',+ as: newId,+ params: [+ {+ type: 'field',+ value: field.fid,+ },+ ],+ },+ };+}++function encodingToDimension(name: EncodingChannels, encoding: any, dict: Map<string, IViewField>): DimensionInfo {+ switch (name) {+ case 'order':+ return {+ sort: sortValueTransform(encoding.sort),+ };+ default:+ const analogChannel = analogChannels.has(name);+ const dictField = dict.get(encoding.field) ?? countField;+ const field = encoding.bin ? createBinField(dictField) : dictField;+ const aggregate = field === countField ? 'count' : isValidAggregate(encoding.aggregate) && analogChannel ? encoding.aggregate : undefined;+ let analyticType: 'auto' | 'measure' | 'dimension';+ if (field === countField || aggregate) {+ analyticType = 'measure';+ } else if (field.analyticType === 'measure' && analogChannels.has(name)) {+ analyticType = 'auto';+ } else {+ analyticType = 'dimension';+ }+ return {+ dimension: field,+ binDimension: encoding.bin ? field : undefined,+ dimensionType: dimensionTypeMap[name],+ analyticType,+ aggregate,+ stack: stackTransform(encoding.stack),+ sort: encoding.sort ? sortValueTransform(encoding.sort) : undefined,+ };+ }+}++const entries = (obj: any) => Object.keys(obj).map((name) => ({ name, value: obj[name] }));++function getGeom(mark: markChannel): GWGeoms {+ function mapper(geom: string) {+ switch (geom) {+ case 'interval':+ case 'bar':+ return 'bar';+ case 'line':+ return 'line';+ case 'boxplot':+ return 'boxplot';+ case 'area':+ return 'area';+ case 'point':+ return 'point';+ case 'arc':+ return 'arc';+ case 'circle':+ return 'circle';+ case 'heatmap':+ return 'circle';+ case 'rect':+ return 'rect';+ case 'tick':+ default:+ return 'tick';+ }+ }+ if (typeof mark === 'string') {+ return mapper(mark);+ }+ return mapper(mark.type);+}++export function VegaliteMapper(vl: any, allFields: IViewField[], visId: string, name: string): IChart {+ let geom: GWGeoms = 'tick';+ const encodings: {+ name: string;+ value: any;+ }[] = [];+ if (vl.facet) {+ encodings.push(...entries(vl.facet));+ }+ if (vl.encoding) {+ encodings.push(...entries(vl.encoding));+ }+ if (vl.mark) {+ geom = getGeom(vl.mark);+ }+ if (vl.spec) {+ geom = getGeom(vl.spec.mark);+ if (vl.spec.encoding) {+ encodings.push(...entries(vl.spec.encoding));+ }+ }+ const dict = new Map<string, IViewField>();+ allFields.forEach((v) => {+ dict.set(v.fid, v);+ });+ const results = encodings.flatMap(({ name, value }) => (isSupportedChannel(name) ? [encodingToDimension(name, value, dict)] : []));+ const defaultAggregated = results.reduce((x, y) => x || !!y.aggregate, false);+ const sort = results.reduce((x: 'none' | 'descending' | 'ascending', y) => y.sort ?? x, 'none' as const);+ const stack = results.reduce((x: 'none' | 'stack' | 'normalize' | 'center', y) => y.stack ?? x, ['bar', 'area', 'arc'].includes(geom) ? 'stack' : 'none');+ const binFields = results.reduce(+ (x, y) => (y.binDimension && !x.has(y.binDimension.name) ? x.set(y.binDimension.name, y.binDimension) : x),+ new Map<string, IViewField>()+ );++ const resultFields = results.flatMap((x) => {+ if (x.dimension && x.dimensionType) {+ if (x.binDimension) {+ return [+ {+ name: x.dimensionType,+ value: binFields.get(x.binDimension.name) ?? x.binDimension,+ },+ ];+ }+ const analyticType = x.analyticType === 'auto' ? (defaultAggregated ? 'dimension' : 'measure') : x.analyticType!;+ return [+ {+ name: x.dimensionType,+ value: {+ ...x.dimension,+ analyticType,+ ...(x.aggregate+ ? {+ aggName: x.aggregate,+ }+ : {}),+ ...(sort && sort !== 'none' && (x.dimensionType === 'column' || x.dimensionType === 'row') && analyticType === 'dimension'+ ? {+ sort,+ }+ : {}),+ },+ },+ ];+ }+ return [];+ });++ const is = (v: string) => (x: { name: string }) => x.name === v;+ const get = <T>(x: { value: T }) => x.value;++ return fillChart({+ visId,+ name,+ encodings: {+ dimensions: allFields.filter((x) => x.analyticType === 'dimension').concat(...binFields.values()),+ measures: allFields.filter((x) => x.analyticType === 'measure' && x.fid !== countField.fid).concat(countField),+ columns: resultFields+ .filter(is('facetX'))+ .concat(resultFields.filter(is('column')))+ .map(get),+ rows: resultFields+ .filter(is('facetY'))+ .concat(resultFields.filter(is('row')))+ .map(get),+ details: resultFields.filter(is('details')).map(get),+ opacity: resultFields.filter(is('opacity')).map(get),+ radius: resultFields.filter(is('radius')).map(get),+ shape: resultFields.filter(is('shape')).map(get),+ size: resultFields.filter(is('size')).map(get),+ text: resultFields.filter(is('text')).map(get),+ theta: resultFields.filter(is('theta')).map(get),+ color: resultFields.filter(is('color')).map(get),+ },+ layout: {+ stack,+ },+ config: {+ defaultAggregated,+ geoms: [geom],+ },+ });+}diff --git a/packages/graphic-walker/src/locales/ja-JP.json b/packages/graphic-walker/src/locales/ja-JP.jsonindex 29ca3c6d..99aeca60 100644--- a/packages/graphic-walker/src/locales/ja-JP.json+++ b/packages/graphic-walker/src/locales/ja-JP.json@@ -155,10 +155,10 @@},"main": {"tablist": {- "new": "+ 新規ビュー",- "auto_title": "ビュー {{idx}}",+ "new": "+ 新規作成",+ "auto_title": "グラフ {{idx}}","chart_name": "グラフ名",- "remove_confirm": "このグラフを削除してもよろしいですか?"+ "remove_confirm": "このグラフを削除してもよろしいですか?"},"askviz": {"placeholder": "データセットから描画したい視覚化は何ですか?"diff --git a/packages/graphic-walker/src/models/utils.ts b/packages/graphic-walker/src/models/utils.tsnew file mode 100644index 00000000..f9c0fe27--- /dev/null+++ b/packages/graphic-walker/src/models/utils.ts@@ -0,0 +1,50 @@+import { nanoid } from 'nanoid';++export function uniqueId(): string {+ return 'gw_' + nanoid(4);+}++export type DeepPartial<T> = T extends Array<any>+ ? T+ : T extends object+ ? {+ [K in keyof T]?: DeepPartial<T[K]>;+ }+ : T;++export type KVTuple<T> = keyof T extends `${infer R}` ? (R extends keyof T ? [R, T[R]] : never) : never;+export type AssertSameKey<T1 extends Record<keyof T2, any>, T2 extends Record<keyof T1, any>> = never;+export type NestedKeyOf<T> = {+ [Key in keyof T & (string | number)]: T[Key] extends object ? `${Key}` | `${Key}.${NestedKeyOf<T[Key]>}` : `${Key}`;+}[keyof T & (string | number)];+export type TypeOfPath<T, Path extends string> = Path extends `${infer A}.${infer rest}`+ ? A extends keyof T+ ? TypeOfPath<T[A], rest>+ : never+ : Path extends keyof T+ ? T[Path]+ : never;+export type ReplacePathOf<T, Path extends string, U> = {+ [K in keyof T]: Path extends `${infer A}.${infer rest}` ? (A extends K ? ReplacePathOf<T[K], rest, U> : T[K]) : Path extends K ? U : T[K];+};++export const insert = <T>(arr: T[], item: T, index: number) =>+ index === arr.length ? arr.concat([item]) : arr.flatMap((x, i) => (i === index ? [item, x] : [x]));+export const remove = <T>(arr: T[], index: number) => arr.filter((_, i) => i !== index);+export const replace = <T>(arr: T[], index: number, f: (item: T) => T) => arr.map((x, i) => (i === index ? f(x) : x));+export function mutPath<T extends object, P extends NestedKeyOf<T>, U>(item: T, path: P, mut: (x: TypeOfPath<T, P>) => U): ReplacePathOf<T, P, U> {+ const mod = (d: any, path: string[], f: (x: any) => any) => {+ const [k, ...rest] = path;+ if (rest.length === 0) {+ return {+ ...d,+ [k]: f(d[k]),+ };+ }+ return {+ ...d,+ [k]: mod(d[k], rest, f),+ };+ };+ return mod(item, path.split('.'), mut);+}diff --git a/packages/graphic-walker/src/models/visSpecHistory.ts b/packages/graphic-walker/src/models/visSpecHistory.tsindex 52ce75a1..5bc17275 100644--- a/packages/graphic-walker/src/models/visSpecHistory.ts+++ b/packages/graphic-walker/src/models/visSpecHistory.ts@@ -1,144 +1,470 @@-import { toJS } from "mobx";-import { GLOBAL_CONFIG } from "../config";-import { DeepReadonly, DraggableFieldState, IVisSpec, IVisualConfig } from "../interfaces";--export class VisSpecWithHistory {-- readonly visId: IVisSpec['visId'];- private snapshots: Pick<IVisSpec, 'name' | 'encodings' | 'config'>[];- private cursor: number;-- constructor(data: IVisSpec) {- this.visId = data.visId;- this.snapshots = [{- name: data.name,- encodings: data.encodings,- config: data.config,- }];- this.cursor = 0;- }-- private get frame(): Readonly<IVisSpec> {- return {- visId: this.visId,- ...this.snapshots[this.cursor]!,+import {+ IChart,+ IMutField,+ DraggableFieldState,+ IFilterRule,+ IViewField,+ ISortMode,+ IAggregator,+ SetToArray,+ IVisualLayout,+ IChartForExport,+ IVisualConfigNew,+ IVisSpec,+ PartialChart,+ ICoordMode,+ IGeoUrl,+ ISemanticType,+} from '../interfaces';+import type { FeatureCollection } from 'geojson';+import { createCountField, createVirtualFields } from '../utils';+import { decodeFilterRule, encodeFilterRule } from '../utils/filter';+import { emptyEncodings, emptyVisualConfig, emptyVisualLayout } from '../utils/save';+import { AssertSameKey, KVTuple, insert, mutPath, remove, replace, uniqueId } from './utils';+import { WithHistory, atWith, create, freeze, performWith, redoWith, undoWith } from './withHistory';+import { GLOBAL_CONFIG } from '../config';+import { DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS } from '../constants';++type normalKeys = keyof Omit<DraggableFieldState, 'filters'>;++// note: only add new methods at end+export enum Methods {+ setConfig,+ removeField,+ reorderField,+ moveField,+ cloneField,+ createBinlogField,+ appendFilter,+ modFilter,+ writeFilter,+ setName,+ applySort,+ transpose,+ setLayout,+ setFieldAggregator,+ setGeoData,+ setCoordSystem,+ createDateDrillField,+ createDateFeatureField,+ changeSemanticType,+}+type PropsMap = {+ [Methods.setConfig]: KVTuple<IVisualConfigNew>;+ [Methods.removeField]: [keyof DraggableFieldState, number];+ [Methods.reorderField]: [keyof DraggableFieldState, number, number];+ [Methods.moveField]: [normalKeys, number, normalKeys, number];+ [Methods.cloneField]: [normalKeys, number, normalKeys, number, string];+ [Methods.createBinlogField]: [normalKeys, number, 'bin' | 'binCount' | 'log10' | 'log2' | 'log', string, number];+ [Methods.appendFilter]: [number, normalKeys, number, string];+ [Methods.modFilter]: [number, normalKeys, number];+ [Methods.writeFilter]: [number, SetToArray<IFilterRule> | null];+ [Methods.setName]: [string];+ [Methods.applySort]: [ISortMode];+ [Methods.transpose]: [];+ [Methods.setLayout]: [KVTuple<IVisualLayout>[]];+ [Methods.setFieldAggregator]: [normalKeys, number, IAggregator];+ [Methods.setGeoData]: [FeatureCollection | undefined, string | undefined, IGeoUrl | undefined];+ [Methods.setCoordSystem]: [ICoordMode];+ [Methods.createDateDrillField]: [normalKeys, number, (typeof DATE_TIME_DRILL_LEVELS)[number], string, string, string | undefined];+ [Methods.createDateFeatureField]: [normalKeys, number, (typeof DATE_TIME_FEATURE_LEVELS)[number], string, string, string | undefined];+ [Methods.changeSemanticType]: [normalKeys, number, ISemanticType];+};+// ensure propsMap has all keys of methods+type assertPropsMap = AssertSameKey<PropsMap, { [a in Methods]: any }>;++type VisActionOf<T> = T extends Methods ? [T, ...PropsMap[T]] : never;+// note: should be serializable+type VisAction = VisActionOf<Methods>;++const actions: {+ [a in Methods]: (d: IChart, ...a: PropsMap[a]) => IChart;+} = {+ [Methods.setConfig]: (data, key, value) => mutPath(data, 'config', (c) => ({ ...c, [key]: value })),+ [Methods.removeField]: (data, encoding, index) => mutPath(data, `encodings.${encoding}`, (fields) => remove(fields, index)) as IChart,+ [Methods.reorderField]: (data, encoding, from, to) =>+ mutPath(data, `encodings.${encoding}`, (fields) =>+ fields.map((x, i, a) => {+ if (i === from) return a[to];+ if (i === to) return a[from];+ return x;+ })+ ),+ [Methods.moveField]: (data, from, findex, to, tindex) => {+ const oriField = data.encodings[from][findex];+ const field =+ to === 'dimensions'+ ? mutPath(oriField, 'analyticType', () => 'dimension')+ : to === 'measures'+ ? mutPath(oriField, 'analyticType', () => 'measure')+ : oriField;+ return mutPath(data, 'encodings', (e) => ({+ ...e,+ [from]: remove(data.encodings[from], findex),+ [to]: insert(data.encodings[to], field, tindex),+ }));+ },+ [Methods.cloneField]: (data, from, findex, to, tindex, newVarKey) => {+ const field = { ...data.encodings[from][findex], dragId: newVarKey };+ return mutPath(data, 'encodings', (e) => ({+ ...e,+ [to]: insert(data.encodings[to], field, tindex),+ }));+ },+ [Methods.createBinlogField]: (data, encoding, index, op, newVarKey, num) => {+ const originField = data.encodings[encoding][index];+ const isBin = op.startsWith('bin');+ const channel = isBin ? 'dimensions' : encoding;+ const prefix = isBin ? `${op}${num}` : `log${num}`;+ const newField: IViewField = {+ fid: newVarKey,+ dragId: newVarKey,+ name: `${prefix}(${originField.name})`,+ semanticType: isBin ? 'ordinal' : 'quantitative',+ analyticType: isBin ? 'dimension' : originField.analyticType,+ computed: true,+ expression: {+ op,+ as: newVarKey,+ params: [+ {+ type: 'field',+ value: originField.fid,+ },+ ],+ num,+ },};- }-- private batchFlag = false;-- public updateLatest(snapshot: Partial<Readonly<VisSpecWithHistory['snapshots'][0]>>) {- this.snapshots[this.cursor] = {- ...this.snapshots[this.cursor],- ...snapshot,- }- }--- private commit(snapshot: Partial<Readonly<VisSpecWithHistory['snapshots'][0]>>): void {- if (this.batchFlag) {- // batch this commit- this.snapshots[this.cursor] = toJS({- ...this.frame,- ...snapshot,- });-- return;+ if (!isBin) {+ newField.aggName = 'sum';}-- this.batchFlag = true;-- this.snapshots = [- ...this.snapshots.slice(0, this.cursor + 1),- toJS({- ...this.frame,- ...snapshot,- }),- ];-- if (this.snapshots.length > GLOBAL_CONFIG.MAX_HISTORY_SIZE) {- this.snapshots.splice(0, 1);+ return mutPath(data, `encodings.${channel}`, (a) => a.concat(newField));+ },+ [Methods.appendFilter]: (data, index, from, findex, dragId) => {+ const originField = data.encodings[from][findex];+ return mutPath(data, 'encodings.filters', (filters) =>+ insert(+ filters,+ {+ ...originField,+ rule: null,+ dragId,+ },+ index+ )+ );+ },+ [Methods.modFilter]: (data, index, from, findex) =>+ mutPath(data, 'encodings.filters', (filters) => {+ const originField = data.encodings[from][findex];+ return replace(filters, index, (f) => ({+ ...originField,+ rule: null,+ dragId: f.dragId,+ }));+ }),+ [Methods.writeFilter]: (data, index, rule) =>+ mutPath(data, 'encodings.filters', (filters) => replace(filters, index, (x) => ({ ...x, rule: decodeFilterRule(rule) }))),+ [Methods.setName]: (data, name) => ({+ ...data,+ name,+ }),+ [Methods.applySort]: (data, sort) => {+ const { rows, columns } = data.encodings;+ const yField = rows.length > 0 ? rows[rows.length - 1] : null;+ const xField = columns.length > 0 ? columns[columns.length - 1] : null;+ if (xField !== null && xField.analyticType === 'dimension' && yField !== null && yField.analyticType === 'measure') {+ return mutPath(data, 'encodings.columns', (cols) => replace(cols, cols.length - 1, (x) => ({ ...x, sort })));}-- this.cursor = this.snapshots.length - 1;-- requestAnimationFrame(() => this.batchFlag = false);- }-- public get canUndo() {- return this.cursor > 0;- }-- public undo(): boolean {- if (this.cursor === 0) {- return false;+ if (xField !== null && xField.analyticType === 'measure' && yField !== null && yField.analyticType === 'dimension') {+ return mutPath(data, 'encodings.rows', (rows) => replace(rows, rows.length - 1, (x) => ({ ...x, sort })));}-- this.cursor -= 1;-- return true;- }-- public get canRedo() {- return this.cursor < this.snapshots.length - 1;- }-- public redo(): boolean {- if (this.cursor === this.snapshots.length - 1) {- return false;- }-- this.cursor += 1;-- return true;- }-- public rebase() {- this.snapshots = [this.snapshots[this.cursor]];- this.cursor = 0;- }-- get name() {- return this.frame.name;- }-- set name(name: IVisSpec['name']) {- this.commit({- name,- });- }-- get encodings(): DeepReadonly<DraggableFieldState> {- return this.frame.encodings;- }-- set encodings(encodings: IVisSpec['encodings']) {- this.commit({- encodings,- });- }-- get config(): DeepReadonly<IVisualConfig> {- return this.frame.config;- }-- set config(config: IVisSpec['config']) {- this.commit({- config,- });- }-- public clone () {- const nextVSWH = new VisSpecWithHistory(this.frame);- nextVSWH.snapshots = this.snapshots.slice().map(s => ({ ...s }));- nextVSWH.cursor = this.cursor;- return nextVSWH;- }-- public exportGW (): IVisSpec {+ return data;+ },+ [Methods.transpose]: (data) =>+ mutPath(data, 'encodings', (e) => ({+ ...e,+ columns: e.rows,+ rows: e.columns,+ })),+ [Methods.setLayout]: (data, kvs) => mutPath(data, 'layout', (l) => Object.assign({}, l, Object.fromEntries(kvs))),+ [Methods.setFieldAggregator]: (data, encoding, index, aggName) =>+ mutPath(data, `encodings.${encoding}`, (f) => replace(f, index, (x) => ({ ...x, aggName }))),+ [Methods.setGeoData]: (data, geojson, geoKey, geoUrl) => mutPath(data, 'layout', (l) => ({ ...l, geojson, geoKey, geoUrl })),+ [Methods.setCoordSystem]: (data, system) =>+ mutPath(data, 'config', (c) => ({+ ...c,+ coordSystem: system,+ geoms: [GLOBAL_CONFIG.GEOM_TYPES[system][0]],+ })),+ [Methods.createDateDrillField]: (data, channel, index, drillLevel, newVarKey, newName, format) => {+ const originField = data.encodings[channel][index];+ const newField: IViewField = {+ fid: newVarKey,+ dragId: newVarKey,+ name: newName,+ semanticType: 'temporal',+ analyticType: originField.analyticType,+ aggName: 'sum',+ computed: true,+ timeUnit: drillLevel,+ expression: {+ op: 'dateTimeDrill',+ as: newVarKey,+ params: [+ {+ type: 'field',+ value: originField.fid,+ },+ {+ type: 'value',+ value: drillLevel,+ },+ ...(format+ ? [+ {+ type: 'format',+ value: format,+ } as const,+ ]+ : []),+ ],+ },+ };+ return mutPath(data, `encodings.${channel}`, (a) => a.concat(newField));+ },+ [Methods.createDateFeatureField]: (data, channel, index, drillLevel, newVarKey, newName, format) => {+ const originField = data.encodings[channel][index];+ const newField: IViewField = {+ fid: newVarKey,+ dragId: newVarKey,+ name: newName,+ semanticType: 'ordinal',+ analyticType: originField.analyticType,+ aggName: 'sum',+ computed: true,+ expression: {+ op: 'dateTimeFeature',+ as: newVarKey,+ params: [+ {+ type: 'field',+ value: originField.fid,+ },+ {+ type: 'value',+ value: drillLevel,+ },+ ...(format+ ? [+ {+ type: 'format',+ value: format,+ } as const,+ ]+ : []),+ ],+ },+ };+ return mutPath(data, `encodings.${channel}`, (a) => a.concat(newField));+ },+ [Methods.changeSemanticType]: (data, channel, index, semanticType) => {+ return mutPath(data, `encodings.${channel}`, (f) => replace(f, index, (x) => ({ ...x, semanticType })));+ },+};++function reducerT<T>(data: IChart, action: VisActionOf<T>): IChart {+ const [type, ...props] = action;+ return actions[type](data, ...props);+}+export type VisSpecWithHistory = WithHistory<IChart, VisAction>;+export const reducer: (data: IChart, action: VisAction) => IChart = reducerT;+export const perform: (data: VisSpecWithHistory, action: VisAction) => VisSpecWithHistory = performWith(reducerT);+export const undo: (data: VisSpecWithHistory) => VisSpecWithHistory = undoWith(reducerT);+export const redo: (data: VisSpecWithHistory) => VisSpecWithHistory = redoWith(reducerT);+export const at: (data: VisSpecWithHistory, cursor: number) => IChart = atWith(reducerT);+export { freeze };++export const performers = Object.fromEntries(+ (Object.keys(Methods) as (keyof typeof Methods)[]).map((k) => [k, (data: any, ...args: any[]) => perform(data, [Methods[k], ...args] as any)])+) as unknown as {+ [K in keyof typeof Methods]: (data: VisSpecWithHistory, ...args: PropsMap[(typeof Methods)[K]]) => VisSpecWithHistory;+};++export function encodeVisSpec(data: IChart): IChartForExport {+ return mutPath(data, 'encodings.filters', (f) =>+ f.map((x) => ({+ ...x,+ rule: encodeFilterRule(x.rule),+ }))+ );+}+export function decodeVisSpec(snapshot: Partial<IChartForExport>): PartialChart {+ return mutPath(snapshot, 'encodings', (e) => {+ const filters = e?.filters?.map((x) => ({+ ...x,+ rule: decodeFilterRule(x.rule),+ }));return {- ...this.frame- }- }--}\ No newline at end of file+ ...e,+ filters,+ };+ });+}+function emptyChart(visId: string, name: string): IChart {+ return {+ config: emptyVisualConfig,+ encodings: emptyEncodings,+ layout: emptyVisualLayout,+ visId: visId,+ name,+ };+}+export function newChart(fields: IMutField[], name: string, visId?: string): IChart {+ if (fields.length === 0) return emptyChart(visId || uniqueId(), name);+ const extraFields = [...createVirtualFields(), createCountField()];+ const extraDimensions = extraFields.filter((x) => x.analyticType === 'dimension');+ const extraMeasures = extraFields.filter((x) => x.analyticType === 'measure');+ return mutPath(emptyChart(visId || uniqueId(), name), 'encodings', (e) => ({+ ...e,+ dimensions: fields+ .filter((f) => f.analyticType === 'dimension')+ .map(+ (f): IViewField => ({+ dragId: uniqueId(),+ fid: f.fid,+ name: f.name || f.fid,+ basename: f.basename || f.name || f.fid,+ semanticType: f.semanticType,+ analyticType: f.analyticType,+ })+ )+ .concat(extraDimensions),+ measures: fields+ .filter((f) => f.analyticType === 'measure')+ .map(+ (f): IViewField => ({+ dragId: uniqueId(),+ fid: f.fid,+ name: f.name || f.fid,+ basename: f.basename || f.name || f.fid,+ analyticType: f.analyticType,+ semanticType: f.semanticType,+ aggName: 'sum',+ })+ )+ .concat(extraMeasures),+ }));+}+export function fillChart(chart: PartialChart): IChart {+ const result = emptyChart(chart.visId || uniqueId(), chart.name || 'Chart');+ result.config = {+ ...result.config,+ ...chart.config,+ };+ result.encodings = {+ ...result.encodings,+ ...chart.encodings,+ };+ result.layout = {+ ...result.layout,+ ...chart.layout,+ size: {+ ...result.layout.size,+ ...chart.layout?.size,+ },+ };+ return result;+}+export function fromSnapshot(snapshot: PartialChart): VisSpecWithHistory {+ return create(fillChart(snapshot));+}+export function fromFields(fields: IMutField[], name: string): VisSpecWithHistory {+ return create(newChart(fields, name));+}+type VisSpecHistoryInfoForExport = {+ base: Partial<IChartForExport>;+ timeline: VisAction[];+};+export function exportFullRaw(data: VisSpecWithHistory, maxHistory = 30): string {+ const result: VisSpecHistoryInfoForExport = {+ base: encodeVisSpec(data.cursor > maxHistory ? at(data, data.cursor - maxHistory) : data.base),+ timeline: data.timeline.slice(Math.max(0, data.cursor - maxHistory)),+ };+ return JSON.stringify(result);+}++export function exportNow(data: VisSpecWithHistory) {+ return encodeVisSpec(data.now);+}++export function importNow(data: IChartForExport) {+ return fromSnapshot(decodeVisSpec(data));+}++export function importFull(data: string): VisSpecWithHistory {+ const result: VisSpecHistoryInfoForExport = JSON.parse(data);+ const base = fromSnapshot(decodeVisSpec(result.base));+ return result.timeline.reduce(perform, base);+}++export function resolveChart(data: string): IChart {+ const result: VisSpecHistoryInfoForExport = JSON.parse(data);+ const base = fillChart(decodeVisSpec(result.base));+ return result.timeline.reduce(reducer, base);+}++export function convertChart(data: IVisSpec): IChart {+ const result = emptyChart(data.visId, data.name || 'Chart');+ result.config = {+ ...result.config,+ defaultAggregated: data.config.defaultAggregated,+ geoms: data.config.geoms?.slice() ?? [],+ limit: data.config.limit,+ coordSystem: data.config.coordSystem,+ folds: data.config.folds,+ };+ result.encodings = {+ ...result.encodings,+ dimensions: data.encodings.dimensions?.slice() ?? [],+ measures: data.encodings.measures?.slice() ?? [],+ rows: data.encodings.rows?.slice() ?? [],+ columns: data.encodings.columns?.slice() ?? [],+ color: data.encodings.color?.slice() ?? [],+ opacity: data.encodings.opacity?.slice() ?? [],+ size: data.encodings.size?.slice() ?? [],+ shape: data.encodings.shape?.slice() ?? [],+ theta: data.encodings.theta?.slice() ?? [],+ radius: data.encodings.radius?.slice() ?? [],+ longitude: data.encodings.longitude?.slice() ?? [],+ latitude: data.encodings.latitude?.slice() ?? [],+ geoId: data.encodings.geoId?.slice() ?? [],+ details: data.encodings.details?.slice() ?? [],+ filters: data.encodings.filters?.slice() ?? [],+ text: data.encodings.text?.slice() ?? [],+ };+ result.layout = {+ ...result.layout,+ background: data.config.background,+ format: data.config.format,+ interactiveScale: data.config.interactiveScale,+ resolve: data.config.resolve,+ showActions: data.config.showActions,+ stack: data.config.stack,+ zeroScale: data.config.zeroScale,+ size: {+ ...result.layout.size,+ ...data.config.size,+ },+ colorPalette: data.config.colorPalette,+ geojson: data.config.geojson,+ geoKey: data.config.geoKey,+ geoUrl: data.config.geoUrl,+ primaryColor: data.config.primaryColor,+ scale: data.config.scale,+ scaleIncludeUnmatchedChoropleth: data.config.scaleIncludeUnmatchedChoropleth,+ showTableSummary: data.config.showTableSummary,+ useSvg: data.config.useSvg,+ };+ return result;+}diff --git a/packages/graphic-walker/src/models/withHistory.test.ts b/packages/graphic-walker/src/models/withHistory.test.tsnew file mode 100644index 00000000..25f9843e--- /dev/null+++ b/packages/graphic-walker/src/models/withHistory.test.ts@@ -0,0 +1,90 @@+import { undoWith, redoWith, performWith, create, WithHistory, freeze, atWith } from './withHistory';++const reducer = (x: number, _: void) => x + 1;+const undo = undoWith(reducer);+const redo = redoWith(reducer);+const perform = performWith(reducer);+const at = atWith(reducer);++describe('test WithHistory', () => {+ let d: WithHistory<number, void> = create(0);+ test('test perform', () => {+ for (let i = 0; i < 300; i++) {+ d = perform(d);+ expect(d.now).toBe(i + 1);+ }+ });+ test('test undo', () => {+ for (let i = 0; i < 300; i++) {+ d = undo(d);+ expect(d.now).toBe(299 - i);+ }+ });+ test('over undo', () => {+ d = undo(d);+ expect(d.now).toBe(0);+ });+ test('test redo', () => {+ for (let i = 0; i < 300; i++) {+ d = redo(d);+ expect(d.now).toBe(i + 1);+ }+ });+ test('over redo', () => {+ d = redo(d);+ expect(d.now).toBe(300);+ });+ test('perform after undo', () => {+ let e = d;+ for (let i = 0; i < 150; i++) {+ e = undo(e);+ expect(e.now).toBe(299 - i);+ }+ e = perform(e);+ expect(e.now).toBe(151);+ e = redo(e);+ expect(e.now).toBe(151);+ });+ test('test freeze', () => {+ const f = freeze(d);+ expect(f.cursor).toBe(0);+ expect(f.now).toEqual(d.now);+ });+ test('test at', () => {+ expect(at(d, 100)).toBe(100);+ expect(at(d, 500)).toBe(300);+ expect(at(d, 290)).toBe(290);+ });+ test('random test', () => {+ let expectValue = 300;+ let justUndo = 0;+ for (let i = 0; i < 300; i++) {+ const R = Math.random();+ if (R < 0.4) {+ const times = Math.floor(Math.random() * 20);+ expectValue += times;+ for (let j = 0; j < times; j++) {+ d = perform(d);+ }+ expect(d.now).toBe(expectValue);+ justUndo = 0;+ } else if (justUndo > 0 && R < 0.8) {+ const times = Math.floor(Math.random() * justUndo);+ expectValue += times;+ for (let j = 0; j < times; j++) {+ d = redo(d);+ }+ expect(d.now).toBe(expectValue);+ justUndo = 0;+ } else {+ const times = Math.min(expectValue, Math.floor(Math.random() * 20));+ expectValue = expectValue - times;+ for (let j = 0; j < times; j++) {+ d = undo(d);+ }+ expect(d.now).toBe(expectValue);+ justUndo = times;+ }+ }+ });+});diff --git a/packages/graphic-walker/src/models/withHistory.ts b/packages/graphic-walker/src/models/withHistory.tsnew file mode 100644index 00000000..ac4b61cf--- /dev/null+++ b/packages/graphic-walker/src/models/withHistory.ts@@ -0,0 +1,102 @@+// mean reducer calls = (((1 + cacheDistance) * cacheDistance)<replace from cache> + cursor<replay from base>) / cacheDistance+// delta(mean reducer calls) / delta(cacheDistance) = 0.5 * cacheDistance + cursor / cacheDistance+// local minimum of mean reducer calls at [cacheDistance = sqrt(2 * cursor)]+export const cacheDistance = (cursor: number) => Math.floor(Math.sqrt(2 * cursor));++export type WithHistory<T, A> = {+ base: T;+ now: T;+ timeline: A[];+ cursor: number;+ cache: {+ value: T;+ cursor: number;+ };+};++export function performWith<T, A>(reducer: (data: T, action: A) => T) {+ return (data: WithHistory<T, A>, action: A): WithHistory<T, A> => {+ const { base, cache, cursor, now, timeline } = data;+ return {+ base,+ now: reducer(now, action),+ cursor: cursor + 1,+ cache:+ cursor - cache.cursor > cacheDistance(cursor)+ ? {+ value: reducer(cache.value, timeline[cache.cursor]),+ cursor: cache.cursor + 1,+ }+ : cache,+ timeline: timeline.slice(0, cursor).concat([action]),+ };+ };+}++export function undoWith<T, A>(reducer: (data: T, action: A) => T) {+ return (data: WithHistory<T, A>): WithHistory<T, A> => {+ const { base, cache, cursor, timeline } = data;+ const newCursor = cursor - 1;+ if (newCursor < 0) return data;+ const rebuildCache = newCursor < cache.cursor;+ const cacheCursor = rebuildCache ? Math.max(0, newCursor - cacheDistance(newCursor)) : cache.cursor;+ const cacheValue = rebuildCache ? timeline.slice(0, cacheCursor).reduce(reducer, base) : cache.value;+ return {+ base,+ now: timeline.slice(cacheCursor, newCursor).reduce(reducer, cacheValue),+ cache: rebuildCache ? { value: cacheValue, cursor: cacheCursor } : cache,+ cursor: newCursor,+ timeline,+ };+ };+}+export function redoWith<T, A>(reducer: (data: T, action: A) => T) {+ return (data: WithHistory<T, A>): WithHistory<T, A> => {+ const { base, cache, cursor, now, timeline } = data;+ if (cursor === timeline.length) return data;+ return {+ base,+ now: reducer(now, timeline[cursor]),+ cursor: cursor + 1,+ cache:+ cursor - cache.cursor > cacheDistance(cursor)+ ? {+ value: reducer(cache.value, timeline[cache.cursor]),+ cursor: cache.cursor + 1,+ }+ : cache,+ timeline,+ };+ };+}+export function freeze<T, A>(data: WithHistory<T, A>): WithHistory<T, A> {+ return {+ base: data.now,+ cache: {+ value: data.now,+ cursor: 0,+ },+ cursor: 0,+ now: data.now,+ timeline: [],+ };+}+export function atWith<T, A>(reducer: (data: T, action: A) => T) {+ return (data: WithHistory<T, A>, cursor: number) => {+ if (cursor > data.cursor) return data.now;+ if (cursor > data.cache.cursor) return data.timeline.slice(data.cache.cursor, cursor).reduce(reducer, data.cache.value);+ return data.timeline.slice(0, cursor).reduce(reducer, data.base);+ };+}+export function create<T>(data: T) {+ return {+ base: data,+ cursor: 0,+ cache: {+ value: data,+ cursor: 0,+ },+ now: data,+ timeline: [],+ };+}diff --git a/packages/graphic-walker/src/renderer/hooks.ts b/packages/graphic-walker/src/renderer/hooks.tsindex 8ff2851d..855abe44 100644--- a/packages/graphic-walker/src/renderer/hooks.ts+++ b/packages/graphic-walker/src/renderer/hooks.ts@@ -1,22 +1,16 @@import { useState, useEffect, useMemo, useRef } from 'react';import { unstable_batchedUpdates } from 'react-dom';-import type { DeepReadonly, IFilterField, IRow, IViewField, IDataQueryWorkflowStep, IComputationFunction } from '../interfaces';-import { useGlobalStore } from '../store';+import type { IFilterField, IRow, IViewField, IDataQueryWorkflowStep, IComputationFunction } from '../interfaces';import { useAppRootContext } from '../components/appRoot';import { toWorkflow } from '../utils/workflow';-import { dataQueryServer } from '../computation/serverComputation';+import { dataQuery } from '../computation';import { fold2 } from '../lib/op/fold';-export const useComputationFunc = (): IComputationFunction => {- const { vizStore } = useGlobalStore();- return vizStore.computationFunction;-};-interface UseRendererProps {allFields: Omit<IViewField, 'dragId'>[];viewDimensions: Omit<IViewField, 'dragId'>[];viewMeasures: Omit<IViewField, 'dragId'>[];- filters: readonly DeepReadonly<IFilterField>[];+ filters: IFilterField[];defaultAggregated: boolean;sort: 'none' | 'ascending' | 'descending';limit: number;@@ -50,7 +44,7 @@ export const useRenderer = (props: UseRendererProps): UseRendererResult => {const taskId = ++taskIdRef.current;appRef.current?.updateRenderStatus('computing');setComputing(true);- dataQueryServer(computationFunction, workflow, limit > 0 ? limit : undefined)+ dataQuery(computationFunction, workflow, limit > 0 ? limit : undefined).then((res) => fold2(res, defaultAggregated, allFields, viewMeasures, viewDimensions, folds)).then((data) => {if (taskId !== taskIdRef.current) {diff --git a/packages/graphic-walker/src/renderer/index.tsx b/packages/graphic-walker/src/renderer/index.tsxindex e74a9a6b..634b2824 100644--- a/packages/graphic-walker/src/renderer/index.tsx+++ b/packages/graphic-walker/src/renderer/index.tsx@@ -1,23 +1,24 @@import { observer } from 'mobx-react-lite';import React, { useState, useEffect, forwardRef, useRef, useCallback } from 'react';-import { DeepReadonly, DraggableFieldState, IDarkMode, IRow, IThemeKey, IVisualConfig, IComputationFunction, IChannelScales } from '../interfaces';+import { DraggableFieldState, IDarkMode, IRow, IThemeKey, IComputationFunction, IVisualConfigNew, IChannelScales } from '../interfaces';import { useTranslation } from 'react-i18next';import SpecRenderer from './specRenderer';-import { runInAction, toJS } from 'mobx';-import { useGlobalStore } from '../store';+import { runInAction } from 'mobx';+import { useVizStore } from '../store';import { IReactVegaHandler } from '../vis/react-vega';import { unstable_batchedUpdates } from 'react-dom';import { useRenderer } from './hooks';-import { download, initEncoding } from '../utils/save';+import { download } from '../utils/save';import { useChartIndexControl } from '../utils/chartIndexControl';import { LEAFLET_DEFAULT_HEIGHT, LEAFLET_DEFAULT_WIDTH } from '../components/leafletRenderer';-import { initVisualConfig } from '../utils/save';+import { emptyEncodings, emptyVisualConfig } from '../utils/save';import { getMeaAggKey } from '../utils';import { COUNT_FIELD_ID } from '../constants';+import { GWGlobalConfig } from '../vis/theme';interface RendererProps {themeKey?: IThemeKey;- themeConfig?: any;+ themeConfig?: GWGlobalConfig;dark?: IDarkMode;computationFunction: IComputationFunction;channelScales?: IChannelScales;@@ -28,26 +29,28 @@ interface RendererProps {* Depending on global store.*/const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, ref) {- const { themeKey, dark, computationFunction, themeConfig, csvRef, } = props;- const { vizStore, commonStore } = useGlobalStore();+ const { themeKey, dark, computationFunction, themeConfig, csvRef } = props;+ const vizStore = useVizStore();const {allFields,viewFilters,viewDimensions,viewMeasures,- visualConfig,- draggableFieldState,- visList,+ config: visualConfig,+ layout,+ currentVis: chart,visIndex,+ visLength,sort,limit,} = vizStore;- const chart = visList[visIndex];++ const draggableFieldState = chart.encodings;const { i18n } = useTranslation();- const [viewConfig, setViewConfig] = useState<IVisualConfig>(initVisualConfig);- const [encodings, setEncodings] = useState<DeepReadonly<DraggableFieldState>>(initEncoding);+ const [viewConfig, setViewConfig] = useState<IVisualConfigNew>(emptyVisualConfig);+ const [encodings, setEncodings] = useState<DraggableFieldState>(emptyEncodings);const [viewData, setViewData] = useState<IRow[]>([]);const { viewData: data, loading: waiting } = useRenderer({@@ -91,13 +94,13 @@ const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, r// Dependencies that should not trigger effect individuallyconst latestFromRef = useRef({data,- draggableFieldState: toJS(draggableFieldState),- visualConfig: toJS(visualConfig),+ draggableFieldState: draggableFieldState,+ visualConfig: visualConfig,});latestFromRef.current = {data,- draggableFieldState: toJS(draggableFieldState),- visualConfig: toJS(visualConfig),+ draggableFieldState: draggableFieldState,+ visualConfig: visualConfig,};useEffect(() => {@@ -111,7 +114,7 @@ const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, r}, [waiting, data, vizStore]);useChartIndexControl({- count: visList.length,+ count: visLength,index: visIndex,onChange: (idx) => vizStore.selectVisualization(idx),});@@ -119,16 +122,16 @@ const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, rconst handleGeomClick = useCallback((values: any, e: any) => {e.stopPropagation();runInAction(() => {- commonStore.showEmbededMenu([e.pageX, e.pageY]);- commonStore.setFilters(values);+ vizStore.showEmbededMenu([e.pageX, e.pageY]);+ vizStore.setFilters(values);});const selectedMarkObject = values.vlPoint.or[0];- commonStore.updateSelectedMarkObject(selectedMarkObject);+ vizStore.updateSelectedMarkObject(selectedMarkObject);}, []);const handleChartResize = useCallback((width: number, height: number) => {- vizStore.setChartLayout({+ vizStore.setVisualLayout('size',{mode: 'fixed',width,height,@@ -139,20 +142,20 @@ const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, rconst isSpatial = viewConfig.coordSystem === 'geographic';- const sizeRef = useRef(viewConfig.size);- sizeRef.current = viewConfig.size;+ const sizeRef = useRef(layout.size);+ sizeRef.current = layout.size;useEffect(() => {if (isSpatial) {const prevSizeConfig = sizeRef.current;if (sizeRef.current.width < LEAFLET_DEFAULT_WIDTH || sizeRef.current.height < LEAFLET_DEFAULT_HEIGHT) {- vizStore.setChartLayout({+ vizStore.setVisualLayout('size', {mode: sizeRef.current.mode,width: Math.max(prevSizeConfig.width, LEAFLET_DEFAULT_WIDTH),height: Math.max(prevSizeConfig.height, LEAFLET_DEFAULT_HEIGHT),});return () => {- vizStore.setChartLayout(prevSizeConfig);+ vizStore.setVisualLayout('size', prevSizeConfig);};}}@@ -172,7 +175,7 @@ const Renderer = forwardRef<IReactVegaHandler, RendererProps>(function (props, rvisualConfig={viewConfig}onGeomClick={handleGeomClick}onChartResize={handleChartResize}- computationFunction={computationFunction}+ layout={layout}channelScales={props.channelScales}/>);diff --git a/packages/graphic-walker/src/renderer/pureRenderer.tsx b/packages/graphic-walker/src/renderer/pureRenderer.tsxindex 2f6e599e..9d7419c8 100644--- a/packages/graphic-walker/src/renderer/pureRenderer.tsx+++ b/packages/graphic-walker/src/renderer/pureRenderer.tsx@@ -1,25 +1,26 @@import React, { useState, useEffect, forwardRef, useMemo, useRef } from 'react';import { unstable_batchedUpdates } from 'react-dom';-import { toJS } from 'mobx';import { observer } from 'mobx-react-lite';import { ShadowDom } from '../shadow-dom';import LeafletRenderer, { LEAFLET_DEFAULT_HEIGHT } from '../components/leafletRenderer';import { withAppRoot } from '../components/appRoot';-import type { IDarkMode, IViewField, IRow, IThemeKey, DraggableFieldState, IVisualConfig, IComputationFunction, IChannelScales } from '../interfaces';+import type { IDarkMode, IViewField, IRow, IThemeKey, DraggableFieldState, IVisualConfigNew, IComputationFunction, IVisualLayout, IChannelScales } from '../interfaces';import type { IReactVegaHandler } from '../vis/react-vega';import SpecRenderer from './specRenderer';import { useRenderer } from './hooks';import { getComputation } from '../computation/clientComputation';import { getSort } from '../utils';+import { GWGlobalConfig } from '../vis/theme';type IPureRendererProps =| {name?: string;themeKey?: IThemeKey;- themeConfig?: any;+ themeConfig?: GWGlobalConfig;dark?: IDarkMode;visualState: DraggableFieldState;- visualConfig: IVisualConfig;+ visualConfig: IVisualConfigNew;+ visualLayout: IVisualLayout;locale?: string;channelScales?: IChannelScales;} & (@@ -38,7 +39,7 @@ type IPureRendererProps =* This is a pure component, which means it will not depend on any global state.*/const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(function PureRenderer(props, ref) {- const { name, themeKey, dark, visualState, visualConfig, type, locale, themeConfig, channelScales } = props;+ const { name, themeKey, dark, visualState, visualConfig, visualLayout, locale, type, themeConfig, channelScales } = props;const computation = useMemo(() => {if (props.type === 'remote') {return props.computation;@@ -55,7 +56,7 @@ const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(functionconst viewDimensions: IViewField[] = [];const viewMeasures: IViewField[] = [];- const { dimensions, measures, filters, ...state } = toJS(visualState);+ const { dimensions, measures, filters, ...state } = visualState;const allFields = [...dimensions, ...measures];const dKeys = Object.keys(state) as (keyof DraggableFieldState)[];@@ -103,7 +104,7 @@ const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(function<div className="relative flex flex-col w-full flex-1">{isSpatial && (<div className="max-w-full" style={{ height: LEAFLET_DEFAULT_HEIGHT, flexGrow: 1 }}>- <LeafletRenderer data={data} draggableFieldState={visualState} visualConfig={visualConfig} />+ <LeafletRenderer data={data} draggableFieldState={visualState} visualConfig={visualConfig} visualLayout={visualLayout} /></div>)}{isSpatial || (@@ -117,8 +118,8 @@ const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(functiondark={dark}draggableFieldState={visualState}visualConfig={visualConfig}+ layout={visualLayout}locale={locale ?? 'en-US'}- computationFunction={computation}channelScales={channelScales}/>)}diff --git a/packages/graphic-walker/src/renderer/specRenderer.tsx b/packages/graphic-walker/src/renderer/specRenderer.tsxindex e92ef7e8..3af881eb 100644--- a/packages/graphic-walker/src/renderer/specRenderer.tsx+++ b/packages/graphic-walker/src/renderer/specRenderer.tsx@@ -6,19 +6,20 @@ import PivotTable from '../components/pivotTable';import LeafletRenderer from '../components/leafletRenderer';import ReactVega, { IReactVegaHandler } from '../vis/react-vega';import {- DeepReadonly,+DraggableFieldState,IDarkMode,IRow,IThemeKey,- IVisualConfig,+ IVisualConfigNew, IVisualLayout,VegaGlobalConfig,- IComputationFunction,+IChannelScales,} from '../interfaces';import LoadingLayer from '../components/loadingLayer';import { useCurrentMediaTheme } from '../utils/media';import { getTheme } from '../utils/useTheme';+import { GWGlobalConfig } from '../vis/theme';interface SpecRendererProps {name?: string;@@ -26,13 +27,13 @@ interface SpecRendererProps {dark?: IDarkMode;data: IRow[];loading: boolean;- draggableFieldState: DeepReadonly<DraggableFieldState>;- visualConfig: DeepReadonly<IVisualConfig>;+ draggableFieldState: DraggableFieldState;+ visualConfig: IVisualConfigNew;+ layout: IVisualLayout;onGeomClick?: ((values: any, e: any) => void) | undefined;onChartResize?: ((width: number, height: number) => void) | undefined;locale?: string;- computationFunction: IComputationFunction;- themeConfig?: VegaGlobalConfig;+ themeConfig?: GWGlobalConfig;channelScales?: IChannelScales;}/**@@ -41,7 +42,7 @@ interface SpecRendererProps {*/const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function ({- name,+ name,layout,themeKey,dark,data,@@ -51,18 +52,19 @@ const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function (onGeomClick,onChartResize,locale,- computationFunction,+themeConfig: customizedThemeConfig,channelScales,- },+ },ref) {// const { draggableFieldState, visualConfig } = vizStore;const {- geoms,- coordSystem = 'generic',+ geoms, defaultAggregated,+ coordSystem } = visualConfig;+ const {interactiveScale,- defaultAggregated,+stack,showActions,size,@@ -74,7 +76,7 @@ const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function (primaryColor,colorPalette,scale- } = visualConfig;+ } = layout;const rows = draggableFieldState.rows;const columns = draggableFieldState.columns;@@ -86,7 +88,7 @@ const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function (const sizeChannel = draggableFieldState.size;const details = draggableFieldState.details;const text = draggableFieldState.text;- const format = toJS(_format);+ const format = _format;const rowLeftFacetFields = useMemo(() => rows.slice(0, -1).filter((f) => f.analyticType === 'dimension'), [rows]);const colLeftFacetFields = useMemo(() => columns.slice(0, -1).filter((f) => f.analyticType === 'dimension'), [columns]);@@ -144,10 +146,10 @@ const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function (data={data}draggableFieldState={draggableFieldState}visualConfig={visualConfig}+ layout={layout}loading={loading}themeKey={themeKey}dark={dark}- computationFunction={computationFunction}/>);}@@ -186,7 +188,14 @@ const SpecRenderer = forwardRef<IReactVegaHandler, SpecRendererProps>(function (>{loading && <LoadingLayer />}{isSpatial && (- <LeafletRenderer name={name} data={data} draggableFieldState={draggableFieldState} visualConfig={visualConfig} vegaConfig={vegaConfig} />+ <LeafletRenderer+ name={name}+ data={data}+ draggableFieldState={draggableFieldState}+ visualConfig={visualConfig}+ visualLayout={layout}+ vegaConfig={vegaConfig}+ />)}{isSpatial || (<ReactVegadiff --git a/packages/graphic-walker/src/segments/segmentNav.tsx b/packages/graphic-walker/src/segments/segmentNav.tsxindex 1e658115..6a0b201f 100644--- a/packages/graphic-walker/src/segments/segmentNav.tsx+++ b/packages/graphic-walker/src/segments/segmentNav.tsx@@ -1,14 +1,14 @@import React, { useCallback } from "react";import { observer } from "mobx-react-lite";import DefaultTab, { ITabOption } from "../components/tabs/defaultTab";-import { useGlobalStore } from "../store";+import { useVizStore } from "../store";import { ChartPieIcon, CircleStackIcon } from "@heroicons/react/24/outline";import { ISegmentKey } from "../interfaces";import { useTranslation } from "react-i18next";const SegmentNav: React.FC = (props) => {- const { vizStore, commonStore } = useGlobalStore();- const { segmentKey } = commonStore;+ const vizStore = useVizStore();+ const { segmentKey } = vizStore;const { t } = useTranslation();const tabs: ITabOption[] = [@@ -36,7 +36,7 @@ const SegmentNav: React.FC = (props) => {tabs={tabs}onEditLabel={editLabelHandler}onSelected={(k) => {- commonStore.setSegmentKey(k as ISegmentKey)+ vizStore.setSegmentKey(k as ISegmentKey)}}/>);diff --git a/packages/graphic-walker/src/segments/visNav.tsx b/packages/graphic-walker/src/segments/visNav.tsxindex 8a8d0bfe..c8f19a87 100644--- a/packages/graphic-walker/src/segments/visNav.tsx+++ b/packages/graphic-walker/src/segments/visNav.tsx@@ -2,19 +2,18 @@ import React, { useCallback, useEffect } from "react";import { observer } from "mobx-react-lite";import { useTranslation } from "react-i18next";import EditableTabs, { ITabOption } from "../components/tabs/editableTab";-import { useGlobalStore } from "../store";+import { useVizStore } from "../store";const ADD_KEY = '_add';const VisNav: React.FC = (props) => {- const { vizStore, commonStore } = useGlobalStore();- const { visIndex, visList } = vizStore;- const { currentDataset } = commonStore;+ const vizStore = useVizStore();+ const { currentVis, visLength, vizList } = vizStore;const { t } = useTranslation();- const tabs: ITabOption[] = visList.map((v) => ({+ const tabs: ITabOption[] = vizList.map((v) => ({key: v.visId,label: v.name ?? 'vis',editable: true@@ -25,22 +24,13 @@ const VisNav: React.FC = (props) => {label: t('main.tablist.new')});- useEffect(() => {- if (visList.length === 1) {- // should set the first vis name when the component is mounted- vizStore.setVisName(0, t('main.tablist.auto_title', { idx: 1 }));- }- // no need to add deps here- }, [])-const visSelectionHandler = useCallback((tabKey: string, tabIndex: number) => {if (tabKey === ADD_KEY) {- vizStore.addVisualization(t('main.tablist.auto_title', { idx: visList.length + 1 }));- vizStore.initMetaState(currentDataset)+ vizStore.addVisualization(t('main.tablist.auto_title', { idx: visLength + 1 }));} else {vizStore.selectVisualization(tabIndex);}- }, [currentDataset, vizStore, visList.length])+ }, [vizStore, visLength])const editLabelHandler = useCallback((content: string, tabIndex: number) => {vizStore.setVisName(tabIndex, content)@@ -56,13 +46,13 @@ const VisNav: React.FC = (props) => {return (<EditableTabs- selectedKey={visList[visIndex].visId}+ selectedKey={currentVis.visId}tabs={tabs}onEditLabel={editLabelHandler}onSelected={visSelectionHandler}onDuplicate={dupHandler}onRemove={deleteHandler}- showRemove={visList.length > 1}+ showRemove={visLength > 1}/>);};diff --git a/packages/graphic-walker/src/services.ts b/packages/graphic-walker/src/services.tsindex a6dec61a..e3228c04 100644--- a/packages/graphic-walker/src/services.ts+++ b/packages/graphic-walker/src/services.ts@@ -1,5 +1,4 @@-import { toJS } from 'mobx';-import { IRow, IMutField, IViewField, Specification, IFilterFiledSimple, IExpression } from './interfaces';+import { IRow, IMutField, Specification, IFilterFiledSimple, IExpression, IViewQuery, IViewField } from './interfaces';import { INestNode } from "./components/pivotTable/inteface";/* eslint import/no-webpack-loader-syntax:0 */// @ts-ignore@@ -15,16 +14,6 @@ import ViewQueryWorker from './workers/viewQuery.worker?worker&inline';import BuildMetricTableWorker from './workers/buildMetricTable.worker?worker&inline';import SortWorker from './workers/sort.worker?worker&inline';-import { IViewQuery } from './lib/viewQuery';--// interface WorkerState {-// eWorker: Worker | null;-// }--// const workerState: WorkerState = {-// eWorker: null,-// }-function workerService<T, R>(worker: Worker, data: R): Promise<T> {return new Promise<T>((resolve, reject) => {worker.postMessage(data);@@ -114,7 +103,7 @@ export const applyFilter = async (data: IRow[], filters: readonly IFilterFiledSitry {const res: IRow[] = await workerService(worker, {dataSource: data,- filters: toJS(filters),+ filters: filters,});return res;@@ -147,7 +136,7 @@ export const applyViewQuery = async (data: IRow[], query: IViewQuery): Promise<Itry {const res: IRow[] = await workerService(worker, {dataSource: data,- query: toJS(query),+ query: query,});return res;} catch (err) {@@ -191,7 +180,7 @@ export const applySort = async (try {const res: IRow[] = await workerService(worker, {data,- viewMeasures: viewMeasures.map((x) => toJS(x)),+ viewMeasures,sort,});return res;diff --git a/packages/graphic-walker/src/store/commonStore.ts b/packages/graphic-walker/src/store/commonStore.tsindex bd21fef2..29c210e3 100644--- a/packages/graphic-walker/src/store/commonStore.ts+++ b/packages/graphic-walker/src/store/commonStore.ts@@ -1,119 +1,23 @@-import { ICreateField, DataSet, Filters, IDataSet, IDataSetInfo, IDataSource, IMutField, IRow, ISegmentKey } from '../interfaces';-import { makeAutoObservable, observable, toJS } from 'mobx';+import { IDataSetInfo, IMutField, IRow } from '../interfaces';+import { makeAutoObservable, observable } from 'mobx';import { transData } from '../dataSource/utils';+import { DataStore } from './dataStore';import { INestNode } from '../components/pivotTable/inteface';export class CommonStore {- public datasets: IDataSet[] = [];- public dataSources: IDataSource[] = [];- public dsIndex: number = 0;+ public dataStore: DataStore = new DataStore();public tmpDSName: string = '';public tmpDSRawFields: IMutField[] = [];public tmpDataSource: IRow[] = [];public showDSPanel: boolean = false;- public showLogSettingPanel: boolean = false;- public showBinSettingPanel: boolean = false;- public showInsightBoard: boolean = false;- public createField: ICreateField | undefined = undefined;- public vizEmbededMenu: { show: boolean; position: [number, number] } = { show: false, position: [0, 0] };- public showDataConfig: boolean = false;- public showCodeExportPanel: boolean = false;- public showVisualConfigPanel: boolean = false;- public showGeoJSONConfigPanel: boolean = false;- public filters: Filters = {};- public segmentKey: ISegmentKey = ISegmentKey.vis;- public selectedMarkObject: Record<string, string | number | undefined> = {};- public tableCollapsedHeaderMap: Map<string, INestNode["path"]> = new Map();- public showErrorResolutionPanel: number = 0;-constructor () {- this.datasets = [];- this.dataSources = [];makeAutoObservable(this, {- dataSources: observable.ref,tmpDataSource: observable.ref,- filters: observable.ref,- tableCollapsedHeaderMap: observable.ref,});}- public get currentDataset (): DataSet {- const datasetIndex = this.dsIndex;- if (this.datasets.length > 0) {- const dataSourceId = this.datasets[datasetIndex].dsId;- const dataSource = this.dataSources.find(d => d.id === dataSourceId);- const rawFields = toJS(this.datasets[datasetIndex].rawFields)//.concat(createCountField())- // const base = extendCountField((dataSource ? dataSource.data : []), rawFields)- return {- ...this.datasets[datasetIndex],- dataSource: dataSource?.data ?? [],- rawFields- }- }- return {- id: '__null_ds__',- name: 'Empty Dataset',- rawFields: [],- dataSource: []- }- }- public setSegmentKey (sk: ISegmentKey) {- this.segmentKey = sk;- }public setShowDSPanel (show: boolean) {this.showDSPanel = show;}- public setShowDataConfig (show: boolean) {- this.showDataConfig = show;- }- public setShowInsightBoard (show: boolean) {- this.showInsightBoard = show;- }- public showEmbededMenu (position: [number, number]) {- this.vizEmbededMenu.show = true;- this.vizEmbededMenu.position = position;- }- public setShowCodeExportPanel (show: boolean) {- this.showCodeExportPanel = show;- }- public setShowVisualConfigPanel (show: boolean) {- this.showVisualConfigPanel = show;- }- public setShowLogSettingPanel (show: boolean) {- this.showLogSettingPanel = show;- }- public setShowBinSettingPanel (show: boolean) {- this.showBinSettingPanel = show;- }- public setCreateField ( field: ICreateField ){- this.createField = field;- }- public updateTableCollapsedHeader (node: INestNode) {- const {uniqueKey, height} = node;- if (height < 1) return;- const updatedMap = new Map(this.tableCollapsedHeaderMap)- // if some child nodes of the incoming node are collapsed, remove them first- updatedMap.forEach((existingPath, existingKey) => {- if (existingKey.startsWith(uniqueKey) && existingKey.length > uniqueKey.length) {- updatedMap.delete(existingKey)- }- })- if (!updatedMap.has(uniqueKey)) {- updatedMap.set(uniqueKey, node.path)- } else {- updatedMap.delete(uniqueKey)- }- this.tableCollapsedHeaderMap = updatedMap- }- public resetTableCollapsedHeader () {- const updatedMap: Map<string, INestNode["path"]> = new Map();- this.tableCollapsedHeaderMap = updatedMap;- }- public setShowGeoJSONConfigPanel (show: boolean) {- this.showGeoJSONConfigPanel = show;- }- public closeEmbededMenu () {- this.vizEmbededMenu.show = false;- }public initTempDS () {this.tmpDSName = 'New Dataset'this.tmpDSRawFields = [];@@ -123,16 +27,6 @@ export class CommonStore {this.tmpDSRawFields = fields;}- public updateCurrentDatasetMetas (fid: string, diffMeta: Partial<IMutField>) {- const dataset = this.datasets[this.dsIndex];- const field = dataset.rawFields.find(f => f.fid === fid);- if (field) {- for (let mk in diffMeta) {- field[mk] = diffMeta[mk];- }- }- }-public updateTempDatasetMetas (fid: string, diffMeta: Partial<IMutField>) {const field = this.tmpDSRawFields.find(f => f.fid === fid);if (field) {@@ -177,9 +71,9 @@ export class CommonStore {public commitTempDS () {const { tmpDSName, tmpDSRawFields, tmpDataSource } = this;- this.addAndUseDS({- dataSource: tmpDataSource,- rawFields: tmpDSRawFields,+ this.dataStore.addDataSource({+ data: tmpDataSource,+ fields: tmpDSRawFields,name: tmpDSName})this.setShowDSPanel(false);@@ -190,63 +84,4 @@ export class CommonStore {this.initTempDS();this.showDSPanel = true;}- public addAndUseDS(dataset: IDataSetInfo, datasetId?: string | undefined) {- const id = this.addDS(dataset, datasetId);- this.dsIndex = this.datasets.length - 1;- return id- }- public addDS(dataset: IDataSetInfo, datasetId?: string | undefined) {- const timestamp = new Date().getTime();- const dataSetId = datasetId || `dst-${timestamp}`- const dataSourceId = `dse-${timestamp}`;- this.dataSources.push({- id: dataSourceId,- data: dataset.dataSource- })- this.datasets.push({- id: dataSetId,- name: dataset.name,- rawFields: dataset.rawFields,- dsId: dataSourceId- })- return dataSourceId;- }- public removeDS(datasetId: string) {- const datasetIndex = this.datasets.findIndex(d => d.id === datasetId);- if (datasetIndex > -1) {- const dataSourceId = this.datasets[datasetIndex].id;- const dataSourceIndex = this.dataSources.findIndex(d => d.id === dataSourceId);- this.dataSources.splice(dataSourceIndex, 1);- this.datasets.splice(datasetIndex, 1);- }- }- public useDS(datasetId: string) {- const datasetIndex = this.datasets.findIndex(d => d.id === datasetId);- if (datasetIndex > -1) {- this.dsIndex = datasetIndex;- }- }- public createPlaceholderDS() {- this.addDS({- name: 'new dataset',- dataSource: [],- rawFields: []- })- }- public setFilters (props: Filters) {- this.filters = props;- }-- public updateSelectedMarkObject (newMarkObj) {- this.selectedMarkObject = newMarkObj;- }-- public updateShowErrorResolutionPanel(errCode: number) {- this.showErrorResolutionPanel = errCode;- }-- public destroy () {- this.dataSources = [];- this.datasets = [];- }}\ No newline at end of filediff --git a/packages/graphic-walker/src/store/dataStore.ts b/packages/graphic-walker/src/store/dataStore.tsnew file mode 100644index 00000000..a44d8b8b--- /dev/null+++ b/packages/graphic-walker/src/store/dataStore.ts@@ -0,0 +1,174 @@+import { computed, makeAutoObservable, toJS } from 'mobx';+import { DataSet, IAnalyticType, IDataSource, IMutField, IRow, ISemanticType } from '../interfaces';+import { VizSpecStore } from './visualSpecStore';+import { getComputation } from '../computation/clientComputation';+import { IStoInfo, IStoInfoV2, IStoInfoV2SchemaUrl, forwardVisualConfigs, visSpecDecoder } from '../utils/save';+import { uniqueId } from '../models/utils';++const emptyMeta: IMutField[] = [];++const emptyVizStore = new VizSpecStore([]);++export class DataStore {+ metaDict: Record<string, IMutField[]> = {};+ metaMap: Record<string, string> = {};+ visDict: Record<string, VizSpecStore> = {};+ dataSources: Required<IDataSource>[] = [];+ dsIndex = 0;++ constructor() {+ makeAutoObservable(this, {+ dataSource: computed.struct,+ });+ }++ get dataSource(): Required<IDataSource> | undefined {+ return this.dataSources[this.dsIndex];+ }++ get metaId() {+ return this.dataSource?.metaId;+ }++ get meta() {+ if (!this.metaId) return emptyMeta;+ return this.metaDict[this.metaId] ?? emptyMeta;+ }++ get computation() {+ return this.dataSource?.data ? getComputation(toJS(this.dataSource.data)) : async () => [];+ }++ get visSpecStore() {+ if (!this.metaId || !this.meta.length) return emptyVizStore;+ if (!this.visDict[this.metaId])+ this.visDict[this.metaId] = new VizSpecStore(this.meta, { onMetaChange: (f, d) => this.updateCurrentDatasetMetas(f, d) });+ return this.visDict[this.metaId];+ }++ get currentDataset(): DataSet {+ return {+ dataSource: this.dataSource?.data ?? [],+ id: this.dataSource?.id ?? '',+ name: this.dataSource?.name ?? '',+ rawFields: this.meta,+ };+ }++ updateCurrentDatasetMetas(fid: string, diffMeta: Partial<IMutField>) {+ const field = this.meta.find((f) => f.fid === fid);+ if (field) {+ for (let mk in diffMeta) {+ field[mk] = diffMeta[mk];+ }+ }+ }++ useDS(dsid: string) {+ const index = this.dataSources.findIndex((x) => x.id === dsid);+ if (index > -1) {+ this.setDatasetIndex(index);+ }+ }++ setDatasetIndex(i: number) {+ this.dsIndex = i;+ }++ importData(data: IStoInfo) {+ if (data.$schema === IStoInfoV2SchemaUrl) {+ this.metaDict = data.metaDict;+ const metaMap: Record<string, string> = {};+ Object.keys(data.metaDict).forEach((k) => {+ const meta = data.metaDict[k];+ metaMap[encodeMeta(meta)] = k;+ });+ this.metaMap = metaMap;+ this.dataSources = data.datasets;+ this.visDict = Object.fromEntries(+ Object.entries(data.specDict).map(([key, info]) => {+ const store = new VizSpecStore(data.metaDict[key], { empty: true, onMetaChange: (f, d) => this.updateCurrentDatasetMetas(f, d) });+ store.importRaw(info);+ return [key, store];+ })+ );+ } else {+ const metaDict: Record<string, IMutField[]> = {};+ const dsDict = Object.fromEntries(data.dataSources.map((x) => [x.id, x]));+ const dataSources: Required<IDataSource>[] = [];+ const metaMap: Record<string, string> = {};+ const visDict: Record<string, VizSpecStore> = {};+ data.datasets.forEach(({ dsId, id, name, rawFields }) => {+ const key = encodeMeta(rawFields);+ if (metaMap[key]) {+ id = metaMap[key];+ } else {+ metaMap[key] = id;+ metaDict[id] = rawFields;+ visDict[id] = new VizSpecStore(rawFields, { empty: true, onMetaChange: (f, d) => this.updateCurrentDatasetMetas(f, d) });+ }+ const ds = dsDict[dsId]!;+ dataSources.push({+ data: ds.data,+ id: dsId,+ metaId: id,+ name,+ });+ });+ const [defaultId] = Object.keys(metaDict);+ if (defaultId) {+ data.specList.forEach((x) => {+ const key = encodeMeta(x.encodings.dimensions.concat(x.encodings.measures).filter((x) => !x.computed));+ const store = visDict[key] || visDict[defaultId];+ store.appendFromOld(x);+ });+ }+ this.metaDict = metaDict;+ this.visDict = visDict;+ this.dataSources = dataSources;+ this.dsIndex = 0;+ }+ }++ exportData(): IStoInfoV2 {+ const resultSpecList: Record<string, string[]> = {};+ Object.keys(this.visDict).forEach((k) => {+ resultSpecList[k] = this.visDict[k].exportAllCharts();+ });+ return {+ $schema: IStoInfoV2SchemaUrl,+ datasets: toJS(this.dataSources),+ metaDict: toJS(this.metaDict),+ specDict: resultSpecList,+ };+ }++ addDataSource(data: { data: IRow[]; fields: IMutField[]; name: string }) {+ const metaKey = encodeMeta(data.fields);+ if (!this.metaMap[metaKey]) {+ this.metaMap[metaKey] = uniqueId();+ }+ const id = this.metaMap[metaKey];+ this.metaDict[id] = data.fields;+ this.dataSources.push({+ data: data.data,+ id: uniqueId(),+ metaId: id,+ name: data.name,+ });+ this.dsIndex = this.dataSources.length - 1;+ }+}++function encodeMeta(+ m: {+ name?: string;+ analyticType: IAnalyticType;+ semanticType: ISemanticType;+ }[]+) {+ return m+ .map((x) => `${x.name}-${x.analyticType[0]}-${x.semanticType[0]}`)+ .sort()+ .join(',');+}diff --git a/packages/graphic-walker/src/store/index.tsx b/packages/graphic-walker/src/store/index.tsxindex 6b3ebc48..b503a84d 100644--- a/packages/graphic-walker/src/store/index.tsx+++ b/packages/graphic-walker/src/store/index.tsx@@ -1,34 +1,36 @@-import React, { useContext, useMemo, useEffect } from 'react';+import React, { useContext, useMemo, useEffect, createContext, useRef } from 'react';import { CommonStore } from './commonStore';import { VizSpecStore } from './visualSpecStore';+import { IComputationFunction, IMutField, IRow } from '../interfaces';-export interface IGlobalStore {- commonStore: CommonStore;- vizStore: VizSpecStore;+function createKeepAliveContext<T, U extends any[]>(create: (...args: U) => T) {+ const dict: Record<string, T> = {};+ return (key?: string, ...args: U): T => {+ if (key) {+ if (!dict[key]) dict[key] = create(...args);+ return dict[key];+ } else {+ return create(...args);+ }+ };}-const StoreDict: Record<string, IGlobalStore> = {};-const createStore = () => {- const commonStore = new CommonStore();- const vizStore = new VizSpecStore(commonStore);- return {- commonStore,- vizStore,- };-};-const getStore = (key?: string): IGlobalStore => {- if (key) {- if (!StoreDict[key]) StoreDict[key] = createStore();- return StoreDict[key];- } else {- return createStore();- }-};+const getCommonStore = createKeepAliveContext(() => new CommonStore());+const getVizStore = createKeepAliveContext(+ (+ meta: IMutField[],+ opts?: {+ empty?: boolean;+ onMetaChange?: (fid: string, diffMeta: Partial<IMutField>) => void;+ }+ ) => new VizSpecStore(meta, opts)+);-const StoreContext = React.createContext<IGlobalStore>(null!);+const StoreContext = React.createContext<CommonStore>(null!);+export const VisContext = React.createContext<VizSpecStore>(null!);interface StoreWrapperProps {keepAlive?: boolean | string;- storeRef?: React.MutableRefObject<IGlobalStore | null>;+ storeRef?: React.MutableRefObject<CommonStore | null>;children?: React.ReactNode;}@@ -36,7 +38,7 @@ const noop = () => {};export const StoreWrapper = (props: StoreWrapperProps) => {const storeKey = props.keepAlive ? `${props.keepAlive}` : '';- const store = useMemo(() => getStore(storeKey), [storeKey]);+ const store = useMemo(() => getCommonStore(storeKey), [storeKey]);useEffect(() => {if (props.storeRef) {const ref = props.storeRef;@@ -47,18 +49,59 @@ export const StoreWrapper = (props: StoreWrapperProps) => {}return noop;}, [props.storeRef]);+ return <StoreContext.Provider value={store}>{props.children}</StoreContext.Provider>;+};++export function useGlobalStore() {+ return useContext(StoreContext);+}+interface VizStoreWrapperProps {+ keepAlive?: boolean | string;+ storeRef?: React.MutableRefObject<VizSpecStore | null>;+ children?: React.ReactNode;+ meta: IMutField[];+ onMetaChange?: (fid: string, meta: Partial<IMutField>) => void;+}++export const VizStoreWrapper = (props: VizStoreWrapperProps) => {+ const storeKey = props.keepAlive ? `${props.keepAlive}` : '';+ const store = useMemo(() => getVizStore(storeKey, props.meta, { onMetaChange: props.onMetaChange }), [storeKey]);+ const lastMeta = useRef(props.meta);+ useEffect(() => {+ if (lastMeta.current !== props.meta) {+ store.setMeta(props.meta);+ lastMeta.current = props.meta;+ }+ }, [props.meta]);useEffect(() => {- if (!storeKey) {+ if (props.storeRef) {+ const ref = props.storeRef;+ ref.current = store;return () => {- store.commonStore.destroy();- store.vizStore.destroy();+ ref.current = null;};}return noop;- }, [storeKey]);- return <StoreContext.Provider value={store}>{props.children}</StoreContext.Provider>;+ }, [props.storeRef]);+ return <VisContext.Provider value={store}>{props.children}</VisContext.Provider>;};-export function useGlobalStore() {- return useContext(StoreContext);+export function useVizStore() {+ return useContext(VisContext);+}++export const ComputationContext = createContext<IComputationFunction>(async () => []);++export function useCompututaion() {+ return useContext(ComputationContext);+}++export function withTimeout<T extends any[], U>(f: (...args: T) => Promise<U>, timeout: number) {+ return (...args: T) =>+ Promise.race([+ f(...args),+ new Promise<never>((_, reject) => {+ setTimeout(() => reject(new Error('timeout')), timeout);+ }),+ ]);}diff --git a/packages/graphic-walker/src/store/visualSpecStore.ts b/packages/graphic-walker/src/store/visualSpecStore.tsindex f4500845..07755577 100644--- a/packages/graphic-walker/src/store/visualSpecStore.ts+++ b/packages/graphic-walker/src/store/visualSpecStore.ts@@ -1,1026 +1,634 @@-import { IReactionDisposer, makeAutoObservable, observable, reaction, toJS } from 'mobx';-import produce from 'immer';+import { computed, makeAutoObservable, observable } from 'mobx';+import {+ VisSpecWithHistory,+ convertChart,+ exportFullRaw,+ exportNow,+ fromFields,+ fromSnapshot,+ importFull,+ importNow,+ newChart,+ performers,+ redo,+ undo,+} from '../models/visSpecHistory';+import { emptyEncodings, forwardVisualConfigs, visSpecDecoder } from '../utils/save';import { feature } from 'topojson-client';import type { FeatureCollection } from 'geojson';import {- DataSet,DraggableFieldState,+ Filters,+ IAggregator,+ IChart,IFilterRule,+ IMutField,+ ISegmentKey,IGeographicData,ISortMode,- IStackMode,IViewField,IVisSpec,- IVisSpecForExport,- IFilterFieldForExport,- IVisualConfig,+ IVisualConfigNew,+ IVisualLayout,Specification,- IComputationFunction,+ ICoordMode,+ IVisSpecForExport,IGeoUrl,+ ICreateField,ISemanticType,+ IChartForExport} from '../interfaces';-import { DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS, MEA_KEY_ID, MEA_VAL_ID } from '../constants';import { GLOBAL_CONFIG } from '../config';-import { VisSpecWithHistory } from '../models/visSpecHistory';-import {- IStoInfo,- dumpsGWPureSpec,- parseGWContent,- parseGWPureSpec,- stringifyGWContent,- initVisualConfig,- forwardVisualConfigs,- visSpecDecoder,- initEncoding,-} from '../utils/save';-import { CommonStore } from './commonStore';-import { createCountField, createVirtualFields, getSort } from '../utils';-import { COUNT_FIELD_ID } from '../constants';-import { nanoid } from 'nanoid';-import { toWorkflow } from '../utils/workflow';-import { Field } from '../models/field';+import { DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS } from '../constants';-function getChannelSizeLimit(channel: string): number {- if (typeof GLOBAL_CONFIG.CHANNEL_LIMIT[channel] === 'undefined') return Infinity;- return GLOBAL_CONFIG.CHANNEL_LIMIT[channel];-}--function uniqueId(): string {- return 'gw_' + nanoid(4);-}+import { toWorkflow } from '../utils/workflow';+import { KVTuple, uniqueId } from '../models/utils';+import { encodeFilterRule } from '../utils/filter';+import { INestNode } from '../components/pivotTable/inteface';-function geomAdapter(geom: string) {+const encodingKeys = (Object.keys(emptyEncodings) as (keyof DraggableFieldState)[]).filter((dkey) => !GLOBAL_CONFIG.META_FIELD_KEYS.includes(dkey));+const viewEncodingKeys = (geom: string) => {switch (geom) {- case 'interval':+ case 'choropleth':+ return ['geoId', 'color', 'opacity', 'text', 'details'];+ case 'poi':+ return ['longitude', 'latitude', 'color', 'opacity', 'size', 'details'];+ case 'arc':+ return ['radius', 'theta', 'color', 'opacity', 'size', 'details', 'text'];case 'bar':- return 'bar';+ case 'tick':case 'line':- return 'line';- case 'boxplot':- return 'boxplot';case 'area':- return 'area';- case 'point':- return 'point';- case 'arc':- return 'arc';- case 'circle':- return 'circle';- case 'heatmap':- return 'circle';- case 'rect':- return 'rect';- case 'tick':+ case 'boxplot':+ return ['columns', 'rows', 'color', 'opacity', 'size', 'details', 'text'];+ case 'text':+ return ['columns', 'rows', 'color', 'opacity', 'size', 'text'];+ case 'table':+ return ['columns', 'rows'];default:- return 'tick';+ return ['columns', 'rows', 'color', 'opacity', 'size', 'details', 'shape'];}-}+};-function stackValueTransform(vlValue: string | undefined | null): IStackMode {- if (vlValue === 'center') return 'center';- if (vlValue === 'normalize') return 'normalize';- if (vlValue === 'zero') return 'zero';- return 'none';-}+export class VizSpecStore {+ visList: VisSpecWithHistory[];+ visIndex: number = 0;+ editingFilterIdx: number | null = null;+ meta: IMutField[];+ segmentKey: ISegmentKey = ISegmentKey.data;+ showInsightBoard: boolean = false;+ vizEmbededMenu: { show: boolean; position: [number, number] } = { show: false, position: [0, 0] };+ showDataConfig: boolean = false;+ showCodeExportPanel: boolean = false;+ showVisualConfigPanel: boolean = false;+ showGeoJSONConfigPanel: boolean = false;+ removeConfirmIdx: number | null = null;+ filters: Filters = {};+ tableCollapsedHeaderMap: Map<string, INestNode['path']> = new Map();+ selectedMarkObject: Record<string, string | number | undefined> = {};+ showLogSettingPanel: boolean = false;+ showBinSettingPanel: boolean = false;+ createField: ICreateField | undefined = undefined;+ localGeoJSON: FeatureCollection | undefined = undefined;+ showErrorResolutionPanel: number = 0;++ private onMetaChange?: (fid: string, diffMeta: Partial<IMutField>) => void;++ constructor(+ meta: IMutField[],+ options?: {+ empty?: boolean;+ onMetaChange?: (fid: string, diffMeta: Partial<IMutField>) => void;+ }+ ) {+ this.meta = meta;+ this.visList = options?.empty ? [] : [fromFields(meta, 'Chart 1')];+ this.onMetaChange = options?.onMetaChange;+ makeAutoObservable(this, {+ visList: observable.shallow,+ allEncodings: computed.struct,+ filters: observable.ref,+ tableCollapsedHeaderMap: observable.ref,+ });+ }-function sortValueTransform(vlValue: object | string | null): ISortMode {- let order: string = 'none';- if (typeof vlValue === 'string') {- order = vlValue;- } else if (vlValue && vlValue instanceof Object) {- order = vlValue['order'] ?? 'ascending';+ get visLength() {+ return this.visList.length;}- if (order !== 'none') {- const channels: string[] = ['x', 'y', 'color', 'size', 'opacity'];- // TODO: support all sorting config in vl- if (order.startsWith('-') || order === 'descending') return 'descending';- if (channels.indexOf(order) > -1 || order === 'ascending') return 'ascending';++ get vizList() {+ return this.visList.map((x) => x.now);}- return 'none';-}-type DeepReadonly<T extends Record<keyof any, any>> = {- readonly [K in keyof T]: T[K] extends Record<keyof any, any> ? DeepReadonly<T[K]> : T[K];-};+ get currentVis() {+ return this.visList[this.visIndex].now;+ }-function isDraggableStateEmpty(state: DeepReadonly<DraggableFieldState>): boolean {- return Object.values(state).every((value) => value.length === 0);-}+ get currentEncodings() {+ return this.currentVis.encodings;+ }-function withTimeout<T extends any[], U>(f: (...args: T) => Promise<U>, timeout: number) {- return (...args: T) =>- Promise.race([- f(...args),- new Promise<never>((_, reject) => {- setTimeout(() => reject(new Error('timeout')), timeout);- }),- ]);-}+ get viewFilters() {+ return this.currentEncodings.filters;+ }-export class VizSpecStore {- // public fields: IViewField[] = [];- private commonStore: CommonStore;- /**- * This segment will always refers to the state of the active tab -- * `this.visList[this.visIndex].encodings`.- * Notice that observing rule of `this.visList` is `"shallow"`- * so mobx will NOT compare every deep value of `this.visList`,- * because the active tab is the only item in the list that may change.- * @readonly- * Assignment or mutable operations applied to ANY members of this segment- * is strictly FORBIDDEN.- * Members of it can only be got as READONLY objects.- *- * If you're trying to change the value of it and let mobx catch the action to trigger an update,- * please use `this.useMutable()` to access to a writable reference- * (an `immer` draft) of `this.visList[this.visIndex]`.- */- public readonly draggableFieldState: DeepReadonly<DraggableFieldState>;- private reactions: IReactionDisposer[] = [];- /**- * This segment will always refers to the state of the active tab -- * `this.visList[this.visIndex].config`.- * Notice that observing rule of `this.visList` is `"shallow"`- * so mobx will NOT compare every deep value of `this.visList`,- * because the active tab is the only item in the list that may change.- * @readonly- * Assignment or mutable operations applied to ANY members of this segment- * is strictly FORBIDDEN.- * Members of it can only be got as READONLY objects.- *- * If you're trying to change the value of it and let mobx catch the action to trigger an update,- * please use `this.useMutable()` to access to a writable reference- * (an `immer` draft) of `this.visList[this.visIndex]`.- */- public readonly visualConfig: Readonly<IVisualConfig>;- public visList: VisSpecWithHistory[] = [];- public visIndex: number = 0;- public canUndo = false;- public canRedo = false;- public editingFilterIdx: number | null = null;- public removeConfirmIdx: number | null = null;- // TODO- public computationFunction: IComputationFunction = async () => [];- constructor(commonStore: CommonStore) {- this.commonStore = commonStore;- this.draggableFieldState = initEncoding();- this.visualConfig = initVisualConfig();- this.visList.push(- new VisSpecWithHistory({- name: 'Chart 1',- visId: uniqueId(),- config: this.visualConfig,- encodings: this.draggableFieldState,- })- );- makeAutoObservable(this, {- visList: observable.shallow,- computationFunction: observable.ref,- visualConfig: observable.ref,- // @ts-expect-error private fields are not supported- reactions: false,+ get dimensions() {+ return this.currentEncodings.dimensions;+ }++ get measures() {+ return this.currentEncodings.measures;+ }++ get rows() {+ return this.currentEncodings.rows;+ }++ get columns() {+ return this.currentEncodings.columns;+ }++ get sort() {+ const { rows, columns } = this;+ if (rows.length && !rows.find((x) => x.analyticType === 'measure')) {+ return rows[rows.length - 1].sort || 'none';+ }+ if (columns.length && !columns.find((x) => x.analyticType === 'measure')) {+ return columns[columns.length - 1].sort || 'none';+ }+ return 'none';+ }++ get allFields() {+ return [...this.dimensions, ...this.measures];+ }++ get config() {+ return this.currentVis.config;+ }++ get layout() {+ return {+ ...this.currentVis.layout,+ ...(this.localGeoJSON ? {+ geoJson: this.localGeoJSON+ }: {})+ };+ }++ get allEncodings() {+ const result: Record<string, IViewField[]> = {};+ encodingKeys.forEach((k) => {+ result[k] = this.currentEncodings[k];});- this.reactions.push(- reaction(- () => this.visList[this.visIndex],- (frame) => {- // @ts-ignore Allow assignment here to trigger watch- this.draggableFieldState = frame.encodings;- // @ts-ignore Allow assignment here to trigger watch- this.visualConfig = frame.config;- this.canUndo = frame.canUndo;- this.canRedo = frame.canRedo;- }- ),- reaction(- () => commonStore.currentDataset,- (dataset) => {- // this.initState();- if (isDraggableStateEmpty(this.draggableFieldState) && dataset.dataSource.length > 0 && dataset.rawFields.length > 0) {- this.initMetaState(dataset);- }- }- )+ return result;+ }++ get viewEncodings() {+ const result: Record<string, IViewField[]> = {};+ viewEncodingKeys(this.config.geoms[0]).forEach((k) => {+ result[k] = this.currentEncodings[k];+ });+ return result;+ }++ get viewEncodingFields() {+ return viewEncodingKeys(this.config.geoms[0]).flatMap((k) => this.viewEncodings[k]);+ }++ get viewDimensions() {+ return this.viewEncodingFields.filter((x) => x.analyticType === 'dimension');+ }++ get viewMeasures() {+ return this.viewEncodingFields.filter((x) => x.analyticType === 'measure');+ }++ get workflow() {+ return toWorkflow(+ this.viewFilters,+ this.allFields,+ this.viewDimensions,+ this.viewMeasures,+ this.config.defaultAggregated,+ this.sort,+ this.config.folds,+ this.config.limit);}- private __dangerous_is_inside_useMutable__ = false;- /**- * @important NEVER recursively call `useMutable()`- * because the state will be overwritten by the root `useMutable()` call,- * update caused by recursive `useMutable()` call will be reverted or lead to unexpected behaviors.- * Inline your invoking or just use block with IF statement to avoid this in your cases.- *- * Allow to change any deep member of `encodings` or `config`- * in the active tab `this.visList[this.visIndex]`.- *- * - `tab.encodings`- *- * A mutable reference of `this.draggableFieldState`- *- * - `tab.config`- *- * A mutable reference of `this.visualConfig`- */- private useMutable(cb: (tab: { encodings: DraggableFieldState; config: IVisualConfig }) => void) {- if (this.__dangerous_is_inside_useMutable__) {- throw new Error(- 'A recursive call of useMutable() is detected, ' + 'this is prevented because update will be overwritten by parent execution context.'- );- }- this.__dangerous_is_inside_useMutable__ = true;+ get limit() {+ return this.config.limit;+ }- const { encodings, config } = produce(- {- encodings: this.visList[this.visIndex].encodings,- config: this.visList[this.visIndex].config,- },- (draft) => {- cb(draft);- }- ); // notice that cb() may unexpectedly returns a non-nullable value+ get canUndo() {+ return this.visList[this.visIndex].cursor > 0;+ }- this.visList[this.visIndex].encodings = encodings;- this.visList[this.visIndex].config = config;+ get canRedo() {+ const viz = this.visList[this.visIndex];+ return viz.cursor !== viz.timeline.length;+ }++ private appendFilter(index: number, sourceKey: keyof Omit<DraggableFieldState, 'filters'>, sourceIndex: number) {+ this.visList[this.visIndex] = performers.appendFilter(this.visList[this.visIndex], index, sourceKey, sourceIndex, uniqueId());+ this.editingFilterIdx = index;+ }- this.canUndo = this.visList[this.visIndex].canUndo;- this.canRedo = this.visList[this.visIndex].canRedo;+ undo() {+ this.visList[this.visIndex] = undo(this.visList[this.visIndex]);+ }- // @ts-ignore Allow assignment here to trigger watch- this.visualConfig = config;- // @ts-ignore Allow assignment here to trigger watch- this.draggableFieldState = encodings;+ redo() {+ this.visList[this.visIndex] = redo(this.visList[this.visIndex]);+ }- this.__dangerous_is_inside_useMutable__ = false;+ setVisName(index: number, name: string) {+ this.visList[index] = performers.setName(this.visList[index], name);}- public undo() {- if (this.visList[this.visIndex]?.undo()) {- this.canUndo = this.visList[this.visIndex].canUndo;- this.canRedo = this.visList[this.visIndex].canRedo;- // @ts-ignore Allow assignment here to trigger watch- this.visualConfig = this.visList[this.visIndex].config;- // @ts-ignore Allow assignment here to trigger watch- this.draggableFieldState = this.visList[this.visIndex].encodings;- }++ setMeta(meta: IMutField[]) {+ this.meta = meta;}- public redo() {- if (this.visList[this.visIndex]?.redo()) {- this.canUndo = this.visList[this.visIndex].canUndo;- this.canRedo = this.visList[this.visIndex].canRedo;- // @ts-ignore Allow assignment here to trigger watch- this.visualConfig = this.visList[this.visIndex].config;- // @ts-ignore Allow assignment here to trigger watch- this.draggableFieldState = this.visList[this.visIndex].encodings;- }++ resetVisualization() {+ this.visList = [fromFields(this.meta, 'Chart 1')];}- private freezeHistory() {- this.visList[this.visIndex]?.rebase();- this.canUndo = this.visList[this.visIndex].canUndo;- this.canRedo = this.visList[this.visIndex].canRedo;- }- /**- * dimension fields in visualization- */- public get viewDimensions(): IViewField[] {- const { draggableFieldState } = this;- const { filters, ...state } = toJS(draggableFieldState);- const fields: IViewField[] = [];- (Object.keys(state) as (keyof DraggableFieldState)[])- .filter((dkey) => !GLOBAL_CONFIG.META_FIELD_KEYS.includes(dkey))- .forEach((dkey) => {- fields.push(...state[dkey].filter((f) => f.analyticType === 'dimension'));- });- return fields;- }- /**- * dimension fields in visualization- */- public get viewMeasures(): IViewField[] {- const { draggableFieldState } = this;- const { filters, ...state } = toJS(draggableFieldState);- const fields: IViewField[] = [];- (Object.keys(state) as (keyof DraggableFieldState)[])- .filter((dkey) => !GLOBAL_CONFIG.META_FIELD_KEYS.includes(dkey))- .forEach((dkey) => {- fields.push(...state[dkey].filter((f) => f.analyticType === 'measure'));- });- return fields;- }- public get allFields(): IViewField[] {- const { draggableFieldState } = this;- const dimensions = toJS(draggableFieldState.dimensions);- const measures = toJS(draggableFieldState.measures);- return [...dimensions, ...measures];- }- public get viewFilters() {- const { draggableFieldState } = this;- const state = toJS(draggableFieldState);- return state.filters;- }-- public addVisualization(defaultName?: string) {++ addVisualization(defaultName?: string) {const name = defaultName || 'Chart ' + (this.visList.length + 1);- this.visList.push(- new VisSpecWithHistory({- name,- visId: uniqueId(),- config: initVisualConfig(),- encodings: initEncoding(),- })- );+ this.visList.push(fromFields(this.meta, name));this.visIndex = this.visList.length - 1;}- public selectVisualization(visIndex: number) {- this.visIndex = visIndex;- }- public removeVisualization(index: number) {- if (this.visList.length === 1) return;++ removeVisualization(index: number) {+ if (this.visLength === 1) return;if (this.visIndex >= index && this.visIndex > 0) this.visIndex -= 1;this.visList.splice(index, 1);}- public duplicateVisualization(index: number) {- const ori = this.visList[index].exportGW();++ duplicateVisualization(index: number) {this.visList.push(- new VisSpecWithHistory({- ...ori,- name: ori.name + ' Copy',+ fromSnapshot({+ ...this.visList[index].now,+ name: this.visList[index].now.name + ' Copy',visId: uniqueId(),}));this.visIndex = this.visList.length - 1;}- public setVisName(visIndex: number, name: string) {- this.visList[visIndex] = this.visList[visIndex].clone();- this.visList[visIndex].updateLatest({- name,- });+ setFilterEditing(index: number) {+ this.editingFilterIdx = index;}- public initState() {- this.useMutable((tab) => {- tab.encodings = initEncoding();- this.freezeHistory();- });++ closeFilterEditing() {+ this.editingFilterIdx = null;}- public initMetaState(dataset: DataSet) {- const countField = createCountField();- const virtualFields = createVirtualFields();- this.useMutable(({ encodings }) => {- encodings.dimensions = dataset.rawFields- .filter((f) => f.analyticType === 'dimension')- .map((f) => ({- dragId: uniqueId(),- fid: f.fid,- name: f.name || f.fid,- basename: f.basename || f.name || f.fid,- semanticType: f.semanticType,- analyticType: f.analyticType,- }));- encodings.measures = dataset.rawFields- .filter((f) => f.analyticType === 'measure')- .map((f) => ({- dragId: uniqueId(),- fid: f.fid,- name: f.name || f.fid,- basename: f.basename || f.name || f.fid,- analyticType: f.analyticType,- semanticType: f.semanticType,- aggName: 'sum',- }));- encodings.measures.push(countField);- for (const vf of virtualFields) {- encodings[`${vf.analyticType}s`].push(vf);- }- });- this.freezeHistory();- }- /**- * clear all config in draggable state- */- public clearState() {- this.useMutable(({ encodings }) => {- for (let key in encodings) {- if (!GLOBAL_CONFIG.META_FIELD_KEYS.includes(key as keyof DraggableFieldState)) {- encodings[key] = [];- }- }- });+ setSegmentKey(sk: ISegmentKey) {+ this.segmentKey = sk;}- public setVisualConfig<K extends keyof IVisualConfig>(configKey: K, value: IVisualConfig[K]) {- this.useMutable(({ config }) => {- switch (true) {- case ['defaultAggregated', 'defaultStack', 'showActions', 'interactiveScale', 'scaleIncludeUnmatchedChoropleth', 'useSvg'].includes(- configKey- ): {- return ((config as unknown as { [k: string]: boolean })[configKey] = Boolean(value));- }- case configKey === 'geoms' && Array.isArray(value):- case configKey === 'showTableSummary':- case configKey === 'coordSystem':- case configKey === 'size' && typeof value === 'object':- case configKey === 'sorted':- case configKey === 'zeroScale':- case configKey === 'background':- case configKey === 'resolve':- case configKey === 'limit':- case configKey === 'primaryColor':- case configKey === 'colorPalette':- case configKey === 'scale':- case configKey === 'folds':- case configKey === 'stack': {- return (config[configKey] = value);- }- case configKey === 'format' && typeof value === 'object': {- return (config[configKey] = value);- }-- default: {- console.error('[unknown key] ' + configKey + ' You should registered visualConfig at setVisualConfig');- }- }- });++ setVisualConfig(...args: KVTuple<IVisualConfigNew>) {+ this.visList[this.visIndex] = performers.setConfig(this.visList[this.visIndex], ...args);}- public transformCoord(coord: 'cartesian' | 'polar') {- if (coord === 'polar') {- }++ setCoordSystem(mode: ICoordMode) {+ this.visList[this.visIndex] = performers.setCoordSystem(this.visList[this.visIndex], mode);}- public setChartLayout(props: { mode: IVisualConfig['size']['mode']; width?: number; height?: number }) {- this.useMutable(({ config }) => {- const { mode = config.size.mode, width = config.size.width, height = config.size.height } = props;- config.size.mode = mode;- config.size.width = width;- config.size.height = height;- });+ setVisualLayout(...args: KVTuple<IVisualLayout>);+ setVisualLayout(...args: KVTuple<IVisualLayout>[]);+ setVisualLayout(...args: KVTuple<IVisualLayout> | KVTuple<IVisualLayout>[]) {+ if (typeof args[0] === 'string') {+ this.visList[this.visIndex] = performers.setLayout(this.visList[this.visIndex], [args]);+ } else {+ this.visList[this.visIndex] = performers.setLayout(this.visList[this.visIndex], args);+ }}- public reorderField(stateKey: keyof DraggableFieldState, sourceIndex: number, destinationIndex: number) {++ reorderField(stateKey: keyof DraggableFieldState, sourceIndex: number, destinationIndex: number) {if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(stateKey)) return;if (sourceIndex === destinationIndex) return;-- this.useMutable(({ encodings }) => {- const fields = encodings[stateKey];- const [field] = fields.splice(sourceIndex, 1);- fields.splice(destinationIndex, 0, field);- });+ this.visList[this.visIndex] = performers.reorderField(this.visList[this.visIndex], stateKey, sourceIndex, destinationIndex);}- public moveField(sourceKey: keyof DraggableFieldState, sourceIndex: number, destinationKey: keyof DraggableFieldState, destinationIndex: number) {++ moveField(sourceKey: keyof DraggableFieldState, sourceIndex: number, destinationKey: keyof DraggableFieldState, destinationIndex: number) {if (sourceKey === 'filters') {return this.removeField(sourceKey, sourceIndex);} else if (destinationKey === 'filters') {- return this.appendFilter(destinationIndex, this.draggableFieldState[sourceKey][sourceIndex]);+ return this.appendFilter(destinationIndex, sourceKey, sourceIndex);+ }+ const sourceMeta = GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey);+ const destMeta = GLOBAL_CONFIG.META_FIELD_KEYS.includes(destinationKey);+ if (destMeta === sourceMeta) {+ this.visList[this.visIndex] = performers.moveField(this.visList[this.visIndex], sourceKey, sourceIndex, destinationKey, destinationIndex);+ } else if (destMeta) {+ this.visList[this.visIndex] = performers.removeField(this.visList[this.visIndex], sourceKey, sourceIndex);+ } else {+ this.visList[this.visIndex] = performers.cloneField(+ this.visList[this.visIndex],+ sourceKey,+ sourceIndex,+ destinationKey,+ destinationIndex,+ uniqueId()+ );}-- this.useMutable(({ encodings }) => {- let movingField: IViewField;- // 来源是不是metafield,是->clone;不是->直接删掉- if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey)) {- // use a different dragId- movingField = {- ...toJS(encodings[sourceKey][sourceIndex]), // toJS will NOT shallow copy a object here- dragId: uniqueId(),- };- } else {- [movingField] = encodings[sourceKey].splice(sourceIndex, 1);- }- // 目的地是metafields的情况,只有在来源也是metafields时,会执行字段类型转化操作- if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(destinationKey)) {- if (!GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey)) return;- encodings[sourceKey].splice(sourceIndex, 1);- movingField = new Field(movingField).switchAnalyticType(destinationKey === 'dimensions' ? 'dimension' : 'measure')- }- const limitSize = getChannelSizeLimit(destinationKey);- const fixedDestinationIndex = Math.min(destinationIndex, limitSize - 1);- const overflowSize = Math.max(0, encodings[destinationKey].length + 1 - limitSize);- encodings[destinationKey].splice(fixedDestinationIndex, overflowSize, movingField);- });}- public removeField(sourceKey: keyof DraggableFieldState, sourceIndex: number) {- if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey)) return;- this.useMutable(({ encodings }) => {- const fields = encodings[sourceKey];- fields.splice(sourceIndex, 1);- });+ modFilter(index: number, sourceKey: keyof Omit<DraggableFieldState, 'filters'>, sourceIndex: number) {+ this.visList[this.visIndex] = performers.modFilter(this.visList[this.visIndex], index, sourceKey, sourceIndex);}- public replaceField(sourceKey: keyof DraggableFieldState, sourceIndex: number, fid: string) {- if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey)) return;- const enteringField = [...this.draggableFieldState.dimensions, ...this.draggableFieldState.measures].find((which) => which.fid === fid);- if (!enteringField) {- return;- }- this.useMutable(({ encodings }) => {- const fields = encodings[sourceKey];- fields.splice(sourceIndex, 1, toJS(enteringField));- });- }- private appendFilter(index: number, data: IViewField) {- this.useMutable(({ encodings }) => {- encodings.filters.splice(index, 0, {- ...toJS(data),- dragId: uniqueId(),- rule: null,- });- this.editingFilterIdx = index;- });- }- public writeFilter(index: number, rule: IFilterRule | null) {- this.useMutable(({ encodings }) => {- encodings.filters[index].rule = rule;- });- }- public setFilterEditing(index: number) {- this.editingFilterIdx = index;- }- public closeFilterEditing() {- this.editingFilterIdx = null;+ removeField(sourceKey: keyof DraggableFieldState, sourceIndex: number) {+ if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(sourceKey)) return;+ this.visList[this.visIndex] = performers.removeField(this.visList[this.visIndex], sourceKey, sourceIndex);}- public transpose() {- this.useMutable(({ encodings }) => {- const fieldsInCup = encodings.columns;- encodings.columns = encodings.rows;- encodings.rows = fieldsInCup as typeof encodings.rows; // assume this as writable+ writeFilter(index: number, rule: IFilterRule | null) {+ this.visList[this.visIndex] = performers.writeFilter(this.visList[this.visIndex], index, encodeFilterRule(rule));+ }- const fieldsInCup2 = encodings.longitude;- encodings.longitude = encodings.latitude;- encodings.latitude = fieldsInCup2 as typeof encodings.latitude; // assume this as writable- });+ transpose() {+ this.visList[this.visIndex] = performers.transpose(this.visList[this.visIndex]);}- public createBinField(stateKey: keyof DraggableFieldState, index: number, binType: 'bin' | 'binCount', num: number | undefined = 10): string {++ createBinField(stateKey: keyof Omit<DraggableFieldState, 'filters'>, index: number, binType: 'bin' | 'binCount', binNumber = 10): string {const newVarKey = uniqueId();- const state = this.draggableFieldState;+ const state = this.currentEncodings;const existedRelatedBinField = state.dimensions.find(- (f) =>- f.computed &&- f.expression &&- f.expression.op === binType &&- f.expression.num === num &&- f.expression.params[0].value === state[stateKey][index].fid+ (f) => f.computed && f.expression && f.expression.op === binType && f.expression.params[0].value === state[stateKey][index].fid && f.expression.num === binNumber);if (existedRelatedBinField) {return existedRelatedBinField.fid;}- this.useMutable(({ encodings }) => {- const originField = encodings[stateKey][index];- const binField: IViewField = {- fid: newVarKey,- dragId: newVarKey,- name: `${binType}${num}(${originField.name})`,- semanticType: 'ordinal',- analyticType: 'dimension',- computed: true,- expression: {- op: binType,- as: newVarKey,- params: [- {- type: 'field',- value: originField.fid,- },- ],- num: num,- },- };- encodings.dimensions.push(binField);- });+ this.visList[this.visIndex] = performers.createBinlogField(this.visList[this.visIndex], stateKey, index, binType, newVarKey, binNumber);return newVarKey;}- public createLogField(stateKey: keyof DraggableFieldState, index: number, scaleType: 'log', num: number | undefined = 10) {- if (stateKey === 'filters') {- return;- }- this.useMutable(({ encodings }) => {- const originField = encodings[stateKey][index];- const newVarKey = uniqueId();- const logField: IViewField = {- fid: newVarKey,- dragId: newVarKey,- name: `${scaleType}${num}(${originField.name})`,- semanticType: 'quantitative',- analyticType: originField.analyticType,- aggName: 'sum',- computed: true,- expression: {- op: scaleType,- as: newVarKey,- num: num,- params: [- {- type: 'field',- value: originField.fid,- },- ],- },- };- encodings[stateKey].push(logField);- });- }- public changeSemanticType(stateKey: keyof DraggableFieldState, index: number, newSemanticType: ISemanticType) {- this.useMutable(({ encodings }) => {- const originField = encodings[stateKey][index];- encodings[stateKey].splice(index, 1, {- ...originField,- semanticType: newSemanticType,- });- });++ createLogField(stateKey: keyof Omit<DraggableFieldState, 'filters'>, index: number, scaleType: 'log10' | 'log2' | 'log', logNumber = 10) {+ this.visList[this.visIndex] = performers.createBinlogField(this.visList[this.visIndex], stateKey, index, scaleType, uniqueId(), logNumber);}+public createDateTimeDrilledField(- stateKey: keyof DraggableFieldState,+ stateKey: keyof Omit<DraggableFieldState, 'filters'>,index: number,- op: 'dateTimeDrill',drillLevel: (typeof DATE_TIME_DRILL_LEVELS)[number],- name: string | ((originFieldName: string) => string),+ name: string,format: string- );- public createDateTimeDrilledField(- stateKey: keyof DraggableFieldState,+ ) {+ this.visList[this.visIndex] = performers.createDateDrillField(this.visList[this.visIndex], stateKey, index, drillLevel, uniqueId(), name, format);+ }++ public createDateFeatureField(+ stateKey: keyof Omit<DraggableFieldState, 'filters'>,index: number,- op: 'dateTimeFeature',drillLevel: (typeof DATE_TIME_FEATURE_LEVELS)[number],- name: string | ((originFieldName: string) => string),+ name: string,format: string- );- public createDateTimeDrilledField(stateKey, index, op, drillLevel, name, format) {- if (stateKey === 'filters') {- return;- }+ ) {+ this.visList[this.visIndex] = performers.createDateFeatureField(this.visList[this.visIndex], stateKey, index, drillLevel, uniqueId(), name, format);+ }- this.useMutable(({ encodings }) => {- const originField = encodings[stateKey][index];- const newVarKey = uniqueId();- const logField: IViewField = {- fid: newVarKey,- dragId: newVarKey,- name: typeof name === 'function' ? name(originField.name) : name,- semanticType: op === 'dateTimeDrill' ? 'temporal' : 'ordinal',- analyticType: originField.analyticType,- aggName: 'sum',- computed: true,- timeUnit: op === 'dateTimeDrill' ? drillLevel : undefined,- expression: {- op,- as: newVarKey,- params: [- {- type: 'field',- value: originField.fid,- },- {- type: 'value',- value: drillLevel,- },- {- type: 'format',- value: format,- },- ],- },- };- encodings[stateKey].push(logField);- });+ setFieldAggregator(stateKey: keyof Omit<DraggableFieldState, 'filters'>, index: number, aggName: IAggregator) {+ this.visList[this.visIndex] = performers.setFieldAggregator(this.visList[this.visIndex], stateKey, index, aggName);}- public setFieldAggregator(stateKey: keyof DraggableFieldState, index: number, aggName: string) {- this.useMutable(({ encodings }) => {- const fields = encodings[stateKey];- if (fields[index]) {- encodings[stateKey][index].aggName = aggName;- }- });+ applyDefaultSort(sortType: ISortMode = 'ascending') {+ this.visList[this.visIndex] = performers.applySort(this.visList[this.visIndex], sortType);}- public openRemoveConfirmModal(index: number) {- this.removeConfirmIdx = index;++ exportCurrentChart() {+ return exportFullRaw(this.visList[this.visIndex]);}- public closeRemoveConfirmModal() {- this.removeConfirmIdx = null;+ exportAllCharts() {+ return this.visList.map((x) => exportFullRaw(x));}- public get sortCondition() {- const { rows, columns } = this.draggableFieldState;- const yField = rows.length > 0 ? rows[rows.length - 1] : null;- const xField = columns.length > 0 ? columns[columns.length - 1] : null;- if (xField !== null && xField.analyticType === 'dimension' && yField !== null && yField.analyticType === 'measure') {- return true;- }- if (xField !== null && xField.analyticType === 'measure' && yField !== null && yField.analyticType === 'dimension') {- return true;- }- return false;+ exportCode() {+ return this.visList.map(x => exportNow(x));}- public setFieldSort(stateKey: keyof DraggableFieldState, index: number, sortType: ISortMode) {- this.useMutable(({ encodings }) => {- encodings[stateKey][index].sort = sortType;- });++ importCode(data: IChartForExport[]) {+ this.visList = data.map(x => importNow(x));+ this.visIndex = 0;}- public applyDefaultSort(sortType: ISortMode = 'ascending') {- this.useMutable(({ encodings }) => {- const { rows, columns } = encodings;- const yField = rows.length > 0 ? rows[rows.length - 1] : null;- const xField = columns.length > 0 ? columns[columns.length - 1] : null;- if (xField !== null && xField.analyticType === 'dimension' && yField !== null && yField.analyticType === 'measure') {- encodings.columns[columns.length - 1].sort = sortType;- return;- }- if (xField !== null && xField.analyticType === 'measure' && yField !== null && yField.analyticType === 'dimension') {- encodings.rows[rows.length - 1].sort = sortType;- return;- }- });+ appendRaw(data: string) {+ const newChart = importFull(data);+ this.visList.push(newChart);+ this.visIndex = this.visList.length - 1;}- public appendField(destinationKey: keyof DraggableFieldState, field: IViewField | undefined, overrideAttr?: Record<string, any>) {- if (GLOBAL_CONFIG.META_FIELD_KEYS.includes(destinationKey)) return;- if (typeof field === 'undefined') return;- if (destinationKey === 'filters') {- return;- }- this.useMutable(({ encodings }) => {- const cloneField = { ...toJS(field), ...overrideAttr };- cloneField.dragId = uniqueId();- encodings[destinationKey].push(cloneField);- });+ importRaw(data: string[]) {+ this.visList = data.map(importFull);+ this.visIndex = 0;}- public setVizFormatConfig(formatKey: keyof IVisualConfig['format'], value?: string) {- this.visualConfig[formatKey] = value;- }- public renderVLSubset(vlStruct: any) {- const tab = this.visList[this.visIndex];- this.clearState();- this.setVisualConfig('defaultAggregated', false);- this.setVisualConfig('stack', 'stack');- // this.setVisualConfig('sorted', 'none')- this.applyDefaultSort('none');-- if (!tab) return;- const fields = tab.encodings.dimensions.concat(tab.encodings.measures);- const countField = fields.find((f) => f.fid === COUNT_FIELD_ID);- const renderVLFacet = (vlFacet: any) => {- if (vlFacet.facet) {- this.appendField('rows', fields.find((f) => f.fid === vlFacet.facet.field) || countField, { analyticType: 'dimension' });- }- if (vlFacet.row) {- this.appendField('rows', fields.find((f) => f.fid === vlFacet.row.field) || countField, { analyticType: 'dimension' });- }- if (vlFacet.column) {- this.appendField('columns', fields.find((f) => f.fid === vlFacet.column.field) || countField, { analyticType: 'dimension' });- }- };- const isValidAggregate = (aggName: string) => aggName && (GLOBAL_CONFIG.AGGREGATOR_LIST as string[]).includes(aggName);- const renderVLSpec = (vlSpec: any) => {- if (typeof vlSpec.mark === 'string') {- this.setVisualConfig('geoms', [geomAdapter(vlSpec.mark)]);- } else {- this.setVisualConfig('geoms', [geomAdapter(vlSpec.mark.type)]);- }- if (vlSpec.encoding.x) {- const field = fields.find((f) => f.fid === vlSpec.encoding.x.field) || countField;- this.appendField('columns', field, { analyticType: 'dimension' });- if (isValidAggregate(vlSpec.encoding.x.aggregate) || field === countField) {- this.setVisualConfig('defaultAggregated', true);- this.setFieldAggregator('columns', this.draggableFieldState.columns.length - 1, vlSpec.encoding.x.aggregate);- }- if (vlSpec.encoding.x.bin) {- const binFid = this.createBinField('columns', this.draggableFieldState.columns.length - 1, 'bin');- this.replaceField('columns', this.draggableFieldState.columns.length - 1, binFid);- }- if (vlSpec.encoding.x.stack) {- this.setVisualConfig('stack', stackValueTransform(vlSpec.encoding.x.stack));- }- }- if (vlSpec.encoding.y) {- const field = fields.find((f) => f.fid === vlSpec.encoding.y.field) || countField;- this.appendField('rows', field, { analyticType: 'measure' });- if (isValidAggregate(vlSpec.encoding.y.aggregate) || field === countField) {- this.setVisualConfig('defaultAggregated', true);- this.setFieldAggregator('rows', this.draggableFieldState.rows.length - 1, vlSpec.encoding.y.aggregate);- }- if (vlSpec.encoding.y.bin) {- const binFid = this.createBinField('rows', this.draggableFieldState.rows.length - 1, 'bin');- this.replaceField('rows', this.draggableFieldState.rows.length - 1, binFid);- }- if (vlSpec.encoding.y.stack) {- this.setVisualConfig('stack', stackValueTransform(vlSpec.encoding.y.stack));- }- }- (['color', 'opacity', 'shape', 'size', 'details', 'theta', 'text', 'radius'] as (keyof DraggableFieldState)[]).forEach((ch) => {- if (vlSpec.encoding[ch]) {- const field = fields.find((f) => f.fid === vlSpec.encoding[ch].field) || countField;- this.appendField(- ch,- field,- field !== countField && ['color', 'opacity', 'size', 'radius'].includes(ch)- ? { analyticType: 'dimension' }- : field === countField || ['theta'].includes(ch)- ? { analyticType: 'measure' }- : {}- );- const aggregate = isValidAggregate(vlSpec.encoding[ch].aggregate);- if ((['theta', 'radius'].includes(ch) && aggregate) || field === countField) {- this.setVisualConfig('defaultAggregated', true);- if (aggregate) {- this.setFieldAggregator(ch, this.draggableFieldState[ch].length - 1, vlSpec.encoding[ch].aggregate);- }- }- }- });- ['x', 'y', 'facet'].forEach((ch) => {- if (vlSpec.encoding[ch] && vlSpec.encoding[ch].sort) {- this.applyDefaultSort(sortValueTransform(vlSpec.encoding[ch].sort));- }- });- if (vlSpec.encoding.order && vlSpec.encoding.order.sort) {- this.applyDefaultSort(sortValueTransform(vlSpec.encoding.order.sort));- }- };- if (vlStruct.encoding && vlStruct.mark) {- renderVLFacet(vlStruct.encoding);- renderVLSpec(vlStruct);- } else if (vlStruct.spec) {- if (vlStruct.facet) {- renderVLFacet(vlStruct.facet);- }- renderVLSpec(vlStruct.spec);- }+ importOld(data: IVisSpecForExport[]) {+ this.visList = visSpecDecoder(forwardVisualConfigs(data)).map(convertChart).map(fromSnapshot);+ this.visIndex = 0;}- public renderSpec(spec: Specification) {- const tab = this.visList[this.visIndex];-- if (tab) {- const fields = tab.encodings.dimensions.concat(tab.encodings.measures);- // thi- // const [xField, yField, ] = spec.position;- this.clearState();- this.setVisualConfig('defaultAggregated', Boolean(spec.aggregate));- if ((spec.geomType?.length ?? 0) > 0) {- this.setVisualConfig(- 'geoms',- spec.geomType!.map((g) => geomAdapter(g))- );- }- if ((spec.facets?.length ?? 0) > 0) {- const facets = (spec.facets || []).concat(spec.highFacets || []);- for (let facet of facets) {- this.appendField(- 'rows',- fields.find((f) => f.fid === facet)- );- }- }- if (spec.position) {- const [cols, rows] = spec.position;- if (cols)- this.appendField(- 'columns',- fields.find((f) => f.fid === cols)- );- if (rows)- this.appendField(- 'rows',- fields.find((f) => f.fid === rows)- );- }- if ((spec.color?.length ?? 0) > 0) {- this.appendField(- 'color',- fields.find((f) => f.fid === spec.color![0])- );- }- if ((spec.size?.length ?? 0) > 0) {- this.appendField(- 'size',- fields.find((f) => f.fid === spec.size![0])- );- }- if ((spec.opacity?.length ?? 0) > 0) {- this.appendField(- 'opacity',- fields.find((f) => f.fid === spec.opacity![0])- );- }- }++ appendFromOld(data: IVisSpecForExport) {+ const newChart = fromSnapshot(convertChart(visSpecDecoder(forwardVisualConfigs([data]))[0]));+ this.visList.push(newChart);+ this.visIndex = this.visList.length - 1;}- public destroy() {- this.reactions.forEach((rec) => {- rec();- });++ replaceNow(chart: IChart) {+ this.visList[this.visIndex] = fromSnapshot(chart);}- public exportAsRaw() {- const pureVisList = dumpsGWPureSpec(this.visList);- return stringifyGWContent({- datasets: toJS(this.commonStore.datasets),- dataSources: this.commonStore.dataSources,- specList: this.visSpecEncoder(pureVisList),- });++ selectVisualization(index: number) {+ this.visIndex = index;+ }++ setShowDataConfig(show: boolean) {+ this.showDataConfig = show;}- public exportViewSpec() {- const pureVisList = dumpsGWPureSpec(this.visList);- return this.visSpecEncoder(pureVisList);+ setShowInsightBoard(show: boolean) {+ this.showInsightBoard = show;}- public importStoInfo(stoInfo: IStoInfo) {- this.visList = parseGWPureSpec(visSpecDecoder(forwardVisualConfigs(stoInfo.specList)));- this.visIndex = 0;- this.commonStore.datasets = stoInfo.datasets;- this.commonStore.dataSources = stoInfo.dataSources;- this.commonStore.dsIndex = Math.max(stoInfo.datasets.length - 1, 0);+ showEmbededMenu(position: [number, number]) {+ this.vizEmbededMenu.show = true;+ this.vizEmbededMenu.position = position;+ }+ setShowCodeExportPanel(show: boolean) {+ this.showCodeExportPanel = show;+ }+ setShowVisualConfigPanel(show: boolean) {+ this.showVisualConfigPanel = show;+ }+ closeEmbededMenu() {+ this.vizEmbededMenu.show = false;}- public importRaw(raw: string) {- const content = parseGWContent(raw);- this.importStoInfo(content);+ setFilters(props: Filters) {+ this.filters = props;}- public setGeographicUrl(geoUrl: IGeoUrl) {- this.useMutable(({ config }) => {- config.geoUrl = geoUrl;- });+ updateCurrentDatasetMetas(fid: string, diffMeta: Partial<IMutField>) {+ const field = this.meta.find((f) => f.fid === fid);+ if (field) {+ for (let mk in diffMeta) {+ field[mk] = diffMeta[mk];+ }+ }+ this.onMetaChange?.(fid, diffMeta);}- public clearGeographicData() {- this.useMutable(({ config }) => {- config.geojson = undefined;- config.geoKey = undefined;- config.geoUrl = undefined;- });+ openRemoveConfirmModal(index: number) {+ this.removeConfirmIdx = index;}- public setGeographicData(data: IGeographicData, geoKey: string, geoUrl?: IGeoUrl) {+ closeRemoveConfirmModal() {+ this.removeConfirmIdx = null;+ }++ setGeographicData(data: IGeographicData, geoKey: string, geoUrl?: IGeoUrl) {const geoJSON =data.type === 'GeoJSON' ? data.data : (feature(data.data, data.objectKey || Object.keys(data.data.objects)[0]) as unknown as FeatureCollection);if (!('features' in geoJSON)) {console.error('Invalid GeoJSON: GeoJSON must be a FeatureCollection, but got', geoJSON);return;}- this.useMutable(({ config }) => {- config.geojson = geoJSON;- config.geoKey = geoKey;- config.geoUrl = geoUrl;- });+ this.localGeoJSON = geoJSON;+ if (geoUrl) {+ this.visList[this.visIndex] = performers.setGeoData(this.visList[this.visIndex], undefined, geoKey, geoUrl);+ } else {+ this.visList[this.visIndex] = performers.setGeoData(this.visList[this.visIndex], geoJSON, geoKey, undefined);+ }}- public updateGeoKey(key: string) {- this.useMutable(({ config }) => {- config.geoKey = key;- });++ clearGeographicData() {+ this.visList[this.visIndex] = performers.setGeoData(this.visList[this.visIndex], undefined, undefined, undefined);+ }++ changeSemanticType(stateKey: keyof Omit<DraggableFieldState, 'filters'>, index: number, semanticType: ISemanticType) {+ this.visList[this.visIndex] = performers.changeSemanticType(this.visList[this.visIndex], stateKey, index, semanticType);+ }++ updateGeoKey(key: string) {+ this.setVisualLayout('geoKey', key);}- private visSpecEncoder(visList: IVisSpec[]): IVisSpecForExport[] {- const updatedVisList = visList.map((visSpec) => {- const updatedFilters = visSpec.encodings.filters.map((filter) => {- if (filter.rule?.type === 'one of') {- const rule = {- ...filter.rule,- value: Array.from(filter.rule.value),- };- return {- ...filter,- rule,- };- }- return filter as IFilterFieldForExport;- });- return {- ...visSpec,- encodings: {- ...visSpec.encodings,- filters: updatedFilters,- },- config: {- ...visSpec.config,- geojson: visSpec.config.geoUrl ? undefined : visSpec.config.geojson,- },- };+ updateTableCollapsedHeader(node: INestNode) {+ const { uniqueKey, height } = node;+ if (height < 1) return;+ const updatedMap = new Map(this.tableCollapsedHeaderMap);+ // if some child nodes of the incoming node are collapsed, remove them first+ updatedMap.forEach((existingPath, existingKey) => {+ if (existingKey.startsWith(uniqueKey) && existingKey.length > uniqueKey.length) {+ updatedMap.delete(existingKey);+ }});- return updatedVisList;+ if (!updatedMap.has(uniqueKey)) {+ updatedMap.set(uniqueKey, node.path);+ } else {+ updatedMap.delete(uniqueKey);+ }+ this.tableCollapsedHeaderMap = updatedMap;}- public get limit() {- return this.visualConfig.limit;++ resetTableCollapsedHeader() {+ const updatedMap: Map<string, INestNode['path']> = new Map();+ this.tableCollapsedHeaderMap = updatedMap;}- public setLimit(value: number) {- this.setVisualConfig('limit', value);+ setShowGeoJSONConfigPanel(show: boolean) {+ this.showGeoJSONConfigPanel = show;}- public get sort() {- return getSort(this.draggableFieldState);+ setShowBinSettingPanel(show: boolean) {+ this.showBinSettingPanel = show;}- public getWorkflow() {- return toWorkflow(- this.viewFilters,- this.allFields,- this.viewDimensions,- this.viewMeasures,- this.visualConfig.defaultAggregated,- this.sort,- this.visualConfig.folds ?? [],- this.limit > 0 ? this.limit : undefined- );+ setShowLogSettingPanel(show: boolean) {+ this.showLogSettingPanel = show;+ }++ setCreateField(field: ICreateField) {+ this.createField = field;+ }++ updateSelectedMarkObject(newMarkObj: Record<string, string | number | undefined>) {+ this.selectedMarkObject = newMarkObj;+ }++ updateShowErrorResolutionPanel(errCode: number) {+ this.showErrorResolutionPanel = errCode;+ }+}++export function renderSpec(spec: Specification, meta: IMutField[], name: string, visId: string) {+ const chart = newChart(meta, name, visId);+ const fields = chart.encodings.dimensions.concat(chart.encodings.measures);+ chart.config.defaultAggregated = Boolean(spec.aggregate);+ if ((spec.geomType?.length ?? 0) > 0) {+ chart.config.geoms = spec.geomType?.map((g) => geomAdapter(g)) ?? ['tick'];+ }+ if ((spec.facets?.length ?? 0) > 0) {+ const facets = (spec.facets || []).concat(spec.highFacets || []);+ for (let facet of facets) {+ const f = fields.find((f) => f.fid === facet);+ f && chart.encodings.rows.push(f);+ }+ }+ if (spec.position) {+ const [cols, rows] = spec.position;+ if (cols) {+ const f = fields.find((f) => f.fid === cols);+ f && chart.encodings.columns.push(f);+ }+ if (rows) {+ const f = fields.find((f) => f.fid === rows);+ f && chart.encodings.rows.push(f);+ }+ }+ if (spec.color && spec.color.length > 0) {+ const color = spec.color[0];+ const f = fields.find((f) => f.fid === color);+ f && chart.encodings.color.push(f);}+ if (spec.size && spec.size.length > 0) {+ const size = spec.size[0];+ const f = fields.find((f) => f.fid === size);+ f && chart.encodings.size.push(f);+ }+ if (spec.opacity && spec.opacity.length > 0) {+ const opacity = spec.opacity[0];+ const f = fields.find((f) => f.fid === opacity);+ f && chart.encodings.opacity.push(f);+ }+ return chart;+}- public setComputationFunction(f: IComputationFunction, timeout = 60000) {- this.computationFunction = withTimeout(f, timeout);+function geomAdapter(geom: string) {+ switch (geom) {+ case 'interval':+ case 'bar':+ return 'bar';+ case 'line':+ return 'line';+ case 'boxplot':+ return 'boxplot';+ case 'area':+ return 'area';+ case 'point':+ return 'point';+ case 'arc':+ return 'arc';+ case 'circle':+ return 'circle';+ case 'heatmap':+ return 'circle';+ case 'rect':+ return 'rect';+ case 'tick':+ default:+ return 'tick';}}diff --git a/packages/graphic-walker/src/utils/filter.ts b/packages/graphic-walker/src/utils/filter.tsnew file mode 100644index 00000000..7afa3126--- /dev/null+++ b/packages/graphic-walker/src/utils/filter.ts@@ -0,0 +1,22 @@+import { IFilterRule, SetToArray } from '../interfaces';++export function encodeFilterRule(rule: IFilterRule | null): SetToArray<IFilterRule> | null {+ if (!rule) return null;+ if (rule.type === 'one of') {+ return {+ ...rule,+ value: [...rule.value],+ };+ }+ return rule;+}+export function decodeFilterRule(rule: SetToArray<IFilterRule> | null): IFilterRule | null {+ if (!rule) return null;+ if (rule.type === 'one of') {+ return {+ ...rule,+ value: new Set(rule.value),+ };+ }+ return rule;+}diff --git a/packages/graphic-walker/src/utils/index.ts b/packages/graphic-walker/src/utils/index.tsindex 257a3f9a..083e174f 100644--- a/packages/graphic-walker/src/utils/index.ts+++ b/packages/graphic-walker/src/utils/index.ts@@ -294,7 +294,6 @@ export function getMeaAggKey(meaKey: string, agg?: string | undefined) {}return `${meaKey}_${agg}`;}-export function getSort({ rows, columns }: { rows: readonly IViewField[]; columns: readonly IViewField[] }) {if (rows.length && !rows.find((x) => x.analyticType === 'measure')) {return rows[rows.length - 1].sort || 'none';@@ -304,3 +303,15 @@ export function getSort({ rows, columns }: { rows: readonly IViewField[]; column}return 'none';}++const defaultValueComparator = (a: any, b: any) => {+ if (typeof a === 'number' && typeof b === 'number') {+ return a - b;+ } else {+ return String(a).localeCompare(String(b));+ }+};++export function parseCmpFunction(str?: string): (a: any, b: any) => number {+ return defaultValueComparator;+}diff --git a/packages/graphic-walker/src/utils/save.ts b/packages/graphic-walker/src/utils/save.tsindex 63107294..de4513e8 100644--- a/packages/graphic-walker/src/utils/save.ts+++ b/packages/graphic-walker/src/utils/save.ts@@ -1,16 +1,6 @@-import { DraggableFieldState, IDataSet, IDataSource, IVisSpec, IVisSpecForExport, IVisualConfig } from "../interfaces";-import { VisSpecWithHistory } from "../models/visSpecHistory";-import { toJS } from 'mobx';+import { DraggableFieldState, IDataSet, IDataSource, IMutField, IVisSpec, IVisSpecForExport, IVisualConfig, IVisualConfigNew, IVisualLayout } from '../interfaces';import { GLOBAL_CONFIG } from '../config';-export function dumpsGWPureSpec(list: VisSpecWithHistory[]): IVisSpec[] {- return list.map((l) => l.exportGW());-}--export function parseGWPureSpec(list: IVisSpec[]): VisSpecWithHistory[] {- return list.map((l) => new VisSpecWithHistory(l));-}-export function initEncoding(): DraggableFieldState {return {dimensions: [],@@ -25,7 +15,7 @@ export function initEncoding(): DraggableFieldState {theta: [],longitude: [],latitude: [],- geoId: [],+ geoId: [],details: [],filters: [],text: [],@@ -33,7 +23,7 @@ export function initEncoding(): DraggableFieldState {}export function initVisualConfig(): IVisualConfig {- const [ geom ] = GLOBAL_CONFIG.GEMO_TYPES.generic;+ const [ geom ] = GLOBAL_CONFIG.GEOM_TYPES.generic;return {defaultAggregated: true,geoms: [geom],@@ -47,7 +37,7 @@ export function initVisualConfig(): IVisualConfig {scaleIncludeUnmatchedChoropleth: false,background: undefined,size: {- mode: "auto",+ mode: 'auto',width: 320,height: 200,},@@ -69,6 +59,60 @@ export function initVisualConfig(): IVisualConfig {};}+export const emptyVisualLayout: IVisualLayout = {+ showActions: false,+ showTableSummary: false,+ stack: 'stack',+ interactiveScale: false,+ zeroScale: true,+ background: undefined,+ size: {+ mode: 'auto',+ width: 320,+ height: 200,+ },+ format: {+ numberFormat: undefined,+ timeFormat: undefined,+ normalizedNumberFormat: undefined,+ },+ geoKey: 'name',+ resolve: {+ x: false,+ y: false,+ color: false,+ opacity: false,+ shape: false,+ size: false,+ },+};++export const emptyVisualConfig: IVisualConfigNew = {+ defaultAggregated: true,+ geoms: [GLOBAL_CONFIG.GEOM_TYPES.generic[0]],+ coordSystem: 'generic',+ limit: -1,+};++export const emptyEncodings: DraggableFieldState = {+ dimensions: [],+ measures: [],+ rows: [],+ columns: [],+ color: [],+ opacity: [],+ size: [],+ shape: [],+ radius: [],+ theta: [],+ longitude: [],+ latitude: [],+ geoId: [],+ details: [],+ filters: [],+ text: [],+};+export function visSpecDecoder(visList: IVisSpecForExport[]): IVisSpec[] {const updatedVisList = visList.map((visSpec) => {const updatedFilters = visSpec.encodings.filters.map((filter) => {@@ -95,7 +139,7 @@ export function visSpecDecoder(visList: IVisSpecForExport[]): IVisSpec[] {return updatedVisList;}-export const forwardVisualConfigs = (backwards: ReturnType<typeof parseGWContent>['specList']): IVisSpecForExport[] => {+export const forwardVisualConfigs = (backwards: IStoInfoOld['specList']): IVisSpecForExport[] => {return backwards.map((content) => ({...content,config: {@@ -105,30 +149,27 @@ export const forwardVisualConfigs = (backwards: ReturnType<typeof parseGWContent}));};-export function resolveSpecFromStoInfo(info: IStoInfo) {- const spec = parseGWPureSpec(visSpecDecoder(forwardVisualConfigs(info.specList)))[0];- return {- config: toJS(spec.config) as IVisualConfig,- encodings: toJS(spec.encodings) as DraggableFieldState,- name: spec.name,- };+export const resolveVisSpec = (a: IVisSpecForExport[]): IVisSpec[] => {+ return visSpecDecoder(forwardVisualConfigs(a))}-export interface IStoInfo {+export interface IStoInfoOld {+ $schema: undefined;datasets: IDataSet[];- specList: {- [K in keyof IVisSpecForExport]: K extends 'config' ? Partial<IVisSpecForExport[K]> : IVisSpecForExport[K];- }[];+ specList: IVisSpecForExport[];dataSources: IDataSource[];}-export function stringifyGWContent(info: IStoInfo) {- return JSON.stringify(info);-}+export const IStoInfoV2SchemaUrl = 'https://graphic-walker.kanaries.net/stoinfo_v2.json';-export function parseGWContent(raw: string): IStoInfo {- return JSON.parse(raw);-}+export interface IStoInfoV2 {+ $schema: typeof IStoInfoV2SchemaUrl,+ metaDict: Record<string, IMutField[]>,+ datasets: Required<IDataSource>[],+ specDict: Record<string, string[]>,+};++export type IStoInfo = IStoInfoOld | IStoInfoV2;export function download(data: string, filename: string, type: string) {var file = new Blob([data], { type: type });diff --git a/packages/graphic-walker/src/utils/workflow.ts b/packages/graphic-walker/src/utils/workflow.tsindex ba06115e..fb3e7749 100644--- a/packages/graphic-walker/src/utils/workflow.ts+++ b/packages/graphic-walker/src/utils/workflow.ts@@ -48,7 +48,7 @@ export const toWorkflow = (allFields: Omit<IViewField, 'dragId'>[],viewDimensionsRaw: Omit<IViewField, 'dragId'>[],viewMeasuresRaw: Omit<IViewField, 'dragId'>[],- defaultAggregated: VizSpecStore['visualConfig']['defaultAggregated'],+ defaultAggregated: VizSpecStore['config']['defaultAggregated'],sort: 'none' | 'ascending' | 'descending',folds = [] as string[],limit?: numberdiff --git a/packages/graphic-walker/src/vanilla.tsx b/packages/graphic-walker/src/vanilla.tsxindex a4298e2a..1b1ce985 100644--- a/packages/graphic-walker/src/vanilla.tsx+++ b/packages/graphic-walker/src/vanilla.tsx@@ -2,11 +2,11 @@ import React from 'react';import ReactDOM from 'react-dom';import { GraphicWalker } from './index';-import { IGWProps } from './App';+import { IGWProps } from './FullApp';-export function embedGraphicWalker (dom: HTMLElement | null, props: IGWProps | undefined = {}) {+export function embedGraphicWalker(dom: HTMLElement | null, props: IGWProps | undefined = {}) {if (!dom) {- throw("DOM element not found.")+ throw 'DOM element not found.';}// Example: Detect if Concurrent Mode is availableconst isConcurrentModeAvailable = 'createRoot' in ReactDOM;@@ -14,7 +14,9 @@ export function embedGraphicWalker (dom: HTMLElement | null, props: IGWProps | u// Use the new ReactDOM.createRoot API if available, otherwise fall back to the old ReactDOM.render APIif (isConcurrentModeAvailable) {if (import.meta.env.DEV) {- console.warn('React 18+ detected, remove strict mode if you meet drag and drop issue. more info at https://docs.kanaries.net/graphic-walker/faq/graphic-walker-react-18')+ console.warn(+ 'React 18+ detected, remove strict mode if you meet drag and drop issue. more info at https://docs.kanaries.net/graphic-walker/faq/graphic-walker-react-18'+ );}// @ts-ignoreconst root = ReactDOM.createRoot(dom as HTMLElement);diff --git a/packages/graphic-walker/src/visualSettings/index.tsx b/packages/graphic-walker/src/visualSettings/index.tsxindex 345ecdb1..e5eb78e9 100644--- a/packages/graphic-walker/src/visualSettings/index.tsx+++ b/packages/graphic-walker/src/visualSettings/index.tsx@@ -32,7 +32,7 @@ import styled from 'styled-components';import { useTranslation } from 'react-i18next';import { ResizeDialog } from '../components/sizeSetting';import { GLOBAL_CONFIG } from '../config';-import { useGlobalStore } from '../store';+import { useVizStore } from '../store';import { IStackMode, IDarkMode } from '../interfaces';import { IReactVegaHandler } from '../vis/react-vega';import Toolbar, { ToolbarItemProps } from '../components/toolbar';@@ -74,28 +74,25 @@ interface IVisualSettings {extra?: ToolbarItemProps[];}-const VisualSettings: React.FC<IVisualSettings> = ({- rendererHandler,- darkModePreference,- csvHandler,- extra = [],- exclude = [],-}) => {- const { vizStore, commonStore } = useGlobalStore();- const { visualConfig, canUndo, canRedo, limit } = vizStore;+const VisualSettings: React.FC<IVisualSettings> = ({ rendererHandler, darkModePreference, csvHandler, extra = [], exclude = [] }) => {+ const vizStore = useVizStore();+ const { config, layout, canUndo, canRedo, limit } = vizStore;const { t: tGlobal } = useTranslation();const { t } = useTranslation('translation', { keyPrefix: 'main.tabpanel.settings' });const {defaultAggregated,+ coordSystem = 'generic',geoms: [markType],+ } = config;++ const {showTableSummary,- coordSystem = 'generic',stack,interactiveScale,size: { mode: sizeMode, width, height },showActions,- } = visualConfig;+ } = layout;const downloadPNG = useCallback(throttle(() => {@@ -137,12 +134,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({<><ArrowUturnLeftIcon /><Invisible aria-hidden>- <ButtonWithShortcut- label="undo"- disabled={!canUndo}- handler={vizStore.undo.bind(vizStore)}- shortcut="Ctrl+Z"- />+ <ButtonWithShortcut label="undo" disabled={!canUndo} handler={vizStore.undo.bind(vizStore)} shortcut="Ctrl+Z" /></Invisible></>),@@ -156,12 +148,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({<><ArrowUturnRightIcon /><Invisible aria-hidden>- <ButtonWithShortcut- label="redo"- disabled={!canRedo}- handler={vizStore.redo.bind(vizStore)}- shortcut="Ctrl+Shift+Z"- />+ <ButtonWithShortcut label="redo" disabled={!canRedo} handler={vizStore.redo.bind(vizStore)} shortcut="Ctrl+Shift+Z" /></Invisible></>),@@ -187,7 +174,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({color: 'rgb(294,115,22)',},},- options: GLOBAL_CONFIG.GEMO_TYPES[coordSystem].map((g) => ({+ options: GLOBAL_CONFIG.GEOM_TYPES[coordSystem].map((g) => ({key: g,label: tGlobal(`constant.mark_type.${g}`),icon: {@@ -254,11 +241,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({aria-hidden{...props}>- <path- strokeLinecap="round"- strokeLinejoin="round"- d="M9,12 A3,3,0,0,1,16,12 A3,3,0,0,1,9,12"- />+ <path strokeLinecap="round" strokeLinejoin="round" d="M9,12 A3,3,0,0,1,16,12 A3,3,0,0,1,9,12" /></svg>),circle: (props: SVGProps<SVGSVGElement>) => (@@ -271,11 +254,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({aria-hidden{...props}>- <path- strokeLinecap="round"- strokeLinejoin="round"- d="M6,12 A6,6,0,0,1,18,12 A6,6,0,0,1,6,12"- />+ <path strokeLinecap="round" strokeLinejoin="round" d="M6,12 A6,6,0,0,1,18,12 A6,6,0,0,1,6,12" /></svg>),tick: (props: SVGProps<SVGSVGElement>) => (@@ -331,11 +310,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({aria-hidden{...props}>- <path- strokeLinecap="round"- strokeLinejoin="round"- d="M12,21l-9,-15a12,12,0,0,1,18,0Z"- />+ <path strokeLinecap="round" strokeLinejoin="round" d="M12,21l-9,-15a12,12,0,0,1,18,0Z" /></svg>),boxplot: (props: SVGProps<SVGSVGElement>) => (@@ -348,11 +323,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({aria-hidden{...props}>- <path- strokeLinecap="round"- strokeLinejoin="round"- d="M7,7v9h10v-9Zm0,4h8M12,7v-6m-3,0h6M12,16v7m-3,0h6"- />+ <path strokeLinecap="round" strokeLinejoin="round" d="M7,7v9h10v-9Zm0,4h8M12,7v-6m-3,0h6M12,16v7m-3,0h6" /></svg>),table: (props: SVGProps<SVGSVGElement>) => (@@ -397,7 +368,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({})),value: stack,onSelect: (value) => {- vizStore.setVisualConfig('stack', value as IStackMode);+ vizStore.setVisualLayout('stack', value as IStackMode);},},'-',@@ -425,7 +396,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({icon: TableCellsIcon,checked: showTableSummary,onChange: checked => {- vizStore.setVisualConfig('showTableSummary', checked);+ vizStore.setVisualLayout('showTableSummary', checked);},},'-',@@ -435,7 +406,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({icon: ChevronUpDownIcon,checked: interactiveScale,onChange: (checked) => {- vizStore.setVisualConfig('interactiveScale', checked);+ vizStore.setVisualLayout('interactiveScale', checked);},},{@@ -449,7 +420,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({})),value: sizeMode,onSelect: (key) => {- vizStore.setChartLayout({ mode: key as 'fixed' | 'auto' });+ vizStore.setVisualLayout('size', { ...layout.size, mode: key as 'fixed' | 'auto' });},form: (<FormContainer>@@ -457,15 +428,17 @@ const VisualSettings: React.FC<IVisualSettings> = ({width={width}height={height}onHeightChange={(v) => {- vizStore.setChartLayout({+ vizStore.setVisualLayout('size', {mode: 'fixed',height: v,+ width: layout.size.width});}}onWidthChange={(v) => {- vizStore.setChartLayout({+ vizStore.setVisualLayout('size', {mode: 'fixed',width: v,+ height: layout.size.height});}}/>@@ -488,8 +461,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({value: coordSystem,onSelect: value => {const coord = value as typeof GLOBAL_CONFIG.COORD_TYPES[number];- vizStore.setVisualConfig('coordSystem', coord);- vizStore.setVisualConfig('geoms', [GLOBAL_CONFIG.GEMO_TYPES[coord][0]]);+ vizStore.setCoordSystem(coord);},},coordSystem === 'geographic' && markType === 'choropleth' && {@@ -497,7 +469,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({label: t('button.geojson'),icon: GlobeAmericasIcon,onClick: () => {- commonStore.setShowGeoJSONConfigPanel(true);+ vizStore.setShowGeoJSONConfigPanel(true);},},'-',@@ -507,7 +479,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({icon: WrenchIcon,checked: showActions,onChange: (checked) => {- vizStore.setVisualConfig('showActions', checked);+ vizStore.setVisualLayout('showActions', checked);},},...coordSystem === 'generic' ?[{@@ -518,9 +490,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({<FormContainer className={dark ? 'dark' : ''}><buttonclassName={`text-xs pt-1 pb-1 pl-6 pr-6 ${- dark- ? 'dark bg-zinc-900 text-gray-100 hover:bg-gray-700'- : 'bg-white hover:bg-gray-200 text-gray-800'+ dark ? 'dark bg-zinc-900 text-gray-100 hover:bg-gray-700' : 'bg-white hover:bg-gray-200 text-gray-800'}`}aria-label={t('button.export_chart_as', { type: 'png' })}onClick={() => downloadPNG()}@@ -529,9 +499,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({</button><buttonclassName={`text-xs pt-1 pb-1 pl-6 pr-6 ${- dark- ? 'dark bg-zinc-900 text-gray-100 hover:bg-gray-700'- : 'bg-white hover:bg-gray-200 text-gray-800'+ dark ? 'dark bg-zinc-900 text-gray-100 hover:bg-gray-700' : 'bg-white hover:bg-gray-200 text-gray-800'}`}aria-label={t('button.export_chart_as', { type: 'svg' })}onClick={() => downloadSVG()}@@ -563,7 +531,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({label: t('button.config'),icon: Cog6ToothIcon,onClick: () => {- commonStore.setShowVisualConfigPanel(true);+ vizStore.setShowVisualConfigPanel(true);},},{@@ -571,7 +539,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({label: t('button.export_code'),icon: CodeBracketSquareIcon,onClick: () => {- commonStore.setShowCodeExportPanel(true);+ vizStore.setShowCodeExportPanel(true);},},...(extra.length === 0 ? [] : ['-', ...extra]),@@ -585,7 +553,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({<LimitSettingvalue={limit}setValue={(v) => {- vizStore.setLimit(v);+ vizStore.setVisualConfig('limit', v);}}/></FormContainer>@@ -613,7 +581,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({const items = builtInItems.filter((item) => typeof item === 'string' || !exclude.includes(item.key));- switch (vizStore.visualConfig.geoms[0]) {+ switch (vizStore.config.geoms[0]) {case 'table':return items;default:@@ -638,6 +606,7 @@ const VisualSettings: React.FC<IVisualSettings> = ({extra,exclude,limit,+ showTableSummary,]);return (diff --git a/packages/graphic-walker/src/visualSettings/menubar.tsx b/packages/graphic-walker/src/visualSettings/menubar.tsxindex f51d1b3e..e86f9c4c 100644--- a/packages/graphic-walker/src/visualSettings/menubar.tsx+++ b/packages/graphic-walker/src/visualSettings/menubar.tsx@@ -3,7 +3,7 @@ import React from 'react';import styled from 'styled-components'import { ArrowUturnLeftIcon, ArrowUturnRightIcon } from '@heroicons/react/24/solid';import { useTranslation } from 'react-i18next';-import { useGlobalStore } from '../store';+import { useVizStore } from '../store';export const MenubarContainer = styled.div({@@ -83,7 +83,7 @@ export const ButtonWithShortcut: React.FC<ButtonWithShortcutProps> = ({ label, s};const Menubar: React.FC = () => {- const { vizStore } = useGlobalStore();+ const vizStore = useVizStore();const { canUndo, canRedo } = vizStore;return (diff --git a/packages/graphic-walker/src/workers/filter.worker.ts b/packages/graphic-walker/src/workers/filter.worker.tsnew file mode 100644index 00000000..6151280e--- /dev/null+++ b/packages/graphic-walker/src/workers/filter.worker.ts@@ -0,0 +1,12 @@+import { IRow, IFilterFiledSimple } from '../interfaces';+import { filter } from '../lib/filter';++const main = (e: { data: { dataSource: IRow[]; filters: IFilterFiledSimple[] } }) => {+ const { dataSource, filters } = e.data;++ const filtered = filter(dataSource, filters);++ self.postMessage(filtered);+};++self.addEventListener('message', main, false);diff --git a/packages/graphic-walker/src/workers/sort.worker.ts b/packages/graphic-walker/src/workers/sort.worker.tsindex d0abe410..1c8ca028 100644--- a/packages/graphic-walker/src/workers/sort.worker.ts+++ b/packages/graphic-walker/src/workers/sort.worker.ts@@ -1,5 +1,5 @@import { IRow } from '../interfaces';-import { sortBy } from './sort';+import { sortBy } from '../lib/sort';const main = (e: {data: {diff --git a/packages/graphic-walker/src/workers/transform.worker.js b/packages/graphic-walker/src/workers/transform.worker.jsdeleted file mode 100644index 97184166..00000000--- a/packages/graphic-walker/src/workers/transform.worker.js+++ /dev/null@@ -1,13 +0,0 @@-import { transformData } from './transform'-const main = e => {- const { dataSource, trans } = e.data;-- try {- const ans = transformData(dataSource, trans);- self.postMessage(ans);- } catch (error) {- self.postMessage({ error: error.message });- }-};--self.addEventListener('message', main, false);\ No newline at end of filediff --git a/packages/graphic-walker/src/workers/transform.worker.ts b/packages/graphic-walker/src/workers/transform.worker.tsnew file mode 100644index 00000000..d4110f47--- /dev/null+++ b/packages/graphic-walker/src/workers/transform.worker.ts@@ -0,0 +1,15 @@+import { IRow, IFieldTransform } from '../interfaces';+import { transformData } from '../lib/transform';++const main = (e: { data: { dataSource: IRow[]; trans: IFieldTransform[] } }) => {+ const { dataSource, trans } = e.data;++ try {+ const ans = transformData(dataSource, trans);+ self.postMessage(ans);+ } catch (error: any) {+ self.postMessage({ error: error.message });+ }+};++self.addEventListener('message', main, false);diff --git a/packages/graphic-walker/src/workers/viewQuery.worker.js b/packages/graphic-walker/src/workers/viewQuery.worker.tssimilarity index 57%rename from packages/graphic-walker/src/workers/viewQuery.worker.jsrename to packages/graphic-walker/src/workers/viewQuery.worker.tsindex 7cbe5807..e4e55338 100644--- a/packages/graphic-walker/src/workers/viewQuery.worker.js+++ b/packages/graphic-walker/src/workers/viewQuery.worker.ts@@ -1,13 +1,12 @@-import { queryView } from '../lib/viewQuery'-const main = e => {+import { IRow, IViewQuery } from '../interfaces';+import { queryView } from '../lib/viewQuery';++const main = (e: { data: { dataSource: IRow[]; query: IViewQuery } }) => {try {const { dataSource, query } = e.data;const ans = queryView(dataSource, query);self.postMessage(ans);-- } catch (err) {- // console.log(err.s)- // log err stack+ } catch (err: any) {console.error(err.stack);self.postMessage(err.stack);}diff --git a/yarn.lock b/yarn.lockindex 21e398f5..3e83f959 100644--- a/yarn.lock+++ b/yarn.lock@@ -10,6 +10,14 @@"@jridgewell/gen-mapping" "^0.1.0""@jridgewell/trace-mapping" "^0.3.9"+"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3"+ integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==+ dependencies:+ "@babel/highlight" "^7.22.10"+ chalk "^2.4.2"+"@babel/code-frame@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a"@@ -22,6 +30,32 @@resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298"integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==+"@babel/compat-data@^7.22.9":+ version "7.22.9"+ resolved "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730"+ integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==++"@babel/core@^7.11.6", "@babel/core@^7.12.3":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/core/-/core-7.22.10.tgz#aad442c7bcd1582252cb4576747ace35bc122f35"+ integrity sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==+ dependencies:+ "@ampproject/remapping" "^2.2.0"+ "@babel/code-frame" "^7.22.10"+ "@babel/generator" "^7.22.10"+ "@babel/helper-compilation-targets" "^7.22.10"+ "@babel/helper-module-transforms" "^7.22.9"+ "@babel/helpers" "^7.22.10"+ "@babel/parser" "^7.22.10"+ "@babel/template" "^7.22.5"+ "@babel/traverse" "^7.22.10"+ "@babel/types" "^7.22.10"+ convert-source-map "^1.7.0"+ debug "^4.1.0"+ gensync "^1.0.0-beta.2"+ json5 "^2.2.2"+ semver "^6.3.1"+"@babel/core@^7.19.6", "@babel/core@^7.20.12":version "7.21.0"resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.0.tgz#1341aefdcc14ccc7553fcc688dd8986a2daffc13"@@ -53,6 +87,16 @@"@jridgewell/trace-mapping" "^0.3.17"jsesc "^2.5.1"+"@babel/generator@^7.22.10", "@babel/generator@^7.7.2":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722"+ integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==+ dependencies:+ "@babel/types" "^7.22.10"+ "@jridgewell/gen-mapping" "^0.3.2"+ "@jridgewell/trace-mapping" "^0.3.17"+ jsesc "^2.5.1"+"@babel/helper-annotate-as-pure@^7.16.0", "@babel/helper-annotate-as-pure@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb"@@ -71,11 +115,27 @@lru-cache "^5.1.1"semver "^6.3.0"+"@babel/helper-compilation-targets@^7.22.10":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz#01d648bbc25dd88f513d862ee0df27b7d4e67024"+ integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==+ dependencies:+ "@babel/compat-data" "^7.22.9"+ "@babel/helper-validator-option" "^7.22.5"+ browserslist "^4.21.9"+ lru-cache "^5.1.1"+ semver "^6.3.1"+"@babel/helper-environment-visitor@^7.18.9":version "7.18.9"resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be"integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==+"@babel/helper-environment-visitor@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98"+ integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==+"@babel/helper-function-name@^7.21.0":version "7.21.0"resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4"@@ -84,6 +144,14 @@"@babel/template" "^7.20.7""@babel/types" "^7.21.0"+"@babel/helper-function-name@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be"+ integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==+ dependencies:+ "@babel/template" "^7.22.5"+ "@babel/types" "^7.22.5"+"@babel/helper-hoist-variables@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678"@@ -91,6 +159,13 @@dependencies:"@babel/types" "^7.18.6"+"@babel/helper-hoist-variables@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb"+ integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==+ dependencies:+ "@babel/types" "^7.22.5"+"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.16.0", "@babel/helper-module-imports@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e"@@ -98,6 +173,13 @@dependencies:"@babel/types" "^7.18.6"+"@babel/helper-module-imports@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c"+ integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==+ dependencies:+ "@babel/types" "^7.22.5"+"@babel/helper-module-transforms@^7.21.0":version "7.21.2"resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2"@@ -112,6 +194,22 @@"@babel/traverse" "^7.21.2""@babel/types" "^7.21.2"+"@babel/helper-module-transforms@^7.22.9":+ version "7.22.9"+ resolved "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129"+ integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==+ dependencies:+ "@babel/helper-environment-visitor" "^7.22.5"+ "@babel/helper-module-imports" "^7.22.5"+ "@babel/helper-simple-access" "^7.22.5"+ "@babel/helper-split-export-declaration" "^7.22.6"+ "@babel/helper-validator-identifier" "^7.22.5"++"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295"+ integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==+"@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2":version "7.20.2"resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629"@@ -124,6 +222,13 @@dependencies:"@babel/types" "^7.20.2"+"@babel/helper-simple-access@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de"+ integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==+ dependencies:+ "@babel/types" "^7.22.5"+"@babel/helper-split-export-declaration@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075"@@ -131,21 +236,43 @@dependencies:"@babel/types" "^7.18.6"+"@babel/helper-split-export-declaration@^7.22.6":+ version "7.22.6"+ resolved "https://registry.npmmirror.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c"+ integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==+ dependencies:+ "@babel/types" "^7.22.5"+"@babel/helper-string-parser@^7.19.4":version "7.19.4"resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==+"@babel/helper-string-parser@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"+ integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==+"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1":version "7.19.1"resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==+"@babel/helper-validator-identifier@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193"+ integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==+"@babel/helper-validator-option@^7.18.6":version "7.21.0"resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180"integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==+"@babel/helper-validator-option@^7.22.5":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac"+ integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==+"@babel/helpers@^7.21.0":version "7.21.0"resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e"@@ -155,6 +282,15 @@"@babel/traverse" "^7.21.0""@babel/types" "^7.21.0"+"@babel/helpers@^7.22.10":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.22.10.tgz#ae6005c539dfbcb5cd71fb51bfc8a52ba63bc37a"+ integrity sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==+ dependencies:+ "@babel/template" "^7.22.5"+ "@babel/traverse" "^7.22.10"+ "@babel/types" "^7.22.10"+"@babel/highlight@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf"@@ -164,11 +300,60 @@chalk "^2.0.0"js-tokens "^4.0.0"+"@babel/highlight@^7.22.10":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.22.10.tgz#02a3f6d8c1cb4521b2fd0ab0da8f4739936137d7"+ integrity sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==+ dependencies:+ "@babel/helper-validator-identifier" "^7.22.5"+ chalk "^2.4.2"+ js-tokens "^4.0.0"++"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.22.10", "@babel/parser@^7.22.5":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55"+ integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==+"@babel/parser@^7.20.7", "@babel/parser@^7.21.0", "@babel/parser@^7.21.2":version "7.21.2"resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3"integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==+"@babel/plugin-syntax-async-generators@^7.8.4":+ version "7.8.4"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d"+ integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-bigint@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea"+ integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-class-properties@^7.8.3":+ version "7.12.13"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10"+ integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==+ dependencies:+ "@babel/helper-plugin-utils" "^7.12.13"++"@babel/plugin-syntax-import-meta@^7.8.3":+ version "7.10.4"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"+ integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==+ dependencies:+ "@babel/helper-plugin-utils" "^7.10.4"++"@babel/plugin-syntax-json-strings@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a"+ integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"+"@babel/plugin-syntax-jsx@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0"@@ -176,6 +361,69 @@dependencies:"@babel/helper-plugin-utils" "^7.18.6"+"@babel/plugin-syntax-jsx@^7.7.2":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918"+ integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==+ dependencies:+ "@babel/helper-plugin-utils" "^7.22.5"++"@babel/plugin-syntax-logical-assignment-operators@^7.8.3":+ version "7.10.4"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"+ integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==+ dependencies:+ "@babel/helper-plugin-utils" "^7.10.4"++"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"+ integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-numeric-separator@^7.8.3":+ version "7.10.4"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97"+ integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==+ dependencies:+ "@babel/helper-plugin-utils" "^7.10.4"++"@babel/plugin-syntax-object-rest-spread@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871"+ integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-optional-catch-binding@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1"+ integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-optional-chaining@^7.8.3":+ version "7.8.3"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"+ integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==+ dependencies:+ "@babel/helper-plugin-utils" "^7.8.0"++"@babel/plugin-syntax-top-level-await@^7.8.3":+ version "7.14.5"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c"+ integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==+ dependencies:+ "@babel/helper-plugin-utils" "^7.14.5"++"@babel/plugin-syntax-typescript@^7.7.2":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272"+ integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==+ dependencies:+ "@babel/helper-plugin-utils" "^7.22.5"+"@babel/plugin-transform-react-jsx-development@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz#dbe5c972811e49c7405b630e4d0d2e1380c0ddc5"@@ -231,6 +479,15 @@"@babel/parser" "^7.20.7""@babel/types" "^7.20.7"+"@babel/template@^7.22.5", "@babel/template@^7.3.3":+ version "7.22.5"+ resolved "https://registry.npmmirror.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec"+ integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==+ dependencies:+ "@babel/code-frame" "^7.22.5"+ "@babel/parser" "^7.22.5"+ "@babel/types" "^7.22.5"+"@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.4.5":version "7.21.2"resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.2.tgz#ac7e1f27658750892e815e60ae90f382a46d8e75"@@ -247,6 +504,31 @@debug "^4.1.0"globals "^11.1.0"+"@babel/traverse@^7.22.10":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa"+ integrity sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==+ dependencies:+ "@babel/code-frame" "^7.22.10"+ "@babel/generator" "^7.22.10"+ "@babel/helper-environment-visitor" "^7.22.5"+ "@babel/helper-function-name" "^7.22.5"+ "@babel/helper-hoist-variables" "^7.22.5"+ "@babel/helper-split-export-declaration" "^7.22.6"+ "@babel/parser" "^7.22.10"+ "@babel/types" "^7.22.10"+ debug "^4.1.0"+ globals "^11.1.0"++"@babel/types@^7.0.0", "@babel/types@^7.22.10", "@babel/types@^7.22.5", "@babel/types@^7.3.3":+ version "7.22.10"+ resolved "https://registry.npmmirror.com/@babel/types/-/types-7.22.10.tgz#4a9e76446048f2c66982d1a989dd12b8a2d2dc03"+ integrity sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==+ dependencies:+ "@babel/helper-string-parser" "^7.22.5"+ "@babel/helper-validator-identifier" "^7.22.5"+ to-fast-properties "^2.0.0"+"@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2":version "7.21.2"resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1"@@ -256,6 +538,11 @@"@babel/helper-validator-identifier" "^7.19.1"to-fast-properties "^2.0.0"+"@bcoe/v8-coverage@^0.2.3":+ version "0.2.3"+ resolved "https://registry.npmmirror.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"+ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==+"@emotion/is-prop-valid@^1.1.0":version "1.2.0"resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz#7f2d35c97891669f7e276eb71c83376a5dc44c83"@@ -525,6 +812,214 @@resolved "https://registry.npmmirror.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8"integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw==+"@istanbuljs/load-nyc-config@^1.0.0":+ version "1.1.0"+ resolved "https://registry.npmmirror.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"+ integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==+ dependencies:+ camelcase "^5.3.1"+ find-up "^4.1.0"+ get-package-type "^0.1.0"+ js-yaml "^3.13.1"+ resolve-from "^5.0.0"++"@istanbuljs/schema@^0.1.2":+ version "0.1.3"+ resolved "https://registry.npmmirror.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"+ integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==++"@jest/console@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/console/-/console-29.6.2.tgz#bf1d4101347c23e07c029a1b1ae07d550f5cc541"+ integrity sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w==+ dependencies:+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ chalk "^4.0.0"+ jest-message-util "^29.6.2"+ jest-util "^29.6.2"+ slash "^3.0.0"++"@jest/core@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/core/-/core-29.6.2.tgz#6f2d1dbe8aa0265fcd4fb8082ae1952f148209c8"+ integrity sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg==+ dependencies:+ "@jest/console" "^29.6.2"+ "@jest/reporters" "^29.6.2"+ "@jest/test-result" "^29.6.2"+ "@jest/transform" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ ansi-escapes "^4.2.1"+ chalk "^4.0.0"+ ci-info "^3.2.0"+ exit "^0.1.2"+ graceful-fs "^4.2.9"+ jest-changed-files "^29.5.0"+ jest-config "^29.6.2"+ jest-haste-map "^29.6.2"+ jest-message-util "^29.6.2"+ jest-regex-util "^29.4.3"+ jest-resolve "^29.6.2"+ jest-resolve-dependencies "^29.6.2"+ jest-runner "^29.6.2"+ jest-runtime "^29.6.2"+ jest-snapshot "^29.6.2"+ jest-util "^29.6.2"+ jest-validate "^29.6.2"+ jest-watcher "^29.6.2"+ micromatch "^4.0.4"+ pretty-format "^29.6.2"+ slash "^3.0.0"+ strip-ansi "^6.0.0"++"@jest/environment@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/environment/-/environment-29.6.2.tgz#794c0f769d85e7553439d107d3f43186dc6874a9"+ integrity sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q==+ dependencies:+ "@jest/fake-timers" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ jest-mock "^29.6.2"++"@jest/expect-utils@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/expect-utils/-/expect-utils-29.6.2.tgz#1b97f290d0185d264dd9fdec7567a14a38a90534"+ integrity sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg==+ dependencies:+ jest-get-type "^29.4.3"++"@jest/expect@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/expect/-/expect-29.6.2.tgz#5a2ad58bb345165d9ce0a1845bbf873c480a4b28"+ integrity sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg==+ dependencies:+ expect "^29.6.2"+ jest-snapshot "^29.6.2"++"@jest/fake-timers@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/fake-timers/-/fake-timers-29.6.2.tgz#fe9d43c5e4b1b901168fe6f46f861b3e652a2df4"+ integrity sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA==+ dependencies:+ "@jest/types" "^29.6.1"+ "@sinonjs/fake-timers" "^10.0.2"+ "@types/node" "*"+ jest-message-util "^29.6.2"+ jest-mock "^29.6.2"+ jest-util "^29.6.2"++"@jest/globals@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/globals/-/globals-29.6.2.tgz#74af81b9249122cc46f1eb25793617eec69bf21a"+ integrity sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw==+ dependencies:+ "@jest/environment" "^29.6.2"+ "@jest/expect" "^29.6.2"+ "@jest/types" "^29.6.1"+ jest-mock "^29.6.2"++"@jest/reporters@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/reporters/-/reporters-29.6.2.tgz#524afe1d76da33d31309c2c4a2c8062d0c48780a"+ integrity sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw==+ dependencies:+ "@bcoe/v8-coverage" "^0.2.3"+ "@jest/console" "^29.6.2"+ "@jest/test-result" "^29.6.2"+ "@jest/transform" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@jridgewell/trace-mapping" "^0.3.18"+ "@types/node" "*"+ chalk "^4.0.0"+ collect-v8-coverage "^1.0.0"+ exit "^0.1.2"+ glob "^7.1.3"+ graceful-fs "^4.2.9"+ istanbul-lib-coverage "^3.0.0"+ istanbul-lib-instrument "^5.1.0"+ istanbul-lib-report "^3.0.0"+ istanbul-lib-source-maps "^4.0.0"+ istanbul-reports "^3.1.3"+ jest-message-util "^29.6.2"+ jest-util "^29.6.2"+ jest-worker "^29.6.2"+ slash "^3.0.0"+ string-length "^4.0.1"+ strip-ansi "^6.0.0"+ v8-to-istanbul "^9.0.1"++"@jest/schemas@^29.6.0":+ version "29.6.0"+ resolved "https://registry.npmmirror.com/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040"+ integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==+ dependencies:+ "@sinclair/typebox" "^0.27.8"++"@jest/source-map@^29.6.0":+ version "29.6.0"+ resolved "https://registry.npmmirror.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1"+ integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==+ dependencies:+ "@jridgewell/trace-mapping" "^0.3.18"+ callsites "^3.0.0"+ graceful-fs "^4.2.9"++"@jest/test-result@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/test-result/-/test-result-29.6.2.tgz#fdd11583cd1608e4db3114e8f0cce277bf7a32ed"+ integrity sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw==+ dependencies:+ "@jest/console" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/istanbul-lib-coverage" "^2.0.0"+ collect-v8-coverage "^1.0.0"++"@jest/test-sequencer@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz#585eff07a68dd75225a7eacf319780cb9f6b9bf4"+ integrity sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw==+ dependencies:+ "@jest/test-result" "^29.6.2"+ graceful-fs "^4.2.9"+ jest-haste-map "^29.6.2"+ slash "^3.0.0"++"@jest/transform@^29.6.2":+ version "29.6.2"+ resolved "https://registry.npmmirror.com/@jest/transform/-/transform-29.6.2.tgz#522901ebbb211af08835bc3bcdf765ab778094e3"+ integrity sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg==+ dependencies:+ "@babel/core" "^7.11.6"+ "@jest/types" "^29.6.1"+ "@jridgewell/trace-mapping" "^0.3.18"+ babel-plugin-istanbul "^6.1.1"+ chalk "^4.0.0"+ convert-source-map "^2.0.0"+ fast-json-stable-stringify "^2.1.0"+ graceful-fs "^4.2.9"+ jest-haste-map "^29.6.2"+ jest-regex-util "^29.4.3"+ jest-util "^29.6.2"+ micromatch "^4.0.4"+ pirates "^4.0.4"+ slash "^3.0.0"+ write-file-atomic "^4.0.2"++"@jest/types@^29.6.1":+ version "29.6.1"+ resolved "https://registry.npmmirror.com/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2"+ integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==+ dependencies:+ "@jest/schemas" "^29.6.0"+ "@types/istanbul-lib-coverage" "^2.0.0"+ "@types/istanbul-reports" "^3.0.0"+ "@types/node" "*"+ "@types/yargs" "^17.0.8"+ chalk "^4.0.0"+"@jridgewell/gen-mapping@^0.1.0":version "0.1.1"resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996"@@ -547,6 +1042,11 @@resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78"integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==+"@jridgewell/resolve-uri@^3.1.0":+ version "3.1.1"+ resolved "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"+ integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==+"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1":version "1.1.2"resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72"@@ -557,6 +1057,19 @@resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==+"@jridgewell/sourcemap-codec@^1.4.14":+ version "1.4.15"+ resolved "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"+ integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==++"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18":+ version "0.3.19"+ resolved "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811"+ integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==+ dependencies:+ "@jridgewell/resolve-uri" "^3.1.0"+ "@jridgewell/sourcemap-codec" "^1.4.14"+"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9":version "0.3.17"resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985"@@ -565,6 +1078,45 @@"@jridgewell/resolve-uri" "3.1.0""@jridgewell/sourcemap-codec" "1.4.14"+"@kanaries/[email protected]":+ version "0.4.15"+ resolved "https://registry.yarnpkg.com/@kanaries/graphic-walker/-/graphic-walker-0.4.15.tgz#b36deb5e6420bd437d6e0b16c78e05ee83f3c87d"+ integrity sha512-gsyusdzv2hDW7XIA/DytVa8PQFEqJwTFrzOCfAbsdcGxPZvr1ee7U8QCGP/Yr17zEWVCFS4JQs3AP2qpbhwP9w==+ dependencies:+ "@headlessui/react" "^1.7.12"+ "@heroicons/react" "^2.0.8"+ "@kanaries/react-beautiful-dnd" "^0.0.3"+ "@kanaries/web-data-loader" "^0.1.7"+ "@tailwindcss/forms" "^0.5.4"+ autoprefixer "^10.3.5"+ canvas-size "^1.2.6"+ d3-format "^3.1.0"+ d3-scale "^4.0.2"+ d3-time-format "^4.1.0"+ i18next "^21.9.1"+ i18next-browser-languagedetector "^6.1.5"+ immer "^9.0.15"+ leaflet "^1.9.4"+ mobx "^6.3.3"+ mobx-react-lite "^3.2.1"+ nanoid "^4.0.2"+ postcss "^8.3.7"+ postinstall-postinstall "^2.1.0"+ re-resizable "^6.9.8"+ react-color "^2.19.3"+ react-dropzone "^14.2.3"+ react-error-boundary "^4.0.11"+ react-i18next "^11.18.6"+ react-leaflet "^4.2.1"+ react-shadow "^20.0.0"+ rxjs "^7.3.0"+ tailwindcss "^3.2.4"+ topojson-client "^3.1.0"+ uuid "^8.3.2"+ vega "^5.22.1"+ vega-embed "^6.21.0"+ vega-lite "^5.6.0"+"@kanaries/react-beautiful-dnd@^0.0.3":version "0.0.3"resolved "https://registry.npmmirror.com/@kanaries/react-beautiful-dnd/-/react-beautiful-dnd-0.0.3.tgz#fce3972ed34a55223866b259b0adbabe003c7ba4"@@ -629,6 +1181,25 @@estree-walker "^1.0.1"picomatch "^2.2.2"+"@sinclair/typebox@^0.27.8":+ version "0.27.8"+ resolved "https://registry.npmmirror.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"+ integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==++"@sinonjs/commons@^3.0.0":+ version "3.0.0"+ resolved "https://registry.npmmirror.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72"+ integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==+ dependencies:+ type-detect "4.0.8"++"@sinonjs/fake-timers@^10.0.2":+ version "10.3.0"+ resolved "https://registry.npmmirror.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66"+ integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==+ dependencies:+ "@sinonjs/commons" "^3.0.0"+"@tailwindcss/forms@^0.5.4":version "0.5.4"resolved "https://registry.npmmirror.com/@tailwindcss/forms/-/forms-0.5.4.tgz#5316a782fd95369eb5b6fd01d46323b3dce656a2"@@ -701,6 +1272,39 @@"@tauri-apps/cli-win32-ia32-msvc" "1.2.3""@tauri-apps/cli-win32-x64-msvc" "1.2.3"+"@types/babel__core@^7.1.14":+ version "7.20.1"+ resolved "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b"+ integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==+ dependencies:+ "@babel/parser" "^7.20.7"+ "@babel/types" "^7.20.7"+ "@types/babel__generator" "*"+ "@types/babel__template" "*"+ "@types/babel__traverse" "*"++"@types/babel__generator@*":+ version "7.6.4"+ resolved "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7"+ integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==+ dependencies:+ "@babel/types" "^7.0.0"++"@types/babel__template@*":+ version "7.4.1"+ resolved "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969"+ integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==+ dependencies:+ "@babel/parser" "^7.1.0"+ "@babel/types" "^7.0.0"++"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6":+ version "7.20.1"+ resolved "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf"+ integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==+ dependencies:+ "@babel/types" "^7.20.7"+"@types/clone@~2.1.1":version "2.1.1"resolved "https://registry.yarnpkg.com/@types/clone/-/clone-2.1.1.tgz#9b880d0ce9b1f209b5e0bd6d9caa38209db34024"@@ -743,6 +1347,13 @@resolved "https://registry.npmmirror.com/@types/geojson/-/geojson-7946.0.10.tgz#6dfbf5ea17142f7f9a043809f1cd4c448cb68249"integrity sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==+"@types/graceful-fs@^4.1.3":+ version "4.1.6"+ resolved "https://registry.npmmirror.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae"+ integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==+ dependencies:+ "@types/node" "*"+"@types/hoist-non-react-statics@*", "@types/hoist-non-react-statics@^3.3.0":version "3.3.1"resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"@@ -751,6 +1362,33 @@"@types/react" "*"hoist-non-react-statics "^3.3.0"+"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":+ version "2.0.4"+ resolved "https://registry.npmmirror.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"+ integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==++"@types/istanbul-lib-report@*":+ version "3.0.0"+ resolved "https://registry.npmmirror.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686"+ integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==+ dependencies:+ "@types/istanbul-lib-coverage" "*"++"@types/istanbul-reports@^3.0.0":+ version "3.0.1"+ resolved "https://registry.npmmirror.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff"+ integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==+ dependencies:+ "@types/istanbul-lib-report" "*"++"@types/jest@^29.5.3":+ version "29.5.3"+ resolved "https://registry.npmmirror.com/@types/jest/-/jest-29.5.3.tgz#7a35dc0044ffb8b56325c6802a4781a626b05777"+ integrity sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==+ dependencies:+ expect "^29.0.0"+ pretty-format "^29.0.0"+"@types/js-cookie@^2.2.6":version "2.2.7"resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.7.tgz#226a9e31680835a6188e887f3988e60c04d3f6a3"@@ -833,6 +1471,11 @@resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==+"@types/stack-utils@^2.0.0":+ version "2.0.1"+ resolved "https://registry.npmmirror.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"+ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==+"@types/styled-components@^5.1.26":version "5.1.26"resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.26.tgz#5627e6812ee96d755028a98dae61d28e57c233af"@@ -857,6 +1500,18 @@dependencies:"@types/geojson" "*"+"@types/yargs-parser@*":+ version "21.0.0"+ resolved "https://registry.npmmirror.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b"+ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==++"@types/yargs@^17.0.8":+ version "17.0.24"+ resolved "https://registry.npmmirror.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902"+ integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==+ dependencies:+ "@types/yargs-parser" "*"+"@vercel/analytics@^0.1.8":version "0.1.10"resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-0.1.10.tgz#772ab975f1226b6db9632568299ead173c21da7d"@@ -910,6 +1565,13 @@ acorn@^7.0.0:resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==+ansi-escapes@^4.2.1:+ version "4.3.2"+ resolved "https://registry.npmmirror.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"+ integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==+ dependencies:+ type-fest "^0.21.3"+ansi-regex@^5.0.1:version "5.0.1"resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"@@ -922,14 +1584,19 @@ ansi-styles@^3.2.1:dependencies:color-convert "^1.9.0"-ansi-styles@^4.0.0:+ansi-styles@^4.0.0, ansi-styles@^4.1.0:version "4.3.0"resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==dependencies:color-convert "^2.0.1"-anymatch@~3.1.2:+ansi-styles@^5.0.0:+ version "5.2.0"+ resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"+ integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==++anymatch@^3.0.3, anymatch@~3.1.2:version "3.1.3"resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==@@ -942,6 +1609,13 @@ arg@^5.0.2:resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==+argparse@^1.0.7:+ version "1.0.10"+ resolved "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"+ integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==+ dependencies:+ sprintf-js "~1.0.2"+attr-accept@^2.2.2:version "2.2.2"resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b"@@ -959,6 +1633,40 @@ autoprefixer@^10.3.5:picocolors "^1.0.0"postcss-value-parser "^4.2.0"+babel-jest@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/babel-jest/-/babel-jest-29.6.2.tgz#cada0a59e07f5acaeb11cbae7e3ba92aec9c1126"+ integrity sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==+ dependencies:+ "@jest/transform" "^29.6.2"+ "@types/babel__core" "^7.1.14"+ babel-plugin-istanbul "^6.1.1"+ babel-preset-jest "^29.5.0"+ chalk "^4.0.0"+ graceful-fs "^4.2.9"+ slash "^3.0.0"++babel-plugin-istanbul@^6.1.1:+ version "6.1.1"+ resolved "https://registry.npmmirror.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"+ integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==+ dependencies:+ "@babel/helper-plugin-utils" "^7.0.0"+ "@istanbuljs/load-nyc-config" "^1.0.0"+ "@istanbuljs/schema" "^0.1.2"+ istanbul-lib-instrument "^5.0.4"+ test-exclude "^6.0.0"++babel-plugin-jest-hoist@^29.5.0:+ version "29.5.0"+ resolved "https://registry.npmmirror.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a"+ integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==+ dependencies:+ "@babel/template" "^7.3.3"+ "@babel/types" "^7.3.3"+ "@types/babel__core" "^7.1.14"+ "@types/babel__traverse" "^7.0.6"+"babel-plugin-styled-components@>= 1.12.0":version "2.0.7"resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-2.0.7.tgz#c81ef34b713f9da2b7d3f5550df0d1e19e798086"@@ -975,11 +1683,50 @@ babel-plugin-syntax-jsx@^6.18.0:resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"integrity sha512-qrPaCSo9c8RHNRHIotaufGbuOBN8rtdC4QrrFFc43vyWCCz7Kl7GL1PGaXtMGQZUXrkCjNEgxDfmAuAabr/rlw==+babel-preset-current-node-syntax@^1.0.0:+ version "1.0.1"+ resolved "https://registry.npmmirror.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b"+ integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==+ dependencies:+ "@babel/plugin-syntax-async-generators" "^7.8.4"+ "@babel/plugin-syntax-bigint" "^7.8.3"+ "@babel/plugin-syntax-class-properties" "^7.8.3"+ "@babel/plugin-syntax-import-meta" "^7.8.3"+ "@babel/plugin-syntax-json-strings" "^7.8.3"+ "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3"+ "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"+ "@babel/plugin-syntax-numeric-separator" "^7.8.3"+ "@babel/plugin-syntax-object-rest-spread" "^7.8.3"+ "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"+ "@babel/plugin-syntax-optional-chaining" "^7.8.3"+ "@babel/plugin-syntax-top-level-await" "^7.8.3"++babel-preset-jest@^29.5.0:+ version "29.5.0"+ resolved "https://registry.npmmirror.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2"+ integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==+ dependencies:+ babel-plugin-jest-hoist "^29.5.0"+ babel-preset-current-node-syntax "^1.0.0"++balanced-match@^1.0.0:+ version "1.0.2"+ resolved "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==+binary-extensions@^2.0.0:version "2.2.0"resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==+brace-expansion@^1.1.7:+ version "1.1.11"+ resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==+ dependencies:+ balanced-match "^1.0.0"+ concat-map "0.0.1"+braces@^3.0.2, braces@~3.0.2:version "3.0.2"resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"@@ -997,11 +1744,55 @@ browserslist@^4.21.3, browserslist@^4.21.4:node-releases "^2.0.8"update-browserslist-db "^1.0.10"+browserslist@^4.21.9:+ version "4.21.10"+ resolved "https://registry.npmmirror.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0"+ integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==+ dependencies:+ caniuse-lite "^1.0.30001517"+ electron-to-chromium "^1.4.477"+ node-releases "^2.0.13"+ update-browserslist-db "^1.0.11"++ version "0.2.6"+ resolved "https://registry.npmmirror.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8"+ integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==+ dependencies:+ fast-json-stable-stringify "2.x"++ version "2.1.1"+ resolved "https://registry.npmmirror.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05"+ integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==+ dependencies:+ node-int64 "^0.4.0"++buffer-from@^1.0.0:+ version "1.1.2"+ resolved "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"+ integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==++callsites@^3.0.0:+ version "3.1.0"+ resolved "https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"+ integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==+camelcase-css@^2.0.1:version "2.0.1"resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5"integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==+camelcase@^5.3.1:+ version "5.3.1"+ resolved "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==++camelcase@^6.2.0:+ version "6.3.0"+ resolved "https://registry.npmmirror.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"+ integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==+camelize@^1.0.0:version "1.0.1"resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3"@@ -1012,12 +1803,17 @@ caniuse-lite@^1.0.30001426, caniuse-lite@^1.0.30001449:resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001458.tgz#871e35866b4654a7d25eccca86864f411825540c"integrity sha512-lQ1VlUUq5q9ro9X+5gOEyH7i3vm+AYVT1WDCVB69XOZ17KZRhnZ9J0Sqz7wTHQaLBJccNCHq8/Ww5LlOIZbB0w==+caniuse-lite@^1.0.30001517:+ version "1.0.30001519"+ resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz#3e7b8b8a7077e78b0eb054d69e6edf5c7df35601"+ integrity sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==+canvas-size@^1.2.6:version "1.2.6"resolved "https://registry.yarnpkg.com/canvas-size/-/canvas-size-1.2.6.tgz#1eaa6b56167cf2a70fa4021680829d2073b45706"integrity sha512-x2iVHOrZ5x9V0Hwx6kBz+Yxf/VCAII+jrD6WLjJbytJLozHq/oDJjEva432Os0eHxWMFR0vYlLJwTr6QxyxQqw==-chalk@^2.0.0:+chalk@^2.0.0, chalk@^2.4.2:version "2.4.2"resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==@@ -1026,6 +1822,19 @@ chalk@^2.0.0:escape-string-regexp "^1.0.5"supports-color "^5.3.0"+chalk@^4.0.0:+ version "4.1.2"+ resolved "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"+ integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==+ dependencies:+ ansi-styles "^4.1.0"+ supports-color "^7.1.0"++char-regex@^1.0.2:+ version "1.0.2"+ resolved "https://registry.npmmirror.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"+ integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==+chokidar@^3.5.3:version "3.5.3"resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"@@ -1041,6 +1850,16 @@ chokidar@^3.5.3:optionalDependencies:fsevents "~2.3.2"+ci-info@^3.2.0:+ version "3.8.0"+ resolved "https://registry.npmmirror.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"+ integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==++cjs-module-lexer@^1.0.0:+ version "1.2.3"+ resolved "https://registry.npmmirror.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107"+ integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==+client-only@^0.0.1:version "0.0.1"resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"@@ -1060,6 +1879,16 @@ clone@~2.1.2:resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==+co@^4.6.0:+ version "4.6.0"+ resolved "https://registry.npmmirror.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"+ integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==++collect-v8-coverage@^1.0.0:+ version "1.0.2"+ resolved "https://registry.npmmirror.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9"+ integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==+color-convert@^1.9.0:version "1.9.3"resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"@@ -1094,11 +1923,21 @@ commander@7:resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==-convert-source-map@^1.7.0:+ version "0.0.1"+ resolved "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"+ integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==++convert-source-map@^1.6.0, convert-source-map@^1.7.0:version "1.9.0"resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==+convert-source-map@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"+ integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==+copy-to-clipboard@^3.3.1:version "3.3.3"resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0"@@ -1106,6 +1945,15 @@ copy-to-clipboard@^3.3.1:dependencies:toggle-selection "^1.0.6"+cross-spawn@^7.0.3:+ version "7.0.3"+ resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"+ integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==+ dependencies:+ path-key "^3.1.0"+ shebang-command "^2.0.0"+ which "^2.0.1"+css-box-model@^1.2.0:version "1.2.1"resolved "https://registry.yarnpkg.com/css-box-model/-/css-box-model-1.2.1.tgz#59951d3b81fd6b2074a62d49444415b0d2b4d7c1"@@ -1281,13 +2129,23 @@ d3-shape@^3.1.0:resolved "https://registry.yarnpkg.com/d3-timer/-/d3-timer-3.0.1.tgz#6284d2a2708285b1abb7e201eda4380af35e63b0"integrity sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==-debug@^4.1.0:+debug@^4.1.0, debug@^4.1.1:version "4.3.4"resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==dependencies:ms "2.1.2"+dedent@^1.0.0:+ version "1.5.1"+ resolved "https://registry.npmmirror.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff"+ integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==++deepmerge@^4.2.2:+ version "4.3.1"+ resolved "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a"+ integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==+defined@^1.0.0:version "1.0.1"resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf"@@ -1300,6 +2158,11 @@ delaunator@5:dependencies:robust-predicates "^3.0.0"+detect-newline@^3.0.0:+ version "3.1.0"+ resolved "https://registry.npmmirror.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"+ integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==+detective@^5.2.1:version "5.2.1"resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034"@@ -1314,6 +2177,11 @@ didyoumean@^1.2.2:resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037"integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==+diff-sequences@^29.4.3:+ version "29.4.3"+ resolved "https://registry.npmmirror.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2"+ integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==+dlv@^1.1.3:version "1.1.3"resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"@@ -1324,11 +2192,28 @@ electron-to-chromium@^1.4.284:resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.311.tgz#953bc9a4767f5ce8ec125f9a1ad8e00e8f67e479"integrity sha512-RoDlZufvrtr2Nx3Yx5MB8jX3aHIxm8nRWPJm3yVvyHmyKaRvn90RjzB6hNnt0AkhS3IInJdyRfQb4mWhPvUjVw==+electron-to-chromium@^1.4.477:+ version "1.4.488"+ resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.488.tgz#442b1855f8c84fb1ed79f518985c65db94f64cc9"+ integrity sha512-Dv4sTjiW7t/UWGL+H8ZkgIjtUAVZDgb/PwGWvMsCT7jipzUV/u5skbLXPFKb6iV0tiddVi/bcS2/kUrczeWgIQ==++emittery@^0.13.1:+ version "0.13.1"+ resolved "https://registry.npmmirror.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad"+ integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==+emoji-regex@^8.0.0:version "8.0.0"resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==+error-ex@^1.3.1:+ version "1.3.2"+ resolved "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"+ integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==+ dependencies:+ is-arrayish "^0.2.1"+error-stack-parser@^2.0.6:version "2.1.4"resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.1.4.tgz#229cb01cdbfa84440bfa91876285b94680188286"@@ -1530,11 +2415,53 @@ escape-string-regexp@^1.0.5:resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==+escape-string-regexp@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"+ integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==++esprima@^4.0.0:+ version "4.0.1"+ resolved "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"+ integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==+estree-walker@^1.0.1:version "1.0.1"resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==+execa@^5.0.0:+ version "5.1.1"+ resolved "https://registry.npmmirror.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"+ integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==+ dependencies:+ cross-spawn "^7.0.3"+ get-stream "^6.0.0"+ human-signals "^2.1.0"+ is-stream "^2.0.0"+ merge-stream "^2.0.0"+ npm-run-path "^4.0.1"+ onetime "^5.1.2"+ signal-exit "^3.0.3"+ strip-final-newline "^2.0.0"++exit@^0.1.2:+ version "0.1.2"+ resolved "https://registry.npmmirror.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"+ integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==++expect@^29.0.0, expect@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/expect/-/expect-29.6.2.tgz#7b08e83eba18ddc4a2cf62b5f2d1918f5cd84521"+ integrity sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA==+ dependencies:+ "@jest/expect-utils" "^29.6.2"+ "@types/node" "*"+ jest-get-type "^29.4.3"+ jest-matcher-utils "^29.6.2"+ jest-message-util "^29.6.2"+ jest-util "^29.6.2"+fast-deep-equal@^3.1.3, fast-deep-equal@~3.1.3:version "3.1.3"resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"@@ -1556,7 +2483,7 @@ fast-json-patch@^3.1.1:resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947"integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==-fast-json-stable-stringify@~2.1.0:[email protected], fast-json-stable-stringify@^2.1.0, fast-json-stable-stringify@~2.1.0:version "2.1.0"resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==@@ -1583,6 +2510,13 @@ fastq@^1.6.0:dependencies:reusify "^1.0.4"+fb-watchman@^2.0.0:+ version "2.0.2"+ resolved "https://registry.npmmirror.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c"+ integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==+ dependencies:+ bser "2.1.1"+file-selector@^0.6.0:version "0.6.0"resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.6.0.tgz#fa0a8d9007b829504db4d07dd4de0310b65287dc"@@ -1597,12 +2531,25 @@ fill-range@^7.0.1:dependencies:to-regex-range "^5.0.1"+find-up@^4.0.0, find-up@^4.1.0:+ version "4.1.0"+ resolved "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"+ integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==+ dependencies:+ locate-path "^5.0.0"+ path-exists "^4.0.0"+fraction.js@^4.2.0:version "4.2.0"resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950"integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==-fsevents@~2.3.2:+fs.realpath@^1.0.0:+ version "1.0.0"+ resolved "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"+ integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==++fsevents@^2.3.2, fsevents@~2.3.2:version "2.3.2"resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==@@ -1622,6 +2569,16 @@ get-caller-file@^2.0.5:resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==+get-package-type@^0.1.0:+ version "0.1.0"+ resolved "https://registry.npmmirror.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"+ integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==++get-stream@^6.0.0:+ version "6.0.1"+ resolved "https://registry.npmmirror.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"+ integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==+glob-parent@^5.1.2, glob-parent@~5.1.2:version "5.1.2"resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"@@ -1636,16 +2593,38 @@ glob-parent@^6.0.2:dependencies:is-glob "^4.0.3"+glob@^7.1.3, glob@^7.1.4:+ version "7.2.3"+ resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"+ integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==+ dependencies:+ fs.realpath "^1.0.0"+ inflight "^1.0.4"+ inherits "2"+ minimatch "^3.1.1"+ once "^1.3.0"+ path-is-absolute "^1.0.0"+globals@^11.1.0:version "11.12.0"resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==+graceful-fs@^4.2.9:+ version "4.2.11"+ resolved "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"+ integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==+has-flag@^3.0.0:version "3.0.0"resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==+has-flag@^4.0.0:+ version "4.0.0"+ resolved "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"+ integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==+has@^1.0.3:version "1.0.3"resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"@@ -1660,6 +2639,11 @@ hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0, hoist-non-react-dependencies:react-is "^16.7.0"+html-escaper@^2.0.0:+ version "2.0.2"+ resolved "https://registry.npmmirror.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"+ integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==+html-parse-stringify@^3.0.1:version "3.0.1"resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2"@@ -1667,6 +2651,11 @@ html-parse-stringify@^3.0.1:dependencies:void-elements "3.1.0"+human-signals@^2.1.0:+ version "2.1.0"+ resolved "https://registry.npmmirror.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"+ integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==+humps@^2.0.1:version "2.0.1"resolved "https://registry.yarnpkg.com/humps/-/humps-2.0.1.tgz#dd02ea6081bd0568dc5d073184463957ba9ef9aa"@@ -1703,6 +2692,32 @@ immer@^9.0.15:resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.19.tgz#67fb97310555690b5f9cd8380d38fc0aabb6b38b"integrity sha512-eY+Y0qcsB4TZKwgQzLaE/lqYMlKhv5J9dyd2RhhtGhNo2njPXDqU9XPfcNfa3MIDsdtZt5KlkIsirlo4dHsWdQ==+import-local@^3.0.2:+ version "3.1.0"+ resolved "https://registry.npmmirror.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4"+ integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==+ dependencies:+ pkg-dir "^4.2.0"+ resolve-cwd "^3.0.0"++imurmurhash@^0.1.4:+ version "0.1.4"+ resolved "https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"+ integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==++inflight@^1.0.4:+ version "1.0.6"+ resolved "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"+ integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==+ dependencies:+ once "^1.3.0"+ wrappy "1"++inherits@2:+ version "2.0.4"+ resolved "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"+ integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==+inline-style-prefixer@^6.0.0:version "6.0.4"resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz#4290ed453ab0e4441583284ad86e41ad88384f44"@@ -1716,6 +2731,11 @@ inline-style-prefixer@^6.0.0:resolved "https://registry.yarnpkg.com/internmap/-/internmap-2.0.3.tgz#6685f23755e43c524e251d29cbc97248e3061009"integrity sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==+is-arrayish@^0.2.1:+ version "0.2.1"+ resolved "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"+ integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==+is-binary-path@~2.1.0:version "2.1.0"resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"@@ -1723,6 +2743,13 @@ is-binary-path@~2.1.0:dependencies:binary-extensions "^2.0.0"+is-core-module@^2.13.0:+ version "2.13.0"+ resolved "https://registry.npmmirror.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db"+ integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==+ dependencies:+ has "^1.0.3"+is-core-module@^2.9.0:version "2.11.0"resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144"@@ -1740,6 +2767,11 @@ is-fullwidth-code-point@^3.0.0:resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==+is-generator-fn@^2.0.0:+ version "2.1.0"+ resolved "https://registry.npmmirror.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118"+ integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==+is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:version "4.0.3"resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"@@ -1752,6 +2784,416 @@ is-number@^7.0.0:resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==+is-stream@^2.0.0:+ version "2.0.1"+ resolved "https://registry.npmmirror.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"+ integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==++isexe@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"+ integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==++istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:+ version "3.2.0"+ resolved "https://registry.npmmirror.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3"+ integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==++istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0:+ version "5.2.1"+ resolved "https://registry.npmmirror.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d"+ integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==+ dependencies:+ "@babel/core" "^7.12.3"+ "@babel/parser" "^7.14.7"+ "@istanbuljs/schema" "^0.1.2"+ istanbul-lib-coverage "^3.2.0"+ semver "^6.3.0"++istanbul-lib-report@^3.0.0:+ version "3.0.1"+ resolved "https://registry.npmmirror.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d"+ integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==+ dependencies:+ istanbul-lib-coverage "^3.0.0"+ make-dir "^4.0.0"+ supports-color "^7.1.0"++istanbul-lib-source-maps@^4.0.0:+ version "4.0.1"+ resolved "https://registry.npmmirror.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551"+ integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==+ dependencies:+ debug "^4.1.1"+ istanbul-lib-coverage "^3.0.0"+ source-map "^0.6.1"++istanbul-reports@^3.1.3:+ version "3.1.6"+ resolved "https://registry.npmmirror.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a"+ integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==+ dependencies:+ html-escaper "^2.0.0"+ istanbul-lib-report "^3.0.0"++jest-changed-files@^29.5.0:+ version "29.5.0"+ resolved "https://registry.npmmirror.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e"+ integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==+ dependencies:+ execa "^5.0.0"+ p-limit "^3.1.0"++jest-circus@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-circus/-/jest-circus-29.6.2.tgz#1e6ffca60151ac66cad63fce34f443f6b5bb4258"+ integrity sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw==+ dependencies:+ "@jest/environment" "^29.6.2"+ "@jest/expect" "^29.6.2"+ "@jest/test-result" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ chalk "^4.0.0"+ co "^4.6.0"+ dedent "^1.0.0"+ is-generator-fn "^2.0.0"+ jest-each "^29.6.2"+ jest-matcher-utils "^29.6.2"+ jest-message-util "^29.6.2"+ jest-runtime "^29.6.2"+ jest-snapshot "^29.6.2"+ jest-util "^29.6.2"+ p-limit "^3.1.0"+ pretty-format "^29.6.2"+ pure-rand "^6.0.0"+ slash "^3.0.0"+ stack-utils "^2.0.3"++jest-cli@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-cli/-/jest-cli-29.6.2.tgz#edb381763398d1a292cd1b636a98bfa5644b8fda"+ integrity sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q==+ dependencies:+ "@jest/core" "^29.6.2"+ "@jest/test-result" "^29.6.2"+ "@jest/types" "^29.6.1"+ chalk "^4.0.0"+ exit "^0.1.2"+ graceful-fs "^4.2.9"+ import-local "^3.0.2"+ jest-config "^29.6.2"+ jest-util "^29.6.2"+ jest-validate "^29.6.2"+ prompts "^2.0.1"+ yargs "^17.3.1"++jest-config@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-config/-/jest-config-29.6.2.tgz#c68723f06b31ca5e63030686e604727d406cd7c3"+ integrity sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw==+ dependencies:+ "@babel/core" "^7.11.6"+ "@jest/test-sequencer" "^29.6.2"+ "@jest/types" "^29.6.1"+ babel-jest "^29.6.2"+ chalk "^4.0.0"+ ci-info "^3.2.0"+ deepmerge "^4.2.2"+ glob "^7.1.3"+ graceful-fs "^4.2.9"+ jest-circus "^29.6.2"+ jest-environment-node "^29.6.2"+ jest-get-type "^29.4.3"+ jest-regex-util "^29.4.3"+ jest-resolve "^29.6.2"+ jest-runner "^29.6.2"+ jest-util "^29.6.2"+ jest-validate "^29.6.2"+ micromatch "^4.0.4"+ parse-json "^5.2.0"+ pretty-format "^29.6.2"+ slash "^3.0.0"+ strip-json-comments "^3.1.1"++jest-diff@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-diff/-/jest-diff-29.6.2.tgz#c36001e5543e82a0805051d3ceac32e6825c1c46"+ integrity sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA==+ dependencies:+ chalk "^4.0.0"+ diff-sequences "^29.4.3"+ jest-get-type "^29.4.3"+ pretty-format "^29.6.2"++jest-docblock@^29.4.3:+ version "29.4.3"+ resolved "https://registry.npmmirror.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8"+ integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==+ dependencies:+ detect-newline "^3.0.0"++jest-each@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-each/-/jest-each-29.6.2.tgz#c9e4b340bcbe838c73adf46b76817b15712d02ce"+ integrity sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw==+ dependencies:+ "@jest/types" "^29.6.1"+ chalk "^4.0.0"+ jest-get-type "^29.4.3"+ jest-util "^29.6.2"+ pretty-format "^29.6.2"++jest-environment-node@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-environment-node/-/jest-environment-node-29.6.2.tgz#a9ea2cabff39b08eca14ccb32c8ceb924c8bb1ad"+ integrity sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ==+ dependencies:+ "@jest/environment" "^29.6.2"+ "@jest/fake-timers" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ jest-mock "^29.6.2"+ jest-util "^29.6.2"++jest-get-type@^29.4.3:+ version "29.4.3"+ resolved "https://registry.npmmirror.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5"+ integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==++jest-haste-map@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-haste-map/-/jest-haste-map-29.6.2.tgz#298c25ea5255cfad8b723179d4295cf3a50a70d1"+ integrity sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==+ dependencies:+ "@jest/types" "^29.6.1"+ "@types/graceful-fs" "^4.1.3"+ "@types/node" "*"+ anymatch "^3.0.3"+ fb-watchman "^2.0.0"+ graceful-fs "^4.2.9"+ jest-regex-util "^29.4.3"+ jest-util "^29.6.2"+ jest-worker "^29.6.2"+ micromatch "^4.0.4"+ walker "^1.0.8"+ optionalDependencies:+ fsevents "^2.3.2"++jest-leak-detector@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz#e2b307fee78cab091c37858a98c7e1d73cdf5b38"+ integrity sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==+ dependencies:+ jest-get-type "^29.4.3"+ pretty-format "^29.6.2"++jest-matcher-utils@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz#39de0be2baca7a64eacb27291f0bd834fea3a535"+ integrity sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ==+ dependencies:+ chalk "^4.0.0"+ jest-diff "^29.6.2"+ jest-get-type "^29.4.3"+ pretty-format "^29.6.2"++jest-message-util@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-message-util/-/jest-message-util-29.6.2.tgz#af7adc2209c552f3f5ae31e77cf0a261f23dc2bb"+ integrity sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ==+ dependencies:+ "@babel/code-frame" "^7.12.13"+ "@jest/types" "^29.6.1"+ "@types/stack-utils" "^2.0.0"+ chalk "^4.0.0"+ graceful-fs "^4.2.9"+ micromatch "^4.0.4"+ pretty-format "^29.6.2"+ slash "^3.0.0"+ stack-utils "^2.0.3"++jest-mock@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-mock/-/jest-mock-29.6.2.tgz#ef9c9b4d38c34a2ad61010a021866dad41ce5e00"+ integrity sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg==+ dependencies:+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ jest-util "^29.6.2"++jest-pnp-resolver@^1.2.2:+ version "1.2.3"+ resolved "https://registry.npmmirror.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e"+ integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==++jest-regex-util@^29.4.3:+ version "29.4.3"+ resolved "https://registry.npmmirror.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8"+ integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==++jest-resolve-dependencies@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz#36435269b6672c256bcc85fb384872c134cc4cf2"+ integrity sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w==+ dependencies:+ jest-regex-util "^29.4.3"+ jest-snapshot "^29.6.2"++jest-resolve@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-resolve/-/jest-resolve-29.6.2.tgz#f18405fe4b50159b7b6d85e81f6a524d22afb838"+ integrity sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw==+ dependencies:+ chalk "^4.0.0"+ graceful-fs "^4.2.9"+ jest-haste-map "^29.6.2"+ jest-pnp-resolver "^1.2.2"+ jest-util "^29.6.2"+ jest-validate "^29.6.2"+ resolve "^1.20.0"+ resolve.exports "^2.0.0"+ slash "^3.0.0"++jest-runner@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-runner/-/jest-runner-29.6.2.tgz#89e8e32a8fef24781a7c4c49cd1cb6358ac7fc01"+ integrity sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w==+ dependencies:+ "@jest/console" "^29.6.2"+ "@jest/environment" "^29.6.2"+ "@jest/test-result" "^29.6.2"+ "@jest/transform" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ chalk "^4.0.0"+ emittery "^0.13.1"+ graceful-fs "^4.2.9"+ jest-docblock "^29.4.3"+ jest-environment-node "^29.6.2"+ jest-haste-map "^29.6.2"+ jest-leak-detector "^29.6.2"+ jest-message-util "^29.6.2"+ jest-resolve "^29.6.2"+ jest-runtime "^29.6.2"+ jest-util "^29.6.2"+ jest-watcher "^29.6.2"+ jest-worker "^29.6.2"+ p-limit "^3.1.0"+ source-map-support "0.5.13"++jest-runtime@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-runtime/-/jest-runtime-29.6.2.tgz#692f25e387f982e89ab83270e684a9786248e545"+ integrity sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg==+ dependencies:+ "@jest/environment" "^29.6.2"+ "@jest/fake-timers" "^29.6.2"+ "@jest/globals" "^29.6.2"+ "@jest/source-map" "^29.6.0"+ "@jest/test-result" "^29.6.2"+ "@jest/transform" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ chalk "^4.0.0"+ cjs-module-lexer "^1.0.0"+ collect-v8-coverage "^1.0.0"+ glob "^7.1.3"+ graceful-fs "^4.2.9"+ jest-haste-map "^29.6.2"+ jest-message-util "^29.6.2"+ jest-mock "^29.6.2"+ jest-regex-util "^29.4.3"+ jest-resolve "^29.6.2"+ jest-snapshot "^29.6.2"+ jest-util "^29.6.2"+ slash "^3.0.0"+ strip-bom "^4.0.0"++jest-snapshot@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-snapshot/-/jest-snapshot-29.6.2.tgz#9b431b561a83f2bdfe041e1cab8a6becdb01af9c"+ integrity sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==+ dependencies:+ "@babel/core" "^7.11.6"+ "@babel/generator" "^7.7.2"+ "@babel/plugin-syntax-jsx" "^7.7.2"+ "@babel/plugin-syntax-typescript" "^7.7.2"+ "@babel/types" "^7.3.3"+ "@jest/expect-utils" "^29.6.2"+ "@jest/transform" "^29.6.2"+ "@jest/types" "^29.6.1"+ babel-preset-current-node-syntax "^1.0.0"+ chalk "^4.0.0"+ expect "^29.6.2"+ graceful-fs "^4.2.9"+ jest-diff "^29.6.2"+ jest-get-type "^29.4.3"+ jest-matcher-utils "^29.6.2"+ jest-message-util "^29.6.2"+ jest-util "^29.6.2"+ natural-compare "^1.4.0"+ pretty-format "^29.6.2"+ semver "^7.5.3"++jest-util@^29.0.0, jest-util@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d"+ integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w==+ dependencies:+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ chalk "^4.0.0"+ ci-info "^3.2.0"+ graceful-fs "^4.2.9"+ picomatch "^2.2.3"++jest-validate@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-validate/-/jest-validate-29.6.2.tgz#25d972af35b2415b83b1373baf1a47bb266c1082"+ integrity sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg==+ dependencies:+ "@jest/types" "^29.6.1"+ camelcase "^6.2.0"+ chalk "^4.0.0"+ jest-get-type "^29.4.3"+ leven "^3.1.0"+ pretty-format "^29.6.2"++jest-watcher@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-watcher/-/jest-watcher-29.6.2.tgz#77c224674f0620d9f6643c4cfca186d8893ca088"+ integrity sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA==+ dependencies:+ "@jest/test-result" "^29.6.2"+ "@jest/types" "^29.6.1"+ "@types/node" "*"+ ansi-escapes "^4.2.1"+ chalk "^4.0.0"+ emittery "^0.13.1"+ jest-util "^29.6.2"+ string-length "^4.0.1"++jest-worker@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest-worker/-/jest-worker-29.6.2.tgz#682fbc4b6856ad0aa122a5403c6d048b83f3fb44"+ integrity sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ==+ dependencies:+ "@types/node" "*"+ jest-util "^29.6.2"+ merge-stream "^2.0.0"+ supports-color "^8.0.0"++jest@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/jest/-/jest-29.6.2.tgz#3bd55b9fd46a161b2edbdf5f1d1bd0d1eab76c42"+ integrity sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg==+ dependencies:+ "@jest/core" "^29.6.2"+ "@jest/types" "^29.6.1"+ import-local "^3.0.2"+ jest-cli "^29.6.2"+js-cookie@^2.2.1:version "2.2.1"resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8"@@ -1762,36 +3204,76 @@ js-cookie@^2.2.1:resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==+js-yaml@^3.13.1:+ version "3.14.1"+ resolved "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"+ integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==+ dependencies:+ argparse "^1.0.7"+ esprima "^4.0.0"+jsesc@^2.5.1:version "2.5.2"resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==+json-parse-even-better-errors@^2.3.0:+ version "2.3.1"+ resolved "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"+ integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==+json-stringify-pretty-compact@^3.0.0, json-stringify-pretty-compact@~3.0.0:version "3.0.0"resolved "https://registry.yarnpkg.com/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz#f71ef9d82ef16483a407869556588e91b681d9ab"integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==-json5@^2.2.2:+json5@^2.2.2, json5@^2.2.3:version "2.2.3"resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==+kleur@^3.0.3:+ version "3.0.3"+ resolved "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"+ integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==+leaflet@^1.9.4:version "1.9.4"resolved "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d"integrity sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==+leven@^3.1.0:+ version "3.1.0"+ resolved "https://registry.npmmirror.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"+ integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==+lilconfig@^2.0.5, lilconfig@^2.0.6:version "2.0.6"resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4"integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==+lines-and-columns@^1.1.6:+ version "1.2.4"+ resolved "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"+ integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==++locate-path@^5.0.0:+ version "5.0.0"+ resolved "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"+ integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==+ dependencies:+ p-locate "^4.1.0"+lodash-es@^4.17.15:version "4.17.21"resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==+ version "4.1.2"+ resolved "https://registry.npmmirror.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"+ integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==+lodash@^4.0.1, lodash@^4.17.11, lodash@^4.17.15:version "4.17.21"resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"@@ -1832,6 +3314,25 @@ magic-string@^0.27.0:dependencies:"@jridgewell/sourcemap-codec" "^1.4.13"+make-dir@^4.0.0:+ version "4.0.0"+ resolved "https://registry.npmmirror.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e"+ integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==+ dependencies:+ semver "^7.5.3"++ version "1.3.6"+ resolved "https://registry.npmmirror.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"+ integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==++ version "1.0.12"+ resolved "https://registry.npmmirror.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a"+ integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==+ dependencies:+ tmpl "1.0.5"+material-colors@^1.2.1:version "1.2.6"resolved "https://registry.npmmirror.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46"@@ -1847,6 +3348,11 @@ memoize-one@^5.1.1:resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==+merge-stream@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"+ integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==+merge2@^1.3.0:version "1.4.1"resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"@@ -1860,11 +3366,23 @@ micromatch@^4.0.4, micromatch@^4.0.5:braces "^3.0.2"picomatch "^2.3.1"+mimic-fn@^2.1.0:+ version "2.1.0"+ resolved "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"+ integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==+mini-svg-data-uri@^1.2.3:version "1.4.4"resolved "https://registry.npmmirror.com/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz#8ab0aabcdf8c29ad5693ca595af19dd2ead09939"integrity sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==+minimatch@^3.0.4, minimatch@^3.1.1:+ version "3.1.2"+ resolved "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"+ integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==+ dependencies:+ brace-expansion "^1.1.7"+minimist@^1.2.6:version "1.2.8"resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"@@ -1914,6 +3432,11 @@ nanoid@^4.0.2:resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-4.0.2.tgz#140b3c5003959adbebf521c170f282c5e7f9fb9e"integrity sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==+natural-compare@^1.4.0:+ version "1.4.0"+ resolved "https://registry.npmmirror.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"+ integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==+node-fetch@^2.6.7:version "2.6.9"resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6"@@ -1921,6 +3444,16 @@ node-fetch@^2.6.7:dependencies:whatwg-url "^5.0.0"+node-int64@^0.4.0:+ version "0.4.0"+ resolved "https://registry.npmmirror.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"+ integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==++node-releases@^2.0.13:+ version "2.0.13"+ resolved "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d"+ integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==+node-releases@^2.0.8:version "2.0.10"resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f"@@ -1936,6 +3469,13 @@ normalize-range@^0.1.2:resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==+npm-run-path@^4.0.1:+ version "4.0.1"+ resolved "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"+ integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==+ dependencies:+ path-key "^3.0.0"+object-assign@^4.1.1:version "4.1.1"resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"@@ -1946,11 +3486,76 @@ object-hash@^3.0.0:resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9"integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==+once@^1.3.0:+ version "1.4.0"+ resolved "https://registry.npmmirror.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"+ integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==+ dependencies:+ wrappy "1"++onetime@^5.1.2:+ version "5.1.2"+ resolved "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"+ integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==+ dependencies:+ mimic-fn "^2.1.0"++p-limit@^2.2.0:+ version "2.3.0"+ resolved "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"+ integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==+ dependencies:+ p-try "^2.0.0"++p-limit@^3.1.0:+ version "3.1.0"+ resolved "https://registry.npmmirror.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"+ integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==+ dependencies:+ yocto-queue "^0.1.0"++p-locate@^4.1.0:+ version "4.1.0"+ resolved "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"+ integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==+ dependencies:+ p-limit "^2.2.0"++p-try@^2.0.0:+ version "2.2.0"+ resolved "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"+ integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==+papaparse@^5.1.1:version "5.3.2"resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.3.2.tgz#d1abed498a0ee299f103130a6109720404fbd467"integrity sha512-6dNZu0Ki+gyV0eBsFKJhYr+MdQYAzFUGlBMNj3GNrmHxmz1lfRa24CjFObPXtjcetlOv5Ad299MhIK0znp3afw==+parse-json@^5.2.0:+ version "5.2.0"+ resolved "https://registry.npmmirror.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"+ integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==+ dependencies:+ "@babel/code-frame" "^7.0.0"+ error-ex "^1.3.1"+ json-parse-even-better-errors "^2.3.0"+ lines-and-columns "^1.1.6"++path-exists@^4.0.0:+ version "4.0.0"+ resolved "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"+ integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==++path-is-absolute@^1.0.0:+ version "1.0.1"+ resolved "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"+ integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==++path-key@^3.0.0, path-key@^3.1.0:+ version "3.1.1"+ resolved "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"+ integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==+path-parse@^1.0.7:version "1.0.7"resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"@@ -1961,7 +3566,7 @@ picocolors@^1.0.0:resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==-picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.0, picomatch@^2.3.1:+picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.0, picomatch@^2.3.1:version "2.3.1"resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==@@ -1971,6 +3576,18 @@ pify@^2.3.0:resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==+pirates@^4.0.4:+ version "4.0.6"+ resolved "https://registry.npmmirror.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9"+ integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==++pkg-dir@^4.2.0:+ version "4.2.0"+ resolved "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"+ integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==+ dependencies:+ find-up "^4.0.0"+postcss-import@^14.1.0:version "14.1.0"resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.1.0.tgz#a7333ffe32f0b8795303ee9e40215dac922781f0"@@ -2038,6 +3655,23 @@ postinstall-postinstall@^2.1.0:resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3"integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==+pretty-format@^29.0.0, pretty-format@^29.6.2:+ version "29.6.2"+ resolved "https://registry.npmmirror.com/pretty-format/-/pretty-format-29.6.2.tgz#3d5829261a8a4d89d8b9769064b29c50ed486a47"+ integrity sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==+ dependencies:+ "@jest/schemas" "^29.6.0"+ ansi-styles "^5.0.0"+ react-is "^18.0.0"++prompts@^2.0.1:+ version "2.4.2"+ resolved "https://registry.npmmirror.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"+ integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==+ dependencies:+ kleur "^3.0.3"+ sisteransi "^1.0.5"+prop-types@^15.5.10, prop-types@^15.7.2, prop-types@^15.8.1:version "15.8.1"resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"@@ -2047,6 +3681,11 @@ prop-types@^15.5.10, prop-types@^15.7.2, prop-types@^15.8.1:object-assign "^4.1.1"react-is "^16.13.1"+pure-rand@^6.0.0:+ version "6.0.2"+ resolved "https://registry.npmmirror.com/pure-rand/-/pure-rand-6.0.2.tgz#a9c2ddcae9b68d736a8163036f088a2781c8b306"+ integrity sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==+queue-microtask@^1.2.2:version "1.2.3"resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"@@ -2123,6 +3762,11 @@ react-is@^17.0.2:resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==+react-is@^18.0.0:+ version "18.2.0"+ resolved "https://registry.npmmirror.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"+ integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==+react-leaflet@^4.2.1:version "4.2.1"resolved "https://registry.npmmirror.com/react-leaflet/-/react-leaflet-4.2.1.tgz#c300e9eccaf15cb40757552e181200aa10b94780"@@ -2236,6 +3880,23 @@ resize-observer-polyfill@^1.5.1:resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==+resolve-cwd@^3.0.0:+ version "3.0.0"+ resolved "https://registry.npmmirror.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"+ integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==+ dependencies:+ resolve-from "^5.0.0"++resolve-from@^5.0.0:+ version "5.0.0"+ resolved "https://registry.npmmirror.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"+ integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==++resolve.exports@^2.0.0:+ version "2.0.2"+ resolved "https://registry.npmmirror.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800"+ integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==+resolve@^1.1.7, resolve@^1.17.0, resolve@^1.22.1:version "1.22.1"resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"@@ -2245,6 +3906,15 @@ resolve@^1.1.7, resolve@^1.17.0, resolve@^1.22.1:path-parse "^1.0.7"supports-preserve-symlinks-flag "^1.0.0"+resolve@^1.20.0:+ version "1.22.4"+ resolved "https://registry.npmmirror.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34"+ integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==+ dependencies:+ is-core-module "^2.13.0"+ path-parse "^1.0.7"+ supports-preserve-symlinks-flag "^1.0.0"+reusify@^1.0.4:version "1.0.4"resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"@@ -2325,6 +3995,11 @@ semver@^6.3.0:resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==+semver@^6.3.1:+ version "6.3.1"+ resolved "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"+ integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==+semver@^7.3.8:version "7.3.8"resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"@@ -2332,6 +4007,13 @@ semver@^7.3.8:dependencies:lru-cache "^6.0.0"+semver@^7.5.3:+ version "7.5.4"+ resolved "https://registry.npmmirror.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"+ integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==+ dependencies:+ lru-cache "^6.0.0"+set-harmonic-interval@^1.0.1:version "1.0.1"resolved "https://registry.yarnpkg.com/set-harmonic-interval/-/set-harmonic-interval-1.0.1.tgz#e1773705539cdfb80ce1c3d99e7f298bb3995249"@@ -2342,17 +4024,52 @@ shallowequal@^1.1.0:resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==+shebang-command@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"+ integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==+ dependencies:+ shebang-regex "^3.0.0"++shebang-regex@^3.0.0:+ version "3.0.0"+ resolved "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"+ integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==++signal-exit@^3.0.3, signal-exit@^3.0.7:+ version "3.0.7"+ resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"+ integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==++sisteransi@^1.0.5:+ version "1.0.5"+ resolved "https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"+ integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==++slash@^3.0.0:+ version "3.0.0"+ resolved "https://registry.npmmirror.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"+ integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==+source-map-js@^1.0.2:version "1.0.2"resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==+ version "0.5.13"+ resolved "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"+ integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==+ dependencies:+ buffer-from "^1.0.0"+ source-map "^0.6.0"+version "0.5.6"resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"integrity sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA==-source-map@^0.6.1:+source-map@^0.6.0, source-map@^0.6.1:version "0.6.1"resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==@@ -2362,6 +4079,11 @@ sourcemap-codec@^1.4.8:resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==+sprintf-js@~1.0.2:+ version "1.0.3"+ resolved "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"+ integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==+stack-generator@^2.0.5:version "2.0.10"resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-2.0.10.tgz#8ae171e985ed62287d4f1ed55a1633b3fb53bb4d"@@ -2369,6 +4091,13 @@ stack-generator@^2.0.5:dependencies:stackframe "^1.3.4"+stack-utils@^2.0.3:+ version "2.0.6"+ resolved "https://registry.npmmirror.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f"+ integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==+ dependencies:+ escape-string-regexp "^2.0.0"+stackframe@^1.3.4:version "1.3.4"resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.3.4.tgz#b881a004c8c149a5e8efef37d51b16e412943310"@@ -2391,6 +4120,14 @@ stacktrace-js@^2.0.2:stack-generator "^2.0.5"stacktrace-gps "^3.0.4"+string-length@^4.0.1:+ version "4.0.2"+ resolved "https://registry.npmmirror.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a"+ integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==+ dependencies:+ char-regex "^1.0.2"+ strip-ansi "^6.0.0"+string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:version "4.2.3"resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"@@ -2407,6 +4144,21 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1:dependencies:ansi-regex "^5.0.1"+strip-bom@^4.0.0:+ version "4.0.0"+ resolved "https://registry.npmmirror.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878"+ integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==++strip-final-newline@^2.0.0:+ version "2.0.0"+ resolved "https://registry.npmmirror.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"+ integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==++strip-json-comments@^3.1.1:+ version "3.1.1"+ resolved "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"+ integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==+styled-components@^5.3.6:version "5.3.6"resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.6.tgz#27753c8c27c650bee9358e343fc927966bfd00d1"@@ -2435,6 +4187,20 @@ supports-color@^5.3.0, supports-color@^5.5.0:dependencies:has-flag "^3.0.0"+supports-color@^7.1.0:+ version "7.2.0"+ resolved "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"+ integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==+ dependencies:+ has-flag "^4.0.0"++supports-color@^8.0.0:+ version "8.1.1"+ resolved "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"+ integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==+ dependencies:+ has-flag "^4.0.0"+supports-preserve-symlinks-flag@^1.0.0:version "1.0.0"resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"@@ -2469,6 +4235,15 @@ tailwindcss@^3.2.4:quick-lru "^5.1.1"resolve "^1.22.1"+test-exclude@^6.0.0:+ version "6.0.0"+ resolved "https://registry.npmmirror.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"+ integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==+ dependencies:+ "@istanbuljs/schema" "^0.1.2"+ glob "^7.1.4"+ minimatch "^3.0.4"+throttle-debounce@^3.0.1:version "3.0.1"resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb"@@ -2484,6 +4259,11 @@ tinycolor2@^1.4.1:resolved "https://registry.npmmirror.com/tinycolor2/-/tinycolor2-1.6.0.tgz#f98007460169b0263b97072c5ae92484ce02d09e"integrity sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==+ version "1.0.5"+ resolved "https://registry.npmmirror.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"+ integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==+to-fast-properties@^2.0.0:version "2.0.0"resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"@@ -2518,6 +4298,20 @@ ts-easing@^0.2.0:resolved "https://registry.yarnpkg.com/ts-easing/-/ts-easing-0.2.0.tgz#c8a8a35025105566588d87dbda05dd7fbfa5a4ec"integrity sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==+ts-jest@^29.1.1:+ version "29.1.1"+ resolved "https://registry.npmmirror.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b"+ integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==+ dependencies:+ bs-logger "0.x"+ fast-json-stable-stringify "2.x"+ jest-util "^29.0.0"+ json5 "^2.2.3"+ lodash.memoize "4.x"+ make-error "1.x"+ semver "^7.5.3"+ yargs-parser "^21.0.1"+tslib@^2.1.0, tslib@^2.5.0, tslib@~2.5.0:version "2.5.0"resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"@@ -2528,12 +4322,22 @@ tslib@^2.4.0:resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==-typescript@^4.3.2, typescript@^4.6.4:+ version "4.0.8"+ resolved "https://registry.npmmirror.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"+ integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==++type-fest@^0.21.3:+ version "0.21.3"+ resolved "https://registry.npmmirror.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"+ integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==++typescript@^4.6.4:version "4.9.5"resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==-typescript@^5.0.2:+typescript@^5.0.2, typescript@^5.1.6:version "5.1.6"resolved "https://registry.npmmirror.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==@@ -2546,6 +4350,14 @@ update-browserslist-db@^1.0.10:escalade "^3.1.1"picocolors "^1.0.0"+update-browserslist-db@^1.0.11:+ version "1.0.11"+ resolved "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940"+ integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==+ dependencies:+ escalade "^3.1.1"+ picocolors "^1.0.0"+use-memo-one@^1.1.1:version "1.1.3"resolved "https://registry.yarnpkg.com/use-memo-one/-/use-memo-one-1.1.3.tgz#2fd2e43a2169eabc7496960ace8c79efef975e99"@@ -2556,6 +4368,20 @@ util-deprecate@^1.0.2:resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==+uuid@^8.3.2:+ version "8.3.2"+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"+ integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==++v8-to-istanbul@^9.0.1:+ version "9.1.0"+ resolved "https://registry.npmmirror.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265"+ integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==+ dependencies:+ "@jridgewell/trace-mapping" "^0.3.12"+ "@types/istanbul-lib-coverage" "^2.0.1"+ convert-source-map "^1.6.0"+vega-canvas@^1.2.5, vega-canvas@^1.2.6:version "1.2.6"resolved "https://registry.yarnpkg.com/vega-canvas/-/vega-canvas-1.2.6.tgz#55e032ce9a62acd17229f6bac66d99db3d6879cd"@@ -2962,6 +4788,13 @@ [email protected]:resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09"integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==+walker@^1.0.8:+ version "1.0.8"+ resolved "https://registry.npmmirror.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f"+ integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==+ dependencies:+ makeerror "1.0.12"+webidl-conversions@^3.0.0:version "3.0.1"resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"@@ -2975,6 +4808,13 @@ whatwg-url@^5.0.0:tr46 "~0.0.3"webidl-conversions "^3.0.0"+which@^2.0.1:+ version "2.0.2"+ resolved "https://registry.npmmirror.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"+ integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==+ dependencies:+ isexe "^2.0.0"+wrap-ansi@^7.0.0:version "7.0.0"resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"@@ -2984,6 +4824,19 @@ wrap-ansi@^7.0.0:string-width "^4.1.0"strip-ansi "^6.0.0"+wrappy@1:+ version "1.0.2"+ resolved "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"+ integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==++write-file-atomic@^4.0.2:+ version "4.0.2"+ resolved "https://registry.npmmirror.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd"+ integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==+ dependencies:+ imurmurhash "^0.1.4"+ signal-exit "^3.0.7"+xtend@^4.0.2:version "4.0.2"resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"@@ -3009,11 +4862,24 @@ yaml@^1.10.2:resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==-yargs-parser@^21.1.1:+yargs-parser@^21.0.1, yargs-parser@^21.1.1:version "21.1.1"resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==+yargs@^17.3.1:+ version "17.7.2"+ resolved "https://registry.npmmirror.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"+ integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==+ dependencies:+ cliui "^8.0.1"+ escalade "^3.1.1"+ get-caller-file "^2.0.5"+ require-directory "^2.1.1"+ string-width "^4.2.3"+ y18n "^5.0.5"+ yargs-parser "^21.1.1"+yargs@~17.6.2:version "17.6.2"resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541"@@ -3026,3 +4892,8 @@ yargs@~17.6.2:string-width "^4.2.3"y18n "^5.0.5"yargs-parser "^21.1.1"++yocto-queue@^0.1.0:+ version "0.1.0"+ resolved "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"+ integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==