@@ -6,10 +6,10 @@ import { produce } from 'immer';
66
77import { numberFormats } from './number-formats' ;
88import { detectBaseTheme } from '../react-common/themeDetector' ;
9- import { TopLevelSpec } from 'vega-lite ' ;
9+ import type { Spec as VegaSpec } from 'vega' ;
1010
1111export 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