DocsChartsPrimitives
VoronoiOverlay
React example follows below.
ts
import { VoronoiOverlay } from "@grassroot/charts-react"; <VoronoiOverlay points={[{ id: "a", x: 86, y: 74 }, { id: "b", x: 172, y: 130 }, { id: "c", x: 250, y: 72 }]} width={360} height={220} />ts
<script setup lang="ts">import { VoronoiOverlay } from "@grassroot/charts-vue";</script> <template> <VoronoiOverlay :points='[{ id: "a", x: 86, y: 74 }, { id: "b", x: 172, y: 130 }, { id: "c", x: 250, y: 72 }]' :width='360' :height='220' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootVoronoiOverlay } from "@grassroot/charts-angular"; @Component({ selector: "app-voronoi-overlay-chart-demo", standalone: true, imports: [GrassrootVoronoiOverlay], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-voronoi-overlay [points]='[{ id: "a", x: 86, y: 74 }, { id: "b", x: 172, y: 130 }, { id: "c", x: 250, y: 72 }]' [width]='360' [height]='220' />`,})export class VoronoiOverlayDemoComponent { } export default VoronoiOverlayDemoComponent;ts
<script lang="ts"> import { VoronoiOverlay } from "@grassroot/charts-svelte";</script> <VoronoiOverlay points={[{ id: "a", x: 86, y: 74 }, { id: "b", x: 172, y: 130 }, { id: "c", x: 250, y: 72 }]} width={360} height={220} />ts
/** @jsxImportSource solid-js */import { VoronoiOverlay } from "@grassroot/charts-solid"; export default function VoronoiOverlayDemo() { return <VoronoiOverlay points={[{ id: "a", x: 86, y: 74 }, { id: "b", x: 172, y: 130 }, { id: "c", x: 250, y: 72 }]} width={360} height={220} />;}Installation
bash
pnpm dlx grassroot add chart/voronoi-overlaybash
npx grassroot@latest add chart/voronoi-overlaybash
yarn dlx grassroot add chart/voronoi-overlaybash
bunx grassroot add chart/voronoi-overlayAPI Reference
| Prop | Type | Default |
|---|---|---|
pointsrequired | readonly { x: number; y: number; id?: string; }[] | — |
width | number | undefined | — |
height | number | undefined | — |