Skip to content

An open source alternative to Tableau. Embeddable visual analytic

fix(gw): cross filter does not respond if time of interaction is too short

kyusho20525436b2db
diff --git a/packages/graphic-walker/src/config.ts b/packages/graphic-walker/src/config.ts
index da0b0780..b6591aae 100644
--- a/packages/graphic-walker/src/config.ts
+++ b/packages/graphic-walker/src/config.ts
@@ -25,18 +25,6 @@ export const CHART_LAYOUT_TYPE: Readonly<string[]> = [
'fixed',
] as const;
-export const EXPLORATION_TYPES = [
- 'none',
- 'brush',
- 'point',
-] as const;
-
-export const BRUSH_DIRECTIONS = [
- 'default',
- 'x',
- 'y',
-] as const;
-
export const COLORS = {
// tableau style
// dimension: 'rgb(73, 150, 178)',
diff --git a/packages/graphic-walker/src/interfaces.ts b/packages/graphic-walker/src/interfaces.ts
index 7ea7ca88..ad89343d 100644
--- a/packages/graphic-walker/src/interfaces.ts
+++ b/packages/graphic-walker/src/interfaces.ts
@@ -129,13 +129,26 @@ export type IFilterRule = {
value: Set<string | number>;
};
+export const EXPLORATION_TYPES = [
+ 'none',
+ 'brush',
+ 'point',
+] as const;
+
+export const BRUSH_DIRECTIONS = [
+ 'default',
+ 'x',
+ 'y',
+] as const;
export type IStackMode = 'none' | 'stack' | 'normalize';
+export type IExplorationType = (typeof EXPLORATION_TYPES)[number];
+export type IBrushDirection = (typeof BRUSH_DIRECTIONS)[number];
export interface IVisualConfig {
defaultAggregated: boolean;
geoms: string[];
- stack: 'none' | 'stack' | 'normalize';
+ stack: IStackMode;
showActions: boolean;
interactiveScale: boolean;
sorted: 'none' | 'ascending' | 'descending';
@@ -145,9 +158,9 @@ export interface IVisualConfig {
height: number;
}
exploration: {
- mode: 'none' | 'brush' | 'point';
+ mode: IExplorationType;
/** works when mode is 'brush' */
- brushDirection: 'default' | 'x' | 'y';
+ brushDirection: IBrushDirection;
};
}
diff --git a/packages/graphic-walker/src/vis/react-vega.tsx b/packages/graphic-walker/src/vis/react-vega.tsx
index 08732cc8..d3c1e120 100644
--- a/packages/graphic-walker/src/vis/react-vega.tsx
+++ b/packages/graphic-walker/src/vis/react-vega.tsx
@@ -515,7 +515,11 @@ const ReactVega: React.FC<ReactVegaProps> = props => {
}
const combinedParamStore$ = new Subject<ParamStoreEntry>();
const throttledParamStore$ = combinedParamStore$.pipe(
- op.throttleTime(dataSource.length / 64 * rowRepeatFields.length * colRepeatFields.length)
+ op.throttleTime(
+ dataSource.length / 64 * rowRepeatFields.length * colRepeatFields.length,
+ undefined,
+ { leading: false, trailing: true }
+ )
);
const subscriptions: Subscription[] = [];
const subscribe = (cb: (entry: ParamStoreEntry) => void) => {
diff --git a/packages/graphic-walker/src/visualSettings/index.tsx b/packages/graphic-walker/src/visualSettings/index.tsx
index effde4ea..beeef810 100644
--- a/packages/graphic-walker/src/visualSettings/index.tsx
+++ b/packages/graphic-walker/src/visualSettings/index.tsx
@@ -6,9 +6,9 @@ import { ArrowPathIcon } from '@heroicons/react/24/solid';
import { useTranslation } from 'react-i18next';
import { LiteForm } from '../components/liteForm';
import SizeSetting from '../components/sizeSetting';
-import { BRUSH_DIRECTIONS, CHART_LAYOUT_TYPE, EXPLORATION_TYPES, GEMO_TYPES, STACK_MODE } from '../config';
+import { GEMO_TYPES, STACK_MODE, CHART_LAYOUT_TYPE } from '../config';
import { useGlobalStore } from '../store';
-import { IStackMode } from '../interfaces';
+import { IStackMode, EXPLORATION_TYPES, IBrushDirection, BRUSH_DIRECTIONS } from '../interfaces';
export const LiteContainer = styled.div`
@@ -272,7 +272,7 @@ const VisualSettings: React.FC = () => {
value={visualConfig.exploration.brushDirection}
onChange={e => {
vizStore.setExploration({
- brushDirection: e.target.value as (typeof BRUSH_DIRECTIONS)[number]
+ brushDirection: e.target.value as IBrushDirection
});
}}
>