pandocs icon indicating copy to clipboard operation
pandocs copied to clipboard

Add a memory map of VRAM

Open ISSOtm opened this issue 1 year ago • 1 comments

Fixes #533.

The hand-written SVGs return! (Sorry, Antonio... :P)

The SVG was originally (see 966b0d13810e110fcf290422a10e3efc58a2c5d9) generated automatically from a Python script. At that point, it was fully self-contained (no JS required for interactivity)... at the cost of being just shy of one megabyte.

Considering this was ridiculously large, and visibly taxing on the browser, the SVG was entirely overhauled to move the interactivity from a ****ton of elements and a bit of CSS, to only a bunch of elements and a bit of JS. (This was never fully realised, thus never committed.)

The result was still very large, so I started making use of the <use> element, which allows duplicating elements without copy-paste—perfect for these massive grids! (And chances are, the browser may be able to optimise that. Idk.) This was impossible with the old CSS-only design, due to it being based on some elements having the same position within the parent (which <use> inherently precludes.)

Unfortunately, <use> is also very finicky with regards to mouseover/mouseenter events (especially the former), so the final implementation (fdbf3226ec587059866810a933c70de0fa091d97) may raise some eyebrows among JS devs. I tried to be clean, but I'm only an amateur in that field... :D

ISSOtm avatar Feb 18 '24 13:02 ISSOtm

This last commit moves the JS file from stand-alone to being contained within the SVG itself; this makes the SVG fully interactive even when viewed stand-alone instead of within Pan Docs.

ISSOtm avatar Feb 18 '24 14:02 ISSOtm