SVG from Zero
Learn SVG, the browser's vector drawing language: coordinates, shapes, paths, viewBox, text, groups and reuse, then give the Lumen dashboard a frame that scales.
Every chart in this course is SVG underneath: rectangles for bars, circles for dots, paths for lines. This phase teaches SVG itself, from the first number to the last attribute, before any data arrives. Once you can read and write SVG, a chart library stops being magic.
You learn where a shape lands (the coordinate system), the six basic shapes, the pen commands of a path, how viewBox makes a drawing scale to any screen, how to style and label with text, and how to group, reuse and clip. Each topic also shows what goes wrong: shapes that vanish without an error, a squashed picture, a path the browser refuses.
At the end you rebuild the dashboard's frame in SVG: a header with a bike icon made of paths, three titled boxes, and the week chart in a viewBox so it scales from a phone to a wall screen. That fixes the sideways scrolling Phase 0 left behind.
Phase 1 · the story
Priya, operations lead
“I look at this on my phone in the depot and on the wall screen in the control room, and I want the icons and the frame to look sharp on both.”
Priya runs operations at Lumen Bikes. She keeps the dashboard open on her phone while she walks the depot, and on the big wall screen in the control room. After Phase 0 she opened the first page on both. On the wall screen the week chart is a small postage stamp in a large box. On her phone the chart box scrolls sideways.
"It's the same picture, so it should fit. And the little icons I want for the stations: if I zoom in they must not turn into blocks." Both problems have the same root: the first chart has a fixed pixel size, and it is not yet a drawing that knows how to scale.
SVG draws with shapes, not with pixels, so a drawing can be as sharp on a wall as on a phone. In this phase you learn how, and by the end the dashboard has a proper frame, a bike icon in the header, and a week chart that stretches to fit any box.
In this phase
You will learn
- Read and write SVG: know exactly where a shape lands, and why it sometimes does not appear
- Draw shapes and paths, and read the d attribute that every line chart is made of
- Make a drawing scale to any screen with viewBox, without squashing it
- Style, label, group and reuse shapes, and clip them
You write code in
In the editor on this page, and in your own lumen-dashboard/index.html (no install needed)
Files you touch
- index.html
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.