@kanaries/graphic-walker 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/transform.worker-a12fb3d8.js.map +1 -0
- package/dist/components/timeoutImg.d.ts +5 -0
- package/dist/fields/filterField/slider.d.ts +0 -1
- package/dist/graphic-walker.es.js +15327 -15103
- package/dist/graphic-walker.es.js.map +1 -1
- package/dist/graphic-walker.umd.js +243 -110
- package/dist/graphic-walker.umd.js.map +1 -1
- package/dist/store/index.d.ts +3 -8
- package/package.json +2 -1
- package/src/assets/kanaries.png +0 -0
- package/src/components/modal.tsx +9 -9
- package/src/components/timeoutImg.tsx +29 -0
- package/src/components/toolbar/components.tsx +1 -0
- package/src/fields/filterField/filterEditDialog.tsx +33 -8
- package/src/fields/filterField/slider.tsx +127 -85
- package/src/fields/filterField/tabs.tsx +352 -186
- package/src/lib/execExp.ts +1 -1
- package/src/locales/en-US.json +10 -3
- package/src/locales/ja-JP.json +10 -3
- package/src/locales/zh-CN.json +10 -3
- package/src/store/index.tsx +46 -45
- package/src/visualSettings/index.tsx +296 -70
- package/dist/assets/transform.worker-90e4f506.js.map +0 -1
package/src/locales/en-US.json
CHANGED
|
@@ -83,9 +83,12 @@
|
|
|
83
83
|
"variance": "Variance"
|
|
84
84
|
},
|
|
85
85
|
"filter_type": {
|
|
86
|
-
"one_of": "
|
|
86
|
+
"one_of": "Value set",
|
|
87
|
+
"one_of_desc": "Select values specified",
|
|
87
88
|
"range": "Range",
|
|
88
|
-
"
|
|
89
|
+
"range_desc": "Select values in a range [start, end]",
|
|
90
|
+
"temporal_range": "Date Range",
|
|
91
|
+
"temporal_range_desc": "Select values in a date range [start, end]"
|
|
89
92
|
}
|
|
90
93
|
},
|
|
91
94
|
"App": {
|
|
@@ -165,7 +168,7 @@
|
|
|
165
168
|
"filters": {
|
|
166
169
|
"to_edit": "Edit This Rule",
|
|
167
170
|
"empty_rule": "! (empty rule)",
|
|
168
|
-
"editing": "
|
|
171
|
+
"editing": "Filter Rule Settings",
|
|
169
172
|
"form": {
|
|
170
173
|
"name": "Field",
|
|
171
174
|
"rule": "Rule"
|
|
@@ -182,6 +185,10 @@
|
|
|
182
185
|
"reverse": "Reverse Selection",
|
|
183
186
|
"confirm": "Confirm",
|
|
184
187
|
"cancel": "Cancel"
|
|
188
|
+
},
|
|
189
|
+
"range": {
|
|
190
|
+
"start_value": "Start Value",
|
|
191
|
+
"end_value": "End Value"
|
|
185
192
|
}
|
|
186
193
|
},
|
|
187
194
|
"explain": {
|
package/src/locales/ja-JP.json
CHANGED
|
@@ -82,9 +82,12 @@
|
|
|
82
82
|
"variance": "分散"
|
|
83
83
|
},
|
|
84
84
|
"filter_type": {
|
|
85
|
-
"one_of": "
|
|
85
|
+
"one_of": "値のセット",
|
|
86
|
+
"one_of_desc": "指定された値を選択します",
|
|
86
87
|
"range": "範囲",
|
|
87
|
-
"
|
|
88
|
+
"range_desc": "範囲 [開始, 終了] 内の値を選択します",
|
|
89
|
+
"temporal_range": "日付範囲",
|
|
90
|
+
"temporal_range_desc": "日付範囲 [開始, 終了] 内の値を選択します"
|
|
88
91
|
}
|
|
89
92
|
},
|
|
90
93
|
"App": {
|
|
@@ -164,7 +167,7 @@
|
|
|
164
167
|
"filters": {
|
|
165
168
|
"to_edit": "このルールを編集",
|
|
166
169
|
"empty_rule": "! (空のルール)",
|
|
167
|
-
"editing": "
|
|
170
|
+
"editing": "フィルタールールの設定",
|
|
168
171
|
"form": {
|
|
169
172
|
"name": "フィールド",
|
|
170
173
|
"rule": "ルール"
|
|
@@ -181,6 +184,10 @@
|
|
|
181
184
|
"reverse": "選択を反転する",
|
|
182
185
|
"confirm": "確認",
|
|
183
186
|
"cancel": "キャンセル"
|
|
187
|
+
},
|
|
188
|
+
"range": {
|
|
189
|
+
"start_value": "開始値",
|
|
190
|
+
"end_value": "終了値"
|
|
184
191
|
}
|
|
185
192
|
},
|
|
186
193
|
"explain": {
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -84,8 +84,11 @@
|
|
|
84
84
|
},
|
|
85
85
|
"filter_type": {
|
|
86
86
|
"one_of": "按值筛选",
|
|
87
|
+
"one_of_desc": "选择指定的值",
|
|
87
88
|
"range": "按范围筛选",
|
|
88
|
-
"
|
|
89
|
+
"range_desc": "选择范围内的值 [开始, 结束]",
|
|
90
|
+
"temporal_range": "按日期范围筛选",
|
|
91
|
+
"temporal_range_desc": "选择日期范围内的值 [开始, 结束]"
|
|
89
92
|
}
|
|
90
93
|
},
|
|
91
94
|
"App": {
|
|
@@ -165,7 +168,7 @@
|
|
|
165
168
|
"filters": {
|
|
166
169
|
"to_edit": "编辑这条规则",
|
|
167
170
|
"empty_rule": "! (空的规则)",
|
|
168
|
-
"editing": "
|
|
171
|
+
"editing": "筛选器规则设定",
|
|
169
172
|
"form": {
|
|
170
173
|
"name": "字段",
|
|
171
174
|
"rule": "规则"
|
|
@@ -182,6 +185,10 @@
|
|
|
182
185
|
"reverse": "选择反向",
|
|
183
186
|
"confirm": "确认",
|
|
184
187
|
"cancel": "取消"
|
|
188
|
+
},
|
|
189
|
+
"range": {
|
|
190
|
+
"start_value": "起始值",
|
|
191
|
+
"end_value": "终止值"
|
|
185
192
|
}
|
|
186
193
|
},
|
|
187
194
|
"explain": {
|
|
@@ -203,6 +210,6 @@
|
|
|
203
210
|
"next": "向后",
|
|
204
211
|
"drop_field": "拖拽字段至此",
|
|
205
212
|
"confirm": "确认",
|
|
206
|
-
"
|
|
213
|
+
"cancel": "取消"
|
|
207
214
|
}
|
|
208
215
|
}
|
package/src/store/index.tsx
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { CommonStore } from './commonStore'
|
|
3
|
-
import { VizSpecStore } from './visualSpecStore'
|
|
1
|
+
import React, { useContext, useMemo, useEffect } from 'react';
|
|
2
|
+
import { CommonStore } from './commonStore';
|
|
3
|
+
import { VizSpecStore } from './visualSpecStore';
|
|
4
4
|
|
|
5
5
|
export interface IGlobalStore {
|
|
6
6
|
commonStore: CommonStore;
|
|
7
7
|
vizStore: VizSpecStore;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const StoreDict: Record<string, IGlobalStore> = {};
|
|
11
|
+
const createStore = () => {
|
|
12
|
+
const commonStore = new CommonStore();
|
|
13
|
+
const vizStore = new VizSpecStore(commonStore);
|
|
14
|
+
return {
|
|
15
|
+
commonStore,
|
|
16
|
+
vizStore,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const getStore = (key?: string): IGlobalStore => {
|
|
20
|
+
if (key) {
|
|
21
|
+
if (!StoreDict[key]) StoreDict[key] = createStore();
|
|
22
|
+
return StoreDict[key];
|
|
23
|
+
} else {
|
|
24
|
+
return createStore();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
17
27
|
|
|
18
28
|
const StoreContext = React.createContext<IGlobalStore>(null!);
|
|
19
|
-
|
|
20
|
-
export function destroyGWStore() {
|
|
21
|
-
initStore.commonStore.destroy();
|
|
22
|
-
initStore.vizStore.destroy();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function rebootGWStore() {
|
|
26
|
-
const cs = new CommonStore();
|
|
27
|
-
const vs = new VizSpecStore(cs);
|
|
28
|
-
initStore.commonStore = cs;
|
|
29
|
-
initStore.vizStore = vs;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
29
|
interface StoreWrapperProps {
|
|
33
|
-
keepAlive?: boolean;
|
|
30
|
+
keepAlive?: boolean | string;
|
|
34
31
|
storeRef?: React.MutableRefObject<IGlobalStore | null>;
|
|
32
|
+
children?: React.ReactNode;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
|
|
35
|
+
const noop = () => {};
|
|
36
|
+
|
|
37
|
+
export const StoreWrapper = (props: StoreWrapperProps) => {
|
|
38
|
+
const storeKey = props.keepAlive ? `${props.keepAlive}` : '';
|
|
39
|
+
const store = useMemo(() => getStore(storeKey), [storeKey]);
|
|
40
|
+
useEffect(() => {
|
|
39
41
|
if (props.storeRef) {
|
|
40
|
-
props.storeRef
|
|
42
|
+
const ref = props.storeRef;
|
|
43
|
+
ref.current = store;
|
|
44
|
+
return () => {
|
|
45
|
+
ref.current = null;
|
|
46
|
+
};
|
|
41
47
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
destroyGWStore();
|
|
48
|
+
return noop;
|
|
49
|
+
}, [props.storeRef]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!storeKey) {
|
|
52
|
+
return () => {
|
|
53
|
+
store.commonStore.destroy();
|
|
54
|
+
store.vizStore.destroy();
|
|
55
|
+
};
|
|
52
56
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</StoreContext.Provider>
|
|
58
|
-
}
|
|
59
|
-
}
|
|
57
|
+
return noop;
|
|
58
|
+
}, [storeKey]);
|
|
59
|
+
return <StoreContext.Provider value={store}>{props.children}</StoreContext.Provider>;
|
|
60
|
+
};
|
|
60
61
|
|
|
61
62
|
export function useGlobalStore() {
|
|
62
63
|
return useContext(StoreContext);
|