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

DocsChartsDistribution

ViolinPlotChart

React example follows below.
ts
import { ViolinPlotChart } 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)",
},
];
<ViolinPlotChart series={distribution} />
ts
<script setup lang="ts">
import { ViolinPlotChart } 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>
<ViolinPlotChart :series='distribution' />
</template>
ts
import { ChangeDetectionStrategy, Component } from "@angular/core";
import { GrassrootViolinPlotChart } from "@grassroot/charts-angular";
@Component({
selector: "app-violin-plot-chart-chart-demo",
standalone: true,
imports: [GrassrootViolinPlotChart],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<grassroot-violin-plot-chart [series]='distribution' />`,
})
export class ViolinPlotChartDemoComponent {
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 ViolinPlotChartDemoComponent;
ts
<script lang="ts">
import { ViolinPlotChart } 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>
<ViolinPlotChart series={distribution} />
ts
/** @jsxImportSource solid-js */
import { ViolinPlotChart } 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 ViolinPlotChartDemo() {
return <ViolinPlotChart series={distribution} />;
}

Installation

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

API Reference

ViolinPlotChartProps
PropTypeDefault
seriesrequiredreadonly DistributionSeries[]