Skip to content

Organ ​

A heart that beats, lungs that breathe, with a figure. Good for vital signs and lessons.

The smallest code that works. change the code, then press Run

In your framework

import { Chart } from 'nervure/react';

const spec = { type: 'organ', organ: 'heart', value: 74, rate: 65, unit: ' bpm' };

export default function Example() {
  return <Chart spec={spec} style={{ height: 340 }} />;
}

Or import this chart alone: what each import weighs.

Options

Beside the fields shared by every chart (title, format, heading, export…), type organ takes:

/** One organ, that lives: the heart beats, the lungs breathe. */
interface OrganSpec extends Base {
  type: 'organ';
  organ: 'heart' | 'lungs' | 'brain' | 'stomach' | 'liver' | 'kidneys';
  value?: number;
  unit?: string;
  /** Beats or breaths by minute. */
  rate?: number;
  color?: string;
}

Style it

  • Colours: theme.palette, chart.setColor(name, colour), or --nervure-palette in your CSS. More
  • Marks: [data-series="name"], parts: [data-part="axes"], legend, series. What you change is kept in exports.
  • Movement: animation: false draws at once. More
  • Files: chart.download('png'), svg, csv. More

Close to it