Skip to content

Commit

Permalink
instrument values shown on graph indicators, #105
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 7, 2020
1 parent 43d39b6 commit 25439a3
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 8 deletions.
19 changes: 15 additions & 4 deletions js/common/view/graph/LinearGraphNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,21 @@ define( require => {
tickLabels.push( tickLabel );
}

// indicators & associated properties
const valueH2OProperty = new NumberProperty( 0 );
const valueH3OProperty = new NumberProperty( 0 );
const valueOHProperty = new NumberProperty( 0 );
// Properties
const valueH2OProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueH2OProperty' ),
phetioReadOnly: true
} );
const valueH3OProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueH3OProperty' ),
phetioReadOnly: true
} );
const valueOHProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueOHProperty' ),
phetioReadOnly: true
} );

// indicators
const indicatorH2ONode = GraphIndicatorNode.createH2OIndicator( valueH2OProperty, {
x: scaleNode.right - options.majorTickLength,
tandem: options.tandem.createTandem( 'indicatorH2ONode' )
Expand Down
19 changes: 15 additions & 4 deletions js/common/view/graph/LogarithmicGraphNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,21 @@ define( require => {
}
}

// indicators & associated properties
const valueH2OProperty = new NumberProperty( 0 );
const valueH3OProperty = new NumberProperty( 0 );
const valueOHProperty = new NumberProperty( 0 );
// Properties
const valueH2OProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueH2OProperty' ),
phetioReadOnly: true
} );
const valueH3OProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueH3OProperty' ),
phetioReadOnly: true
} );
const valueOHProperty = new NumberProperty( 0, {
tandem: options.tandem.createTandem( 'valueOHProperty' ),
phetioReadOnly: true
} );

// indicators
const indicatorH2ONode = GraphIndicatorNode.createH2OIndicator( valueH2OProperty, {
x: backgroundNode.right - options.indicatorXOffset,
tandem: options.tandem.createTandem( 'indicatorH2ONode' )
Expand Down
117 changes: 117 additions & 0 deletions js/phet-io/ph-scale-phet-io-elements-baseline.js
Original file line number Diff line number Diff line change
Expand Up @@ -7775,6 +7775,45 @@ window.phet.phetio.phetioElementsBaseline = assert &&
"phetioStudioControl": true,
"phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
},
"phScale.microScreen.view.graphNode.linearGraphNode.valueH2OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.linearGraphNode.valueH3OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.linearGraphNode.valueOHProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.linearGraphNode.visibleProperty": {
"phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
"phetioDynamicElement": false,
Expand Down Expand Up @@ -8243,6 +8282,45 @@ window.phet.phetio.phetioElementsBaseline = assert &&
"phetioStudioControl": true,
"phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
},
"phScale.microScreen.view.graphNode.logarithmicGraphNode.valueH2OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.logarithmicGraphNode.valueH3OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.logarithmicGraphNode.valueOHProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.microScreen.view.graphNode.logarithmicGraphNode.visibleProperty": {
"phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
"phetioDynamicElement": false,
Expand Down Expand Up @@ -11363,6 +11441,45 @@ window.phet.phetio.phetioElementsBaseline = assert &&
"phetioStudioControl": true,
"phetioTypeName": "PropertyIO<NullableIO<BooleanIO>>"
},
"phScale.mySolutionsScreen.view.graphNode.logarithmicGraphNode.valueH2OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.mySolutionsScreen.view.graphNode.logarithmicGraphNode.valueH3OProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.mySolutionsScreen.view.graphNode.logarithmicGraphNode.valueOHProperty": {
"phetioDocumentation": "",
"phetioDynamicElement": false,
"phetioEventType": "MODEL",
"phetioFeatured": false,
"phetioHighFrequency": false,
"phetioIsArchetype": false,
"phetioPlayback": false,
"phetioReadOnly": true,
"phetioState": true,
"phetioStudioControl": true,
"phetioTypeName": "NumberPropertyIO"
},
"phScale.mySolutionsScreen.view.graphNode.logarithmicGraphNode.visibleProperty": {
"phetioDocumentation": "Controls whether the Node will be visible (and interactive), see the NodeIO documentation for more details.",
"phetioDynamicElement": false,
Expand Down

0 comments on commit 25439a3

Please sign in to comment.