RC Day 12 - LayerCake
Published: 2022-05-31
|
Updated: 2022-05-31
Travelled up to Edinburgh for a couple of days.
- Coffee chats with two other Recursers.
- “Regaining momentum when life gets in the way” workshop. This was a group thing where lots of people shared their experiences and strategies.
- I learned that Python has Protocols since 3.8, which seem a lot like Rust’s traits.
- You know what’s way more fiddly than you think? Chart axes. The line in a line chart is waaaaay simpler to describe than an axis with tick marks.
- A nice thing about using svelte and d3 together is escaping the imperative chart building process of d3. We can build charts declaratively with SVG elements in svelte and use d3 for the math, like mapping scales. This breaks a bit when we want a more complex shape that d3 provides a generator for, like an axis. It’d be a pain to manually specify the SVG components for an axis (all those ticks and labels). Totally do-able, but a pain. A reasonable-seeming middle ground would be to create an Axis component which wraps d3’s imperative axis generator. This is getting long for a check-in bullet point, I might need to write more substantial post about it about it.
- In an attempt to resolve the above, I looked into LayerCake a bit. Alongside it’s core thing (layers), it provides some nice chart components, like axes, as copy-pasteable svelte code. It’d be a good exercise for me to dig deeper and to understand the source code for the lib/framework.
Overall, not the most productive day, but pretty good given I also moved city.