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:
parent
1f4a3f858c
commit
743e018668
11 changed files with 422 additions and 588 deletions
|
|
@ -5,7 +5,7 @@ import { useEffect, useRef, useMemo, useCallback } from "react";
|
|||
import { Crosshair } from "lucide-react";
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import "../assets/Map.css";
|
||||
import { Metric, type ParameterValues } from "./Parameters";
|
||||
import { Metric, type ParameterValues } from "./FilterPanel";
|
||||
import { PropertyCard } from "./PropertyCard";
|
||||
import { ScrollArea } from "./ui/scroll-area";
|
||||
import type { GeoJSONFeatureCollection, PropertyFeature, PropertyProperties, POI } from "@/types";
|
||||
|
|
@ -97,7 +97,7 @@ export function Map(props: MapProps) {
|
|||
// Compute color scale from valid metric values only
|
||||
const values = data.features
|
||||
.map(function (d: PropertyFeature) {
|
||||
return (d.properties as Record<string, unknown>)[metricMode] as number;
|
||||
return (d.properties as unknown as Record<string, unknown>)[metricMode] as number;
|
||||
})
|
||||
.filter(function (v: number) { return typeof v === 'number' && isFinite(v) && v > 0; })
|
||||
.sort(function (a: number, b: number) { return a - b; });
|
||||
|
|
@ -405,6 +405,3 @@ export function Map(props: MapProps) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Re-export types for backwards compatibility
|
||||
export { Metric, type ParameterValues } from "./Parameters";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue