@@ -31,16 +31,17 @@ import { MountPoint } from '@looker/extension-sdk'
31
31
import { VisualizationTile } from './components/VisualizationTile/VisualizationTile'
32
32
import { DashboardTile } from './components/DashboardTile/DashboardTile'
33
33
34
- const getDefaultRouteComponent = ( mountPoint , isRendering ) => {
34
+ const getDefaultRouteComponent = ( mountPoint , isRendering , visConfig ) => {
35
35
const config = isRendering
36
36
? {
37
+ ...visConfig ,
37
38
valueCountUp : false ,
38
39
waveAnimateTime : 0 ,
39
40
waveRiseTime : 0 ,
40
41
waveAnimate : false ,
41
42
waveRise : false ,
42
43
}
43
- : { }
44
+ : visConfig
44
45
45
46
if ( mountPoint === MountPoint . dashboardVisualization ) {
46
47
return < VisualizationTile config = { config } />
@@ -56,13 +57,23 @@ const getDefaultRouteComponent = (mountPoint, isRendering) => {
56
57
return < DashboardTile standalone = { true } config = { config } />
57
58
}
58
59
60
+ const emptyConfig = { }
61
+
59
62
export const TileExtension = ( ) => {
60
- const { lookerHostData } = useContext ( ExtensionContext40 )
63
+ const { lookerHostData, visualizationData } = useContext ( ExtensionContext40 )
64
+ // The default visualization configuration can be overridden by the explore.
65
+ // Make the overrides available to the visualization.
66
+ const visConfig = visualizationData ?. visConfig
61
67
const mountPoint = lookerHostData ?. mountPoint
62
68
const isRendering = lookerHostData ?. isRendering
63
69
const component = useMemo (
64
- ( ) => getDefaultRouteComponent ( mountPoint , isRendering ) ,
65
- [ mountPoint , isRendering ]
70
+ ( ) =>
71
+ getDefaultRouteComponent (
72
+ mountPoint ,
73
+ isRendering ,
74
+ visConfig || emptyConfig
75
+ ) ,
76
+ [ mountPoint , isRendering , visConfig ]
66
77
)
67
78
68
79
return (
0 commit comments