Closed gwhitney closed 2 months ago
The upshot here is that we need to document, hopefully in a technical reference page for P5Visualizer or at the very least in comments in P5Visualizer.ts that if you want to set variables in a derived-class inhabit()
function that will be used in the derived-class setup()
function (for example by extracting properties from the div to be inhabited), that must happen before the call to super.inhabit()
, since it is super.inhabit()
that (indirectly) calls this.setup()
. That's perfectly legitimate, but it is a rare case in which you really do want to do stuff in the derived version of the method before the super call. Hence it should be explicitly documented.
I think this is now moot as people writing p5 visualizers with the framework as it now is in ui2 are not writing their own inhabit() function. Closing.
As you said, a tutorial sets the tone for how people make visualizers, and beauty is a core goal. I'd like to set the example of choosing colors with care. If the CSS stuff is too confusing, maybe we could use "magic numbers" with comments explaining that they're chosen to match the page style?
_Originally posted by @Vectornaut in https://github.com/numberscope/frontscope/pull/293#discussion_r1577251515_