Moon phases
A month of drawn moons, computed from the dates, with the new and full moons. Good for calendars, tides, gardening, night events.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = { type: 'moon', month: '2026-07' };
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 moon takes:
/** The phases of the moon over a month, computed from the dates. */
interface MoonSpec extends Base {
type: 'moon';
/** "2026-12". */
month: string;
/** The lit side is mirrored south of the equator. */
hemisphere?: 'north' | 'south';
/** 1 for Monday (default), 0 for Sunday. */
firstDay?: 0 | 1;
}Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More