Skip to content

Commit 8d8264b

Browse files
committed
More type adjustments
1 parent ad2278a commit 8d8264b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/webviews/webview-side/vega-renderer/VegaRenderer.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { produce } from 'immer';
66

77
import { numberFormats } from './number-formats';
88
import { detectBaseTheme } from '../react-common/themeDetector';
9-
import { TopLevelSpec } from 'vega-lite';
9+
import type { Spec as VegaSpec } from 'vega';
1010

1111
export interface VegaRendererProps {
12-
spec: TopLevelSpec;
12+
spec: VegaSpec;
1313
renderer?: 'svg' | 'canvas';
1414
}
1515

@@ -80,6 +80,16 @@ export const VegaRenderer = memo(function VegaRenderer(props: VegaRendererProps)
8080

8181
draft.config.background = backgroundColor;
8282

83+
if (!draft.config.style) {
84+
draft.config.style = {};
85+
}
86+
if (!draft.config.style.cell) {
87+
draft.config.style.cell = {};
88+
}
89+
draft.config.style.cell = {
90+
stroke: backgroundColor
91+
};
92+
8393
if (!draft.config.axis) {
8494
draft.config.axis = {};
8595
}
@@ -103,7 +113,7 @@ export const VegaRenderer = memo(function VegaRenderer(props: VegaRendererProps)
103113
if (!draft.config.text) {
104114
draft.config.text = {};
105115
}
106-
draft.config.text.color = foregroundColor;
116+
draft.config.text.fill = foregroundColor;
107117
});
108118
return structuredClone(patchedSpec); // Immer freezes the spec, which doesn't play well with Vega
109119
}, [spec, backgroundColor, foregroundColor, isDark]);

0 commit comments

Comments
 (0)