Skip to content

Conversation

@tomstephen
Copy link

This PR adds AequilibraE support to SimWrapper. This involves,

  • new plugin at src/plugins/aequilibrae/...
  • registering plugin in src/plugins/pluginRegistry.ts
  • new panel (and registration) in src/dash-panels/aequilibrae.vue (and _allPanels.ts)
  • extension to the HTTPFileSystem.ts to add support for S3 buckets

In my testing I've modified a few other scripts (Splash, deploy scripts, etc) but we don't want to suggest merging these back to the original SimWrapper project, so I will revert. Additionally, current work needs a good refactor, particularly

  • SQLite queries could be leveraged better for speed (for loop over all rows currently)
  • much of the styling/rendering code could be replaced by calls to deck.gl

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 27 changed files in this pull request and generated 25 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

font-size: 1.4rem;
height: 5rem;
font-size: 2.5rem;
// height: 3.5rem;
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented-out height property on line 318 (// height: 3.5rem;) should either be removed or uncommented if it's needed. Leaving commented code creates maintenance confusion.

Suggested change
// height: 3.5rem;

Copilot uses AI. Check for mistakes.
Comment on lines 85 to 113
const buildColorEncoder = (
values: any[],
style: any,
dataRange: [number, number] | null = null
) => {
if (dataRange) {
values = values.map(v => {
const num = toNumber(v)
if (num === null) return null
return Math.max(dataRange[0], Math.min(dataRange[1], num))
})
}

const nums = values.map(toNumber).filter((v): v is number => v !== null)
const s = style || {}
const [min, max] = s.range ? s.range : [safeMin(nums), safeMax(nums)]

const paletteName = s.palette || 'YlGn'
const numColors = s.numColors || 7
const colors = getPaletteColors(paletteName, numColors).map((h: string) => hexToRgba(h, 1))

const scale = max === min ? 0 : (numColors - 1) / (max - min)

return (value: any) => {
const num = toNumber(value) ?? min
const idx = Math.round((num - min) * scale)
return colors[Math.max(0, Math.min(numColors - 1, idx))]
}
}
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing input validation: the function buildColorEncoder doesn't validate that the palette name exists in cartoColors before accessing it. If an invalid palette name is provided, getPaletteColors will return an array of gray colors, which may not be the desired behavior. Consider adding validation or a more informative error message.

Copilot uses AI. Check for mistakes.
Comment on lines 27 to 34
import {
resolvePath,
resolvePaths,
getUsedColumns,
getNeededJoinColumn,
createJoinCacheKey,
hasGeometryColumn,
} from './utils'
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import getUsedColumns.

Copilot uses AI. Check for mistakes.
Comment on lines 257 to 264
// Create a cache key for this specific join query (for logging only)
const cacheKey = createJoinCacheKey(
joinConfig.database,
joinConfig.table,
neededColumn,
joinConfig.filter
)

Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable cacheKey.

Suggested change
// Create a cache key for this specific join query (for logging only)
const cacheKey = createJoinCacheKey(
joinConfig.database,
joinConfig.table,
neededColumn,
joinConfig.filter
)

Copilot uses AI. Check for mistakes.
if (extraDb) {
// Centralized function will handle its own caching
joinedData = await getCachedJoinData(extraDb, joinConfig, neededColumn)
const colInfo = neededColumn ? ` (column: ${neededColumn})` : ''
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable colInfo.

Suggested change
const colInfo = neededColumn ? ` (column: ${neededColumn})` : ''

Copilot uses AI. Check for mistakes.
@tomstephen
Copy link
Author

Latest commit partially merges #3, we don't want every change so doing merge manually. Plan going forward is

  • extend sqlite-map with any extra features from POLARIS plugin we want
  • refactor POLARIS plugin to inherit from sqlite-map
  • split out the sql dashboarding features into a separate plugin
  • put together a combined aequilibrae and polaris test

* Extend tile.vue to support hard-coded key-value pairs, sqlite queries for said values, sqlite queries for entire table

* Full SQL support, either individual queries or a full table

* Add usage comment

* Colour palette-ing, defaults to original pastel palette

* Apply suggestions from review
@tomstephen tomstephen marked this pull request as ready for review January 16, 2026 06:39
@tomstephen tomstephen merged commit 9fbd3d8 into master Jan 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants