CLI previewInstall commands shown on this site are not released yet.

DocsChartsScalar field

ContourChart

React example follows below.
ts
import { ContourChart } from "@grassroot/charts-react";
const rasterCells = Array.from({ length: 24 }, (_, index) => ({ x: index % 6, y: Math.floor(index / 6), value: 2 + (index * 7) % 19 }));
<ContourChart cells={rasterCells} />
ts
<script setup lang="ts">
import { ContourChart } from "@grassroot/charts-vue";
const rasterCells = Array.from({ length: 24 }, (_, index) => ({ x: index % 6, y: Math.floor(index / 6), value: 2 + (index * 7) % 19 }));
</script>
<template>
<ContourChart :cells='rasterCells' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootContourChart } from "@grassroot/charts-angular";
@Component({
selector: "app-contour-chart-chart-demo",
standalone: true,
imports: [GrassrootContourChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-contour-chart [cells]='rasterCells' />`,
})
export class ContourChartDemoComponent {
readonly rasterCells = Array.from({ length: 24 }, (_, index) => ({ x: index % 6, y: Math.floor(index / 6), value: 2 + (index * 7) % 19 }));
}
export default ContourChartDemoComponent;
ts
<script lang="ts">
import { ContourChart } from "@grassroot/charts-svelte";
const rasterCells = Array.from({ length: 24 }, (_, index) => ({ x: index % 6, y: Math.floor(index / 6), value: 2 + (index * 7) % 19 }));
</script>
<ContourChart cells={rasterCells} />
ts
/** @jsxImportSource solid-js */
import { ContourChart } from "@grassroot/charts-solid";
const rasterCells = Array.from({ length: 24 }, (_, index) => ({ x: index % 6, y: Math.floor(index / 6), value: 2 + (index * 7) % 19 }));
export default function ContourChartDemo() {
return <ContourChart cells={rasterCells} />;
}

Installation

bash
pnpm dlx grassroot add chart/contour-chart
bash
npx grassroot@latest add chart/contour-chart
bash
yarn dlx grassroot add chart/contour-chart
bash
bunx grassroot add chart/contour-chart

API Reference

ContourChartProps
PropTypeDefault
cellsrequiredreadonly RasterHeatmapCell[]
thresholdsreadonly number[] | undefined