feat([2fd88f42]): add adjustable marker radius and collapse filters by default
This commit is contained in:
@@ -6,23 +6,26 @@ import type { HeatmapPoint } from '../App';
|
||||
|
||||
interface MapDisplayProps {
|
||||
heatmapData: HeatmapPoint[];
|
||||
radiusMultiplier: number;
|
||||
}
|
||||
|
||||
const MapDisplay: React.FC<MapDisplayProps> = ({ heatmapData }) => {
|
||||
const MapDisplay: React.FC<MapDisplayProps> = ({ heatmapData, radiusMultiplier }) => {
|
||||
const germanyCenter: [number, number] = [51.1657, 10.4515];
|
||||
|
||||
// Simple scaling function for marker radius
|
||||
// Simple scaling function for marker radius, now with a multiplier
|
||||
const calculateRadius = (count: number) => {
|
||||
return 5 + Math.log(count + 1) * 5;
|
||||
// Ensure a base radius so even single points are visible
|
||||
// The multiplier is applied to the dynamic part of the radius
|
||||
return 3 + Math.log(count + 1) * 5 * radiusMultiplier;
|
||||
};
|
||||
|
||||
// Simple color scaling function
|
||||
const getColor = (count: number, maxCount: number) => {
|
||||
const ratio = count / maxCount;
|
||||
if (ratio > 0.8) return 'red';
|
||||
if (ratio > 0.5) return 'orange';
|
||||
if (ratio > 0.2) return 'yellow';
|
||||
return 'green';
|
||||
if (ratio > 0.8) return '#d73027'; // Red
|
||||
if (ratio > 0.5) return '#fdae61'; // Orange
|
||||
if (ratio > 0.2) return '#fee08b'; // Yellow
|
||||
return '#66bd63'; // Green
|
||||
}
|
||||
|
||||
const maxCount = Math.max(...heatmapData.map(p => p.count), 1);
|
||||
|
||||
Reference in New Issue
Block a user