Closed pixelzoom closed 1 year ago
Done in the above commit. @amanda-phet please review, close if OK.
I took a quick look, and the inputEnabledProperty is applying to both f(x) and Predict f(x). Ideally, it would only apply to f(x), so you could still interact with the Predict f(x) curve, but could not change the original f(x) curve if you flipped back to the f(x) mode. I know that is more complex, requiring a conditional or a combo situation for that property.
Self assigning to start over.
There's a bug in Node that is preventing me providing a custom inputEnabledProperty
, see https://github.com/phetsims/scenery/issues/1540. This issues is blocked until that is resolved.
When https://github.com/phetsims/scenery/issues/1540 has been addressed, here's the patch for creating a custom originalGraphNode.inputEnabledProperty
:
So that I could proceed, I resolved https://github.com/phetsims/scenery/issues/1540 myself and assigned to @jonathanolson for review.
Ready for review by @amanda-phet and @kathy-phet. The screenshot below shows the relevant part of the Studio tree.
originalGraphNode.originalCurveInputEnabledProperty
is used to enabled/disable input for f(x).originalGraphNode.inputEnabledProperty
is derived from originalGraphNode.originalCurveInputEnabledProperty
and predictModeEnabledProperty
. It's true if either of those Properties is true.Note that it is NOT possible to disable input for the Predict curve. That's not what you asked for, but I wanted to point that out.
Thinking about this more... The current solution doesn't change the state of the cueing arrows, should it? And perhaps originalGraphNode.originalCurveInputEnabledProperty
should be relocated to originalGraphNode.originalCurveNode.inputEnabledProperty
-- though that feels a little "clever", since there is no input listener associated with originalCurveNode
, and will complicate/confuse the code.
I'm also not entirely sure that I have all the requirements. @kathy-phet with high-priority, could you please confirm that this is what you're expecting:
I'm also not entirely sure that I have all the requirements. @kathy-phet with high-priority, could you please confirm that this is what you're expecting:
Be able to premanently disable f(x) interactivity. Hide the cueing arrows when f(x) interactivity is disabled. No such need for the Predict curve.
Yes - that is what I was thinking of as the requirements. Nice catch on the cuing arrows. I hadn't thought about that - but it makes complete sense to hide those if input is disabled.
Assigning back to you Chris. Since it sounded like the above still needed to be implemented.
@amanda-phet @kathy-phet ready for review.
The screenshot below shows the Studio tree for the revised implementation. The important PhET-iO elements are:
originalCurveNode.inputEnabledProperty
use this to enabled/disable interactivity for f(x)originalGraphNode.inputEnabledProperty
is derived. Note that it's dependency on originalCurveNode.inputEnabledProperty
is not currently shown in the Studio tree because of the scenery/PhET-iO bug, see https://github.com/phetsims/scenery/issues/1541originalCurveNode.cueingArrowsNode.visibleProperty
is derived. Note that it's dependency on originalCurveNode.inputEnabledProperty
is not currently shown in the Studio tree because of the scenery/PhET-iO bug, see https://github.com/phetsims/scenery/issues/1541. When originalCurveNode.inputEnabledProperty
is false, the cueing arrows will be hidden.Note that https://github.com/phetsims/scenery/issues/1541 is a serious problem, and affects all sims. I could work around in this sim, but I don't think we want to have to apply a workaround everywhere that Node Properties are used (visibleProperty, enabledProperty, inputEnabledProperty, etc.) So if there are no additional change requests for this issue, I'll be marking this issue on-hold/blocked.
Note that https://github.com/phetsims/scenery/issues/1541 is a serious problem, and affects all sims. I could work around in this sim, but I don't think we want to have to apply a workaround everywhere that Node Properties are used (visibleProperty, enabledProperty, inputEnabledProperty, etc.) So if there are no additional change requests for this issue, I'll be marking this issue on-hold/blocked.
Another option would be to uninstrument originalGraphNode.inputEnabledProperty
and cueingArrowsNode.visibleProperty
. They are derived (not settable), I seriously doubt that they are useful, or that anyone will ever look at them. And they could be added in a future release, after addressing https://github.com/phetsims/scenery/issues/1541. @amanda-phet @kathy-phet let me know if you're OK with uninstrumenting them.
Another option would be to uninstrument originalGraphNode.inputEnabledProperty
and cueingArrowsNode.visibleProperty
.
3/2/2023 PhET-iO meeting: @kathy-phet and @arouinfar said to do this.
The screenshot below shows the part of the Studio tree under view.graphsNode
. originalCurveNode.inputEnabledProperty
is the sole new Property; clients can use it to disable interactivity of f(x).
@amanda-phet if this looks OK, please close.
Looks good to me!
2/27/2023 design meeting, @kathy-phet requested:
Instrument
originalGraphNode.inputEnabledProperty