@kanaries/graphic-walker 0.4.6 → 0.4.7
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/graphic-walker.es.js +2311 -2307
- package/dist/graphic-walker.es.js.map +1 -1
- package/dist/graphic-walker.umd.js +84 -84
- package/dist/graphic-walker.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/renderer/pureRenderer.tsx +10 -21
package/package.json
CHANGED
|
@@ -3,17 +3,9 @@ import { unstable_batchedUpdates } from 'react-dom';
|
|
|
3
3
|
import { toJS } from 'mobx';
|
|
4
4
|
import { observer } from 'mobx-react-lite';
|
|
5
5
|
import { ShadowDom } from '../shadow-dom';
|
|
6
|
-
import LeafletRenderer from '../components/leafletRenderer';
|
|
6
|
+
import LeafletRenderer, { LEAFLET_DEFAULT_HEIGHT, LEAFLET_DEFAULT_WIDTH } from '../components/leafletRenderer';
|
|
7
7
|
import { withAppRoot } from '../components/appRoot';
|
|
8
|
-
import type {
|
|
9
|
-
IDarkMode,
|
|
10
|
-
IViewField,
|
|
11
|
-
IRow,
|
|
12
|
-
IThemeKey,
|
|
13
|
-
DraggableFieldState,
|
|
14
|
-
IVisualConfig,
|
|
15
|
-
IComputationFunction,
|
|
16
|
-
} from '../interfaces';
|
|
8
|
+
import type { IDarkMode, IViewField, IRow, IThemeKey, DraggableFieldState, IVisualConfig, IComputationFunction } from '../interfaces';
|
|
17
9
|
import type { IReactVegaHandler } from '../vis/react-vega';
|
|
18
10
|
import SpecRenderer from './specRenderer';
|
|
19
11
|
import { useRenderer } from './hooks';
|
|
@@ -32,11 +24,11 @@ type IPureRendererProps =
|
|
|
32
24
|
locale?: string;
|
|
33
25
|
} & (
|
|
34
26
|
| {
|
|
35
|
-
type: 'remote'
|
|
27
|
+
type: 'remote';
|
|
36
28
|
computation: IComputationFunction;
|
|
37
29
|
}
|
|
38
30
|
| {
|
|
39
|
-
type?: 'local'
|
|
31
|
+
type?: 'local';
|
|
40
32
|
rawData: IRow[];
|
|
41
33
|
}
|
|
42
34
|
);
|
|
@@ -52,7 +44,7 @@ const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(function
|
|
|
52
44
|
return props.computation;
|
|
53
45
|
}
|
|
54
46
|
return getComputation(props.rawData);
|
|
55
|
-
}, [props.type, props.type === 'remote' ? props.computation: props.rawData])
|
|
47
|
+
}, [props.type, props.type === 'remote' ? props.computation : props.rawData]);
|
|
56
48
|
const defaultAggregated = visualConfig?.defaultAggregated ?? false;
|
|
57
49
|
|
|
58
50
|
const [viewData, setViewData] = useState<IRow[]>([]);
|
|
@@ -103,15 +95,12 @@ const PureRenderer = forwardRef<IReactVegaHandler, IPureRendererProps>(function
|
|
|
103
95
|
const isSpatial = coordSystem === 'geographic';
|
|
104
96
|
|
|
105
97
|
return (
|
|
106
|
-
<ShadowDom>
|
|
107
|
-
<div className="relative">
|
|
98
|
+
<ShadowDom className="flex w-full" style={{ height: '100%' }}>
|
|
99
|
+
<div className="relative flex flex-col w-full flex-1">
|
|
108
100
|
{isSpatial && (
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
draggableFieldState={visualState}
|
|
113
|
-
visualConfig={visualConfig}
|
|
114
|
-
/>
|
|
101
|
+
<div className="max-w-full" style={{ width: LEAFLET_DEFAULT_WIDTH, height: LEAFLET_DEFAULT_HEIGHT, flexGrow: 1 }}>
|
|
102
|
+
<LeafletRenderer data={data} draggableFieldState={visualState} visualConfig={visualConfig} />
|
|
103
|
+
</div>
|
|
115
104
|
)}
|
|
116
105
|
{isSpatial || (
|
|
117
106
|
<SpecRenderer
|