Redesign filter panel with range sliders, separated visualization card, and backend filter support

Simplify the filter UI to show only essential filters (type toggle, price/bedroom
range sliders, min size) by default, with advanced filters collapsed. Extract
visualization controls (color-by metric, POI travel mode) into a separate
VisualizationCard component. Wire up previously ignored backend filters: max_sqm,
min/max_price_per_sqm, and district_names now work end-to-end.
This commit is contained in:
Viktor Barzin 2026-02-08 18:50:06 +00:00
parent 1f4a3f858c
commit 743e018668
No known key found for this signature in database
GPG key ID: 0EB088298288D958
11 changed files with 422 additions and 588 deletions

View file

@ -1,7 +1,7 @@
// Color schemes for map visualization
// Different color schemes for different metrics to improve clarity
import { Metric } from "@/components/Parameters";
import { Metric } from "@/components/FilterPanel";
// For metrics where LOW is GOOD (price, price per sqm): Green → Yellow → Red
export const LOW_IS_GOOD_COLOR_STOPS: [number, string][] = [
@ -31,6 +31,11 @@ export const LEGACY_COLOR_STOPS: [number, string][] = [
// Get the appropriate color scheme based on metric type
export function getColorSchemeForMetric(metric: Metric | string): [number, string][] {
// Travel time metrics use LOW_IS_GOOD (shorter commute = green)
if (typeof metric === 'string' && metric.startsWith('poi_travel')) {
return LOW_IS_GOOD_COLOR_STOPS;
}
switch (metric) {
case Metric.qmprice:
case Metric.price:
@ -53,6 +58,11 @@ export function getColorSchemeForMetric(metric: Metric | string): [number, strin
// Get interpretation text for legend
export function getMetricInterpretation(metric: Metric | string): { low: string; high: string; name: string } {
// Travel time metrics
if (typeof metric === 'string' && metric.startsWith('poi_travel')) {
return { low: 'Quick commute', high: 'Long commute', name: 'Travel Time' };
}
switch (metric) {
case Metric.qmprice:
case 'qmprice':