Chuyển tới nội dung chính

CorrelationLines

A map overlay component that draws lines between correlated events or entities.

📋 Overview

PropertyValue
Filesrc/components/CorrelationLines.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.0.0

🎯 Purpose

  • Visualize relationships between entities
  • Show correlation between accidents and congestion
  • Display camera coverage areas
  • Indicate data flow between sources

🚀 Usage

import { CorrelationLines } from '@/components/CorrelationLines';

function MapComponent() {
return (
<MapContainer>
<CorrelationLines
correlations={correlationData}
visible={showCorrelations}
/>
</MapContainer>
);
}

📦 Props

PropTypeRequiredDefaultDescription
correlationsCorrelation[]Yes-Correlation data
visiblebooleanNotrueShow/hide lines
colorstringNo'#ff7800'Line color
weightnumberNo2Line thickness
opacitynumberNo0.7Line opacity
animatedbooleanNofalseAnimate lines

🔧 Correlation Object

interface Correlation {
id: string;
from: LatLng;
to: LatLng;
type: 'accident-congestion' | 'camera-event' | 'custom';
strength: number; // 0-1
}

See the complete components reference for all available components.