-
Notifications
You must be signed in to change notification settings - Fork 302
/
index.tsx
25 lines (23 loc) · 978 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { useMemo } from 'react';
import { observer } from 'mobx-react-lite';
import { GraphicWalker } from '@kanaries/graphic-walker';
import { useGlobalStore } from '../../store';
import { IMutField } from '@kanaries/graphic-walker/dist/interfaces';
import '@kanaries/graphic-walker/dist/style.css';
const VisualInterface: React.FC = props => {
const { dataSourceStore } = useGlobalStore();
// TODO: discuss use clean data from dataSourceStore or cooked data from dataPipeline?
const { cleanedData, mutFields } = dataSourceStore;
const gwRawFields = useMemo<IMutField[]>(() => {
return mutFields.map(f => {
return {
key: f.fid,
semanticType: f.semanticType,
dataType: '?',
analyticType: f.analyticType
}
})
}, [mutFields])
return <GraphicWalker dataSource={cleanedData} rawFields={gwRawFields} />
}
export default observer(VisualInterface);