And what about SVG.js?
https://svgjs.dev/docs/3.0/
What about it? The library provides just another API that trades execution speed for somewhat shorter source code. For single use statements the longer native expressions are fine in my experience, and if repeated I write dedicated functions. (For node properties like in the example you linked to, I prefer a function that takes a node reference, and an object containing the attributes to set for the node.)
In development terms, getting the code structure and approach right from the get go is the most important thing. For example, you don't want to do any kind of heavy calculation in an event handler; you want the event handler to trigger e.g. a timeout, so that the actual heavy computation is done in a background thread (preferably a
web worker) and does not block any UI events.
(The same applies to desktop GUI toolkits like Qt and Gtk, too.)
Stuff like how many consecutive lines of code you need for a specific task is basically irrelevant; anything repeated can be refactored and combined later, when you know approximately what kind of operations you need.
I often stride for a library-style modular approach, mostly so that I can refactor any part I consider in need of it;
nothing is absolutely final, ever, but I carefully track any cross-dependencies and internal interfaces I need.
My first version often ignores most visual details (often using crude HTML table and input fields for the UI), and simply tries to implement the functionality. That way I find out exactly what the implementation needs. It also tells me what kind of DOM manipulation is common, so I can design a function to optimize those.
I am not telling you that frameworks are evil/bad. I am only saying that I personally do not need them for HTML+CSS+SVG+JavaScript applications, and that knowing how to do that kind of "bare browser" apps should help you a lot in evaluating what kind of frameworks and libraries work best for your needs and workflow. You might find you don't need a framework, or you might find you gain a lot from using specific frameworks for specific kinds of apps.
The idea that you
need some kind of framework for web apps is demonstrably false. They can be useful, and using dedicated libraries for stuff like FFT definitely makes sense; but the situation is very different from e.g. desktop application development where you do need a widget toolkit or framework, be it portable or OS-specific.