Skip to content

Commit

Permalink
update documentation for ISLC repos, #134
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 10, 2019
1 parent 96e07b3 commit fc265a4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
24 changes: 18 additions & 6 deletions doc/implementation-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,31 @@ Following that, almost all types in the model and view are inherited from the In
It will be useful to become familiar with its [model](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/model.md)
and [implementation](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/implementation-notes.md)

The primary type in this sim is the `Mass`. It handles all positioning as well as the mass values needed to calculate the displayed
force. It is an ISLCObject where only one of radius or density is dynamic at a time.
The primary type in this sim is the `GFLBMass`. It handles all positioning as well as the mass values needed to
calculate the displayed force. It is a subtype of `ISLCObject` where only radius or density is dynamic at a time.

Unlike in Coulomb's Law, here the force can only be attractive, and it is measured from the objects' centers.

This sim is a simplification of the `gravity-force-lab` simulation. Unlike some of the other "basics" sim versions at PhET,
this simulation doesn't take a subset of screens/features. Instead it simplifies the control granularity. In this sim,
sliders that can adjust the mass between 1 and 1000KG are exchanged for number pickers with only a few value options.
All of the possible masses and distances are much larger, so that the force of gravity is within a magnitude that is
easier to grasp.

This sim further simplifies the "regular" sim with changes to the control panel. The "scientific notation" checkbox
is omitted, and an option to omit showing distance between the two masses is added. Toggling distance values off further
simplifies the output, and centers the focus of the sim around the force that the two masses are acting on each other.

## View

The user will mainly be interacting with the ruler, the mass objects, and their control panel. The mass objects have a minimum
separation that is always maintained. When dragging one mass, the other's position will never change. Finally, the arrows are
added to the screenviews as siblings of the mass nodes themselves. This ensures that both arrows appear in the top layer of the scene graph.
The user will mainly be interacting with the ruler, the mass objects, and their control panel. The mass objects have
a minimum separation that is always maintained. When dragging one mass, the other's position will never change. Finally,
the arrows are added to the screenviews as siblings of the mass nodes themselves. This ensures that both arrows appear
in the top layer of the scene graph.

### Mass Nodes
These are instances of ISLCObjectNodes with dynamic or constant radius. See the [ISLC implementation](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/implementation-notes.md)
These are instances of ISLCObjectNodes with dynamic or constant radius. See the
[ISLC implementation](https://github.com/phetsims/inverse-square-law-common/blob/master/doc/implementation-notes.md)
for the details on updating pullers, force values, and arrows.

## Disposal
Expand Down
1 change: 1 addition & 0 deletions doc/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Model Notes
This document describes the model for the Gravity Force Lab simulation. <br>
@author Jesse Greenberg (PhET Interactive Simulations)
@author Michael Barlow (PhET Interactive Simulations)
@author Michael Kauzmann (PhET Interactive Simulations)

The underlying model for gravitational forces between two masses depicted in this simulation is Newton's law of Gravitation.
Please see
Expand Down
15 changes: 15 additions & 0 deletions gravity-force-lab-basics_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,20 @@
loadURL( '../sherpa/lib/require-2.3.6.js', 'js/gravity-force-lab-basics-config.js' );
} )();
</script>
<script>
window.addEventListener( 'message', event => {
if ( !event.data ) {
return;
}
console.log( 'message!!' );
const data = JSON.parse( event.data );

// if load is successful, create a visualization of the parallel DOM
if ( data.type === 'load' && event.source === window ) {
window.hello = phet.joist.sim.display.accessibleDOMElement.outerHTML;
console.log( localCopyPDOM );
}
} );
</script>
</body>
</html>

0 comments on commit fc265a4

Please sign in to comment.