Skip to content

feat: add frequency-based route color visualization#571

Merged
johanohly merged 4 commits into
johanohly:mainfrom
Gaudv:patch-9-ImprovedFrequencyVisualisation
May 23, 2026
Merged

feat: add frequency-based route color visualization#571
johanohly merged 4 commits into
johanohly:mainfrom
Gaudv:patch-9-ImprovedFrequencyVisualisation

Conversation

@Gaudv
Copy link
Copy Markdown
Contributor

@Gaudv Gaudv commented Apr 30, 2026

Description
Map appearance: improve frequency-based arc styling (color + thickness) with percentile scaling.

Issues
Raw frequency values were dominated by extreme routes, collapsing many routes into near-identical visuals.
(ex, if one route is flown 100 times, a route flown 20 times will have no visual difference with a route flown 1 time)

Changes

  • patch: arc thickness by frequency uses percentile-based scaling instead of absolute value.
  • add: arc color by frequency.
image

Summary by cubic

Improved route frequency visualization: arc thickness now uses percentile scaling and arcs can color by frequency, making busy routes stand out without flattening others. Adds a simple control in Map Appearance and persists the choice.

  • New Features
    • Arc thickness uses percentile ranks (per-route, undirected keys) instead of raw counts.
    • New arc color mode: "By frequency" blends base colors toward red as frequency increases; default remains unchanged.
    • Map Appearance → Arcs → Color with "Default" and "By frequency".
    • Preferences: added arcColor to MapPreferences; sanitized, persisted, and resettable.
    • Internals: deck.gl update triggers now include arcColor and per-route percentiles for color and width recalculation.

Written for commit ba1aa6c. Summary will update on new commits.

Note

Add frequency-based route color visualization to the flights map

  • Adds a new byFrequency arc color mode that blends each route's source/target color toward a high-frequency red based on its percentile rank across all routes.
  • Adds ArcColorMode type, arcColor preference (defaulting to 'default'), and wires it through localStorage persistence, sanitization, and reset in map-preferences.svelte.ts.
  • Exposes a 'Routes → Color' selector in MapAppearanceControl.svelte with 'Default' and 'By frequency' options; also moves the reset action to the panel header.
  • Behavioral Change: when arc width is set to byFrequency, widths are now driven by a normalized 0–1 percentile scale instead of absolute frequency counts, so visual thickness is relative rather than absolute.

Macroscope summarized 920799d.

@github-actions github-actions Bot added the Web label Apr 30, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/lib/components/map/AirportsArcsLayer.svelte">

<violation number="1" location="src/lib/components/map/AirportsArcsLayer.svelte:274">
P2: by-frequency arc thickness can evaluate to 0 for the lowest-frequency route, making that route invisible in the main ArcLayer.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/lib/components/map/AirportsArcsLayer.svelte Outdated
@Gaudv Gaudv closed this May 4, 2026
@Gaudv Gaudv reopened this May 4, 2026
@Gaudv Gaudv force-pushed the patch-9-ImprovedFrequencyVisualisation branch from 89a2da4 to ba1aa6c Compare May 4, 2026 11:32
@johanohly johanohly force-pushed the patch-9-ImprovedFrequencyVisualisation branch from ba1aa6c to b51634d Compare May 23, 2026 18:07
@johanohly johanohly changed the title feat: Improved Frequency Visualisation feat: add frequency-based route color visualization May 23, 2026
@sonarqubecloud
Copy link
Copy Markdown

@johanohly johanohly merged commit f8115eb into johanohly:main May 23, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants