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.

  1. HTML hydration

    Hydrate an ordinary static card with JSON values, then connect its existing button to JavaScript and Dart runtime handlers.

  2. JSON HTML tables

    Bind JSON columns and rows to a real HTML table. Row click and keyboard selection flow through a registered JavaScript handler.

  3. SVG drawing

    Load rectangles, circles, lines, polylines, and text from JSON. A JavaScript palette handler drives a Dart SVG redraw.

  4. Canvas drawing

    Draw JSON commands through CanvasRenderingContext2D. Pointer coordinates pass through a JavaScript validator before Dart redraws the canvas.

  5. Charts

    Generate bar and pie charts from one JSON document. Dart computes scales, ticks, positions, labels, and SVG arc paths.

  6. 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.

  7. Animation and tweening

    Tween SVG transform, radius, and opacity while drawing Canvas particles with requestAnimationFrame. JavaScript controls pause, resume, and reset.

  8. 3D Canvas with WebGL

    Compile shaders, upload a colored cube, compute perspective and rotation matrices, and animate WebGL without a 3D JavaScript library.