Museum Visitor Guide
A one-page landscape visitor guide in which every figure is svg, and each figure draws in a different way.
- The floor plan. It is drawn inline; its seven doors and its stairs are two shared components (
plan-door-symbol,plan-stair-symbol) placed withuse, two doors turned to their walls withrotateand the right leaf of the double door the same symbol mirrored withtransform: "scale(-1, 1)". - The key to the plan. It places the same symbols again beside their names, so the key cannot drift from the plan.
- The compass and the site map. The compass is SVG source written inline with
src; the site map is an SVG file read withfile. - The exhibits. Four photographs, each clipped with
clipto a circle, an ellipse, a hexagon or a rectangle and fitted withpreserveAspectRatio: "slice"; each photograph and name is alinkto the online collection. - Footer band. The opening hours, and a QR code to the audio guide below the exhibits.
Features used: PDF/A-2b conformance, columns, SVG, images, barcodes (qrcode), components, headers and footers
- Output
- Template
- Data
How it's built
Symbols placed inside a drawing
plan-door-symbol is a component whose content is one svg: a 10 by 10 viewBox holding the door leaf as a line and its swing as an arc path. Inside the plan, a use places it at x and y in the plan's own coordinates and scales it to width and height. rotate turns it to a wall; transform mirrors it for the other leaf of a double door:
{
"svg": {
"viewBox": [0, 0, 240, 160],
"width": 285,
"height": 190,
"title": "Floor plan: three galleries above the entrance hall, with the doors and the stairs drawn from shared symbols",
"children": [
{ "use": { "name": "plan-door-symbol", "version": "1.0", "x": 104, "y": 40, "width": 20, "height": 20, "rotate": 90 } },
{ "use": { "name": "plan-door-symbol", "version": "1.0", "x": 100, "y": 136, "width": 20, "height": 20 } },
{ "use": { "name": "plan-door-symbol", "version": "1.0", "x": 140, "y": 136, "width": 20, "height": 20, "transform": "scale(-1, 1)" } }
]
}
}
The door's styles set vectorEffect: "nonScalingStroke", so its lines keep their width at any size the plan draws it. The key is a second svg that places the same component beside each text label.
Three ways to give an svg
The plan and the key list their shapes in children. The compass is SVG markup passed as a string in src, and the site map is a file read with file:
{
"svg": {
"file": "images/assets/harbour-site.svg",
"width": 204,
"height": 136,
"title": "Site map: the museum on Quay Street, between the car park and the ferry pier, with the bus 12 stop opposite"
}
}
Every svg carries a title, its description for a reader who cannot see it.
Photographs cut to a shape
The exhibits are one svg holding four image shapes. clip takes one shape, preserveAspectRatio: "slice" fills the box without stretching the photograph, and link makes it clickable:
{
"image": {
"x": 180,
"y": 0,
"width": 150,
"height": 110,
"href": "images/assets/lookbook/console.jpg",
"clip": { "ellipse": { "cx": 255, "cy": 55, "rx": 74, "ry": 48 } },
"link": "https://harbour-museum.example/collection/quay-console",
"preserveAspectRatio": "slice"
}
}
The clip shape is written in the drawing's coordinates, not the photograph's: this image starts at x 180, so its ellipse is centred at cx 255. The hexagon is a clip path, the last photograph a clip rect.