~/talk

Excalidraw: Canvas All The Way Down

Talkat SquiggleConf 2024 · 2024-10-03..10-04· [creative-coding, web-platform]
slides:none on file

Excalidraw adds labeled arrows by drawing arrow paths and measured text onto HTML Canvas, handling multi-line text manually and linking label IDs to arrow IDs. Batching strokes into a single polyline cuts draw time (thousands of points: ~0.3ms vs ~6.4ms), clearRect beats clipping by orders of magnitude (e.g. 16ms vs 302ms; 120ms vs 12,551ms in big loops), and offscreen canvas caching speeds repeated labels (≈2.4ms vs ≈36.4ms for 1,000 items). SVG export uses masking; avoid floating-point coords.

AI-written summary · about

  1. 0:00in this talk…
  2. 0:43introducing labeled arrows and Aakansha
  3. 1:31what are labeled arrows?
  4. 3:09basic requirements of labeled arrows
  5. 5:02rendering arrows in canvas
  6. 8:00demo time: rendering arrows
  7. 9:51rough.js
  8. 10:24rendering label on top of arrow
  9. 12:30computing text dimensions
  10. 13:48clearRect approach
  11. 14:28clipping approach
  12. 16:35demo time: clipping approach
  13. 20:28linking the label to the arrow
  14. 22:20support export to svg
  15. 23:30svg masking
  16. 26:29performance improvements
  17. 27:14demo time: off-screen canvas
  18. 28:28avoiding floating point values
  19. 29:46takeaways
  20. 30:55audience questions and answers
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.