@kanaries/graphic-walker 0.2.14 → 0.2.16
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/App.d.ts +5 -2
- package/dist/assets/explainer.worker-8428eb12.js.map +1 -1
- package/dist/assets/transform.worker-5d54ff09.js.map +1 -0
- package/dist/assets/viewQuery.worker-ffefc111.js.map +1 -0
- package/dist/components/callout.d.ts +2 -0
- package/dist/components/codeExport/index.d.ts +3 -0
- package/dist/components/loadingLayer.d.ts +2 -0
- package/dist/components/tabs/defaultTab.d.ts +1 -0
- package/dist/components/tabs/editableTab.d.ts +1 -2
- package/dist/components/toolbar/components.d.ts +4 -1
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/toolbar-item.d.ts +3 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/dataSource/dataSelection/config.d.ts +1 -0
- package/dist/dataSource/dataSelection/utils.d.ts +2 -0
- package/dist/datasets/tmp/test.json +1 -0
- package/dist/fields/components.d.ts +0 -1
- package/dist/fields/filterField/filterEditDialog.d.ts +1 -1
- package/dist/graphic-walker.es.js +23930 -23320
- package/dist/graphic-walker.es.js.map +1 -1
- package/dist/graphic-walker.umd.js +143 -273
- package/dist/graphic-walker.umd.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/interfaces.d.ts +23 -1
- package/dist/lib/execExp.d.ts +8 -0
- package/dist/lib/interfaces.d.ts +22 -0
- package/dist/lib/op/aggregate.d.ts +3 -0
- package/dist/lib/op/bin.d.ts +3 -0
- package/dist/lib/op/fold.d.ts +3 -0
- package/dist/lib/op/stat.d.ts +8 -0
- package/dist/lib/viewQuery.d.ts +5 -0
- package/dist/models/visSpecHistory.d.ts +2 -0
- package/dist/renderer/index.d.ts +6 -3
- package/dist/renderer/specRenderer.d.ts +13 -0
- package/dist/services.d.ts +4 -1
- package/dist/store/commonStore.d.ts +6 -0
- package/dist/store/index.d.ts +3 -2
- package/dist/store/visualSpecStore.d.ts +11 -4
- package/dist/utils/dataPrep.d.ts +2 -0
- package/dist/utils/index.d.ts +3 -5
- package/dist/utils/media.d.ts +2 -1
- package/dist/utils/save.d.ts +1 -2
- package/dist/vis/react-vega.d.ts +4 -23
- package/dist/vis/spec/aggregate.d.ts +4 -0
- package/dist/vis/spec/encode.d.ts +19 -0
- package/dist/vis/spec/field.d.ts +2 -0
- package/dist/vis/spec/mark.d.ts +7 -0
- package/dist/vis/spec/stack.d.ts +4 -0
- package/dist/vis/spec/view.d.ts +67 -0
- package/dist/vis/theme.d.ts +36 -20
- package/dist/visualSettings/index.d.ts +2 -1
- package/dist/workers/transform.d.ts +2 -0
- package/package.json +4 -3
- package/src/App.tsx +23 -15
- package/src/components/callout.tsx +9 -7
- package/src/components/clickMenu.tsx +1 -7
- package/src/components/codeExport/index.tsx +114 -0
- package/src/components/dataTable/index.tsx +10 -10
- package/src/components/loadingLayer.tsx +7 -0
- package/src/components/modal.tsx +1 -15
- package/src/components/sizeSetting.tsx +2 -2
- package/src/components/tabs/defaultTab.tsx +4 -2
- package/src/components/tabs/editableTab.tsx +75 -40
- package/src/components/toolbar/components.tsx +8 -23
- package/src/components/toolbar/index.tsx +11 -4
- package/src/components/toolbar/toolbar-button.tsx +2 -1
- package/src/components/toolbar/toolbar-item.tsx +17 -12
- package/src/components/toolbar/toolbar-select-button.tsx +9 -13
- package/src/components/toolbar/toolbar-toggle-button.tsx +2 -1
- package/src/components/tooltip.tsx +10 -6
- package/src/dataSource/dataSelection/config.ts +11 -0
- package/src/dataSource/dataSelection/csvData.tsx +72 -40
- package/src/dataSource/dataSelection/gwFile.tsx +2 -2
- package/src/dataSource/dataSelection/utils.ts +28 -0
- package/src/dataSource/index.tsx +2 -3
- package/src/dataSource/utils.ts +8 -3
- package/src/fields/components.tsx +13 -50
- package/src/fields/datasetFields/index.tsx +3 -4
- package/src/fields/datasetFields/meaFields.tsx +12 -4
- package/src/fields/encodeFields/singleEncodeEditor.tsx +1 -1
- package/src/fields/filterField/filterEditDialog.tsx +63 -99
- package/src/fields/filterField/slider.tsx +1 -1
- package/src/index.css +4 -4
- package/src/index.tsx +22 -22
- package/src/insightBoard/mainBoard.tsx +9 -2
- package/src/interfaces.ts +30 -3
- package/src/lib/execExp.ts +147 -0
- package/src/lib/interfaces.ts +39 -0
- package/src/lib/op/aggregate.ts +49 -0
- package/src/lib/op/bin.ts +25 -0
- package/src/lib/op/fold.ts +17 -0
- package/src/lib/op/stat.ts +46 -0
- package/src/lib/viewQuery.ts +23 -0
- package/src/locales/en-US.json +8 -3
- package/src/locales/i18n.ts +7 -1
- package/src/locales/ja-JP.json +197 -0
- package/src/locales/zh-CN.json +8 -3
- package/src/main.tsx +1 -1
- package/src/models/visSpecHistory.ts +14 -0
- package/src/renderer/index.tsx +58 -101
- package/src/renderer/specRenderer.tsx +119 -0
- package/src/segments/segmentNav.tsx +3 -16
- package/src/segments/visNav.tsx +17 -6
- package/src/services.ts +37 -1
- package/src/store/commonStore.ts +14 -9
- package/src/store/index.tsx +11 -4
- package/src/store/visualSpecStore.ts +89 -50
- package/src/utils/dataPrep.ts +24 -0
- package/src/utils/index.ts +16 -17
- package/src/utils/media.ts +16 -11
- package/src/utils/normalization.ts +3 -1
- package/src/utils/save.ts +1 -2
- package/src/vis/react-vega.tsx +11 -332
- package/src/vis/spec/aggregate.ts +13 -0
- package/src/vis/spec/encode.ts +69 -0
- package/src/vis/spec/field.ts +10 -0
- package/src/vis/spec/mark.ts +30 -0
- package/src/vis/spec/stack.ts +11 -0
- package/src/vis/spec/view.ts +138 -0
- package/src/vis/theme.ts +35 -25
- package/src/visualSettings/index.tsx +22 -33
- package/src/workers/transform.ts +12 -0
- package/src/workers/transform.worker.js +13 -0
- package/src/workers/viewQuery.worker.js +16 -0
- package/dist/components/container.d.ts +0 -2
- package/dist/dataSource/pannel.d.ts +0 -5
- package/src/components/container.tsx +0 -25
- package/src/dataSource/pannel.tsx +0 -71
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { IGWProps } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IGWProps } from "./App";
|
|
3
|
+
import "./empty_sheet.css";
|
|
4
4
|
export declare const ShadowDomContext: React.Context<{
|
|
5
5
|
root: ShadowRoot | null;
|
|
6
6
|
}>;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -30,6 +30,24 @@ export interface IUncertainMutField {
|
|
|
30
30
|
semanticType: ISemanticType | '?';
|
|
31
31
|
analyticType: IAnalyticType | '?';
|
|
32
32
|
}
|
|
33
|
+
export type IExpParamter = {
|
|
34
|
+
type: 'field';
|
|
35
|
+
value: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'value';
|
|
38
|
+
value: any;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'expression';
|
|
41
|
+
value: IExpression;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'constant';
|
|
44
|
+
value: any;
|
|
45
|
+
};
|
|
46
|
+
export interface IExpression {
|
|
47
|
+
op: 'bin' | 'log2' | 'log10' | 'one' | 'binCount';
|
|
48
|
+
params: IExpParamter[];
|
|
49
|
+
as: string;
|
|
50
|
+
}
|
|
33
51
|
export interface IField {
|
|
34
52
|
/**
|
|
35
53
|
* fid: key in data record
|
|
@@ -46,6 +64,8 @@ export interface IField {
|
|
|
46
64
|
semanticType: ISemanticType;
|
|
47
65
|
analyticType: IAnalyticType;
|
|
48
66
|
cmp?: (a: any, b: any) => number;
|
|
67
|
+
computed?: boolean;
|
|
68
|
+
expressoion?: IExpression;
|
|
49
69
|
}
|
|
50
70
|
export interface IViewField extends IField {
|
|
51
71
|
dragId: string;
|
|
@@ -146,7 +166,7 @@ export interface IVisualConfig {
|
|
|
146
166
|
}
|
|
147
167
|
export interface IVisSpec {
|
|
148
168
|
readonly visId: string;
|
|
149
|
-
readonly name?:
|
|
169
|
+
readonly name?: string;
|
|
150
170
|
readonly encodings: DeepReadonly<DraggableFieldState>;
|
|
151
171
|
readonly config: DeepReadonly<IVisualConfig>;
|
|
152
172
|
}
|
|
@@ -154,3 +174,5 @@ export declare enum ISegmentKey {
|
|
|
154
174
|
vis = "vis",
|
|
155
175
|
data = "data"
|
|
156
176
|
}
|
|
177
|
+
export type IThemeKey = 'vega' | 'g2';
|
|
178
|
+
export type IDarkMode = 'media' | 'light' | 'dark';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IExpression, IField, IRow } from "../interfaces";
|
|
2
|
+
interface IDataFrame {
|
|
3
|
+
[key: string]: any[];
|
|
4
|
+
}
|
|
5
|
+
export declare function execExpression(exp: IExpression, dataFrame: IDataFrame, columns: IField[]): IDataFrame;
|
|
6
|
+
export declare function dataset2DataFrame(dataset: IRow[], columns: IField[]): IDataFrame;
|
|
7
|
+
export declare function dataframe2Dataset(dataFrame: IDataFrame, columns: IField[]): IRow[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IAggQuery {
|
|
2
|
+
op: 'aggregate';
|
|
3
|
+
groupBy: string[];
|
|
4
|
+
agg: {
|
|
5
|
+
[field: string]: 'sum' | 'count' | 'max' | 'min' | 'mean' | 'median' | 'variance' | 'stdev';
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface IFoldQuery {
|
|
9
|
+
op: 'fold';
|
|
10
|
+
foldBy: string[];
|
|
11
|
+
newFoldKeyCol: string;
|
|
12
|
+
newFoldValueCol: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IBinQuery {
|
|
15
|
+
op: 'bin';
|
|
16
|
+
binBy: string;
|
|
17
|
+
newBinCol: string;
|
|
18
|
+
binSize: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IRawQuery {
|
|
21
|
+
op: 'raw';
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function mean(nums: number[]): number;
|
|
2
|
+
export declare function sum(nums: number[]): number;
|
|
3
|
+
export declare function median(nums: number[]): number;
|
|
4
|
+
export declare function variance(nums: number[]): number;
|
|
5
|
+
export declare function stdev(nums: number[]): number;
|
|
6
|
+
export declare function max(nums: number[]): number;
|
|
7
|
+
export declare function min(nums: number[]): number;
|
|
8
|
+
export declare function count(nums: number[]): number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IRow } from "visual-insights";
|
|
2
|
+
import { IMutField } from "../interfaces";
|
|
3
|
+
import { IAggQuery, IBinQuery, IFoldQuery, IRawQuery } from "./interfaces";
|
|
4
|
+
export type IViewQuery = IAggQuery | IFoldQuery | IBinQuery | IRawQuery;
|
|
5
|
+
export declare function queryView(rawData: IRow[], metas: IMutField[], query: IViewQuery): IRow[];
|
|
@@ -6,6 +6,7 @@ export declare class VisSpecWithHistory {
|
|
|
6
6
|
constructor(data: IVisSpec);
|
|
7
7
|
private get frame();
|
|
8
8
|
private batchFlag;
|
|
9
|
+
updateLatest(snapshot: Partial<Readonly<VisSpecWithHistory['snapshots'][0]>>): void;
|
|
9
10
|
private commit;
|
|
10
11
|
get canUndo(): boolean;
|
|
11
12
|
undo(): boolean;
|
|
@@ -18,5 +19,6 @@ export declare class VisSpecWithHistory {
|
|
|
18
19
|
set encodings(encodings: IVisSpec['encodings']);
|
|
19
20
|
get config(): DeepReadonly<IVisualConfig>;
|
|
20
21
|
set config(config: IVisSpec['config']);
|
|
22
|
+
clone(): VisSpecWithHistory;
|
|
21
23
|
exportGW(): IVisSpec;
|
|
22
24
|
}
|
package/dist/renderer/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IDarkMode, IThemeKey } from '../interfaces';
|
|
2
3
|
import { IReactVegaHandler } from '../vis/react-vega';
|
|
3
|
-
|
|
4
|
-
themeKey?:
|
|
5
|
-
|
|
4
|
+
interface RendererProps {
|
|
5
|
+
themeKey?: IThemeKey;
|
|
6
|
+
dark?: IDarkMode;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<RendererProps & React.RefAttributes<IReactVegaHandler>, "key" | keyof RendererProps> & React.RefAttributes<IReactVegaHandler>>>;
|
|
6
9
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IReactVegaHandler } from '../vis/react-vega';
|
|
3
|
+
import { DeepReadonly, DraggableFieldState, IDarkMode, IRow, IThemeKey, IVisualConfig } from '../interfaces';
|
|
4
|
+
interface SpecRendererProps {
|
|
5
|
+
themeKey?: IThemeKey;
|
|
6
|
+
dark?: IDarkMode;
|
|
7
|
+
data: IRow[];
|
|
8
|
+
loading: boolean;
|
|
9
|
+
draggableFieldState: DeepReadonly<DraggableFieldState>;
|
|
10
|
+
visualConfig: IVisualConfig;
|
|
11
|
+
}
|
|
12
|
+
declare const SpecRenderer: React.ForwardRefExoticComponent<SpecRendererProps & React.RefAttributes<IReactVegaHandler>>;
|
|
13
|
+
export default SpecRenderer;
|
package/dist/services.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Specification } from 'visual-insights';
|
|
2
2
|
import { IRow, Filters, SemanticType, IMeasure, IMutField, IFilterField } from './interfaces';
|
|
3
3
|
import { IExplaination, IMeasureWithStat } from './insights';
|
|
4
|
+
import { IViewQuery } from './lib/viewQuery';
|
|
4
5
|
interface ExplainParams {
|
|
5
6
|
dimensions: string[];
|
|
6
7
|
measures: string[];
|
|
@@ -31,5 +32,7 @@ interface PreAnalysisParams {
|
|
|
31
32
|
}
|
|
32
33
|
export declare function preAnalysis(props: PreAnalysisParams): Promise<void>;
|
|
33
34
|
export declare function destroyWorker(): void;
|
|
34
|
-
export declare const applyFilter: (data:
|
|
35
|
+
export declare const applyFilter: (data: IRow[], filters: readonly IFilterField[]) => Promise<IRow[]>;
|
|
36
|
+
export declare const transformDataService: (data: IRow[], columns: IMutField[]) => Promise<IRow[]>;
|
|
37
|
+
export declare const applyViewQuery: (data: IRow[], metas: IMutField[], query: IViewQuery) => Promise<IRow[]>;
|
|
35
38
|
export {};
|
|
@@ -13,6 +13,7 @@ export declare class CommonStore {
|
|
|
13
13
|
position: [number, number];
|
|
14
14
|
};
|
|
15
15
|
showDataConfig: boolean;
|
|
16
|
+
showCodeExportPanel: boolean;
|
|
16
17
|
filters: Filters;
|
|
17
18
|
segmentKey: ISegmentKey;
|
|
18
19
|
constructor();
|
|
@@ -22,6 +23,7 @@ export declare class CommonStore {
|
|
|
22
23
|
setShowDataConfig(show: boolean): void;
|
|
23
24
|
setShowInsightBoard(show: boolean): void;
|
|
24
25
|
showEmbededMenu(position: [number, number]): void;
|
|
26
|
+
setShowCodeExportPanel(show: boolean): void;
|
|
25
27
|
closeEmbededMenu(): void;
|
|
26
28
|
initTempDS(): void;
|
|
27
29
|
updateTempFields(fields: IMutField[]): void;
|
|
@@ -31,6 +33,10 @@ export declare class CommonStore {
|
|
|
31
33
|
updateTempFieldSemanticType(fieldKey: string, semanticType: IMutField['semanticType']): void;
|
|
32
34
|
updateTempName(name: string): void;
|
|
33
35
|
updateTempDS(rawData: IRow[]): void;
|
|
36
|
+
/**
|
|
37
|
+
* update temp dataset (standard) with dataset info
|
|
38
|
+
* @param dataset
|
|
39
|
+
*/
|
|
34
40
|
updateTempSTDDS(dataset: IDataSetInfo): void;
|
|
35
41
|
commitTempDS(): void;
|
|
36
42
|
startDSBuildingTask(): void;
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonStore } from './commonStore';
|
|
3
3
|
import { VizSpecStore } from './visualSpecStore';
|
|
4
|
-
interface
|
|
4
|
+
export interface IGlobalStore {
|
|
5
5
|
commonStore: CommonStore;
|
|
6
6
|
vizStore: VizSpecStore;
|
|
7
7
|
}
|
|
@@ -9,11 +9,12 @@ export declare function destroyGWStore(): void;
|
|
|
9
9
|
export declare function rebootGWStore(): void;
|
|
10
10
|
interface StoreWrapperProps {
|
|
11
11
|
keepAlive?: boolean;
|
|
12
|
+
storeRef?: React.MutableRefObject<IGlobalStore | null>;
|
|
12
13
|
}
|
|
13
14
|
export declare class StoreWrapper extends React.Component<StoreWrapperProps> {
|
|
14
15
|
constructor(props: StoreWrapperProps);
|
|
15
16
|
componentWillUnmount(): void;
|
|
16
17
|
render(): JSX.Element;
|
|
17
18
|
}
|
|
18
|
-
export declare function useGlobalStore():
|
|
19
|
+
export declare function useGlobalStore(): IGlobalStore;
|
|
19
20
|
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Specification } from "visual-insights";
|
|
2
|
-
import { DataSet, DraggableFieldState, IFilterRule, IViewField, IVisualConfig } from "../interfaces";
|
|
2
|
+
import { DataSet, DraggableFieldState, IFilterRule, IViewField, IVisSpec, IVisualConfig } from "../interfaces";
|
|
3
3
|
import { VisSpecWithHistory } from "../models/visSpecHistory";
|
|
4
|
+
import { IStoInfo } from "../utils/save";
|
|
4
5
|
import { CommonStore } from "./commonStore";
|
|
6
|
+
export declare function initEncoding(): DraggableFieldState;
|
|
7
|
+
export declare function initVisualConfig(): IVisualConfig;
|
|
5
8
|
type DeepReadonly<T extends Record<keyof any, any>> = {
|
|
6
9
|
readonly [K in keyof T]: T[K] extends Record<keyof any, any> ? DeepReadonly<T[K]> : T[K];
|
|
7
10
|
};
|
|
@@ -76,7 +79,9 @@ export declare class VizSpecStore {
|
|
|
76
79
|
* dimension fields in visualization
|
|
77
80
|
*/
|
|
78
81
|
get viewMeasures(): IViewField[];
|
|
79
|
-
|
|
82
|
+
get allFields(): IViewField[];
|
|
83
|
+
get viewFilters(): readonly DeepReadonly<import("../interfaces").IFilterField>[];
|
|
84
|
+
addVisualization(defaultName?: string): void;
|
|
80
85
|
selectVisualization(visIndex: number): void;
|
|
81
86
|
setVisName(visIndex: number, name: string): void;
|
|
82
87
|
initState(): void;
|
|
@@ -99,8 +104,8 @@ export declare class VizSpecStore {
|
|
|
99
104
|
setFilterEditing(index: number): void;
|
|
100
105
|
closeFilterEditing(): void;
|
|
101
106
|
transpose(): void;
|
|
102
|
-
createBinField(stateKey: keyof DraggableFieldState, index: number): void;
|
|
103
|
-
createLogField(stateKey: keyof DraggableFieldState, index: number): void;
|
|
107
|
+
createBinField(stateKey: keyof DraggableFieldState, index: number, binType: 'bin' | 'binCount'): void;
|
|
108
|
+
createLogField(stateKey: keyof DraggableFieldState, index: number, scaleType: 'log10' | 'log2'): void;
|
|
104
109
|
setFieldAggregator(stateKey: keyof DraggableFieldState, index: number, aggName: string): void;
|
|
105
110
|
get sortCondition(): boolean;
|
|
106
111
|
setFieldSort(stateKey: keyof DraggableFieldState, index: number, sortType: "none" | "ascending" | "descending"): void;
|
|
@@ -109,6 +114,8 @@ export declare class VizSpecStore {
|
|
|
109
114
|
renderSpec(spec: Specification): void;
|
|
110
115
|
destroy(): void;
|
|
111
116
|
exportAsRaw(): string;
|
|
117
|
+
exportViewSpec(): IVisSpec[];
|
|
118
|
+
importStoInfo(stoInfo: IStoInfo): void;
|
|
112
119
|
importRaw(raw: string): void;
|
|
113
120
|
}
|
|
114
121
|
export {};
|
package/dist/utils/dataPrep.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRow, Filters,
|
|
1
|
+
import { IRow, Filters, IViewField } from "../interfaces";
|
|
2
2
|
export declare function checkMajorFactor(data: IRow[], childrenData: Map<any, IRow[]>, dimensions: string[], measures: string[]): {
|
|
3
3
|
majorKey: string;
|
|
4
4
|
majorSum: number;
|
|
@@ -16,9 +16,7 @@ export declare function getPredicates(selection: IRow[], dimensions: string[], m
|
|
|
16
16
|
export declare function getPredicatesFromVegaSignals(signals: Filters, dimensions: string[], measures: string[]): IPredicate[];
|
|
17
17
|
export declare function filterByPredicates(data: IRow[], predicates: IPredicate[]): IRow[];
|
|
18
18
|
export declare function applyFilters(dataSource: IRow[], filters: Filters): IRow[];
|
|
19
|
-
export declare function
|
|
20
|
-
dataSource: IRow[];
|
|
21
|
-
fields: IMutField[];
|
|
22
|
-
};
|
|
19
|
+
export declare function createCountField(): IViewField;
|
|
23
20
|
export declare function getRange(nums: number[]): [number, number];
|
|
24
21
|
export declare function makeNumbersBeautiful(nums: number[]): number[];
|
|
22
|
+
export declare function classNames(...classes: string[]): string;
|
package/dist/utils/media.d.ts
CHANGED
package/dist/utils/save.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { IDataSet, IDataSource, IVisSpec } from "../interfaces";
|
|
|
2
2
|
import { VisSpecWithHistory } from "../models/visSpecHistory";
|
|
3
3
|
export declare function dumpsGWPureSpec(list: VisSpecWithHistory[]): IVisSpec[];
|
|
4
4
|
export declare function parseGWPureSpec(list: IVisSpec[]): VisSpecWithHistory[];
|
|
5
|
-
interface IStoInfo {
|
|
5
|
+
export interface IStoInfo {
|
|
6
6
|
datasets: IDataSet[];
|
|
7
7
|
specList: {
|
|
8
8
|
[K in keyof IVisSpec]: K extends "config" ? Partial<IVisSpec[K]> : IVisSpec[K];
|
|
@@ -12,4 +12,3 @@ interface IStoInfo {
|
|
|
12
12
|
export declare function stringifyGWContent(info: IStoInfo): string;
|
|
13
13
|
export declare function parseGWContent(raw: string): IStoInfo;
|
|
14
14
|
export declare function download(data: string, filename: string, type: string): void;
|
|
15
|
-
export {};
|
package/dist/vis/react-vega.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IViewField, IRow, IStackMode } from '../interfaces';
|
|
2
|
+
import { IViewField, IRow, IStackMode, IDarkMode, IThemeKey } from '../interfaces';
|
|
3
|
+
import { SingleViewProps } from './spec/view';
|
|
3
4
|
export interface IReactVegaHandler {
|
|
4
5
|
getSVGData: () => Promise<string[]>;
|
|
5
6
|
getCanvasData: () => Promise<string[]>;
|
|
@@ -28,28 +29,8 @@ interface ReactVegaProps {
|
|
|
28
29
|
selectEncoding: SingleViewProps['selectEncoding'];
|
|
29
30
|
brushEncoding: SingleViewProps['brushEncoding'];
|
|
30
31
|
/** @default "vega" */
|
|
31
|
-
themeKey?:
|
|
32
|
-
|
|
33
|
-
interface SingleViewProps {
|
|
34
|
-
x: IViewField;
|
|
35
|
-
y: IViewField;
|
|
36
|
-
color: IViewField;
|
|
37
|
-
opacity: IViewField;
|
|
38
|
-
size: IViewField;
|
|
39
|
-
shape: IViewField;
|
|
40
|
-
xOffset: IViewField;
|
|
41
|
-
yOffset: IViewField;
|
|
42
|
-
row: IViewField;
|
|
43
|
-
column: IViewField;
|
|
44
|
-
theta: IViewField;
|
|
45
|
-
radius: IViewField;
|
|
46
|
-
defaultAggregated: boolean;
|
|
47
|
-
stack: IStackMode;
|
|
48
|
-
geomType: string;
|
|
49
|
-
enableCrossFilter: boolean;
|
|
50
|
-
asCrossFilterTrigger: boolean;
|
|
51
|
-
selectEncoding: 'default' | 'none';
|
|
52
|
-
brushEncoding: 'x' | 'y' | 'default' | 'none';
|
|
32
|
+
themeKey?: IThemeKey;
|
|
33
|
+
dark?: IDarkMode;
|
|
53
34
|
}
|
|
54
35
|
declare const ReactVega: React.ForwardRefExoticComponent<ReactVegaProps & React.RefAttributes<IReactVegaHandler>>;
|
|
55
36
|
export default ReactVega;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IViewField } from '../../interfaces';
|
|
2
|
+
export interface IEncodeProps {
|
|
3
|
+
geomType: string;
|
|
4
|
+
x: IViewField;
|
|
5
|
+
y: IViewField;
|
|
6
|
+
color: IViewField;
|
|
7
|
+
opacity: IViewField;
|
|
8
|
+
size: IViewField;
|
|
9
|
+
shape: IViewField;
|
|
10
|
+
xOffset: IViewField;
|
|
11
|
+
yOffset: IViewField;
|
|
12
|
+
row: IViewField;
|
|
13
|
+
column: IViewField;
|
|
14
|
+
theta: IViewField;
|
|
15
|
+
radius: IViewField;
|
|
16
|
+
}
|
|
17
|
+
export declare function channelEncode(props: IEncodeProps): {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IStackMode } from '../../interfaces';
|
|
2
|
+
import { IEncodeProps } from './encode';
|
|
3
|
+
export interface SingleViewProps extends IEncodeProps {
|
|
4
|
+
defaultAggregated: boolean;
|
|
5
|
+
stack: IStackMode;
|
|
6
|
+
enableCrossFilter: boolean;
|
|
7
|
+
asCrossFilterTrigger: boolean;
|
|
8
|
+
selectEncoding: 'default' | 'none';
|
|
9
|
+
brushEncoding: 'x' | 'y' | 'default' | 'none';
|
|
10
|
+
hideLegend?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function getSingleView(props: SingleViewProps): {
|
|
13
|
+
config: any;
|
|
14
|
+
mark: {
|
|
15
|
+
type: string;
|
|
16
|
+
opacity: number;
|
|
17
|
+
tooltip: boolean;
|
|
18
|
+
};
|
|
19
|
+
encoding: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
transform?: undefined;
|
|
23
|
+
params?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
config: any;
|
|
26
|
+
transform: {
|
|
27
|
+
filter: {
|
|
28
|
+
param: string;
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
params: {
|
|
32
|
+
name: string;
|
|
33
|
+
select: {
|
|
34
|
+
type: string;
|
|
35
|
+
encodings: ("x" | "y")[] | undefined;
|
|
36
|
+
};
|
|
37
|
+
}[];
|
|
38
|
+
mark: {
|
|
39
|
+
type: string;
|
|
40
|
+
opacity: number;
|
|
41
|
+
tooltip: boolean;
|
|
42
|
+
};
|
|
43
|
+
encoding: {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
};
|
|
46
|
+
} | {
|
|
47
|
+
config: any;
|
|
48
|
+
transform: {
|
|
49
|
+
filter: {
|
|
50
|
+
param: string;
|
|
51
|
+
};
|
|
52
|
+
}[];
|
|
53
|
+
params: {
|
|
54
|
+
name: string;
|
|
55
|
+
select: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
}[];
|
|
59
|
+
mark: {
|
|
60
|
+
type: string;
|
|
61
|
+
opacity: number;
|
|
62
|
+
tooltip: boolean;
|
|
63
|
+
};
|
|
64
|
+
encoding: {
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
};
|
|
67
|
+
};
|
package/dist/vis/theme.d.ts
CHANGED
|
@@ -3,16 +3,24 @@ export declare const VegaTheme: {
|
|
|
3
3
|
readonly background: "transparent";
|
|
4
4
|
};
|
|
5
5
|
readonly dark: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly tickColor: "#d1d5db";
|
|
11
|
-
readonly labelColor: "#d1d5db";
|
|
6
|
+
background: string;
|
|
7
|
+
header: {
|
|
8
|
+
titleColor: string;
|
|
9
|
+
labelColor: string;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
axis: {
|
|
12
|
+
gridColor: string;
|
|
13
|
+
domainColor: string;
|
|
14
|
+
tickColor: string;
|
|
15
|
+
labelColor: string;
|
|
16
|
+
titleColor: string;
|
|
17
|
+
};
|
|
18
|
+
legend: {
|
|
19
|
+
labelColor: string;
|
|
20
|
+
titleColor: string;
|
|
21
|
+
};
|
|
22
|
+
view: {
|
|
23
|
+
stroke: string;
|
|
16
24
|
};
|
|
17
25
|
};
|
|
18
26
|
};
|
|
@@ -98,17 +106,6 @@ export declare const AntVTheme: {
|
|
|
98
106
|
readonly arc: {
|
|
99
107
|
readonly fill: "#5B8FF9";
|
|
100
108
|
};
|
|
101
|
-
readonly background: "transparent";
|
|
102
|
-
readonly axis: {
|
|
103
|
-
readonly gridColor: "#666";
|
|
104
|
-
readonly domainColor: "#d1d5db";
|
|
105
|
-
readonly tickColor: "#d1d5db";
|
|
106
|
-
readonly labelColor: "#d1d5db";
|
|
107
|
-
};
|
|
108
|
-
readonly legend: {
|
|
109
|
-
readonly labelColor: "#d1d5db";
|
|
110
|
-
readonly titleColor: "#d1d5db";
|
|
111
|
-
};
|
|
112
109
|
readonly range: {
|
|
113
110
|
readonly category: readonly ["#5B8FF9", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4"];
|
|
114
111
|
readonly diverging: readonly ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"];
|
|
@@ -120,6 +117,25 @@ export declare const AntVTheme: {
|
|
|
120
117
|
readonly range: readonly ["#f7fbff", "#08306b"];
|
|
121
118
|
};
|
|
122
119
|
};
|
|
120
|
+
readonly background: string;
|
|
121
|
+
readonly header: {
|
|
122
|
+
titleColor: string;
|
|
123
|
+
labelColor: string;
|
|
124
|
+
};
|
|
125
|
+
readonly axis: {
|
|
126
|
+
gridColor: string;
|
|
127
|
+
domainColor: string;
|
|
128
|
+
tickColor: string;
|
|
129
|
+
labelColor: string;
|
|
130
|
+
titleColor: string;
|
|
131
|
+
};
|
|
132
|
+
readonly legend: {
|
|
133
|
+
labelColor: string;
|
|
134
|
+
titleColor: string;
|
|
135
|
+
};
|
|
136
|
+
readonly view: {
|
|
137
|
+
stroke: string;
|
|
138
|
+
};
|
|
123
139
|
};
|
|
124
140
|
};
|
|
125
141
|
export declare const builtInThemes: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { IDarkMode } from '../interfaces';
|
|
2
3
|
import { IReactVegaHandler } from '../vis/react-vega';
|
|
3
|
-
export declare const LiteContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
interface IVisualSettings {
|
|
5
|
+
darkModePreference: IDarkMode;
|
|
5
6
|
rendererHandler?: React.RefObject<IReactVegaHandler>;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: React.FunctionComponent<IVisualSettings>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanaries/graphic-walker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev:front_end": "vite --host",
|
|
6
6
|
"dev": "npm run dev:front_end",
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
},
|
|
29
29
|
"prettier": {
|
|
30
30
|
"tabWidth": 4,
|
|
31
|
-
"printWidth": 120
|
|
31
|
+
"printWidth": 120,
|
|
32
|
+
"singleQuote": true
|
|
32
33
|
},
|
|
33
34
|
"types": "./dist/index.d.ts",
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@headlessui/react": "^1.7.12",
|
|
36
37
|
"@heroicons/react": "^2.0.8",
|
|
37
38
|
"@kanaries/react-beautiful-dnd": "0.0.1",
|
|
38
|
-
"@kanaries/web-data-loader": "0.1.
|
|
39
|
+
"@kanaries/web-data-loader": "^0.1.7",
|
|
39
40
|
"autoprefixer": "^10.3.5",
|
|
40
41
|
"i18next": "^21.9.1",
|
|
41
42
|
"i18next-browser-languagedetector": "^6.1.5",
|