Skip to content

Visualizers should call checkParameters when sequence changes #487

@gwhitney

Description

@gwhitney

Like the testing issues, the documentation issues are great for surfacing underlying problems. Responsive to #46, I am designing a "visualizer lifecycle diagram" (along the lines of the Vue component lifecycle diagram). That exercise has uncovered the following inconsistency:

  • We document the checkParameters() method of a (P5)Visualizer as being able to rely on, and use, the sequence .first and .last properties in validating the parameters of the visualizer, and indeed, some of our Visualizer classes (e.g. Turtle) do so. Yet when the sequence changes, the update pathway only goes back to presketch(); if no parameters specific to the visualizer have changed, the visualizer checkParameters() is not called again. So whatever validations were done on the sequence extents may now be in a failed state. This mismatch is even called out as a bug in the comments in Turtle.ts.

Should we modify the update pathway on sequence change for a Visualizer to include calling checkParameters()? Or if not, how should the above inconsistency be resolved? I do not think the inconsistency should be allowed to remain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    visualizerHas to do with a visualizer or the visualizer subsystem.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions