Skip to content

Commit

Permalink
coin2html: js README update
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobetic authored Jan 3, 2025
1 parent 198f96c commit 12090e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/coin2html/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The overarching goal is to have everything packaged in a single html file, the d

For the longest time I tried to avoid using a JS builder, just piecing the final HTML file together from the various bits here. However the un-modularized Typescript code was difficult to test. I had hopes for ES module support in the browser, but it turns out that inlined modules are useless, cannot be imported (without resorting to some ugly hacks), so eventually I gave up and introduced webpack. I picked webpack because of its HtmlBundlerPlugin that can produce a single HTML page bundling everything.

D3 is the main workhorse of the app, it builds all the visual elements beyond the bare bones dom skeleton defined in body.html. That include not just the charts but the html tables as well. I'd like to stick with D3 as much as possible to keep dependencies to a minimum. I might be tempted to switch to Observable/Plot to reduce the amount of code given that at least some of the charts are pretty standard stock, we'll see, at the moment I'm having too much fun with D3.

As it is the final html file for examples/yearly is ~7MB. This is after stopping importing D3 wholesale and importing just the bits that are used. It does include sourcemaps though to make debugging convenient. There's no minification yet either, which would presumably help as well.

# Project structure

The main pieces are
Expand Down

0 comments on commit 12090e3

Please sign in to comment.