DocsChartsDistribution
RidgelineChart
React example follows below.
ts
import { RidgelineChart } from "@grassroot/charts-react"; const distribution = [ { label: "api", values: [9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 30, 32, 35, 38], color: "var(--accent)", }, { label: "worker", values: [6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 31, 34], color: "var(--vs-success)", }, { label: "edge", values: [14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 29, 31, 33, 36], color: "var(--vs-info)", },]; <RidgelineChart series={distribution} />ts
<script setup lang="ts">import { RidgelineChart } from "@grassroot/charts-vue"; const distribution = [ { label: "api", values: [9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 30, 32, 35, 38], color: "var(--accent)", }, { label: "worker", values: [6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 31, 34], color: "var(--vs-success)", }, { label: "edge", values: [14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 29, 31, 33, 36], color: "var(--vs-info)", },];</script> <template> <RidgelineChart :series='distribution' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootRidgelineChart } from "@grassroot/charts-angular"; @Component({ selector: "app-ridgeline-chart-chart-demo", standalone: true, imports: [GrassrootRidgelineChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-ridgeline-chart [series]='distribution' />`,})export class RidgelineChartDemoComponent { readonly distribution = [ { label: "api", values: [9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 30, 32, 35, 38], color: "var(--accent)", }, { label: "worker", values: [6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 31, 34], color: "var(--vs-success)", }, { label: "edge", values: [14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 29, 31, 33, 36], color: "var(--vs-info)", }, ];} export default RidgelineChartDemoComponent;ts
<script lang="ts"> import { RidgelineChart } from "@grassroot/charts-svelte"; const distribution = [ { label: "api", values: [9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 30, 32, 35, 38], color: "var(--accent)", }, { label: "worker", values: [6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 31, 34], color: "var(--vs-success)", }, { label: "edge", values: [14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 29, 31, 33, 36], color: "var(--vs-info)", }, ];</script> <RidgelineChart series={distribution} />ts
/** @jsxImportSource solid-js */import { RidgelineChart } from "@grassroot/charts-solid"; const distribution = [ { label: "api", values: [9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 30, 32, 35, 38], color: "var(--accent)", }, { label: "worker", values: [6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 31, 34], color: "var(--vs-success)", }, { label: "edge", values: [14, 15, 15, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 28, 29, 31, 33, 36], color: "var(--vs-info)", },]; export default function RidgelineChartDemo() { return <RidgelineChart series={distribution} />;}Installation
bash
pnpm dlx grassroot add chart/ridgeline-chartbash
npx grassroot@latest add chart/ridgeline-chartbash
yarn dlx grassroot add chart/ridgeline-chartbash
bunx grassroot add chart/ridgeline-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
seriesrequired | readonly DistributionSeries[] | — |