Skip to content

Commit 2f3f9cc

Browse files
committed
Trim comments
1 parent cddbb9e commit 2f3f9cc

1 file changed

Lines changed: 1 addition & 73 deletions

File tree

src/plugins/aequilibrae/AequilibraEReader.vue

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -149,79 +149,52 @@ const MyComponent = defineComponent({
149149
},
150150
151151
async mounted() {
152-
console.log('🔧 AequilibraEReader: Starting component initialization')
153-
console.log('📊 Props:', { root: this.root, subfolder: this.subfolder, thumbnail: this.thumbnail, yamlConfig: this.yamlConfig })
154-
155152
this.aeqFileSystem = new AequilibraEFileSystem(this.fileSystem, globalStore)
156-
console.log('💾 File system initialized:', this.fileSystem.name)
157153
158154
// Initialize background layers
159155
try {
160-
console.log('🗺️ Initializing background layers...')
161156
this.bgLayers = new BackgroundLayers({
162157
vizDetails: this.vizDetails,
163158
fileApi: this.aeqFileSystem,
164159
subfolder: this.subfolder,
165160
})
166161
await this.bgLayers.initialLoad()
167-
console.log('✅ Background layers loaded successfully')
168162
} catch (e) {
169163
console.warn('⚠️ Could not load background layers:', e)
170164
}
171165
172166
try {
173-
console.log('📋 Loading visualization configuration...')
174167
await this.getVizDetails()
175-
console.log('✅ Configuration loaded:', {
176-
title: this.vizDetails.title,
177-
database: this.vizDetails.database,
178-
layerCount: Object.keys(this.layerConfigs).length,
179-
layers: Object.keys(this.layerConfigs)
180-
})
181168
182169
// only continue if we are on a real page and not the file browser
183170
if (this.thumbnail) {
184-
console.log('🖼️ Thumbnail mode - skipping data loading')
185171
this.$emit('isLoaded')
186172
return
187173
}
188174
189175
// Initialize spl.js with spatialite support
190176
if (!this.spl) {
191177
this.loadingText = 'Loading SQL engine with spatialite...'
192-
console.log('🔍 Initializing SPL.js with spatialite support...')
193178
this.spl = await SPL()
194-
console.log('✅ SPL engine initialized with spatialite support')
195179
}
196180
197181
// Load the database
198182
this.loadingText = 'Loading database...'
199-
console.log(`💾 Loading database from: ${this.vizDetails.database}`)
200183
const dbPath = this.vizDetails.database
201184
await this.loadDatabase(dbPath)
202-
console.log('✅ Database loaded successfully')
203185
204186
// Get table information
205187
this.loadingText = 'Reading tables...'
206-
console.log('📊 Discovering database tables...')
207188
const tableNames = await this.getTableNames(this.db)
208-
console.log(`📋 Found ${tableNames.length} tables in database:`, tableNames)
209189
210190
// Determine which tables to load based on layer configuration
211-
console.log(this.layerConfigs)
212191
const tablesToLoad = Object.keys(this.layerConfigs).length > 0
213192
? [...new Set(Object.values(this.layerConfigs).map(config => config.table))] // Get unique table names from layer configs
214193
: ['nodes', 'links', 'zones'] // Fallback to default AequilibraE tables
215194
216-
console.log(`🎯 Target tables to load (${tablesToLoad.length}):`, tablesToLoad)
217-
console.log('📐 Layer configurations:', this.layerConfigs)
218-
219195
for (const tableName of tableNames) {
220196
if (tablesToLoad.includes(tableName)) {
221-
console.log(`📊 Loading table schema: ${tableName}`)
222-
223197
const schema = await this.getTableSchema(this.db, tableName)
224-
console.log(` └─ Schema (${schema.length} columns):`, schema.map(col => `${col.name}:${col.type}`).join(', '))
225198
const rowCount = await this.getRowCount(this.db, tableName)
226199
227200
// Check if table has geometry column
@@ -242,9 +215,7 @@ const MyComponent = defineComponent({
242215
// Extract geometry if available
243216
if (this.hasGeometry) {
244217
this.loadingText = 'Extracting geometries...'
245-
console.log('🗺️ Starting geometry extraction from tables with spatial data')
246218
await this.extractGeometryData()
247-
console.log(`✅ Geometry extraction complete. Total features: ${this.geoJsonFeatures.length}`)
248219
} else {
249220
console.log('⚠️ No geometry columns found in loaded tables')
250221
}
@@ -258,13 +229,6 @@ const MyComponent = defineComponent({
258229
259230
this.isLoaded = true
260231
this.loadingText = ''
261-
console.log('🎉 AequilibraE component fully loaded and ready!')
262-
console.log('📊 Final state:', {
263-
tables: this.tables.length,
264-
features: this.geoJsonFeatures.length,
265-
hasGeometry: this.hasGeometry,
266-
viewMode: this.viewMode
267-
})
268232
this.$emit('isLoaded')
269233
} catch (err) {
270234
const e = err as any
@@ -277,39 +241,27 @@ const MyComponent = defineComponent({
277241
278242
methods: {
279243
async getVizDetails() {
280-
console.log('⚙️ Getting visualization details...')
281-
console.log(' 📝 Config object:', this.config)
282-
console.log(' 📁 Subfolder:', this.subfolder)
283-
console.log(' 📄 yamlConfig:', this.yamlConfig)
284-
285244
if (this.config) {
286245
// config came in from the dashboard and is already parsed
287246
this.vizDetails = { ...this.config }
288247
const dbFile = this.config.database || this.config.file
289-
console.log('Database file from config:', dbFile)
290248
this.vizDetails.database = dbFile.startsWith('/') ? dbFile : `${this.subfolder}/${dbFile}`
291249
// Capture view preference from config
292250
if (this.config.view) this.vizDetails.view = this.config.view
293251
294252
// Populate layer configurations for rendering
295253
this.layerConfigs = this.config.layers || {}
296254
297-
console.log('Final database path:', this.vizDetails.database)
298255
this.$emit('titles', this.vizDetails.title || dbFile || 'AequilibraE Database')
299256
} else if (this.yamlConfig) {
300257
// Need to load and parse the YAML file first
301258
const yamlPath = this.subfolder ? `${this.subfolder}/${this.yamlConfig}` : this.yamlConfig
302-
console.log('📄 Loading YAML configuration from:', yamlPath)
303259
304260
const yamlBlob = await this.aeqFileSystem.getFileBlob(yamlPath)
305-
console.log(' └─ YAML file loaded, size:', yamlBlob.size, 'bytes')
306261
307262
const yamlText = await yamlBlob.text()
308-
console.log(' └─ YAML text length:', yamlText.length, 'characters')
309263
310264
const config = YAML.parse(yamlText)
311-
console.log(' └─ Parsed YAML config:', config)
312-
console.log(' └─ Layer definitions found:', Object.keys(config.layers || {}).length)
313265
314266
// Now get the database path from the YAML
315267
const dbFile = config.database || config.file
@@ -332,29 +284,20 @@ const MyComponent = defineComponent({
332284
// Populate layer configurations for rendering
333285
this.layerConfigs = this.vizDetails.layers || {}
334286
335-
console.log('Final database path:', this.vizDetails.database)
336287
this.$emit('titles', this.vizDetails.title)
337288
} else {
338289
throw new Error('No config or yamlConfig provided')
339290
}
340291
},
341292
342293
async loadDatabase(filepath: string): Promise<void> {
343-
console.log('💾 Loading database from:', filepath)
344-
345294
try {
346295
const blob = await this.aeqFileSystem.getFileBlob(filepath)
347-
console.log(' └─ Database file loaded, size:', (blob.size / 1024 / 1024).toFixed(2), 'MB')
348-
349296
const arrayBuffer = await blob.arrayBuffer()
350-
console.log(' └─ Converted to ArrayBuffer, size:', arrayBuffer.byteLength, 'bytes')
351-
352297
const spl = await SPL();
353298
const db = spl.db(arrayBuffer)
354-
console.log(' └─ Database initialized with SPL.js')
355299
356300
this.db = db
357-
console.log(' ✅ Database ready for queries')
358301
} catch (error) {
359302
console.error(' ❌ Database loading failed:', error)
360303
throw error
@@ -367,11 +310,9 @@ const MyComponent = defineComponent({
367310
throw new Error('Database not loaded')
368311
}
369312
370-
console.log('🔍 Querying database for table names...')
371313
const result = await db.exec(`SELECT name FROM sqlite_master WHERE type='table';`).get.objs
372314
const tableNames = result.map((row: any) => row.name)
373315
374-
console.log(` └─ Found ${tableNames.length} tables:`, tableNames)
375316
return tableNames
376317
},
377318
@@ -381,7 +322,6 @@ const MyComponent = defineComponent({
381322
throw new Error('Database not loaded')
382323
}
383324
384-
console.log(`🔍 Getting schema for table: ${tableName}`)
385325
const result = await db.exec(`PRAGMA table_info("${tableName}");`).get.objs
386326
387327
const schema = result.map((row: any) => ({
@@ -390,7 +330,6 @@ const MyComponent = defineComponent({
390330
nullable: row.notnull === 0,
391331
}))
392332
393-
console.log(` └─ Schema (${schema.length} columns):`, schema.map(col => `${col.name}:${col.type}`).join(', '))
394333
return schema
395334
},
396335
@@ -400,17 +339,13 @@ const MyComponent = defineComponent({
400339
throw new Error('Database not loaded')
401340
}
402341
403-
console.log(`📊 Counting rows in table: ${tableName}`)
404342
const result = await db.exec(`SELECT COUNT(*) as count FROM "${tableName}";`).get.objs
405343
const count = result.length > 0 ? result[0].count : 0
406-
console.log(` └─ Row count: ${count.toLocaleString()}`)
407344
return count
408345
},
409346
410347
async extractGeometryData() {
411348
try {
412-
console.log('🎯 Starting geometry extraction process...')
413-
414349
// Convert reactive object to plain object to avoid proxy issues
415350
const plainLayerConfigs = JSON.parse(JSON.stringify(this.layerConfigs))
416351
@@ -452,7 +387,7 @@ const MyComponent = defineComponent({
452387
GeometryType(geometry) as geom_type
453388
FROM "${tableName}"
454389
WHERE geometry IS NOT NULL
455-
LIMIT 10000;
390+
LIMIT 1000000;
456391
`
457392
458393
const result = await this.db.exec(query).get.objs
@@ -537,7 +472,6 @@ const MyComponent = defineComponent({
537472
538473
updateMapColors() {
539474
const featureCount = this.geoJsonFeatures.length
540-
console.log(`🎨 Updating map colors for ${featureCount} features`)
541475
542476
if (featureCount === 0) {
543477
console.log(' ⚠️ No features to style')
@@ -553,27 +487,22 @@ const MyComponent = defineComponent({
553487
554488
// Create filters (all features visible by default)
555489
this.featureFilter = new Float32Array(validFeatures.length).fill(1)
556-
console.log(' ✅ Feature filter initialized')
557490
558491
// Apply layer-based styling
559-
console.log(' 🎨 Applying layer-based styling...')
560492
this.applyLayerStyling()
561493
562494
this.redrawCounter++
563-
console.log(` ✅ Map styling complete, redraw counter: ${this.redrawCounter}`)
564495
},
565496
566497
applyLayerStyling() {
567498
const featureCount = this.geoJsonFeatures.length
568-
console.log(`🎨 Applying layer styling to ${featureCount} features`)
569499
570500
if (featureCount === 0) {
571501
console.log(' ⚠️ No features to style')
572502
return
573503
}
574504
575505
// Initialize color and size arrays
576-
console.log(' 📊 Initializing styling arrays...')
577506
const fillColors = new Uint8ClampedArray(featureCount * 4)
578507
const lineColors = new Uint8ClampedArray(featureCount * 3) // RGB only for lines
579508
const lineWidths = new Float32Array(featureCount)
@@ -583,7 +512,6 @@ const MyComponent = defineComponent({
583512
let defaultStyles = 0
584513
585514
// Apply styling for each feature based on its layer configuration
586-
console.log(' 🔄 Processing feature styles...')
587515
this.geoJsonFeatures.forEach((feature, i) => {
588516
// Null safety checks
589517
if (!feature || !feature.properties || !feature.geometry) {

0 commit comments

Comments
 (0)