changes
This commit is contained in:
parent
524580eb25
commit
ffe080adef
82 changed files with 2652 additions and 2956 deletions
|
|
@ -13,10 +13,13 @@ export const MAP_MIN_ZOOM = 5.5;
|
|||
|
||||
export const BUFFER_MULTIPLIER = 1.5;
|
||||
|
||||
/** Inner London free zone bounds (south, west, north, east) — must match server FREE_ZONE_BOUNDS */
|
||||
export const FREE_ZONE_BOUNDS = { south: 51.48, west: -0.18, north: 51.54, east: -0.02 };
|
||||
|
||||
export const INITIAL_VIEW_STATE: ViewState = {
|
||||
longitude: -1.5,
|
||||
latitude: 53.5,
|
||||
zoom: 6,
|
||||
longitude: (FREE_ZONE_BOUNDS.west + FREE_ZONE_BOUNDS.east) / 2,
|
||||
latitude: (FREE_ZONE_BOUNDS.south + FREE_ZONE_BOUNDS.north) / 2,
|
||||
zoom: 14,
|
||||
pitch: 0,
|
||||
};
|
||||
|
||||
|
|
@ -42,7 +45,7 @@ export const FEATURE_GRADIENT: { t: number; color: [number, number, number] }[]
|
|||
{ t: 1, color: [142, 68, 173] },
|
||||
];
|
||||
|
||||
/** Property density gradient — light mode (cream → orange) */
|
||||
/** Number of properties gradient — light mode (cream → orange) */
|
||||
export const DENSITY_GRADIENT: { t: number; color: [number, number, number] }[] = [
|
||||
{ t: 0, color: [255, 255, 255] },
|
||||
{ t: 0.1, color: [248, 233, 211] },
|
||||
|
|
@ -51,7 +54,7 @@ export const DENSITY_GRADIENT: { t: number; color: [number, number, number] }[]
|
|||
{ t: 1, color: [255, 162, 31] },
|
||||
];
|
||||
|
||||
/** Property density gradient — dark mode (dark warm → bright amber) */
|
||||
/** Number of properties gradient — dark mode (dark warm → bright amber) */
|
||||
export const DENSITY_GRADIENT_DARK: { t: number; color: [number, number, number] }[] = [
|
||||
{ t: 0, color: [55, 45, 35] },
|
||||
{ t: 0.1, color: [85, 65, 40] },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export interface ValueFormat {
|
||||
interface ValueFormat {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
/** Show full integer (no k/M abbreviation) */
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export function getMapStyle(theme: 'light' | 'dark'): StyleSpecification {
|
|||
} as StyleSpecification;
|
||||
}
|
||||
|
||||
export type GradientStop = { t: number; color: [number, number, number] };
|
||||
type GradientStop = { t: number; color: [number, number, number] };
|
||||
|
||||
// Oklab color space for perceptually uniform interpolation
|
||||
function srgbToLinear(c: number): number {
|
||||
|
|
@ -130,11 +130,11 @@ function interpolateGradient(t: number, gradient: GradientStop[]): [number, numb
|
|||
return gradient[gradient.length - 1].color;
|
||||
}
|
||||
|
||||
export function normalizedToColor(t: number): [number, number, number] {
|
||||
function normalizedToColor(t: number): [number, number, number] {
|
||||
return interpolateGradient(t, FEATURE_GRADIENT);
|
||||
}
|
||||
|
||||
export function countToColor(
|
||||
function countToColor(
|
||||
t: number,
|
||||
gradient: GradientStop[] = DENSITY_GRADIENT
|
||||
): [number, number, number] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue