Reactor fleet
Reactors over weeks: running, refuelling, stopped, and the power the fleet has left. Good for planning outages and following the availability of a fleet.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
import 'nervure/themes';
const spec = {
type: 'reactorfleet',
periods: [
'W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10', 'W11', 'W12', 'W13', 'W14',
'W15', 'W16', 'W17', 'W18', 'W19', 'W20', 'W21', 'W22', 'W23', 'W24', 'W25', 'W26',
],
data: [
{
name: 'Unit A1',
capacity: 1300,
states: [
'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'reduced', 'refuel', 'refuel',
'refuel', 'refuel', 'refuel', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on',
'on',
],
},
{
name: 'Unit A2',
capacity: 1300,
states: [
'on', 'reduced', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'reduced', 'forced', 'on', 'on',
'on', 'on', 'on', 'on', 'planned', 'planned', 'planned', 'planned', 'on', 'on', 'reduced',
'on', 'on',
],
},
{
name: 'Unit B1',
capacity: 1300,
states: [
'on', 'on', 'on', 'on', 'on', 'planned', 'planned', 'planned', 'on', 'on', 'on', 'on',
'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'reduced', 'on', 'on', 'on',
],
},
{
name: 'Unit B2',
capacity: 1300,
states: [
'on', 'on', 'reduced', 'forced', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'reduced',
'on', 'on', 'on', 'reduced', 'on', 'refuel', 'refuel', 'refuel', 'refuel', 'on', 'on',
'on', 'on',
],
},
{
name: 'Unit C1',
capacity: 900,
states: [
'on', 'planned', 'planned', 'planned', 'planned', 'planned', 'on', 'on', 'on', 'on', 'on',
'reduced', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on',
'on',
],
},
{
name: 'Unit C2',
capacity: 900,
states: [
'on', 'reduced', 'reduced', 'on', 'on', 'on', 'forced', 'reduced', 'on', 'on', 'on', 'on',
'reduced', 'on', 'on', 'reduced', 'reduced', 'on', 'planned', 'planned', 'planned',
'planned', 'planned', 'on', 'on', 'reduced',
],
},
{
name: 'Unit D1',
capacity: 900,
states: [
'on', 'on', 'reduced', 'refuel', 'refuel', 'refuel', 'refuel', 'on', 'on', 'reduced', 'on',
'on', 'reduced', 'on', 'on', 'reduced', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on',
'on', 'on',
],
},
{
name: 'Unit D2',
capacity: 900,
states: [
'on', 'on', 'forced', 'on', 'reduced', 'on', 'on', 'on', 'reduced', 'on', 'on', 'on', 'on',
'on', 'on', 'on', 'reduced', 'on', 'planned', 'planned', 'planned', 'planned', 'planned',
'planned', 'on', 'reduced',
],
},
],
};
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 reactorfleet takes:
/** Reactors of a fleet over weeks or months: running, refuelling, stopped, and the power available. */
interface ReactorFleetSpec extends Base {
type: 'reactorfleet';
/** Colour of the main series. */
color?: string;
/** "W1", "Jan"… */
periods: string[];
/** One state for each period. `capacity` in MW. */
data: { name: string; capacity: number; states: (ReactorState | null)[] }[];
/** MW by default. */
unit?: string;
}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