A Dart browser demo book
Small runtime.
Direct to the DOM.
Eight standalone chapters use HTML templates, JSON data, Dart-generated JavaScript, and registered JavaScript handlers. No Flutter or heavyweight framework.
HTML hydration
Hydrate an ordinary static card with JSON values, then connect its existing button to JavaScript and Dart runtime handlers.
JSON HTML tables
Bind JSON columns and rows to a real HTML table. Row click and keyboard selection flow through a registered JavaScript handler.
SVG drawing
Load rectangles, circles, lines, polylines, and text from JSON. A JavaScript palette handler drives a Dart SVG redraw.
Canvas drawing
Draw JSON commands through CanvasRenderingContext2D. Pointer coordinates pass through a JavaScript validator before Dart redraws the canvas.
Charts
Generate bar and pie charts from one JSON document. Dart computes scales, ticks, positions, labels, and SVG arc paths.
Line and scatter plots
Render named point series as a connected line plot and a scatter plot. Both use Dart linear scales and immediate Canvas drawing.
Animation and tweening
Tween SVG transform, radius, and opacity while drawing Canvas particles with requestAnimationFrame. JavaScript controls pause, resume, and reset.
3D Canvas with WebGL
Compile shaders, upload a colored cube, compute perspective and rotation matrices, and animate WebGL without a 3D JavaScript library.