Exhibition hall
The stands of a hall to scale, sold, free or reserved, with the doors. Good for trade fairs, markets and events.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'expo',
width: 60,
depth: 38,
stands: [
{ id: 'A1', x: 6, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Tapis Kairouan' },
{ id: 'A2', x: 10.5, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'A3', x: 6, y: 11, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Céramique Djerba' },
{ id: 'A4', x: 10.5, y: 11, width: 4.5, depth: 5, state: 'free' },
{ id: 'A5', x: 6, y: 21, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Huiles de Sfax' },
{ id: 'A6', x: 10.5, y: 21, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Huiles de Sfax' },
{ id: 'A7', x: 6, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Lin de Lille' },
{ id: 'A8', x: 10.5, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Savons de Marseille' },
{ id: 'B1', x: 19, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'B2', x: 23.5, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Huiles de Sfax' },
{ id: 'B3', x: 19, y: 11, width: 4.5, depth: 5, state: 'free' },
{ id: 'B4', x: 23.5, y: 11, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'B5', x: 19, y: 21, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'B6', x: 23.5, y: 21, width: 4.5, depth: 5, state: 'reserved' },
{ id: 'B7', x: 19, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Tapis Kairouan' },
{ id: 'B8', x: 23.5, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Cuirs de Fès' },
{ id: 'C1', x: 32, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Bois du Jura' },
{ id: 'C2', x: 36.5, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Atelier Nabeul' },
{ id: 'C3', x: 32, y: 11, width: 4.5, depth: 5, state: 'free' },
{ id: 'C4', x: 36.5, y: 11, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'C5', x: 32, y: 21, width: 4.5, depth: 5, state: 'reserved' },
{ id: 'C6', x: 36.5, y: 21, width: 4.5, depth: 5, state: 'reserved' },
{ id: 'C7', x: 32, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Céramique Djerba' },
{ id: 'C8', x: 36.5, y: 26, width: 4.5, depth: 5, state: 'free' },
{ id: 'D1', x: 45, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
{ id: 'D2', x: 49.5, y: 6, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Tapis Kairouan' },
{ id: 'D3', x: 45, y: 11, width: 4.5, depth: 5, state: 'reserved' },
{ id: 'D4', x: 49.5, y: 11, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Huiles de Sfax' },
{ id: 'D5', x: 45, y: 21, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Atelier Nabeul' },
{ id: 'D6', x: 49.5, y: 21, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Atelier Nabeul' },
{ id: 'D7', x: 45, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Dattes Tozeur' },
{ id: 'D8', x: 49.5, y: 26, width: 4.5, depth: 5, state: 'sold', exhibitor: 'Verre de Lyon' },
],
entrances: [{ side: 'bottom', at: 30, name: 'Main door' }, { side: 'left', at: 19, name: 'North door' }],
};
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 expo takes:
/** Exhibition hall: stands to scale, by state, with the doors. */
interface ExpoSpec extends Base {
type: 'expo';
/** Size of the hall in metres. */
width: number;
depth: number;
stands: Stand[];
/** Doors: a wall and a distance along it in metres. */
entrances?: { side: 'top' | 'bottom' | 'left' | 'right'; at: number; name?: string }[];
colors?: Record<string, string>;
onItemClick?: (id: string) => void;
}
interface Stand {
id: 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