Closed chrisklus closed 6 years ago
There is no need to expose the implementation detail that it's a subtype of RichText (or a single any kind of text). In fact I wanted to explicitly discourage that because other similar equations (e.g. FocusAndDirectrixEquationNode) cannot be implemented with RichText, and are an assemblage of many Nodes.
Does that make sense?
Does that make sense?
It does, thanks for clarifying. Closing.
Reopening because this does bring up a PhET-iO question. StandardFormEquationNode
is instrumented. And since it extends RichText, that gives the client access to the full PhET-iO API for RichText - which we don't want. So perhaps I should make StandardFormEquationNode
extend Node
, and hide the RichText as a child. What do you think?
I went ahead and wrapped the RichText, see above commit. I think this is appropriate because the RichText API is not supposed to be visible to clients (PhET-iO or otherwise). And now that StandardFormEquationNode extends Node
, hopefully the class name is more agreeable. If this looks OK to you, feel free to close.
@zepumph and I think that sounds like a great idea, nice change. Closing.
That commit is better than a solution where we pass in phetioType: NodeIO
to cut out the RichText functionality from the type.
@zepumph and I are also wondering if the labels for the coefficient sliders (a, b, c) should be exposing RichText API as they currently are.
I think the slider labels are fine as RichText. For the general programming API, they aren't visible outside of CoefficientSlider. And for PhET-iO we decided that "all or nothing" was OK, so I'm not going to go around wrapping everything in a Node to protect it against nefarious PhET-iO usage.
This question extends to how we are treating Checkboxes in GQ too. Currently the text isn't instrumented. In FL the checkbox labels aren't instrumented (see voltmeterCheckbox in ControlPanelNode.js), but this seems inconsistent with having these labels instrumented. @pixelzoom what do you think is best practice (as a whole) for graphing quadratics? In my mind the options are:
The PhET-iO design requirements for this sim did not include any ability to change text, on Checkboxes or any other UI components. The requirements related to things that have text were the ability to show/hide:
"Instrument all labels/titles/text that accompanies UI" sounds like a step back toward the "instrument everything" approach, and I don't think that is desirable or necessary.
Sounds good. I feel like we are ready to close this issue, as it sounds like the current approach meets the phet-io design requirements better than any proposed general convention does.
StandardFormEquationNode extends RichText so @zepumph and I think that it should be renamed to StandardFormEquationText.
Found while working on #14.