@@ -68,7 +68,12 @@ const MyComponent = defineComponent({
6868 data() {
6969 return {
7070 globalState: globalStore .state ,
71- vizDetails: { title: ' ' , description: ' ' , database: ' ' },
71+ vizDetails: { title: ' ' , description: ' ' , database: ' ' , view: ' ' } as {
72+ title: string
73+ description: string
74+ database: string
75+ view: ' table' | ' map' | ' '
76+ },
7277 loadingText: ' ' ,
7378 id: ` id-${Math .floor (1e12 * Math .random ())} ` as any ,
7479 layerId: ` aeq-layer-${Math .floor (1e12 * Math .random ())} ` as string ,
@@ -161,6 +166,13 @@ const MyComponent = defineComponent({
161166 await this .extractGeometryData ()
162167 }
163168
169+ // Apply default view from config (only switch to map if geometry exists)
170+ if (this .vizDetails .view === ' map' && this .hasGeometry ) {
171+ this .viewMode = ' map'
172+ } else if (this .vizDetails .view === ' table' ) {
173+ this .viewMode = ' table'
174+ }
175+
164176 this .isLoaded = true
165177 this .loadingText = ' '
166178 this .$emit (' isLoaded' )
@@ -184,6 +196,8 @@ const MyComponent = defineComponent({
184196 const dbFile = this .config .database || this .config .file
185197 console .log (' Database file from config:' , dbFile )
186198 this .vizDetails .database = dbFile .startsWith (' /' ) ? dbFile : ` ${this .subfolder }/${dbFile } `
199+ // Capture view preference from config
200+ if (this .config .view ) this .vizDetails .view = this .config .view
187201 console .log (' Final database path:' , this .vizDetails .database )
188202 this .$emit (' titles' , this .vizDetails .title || dbFile || ' AequilibraE Database' )
189203 } else if (this .yamlConfig ) {
@@ -211,6 +225,7 @@ const MyComponent = defineComponent({
211225 title: config .title || this .yamlConfig ,
212226 description: config .description || ' ' ,
213227 database: databasePath ,
228+ view: config .view || ' ' ,
214229 }
215230
216231 console .log (' Final database path:' , this .vizDetails .database )
0 commit comments