Skip to content

Commit

Permalink
minor doc and formatting, #7
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
  • Loading branch information
pixelzoom committed Aug 6, 2018
1 parent b34f20e commit 4962f36
Show file tree
Hide file tree
Showing 26 changed files with 57 additions and 36 deletions.
5 changes: 1 addition & 4 deletions js/common/GQColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Colors used throughout this project.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
*/
define( function( require ) {
Expand Down Expand Up @@ -37,7 +36,5 @@ define( function( require ) {
}
};

graphingQuadratics.register( 'GQColors', GQColors );

return GQColors;
return graphingQuadratics.register( 'GQColors', GQColors );
} );
6 changes: 2 additions & 4 deletions js/common/GQConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Constants that are global to this sim.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
*/
define( function( require ) {
'use strict';
Expand All @@ -24,7 +24,5 @@ define( function( require ) {
POINT_RADIUS: 0.25
};

graphingQuadratics.register( 'GQConstants', GQConstants );

return GQConstants;
return graphingQuadratics.register( 'GQConstants', GQConstants );
} );
1 change: 1 addition & 0 deletions js/common/GQFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/**
* Font used throughout this simulation.
*
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
Expand Down
2 changes: 1 addition & 1 deletion js/common/model/GQModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* Common model (base type) for Graphing Quadratics.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand Down
4 changes: 3 additions & 1 deletion js/common/view/EquationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/**
* Control panel for interactive-equation.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand Down Expand Up @@ -44,6 +44,8 @@ define( function( require ) {
constructor( titleNode, interactiveEquationNode, saveFunction, eraseFunction, options ) {

options = _.extend( {

// superclass options
fill: GQColors.CONTROL_PANEL_BACKGROUND,
xMargin: 10,
yMargin: 10
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/GQSceneNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Common view for a scene. Base type for each of the two scenes on the standard form screen, as well as the single
* scene in the vertex form screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/GQScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* Common view for a screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand All @@ -19,7 +19,7 @@ define( function( require ) {

/**
* @param {GQModel} model
* @param {LineFormViewProperties[]} viewPropertiesArray - an array that holds elements of type LineFormViewProperties
* @param {GQViewProperties[]} viewPropertiesArray - view Properties for each scene
*/
constructor( model, viewPropertiesArray ) {

Expand Down
5 changes: 4 additions & 1 deletion js/common/view/GQViewProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ define( function( require ) {

return inherit( LineFormsViewProperties, GQViewProperties, {

// @public
/**
* @public
* @override
*/
reset: function() {
LineFormsViewProperties.prototype.reset.call( this );
this.vertexVisibleProperty.reset();
Expand Down
10 changes: 3 additions & 7 deletions js/common/view/GraphAndLinesNode.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright 2014-2018, University of Colorado Boulder

//TODO consider a better name for this class
/**
* Common view for a scene. Base type for each of the two scenes on the standard form screen, as well as the single
* scene in the vertex form screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand All @@ -27,12 +28,7 @@ define( function( require ) {
* @param {GQViewProperties} viewProperties
* @param {Object} [options]
*/
constructor(
model,
layoutBounds,
viewProperties,
options
) {
constructor( model, layoutBounds, viewProperties, options ) {

options = _.extend( {
hasVertexManipulator: false // only vertex scene has vertex manipulator
Expand Down
4 changes: 4 additions & 0 deletions js/common/view/PlottedPointNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ define( function( require ) {
constructor( radius, color, options ) {

options = _.extend( {

// superclass options
fill: color,
stroke: color,
lineWidth: 1
}, options );

//TODO assert that options fill and stroke are undefined, then assign constructor args

super( radius, options );
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/PointToolNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Tool that displays the (x,y) coordinates of a grid-point on the graph.
* Origin is at the tip of the tool (bottom center.)
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand Down
11 changes: 8 additions & 3 deletions js/common/view/SliderUnit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,22 @@ define( function( require ) {
* @param {string} string
* @param {NumberProperty} property
* @param {number} decimalPlaces
* @param {Object} [options] for slider node.
* @param {Object} [options]
*/
constructor( string, property, decimalPlaces, options ) {

options = _.extend( {
align: 'center',

centralTick: true,

// HSlider options
trackFill: 'black',
trackSize: new Dimension2( 160, 1 ),
thumbSize: new Dimension2( 15, 25 ),
thumbTouchAreaYDilation: 8
thumbTouchAreaYDilation: 8,

// superclass options
align: 'center'
}, options );

super( options );
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/VertexManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/**
* Drag handler for the vertex.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
* @author Chris Malley (PixelZoom, Inc.)
*/
define( function( require ) {
'use strict';
Expand Down
4 changes: 3 additions & 1 deletion js/standardform/StandardFormScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* The 'Standard Form' screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
*/
define( function( require ) {
'use strict';
Expand All @@ -24,6 +24,8 @@ define( function( require ) {
constructor() {

const options = {

// superclass options
name: screenStandardFormString,
backgroundColorProperty: new Property( GQColors.SCREEN_BACKGROUND )
//TODO add homeScreenIcon
Expand Down
2 changes: 2 additions & 0 deletions js/standardform/view/DecimalsGraphControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ define( function( require ) {
) {

options = _.extend( {

// superclass options
fill: GQColors.CONTROL_PANEL_BACKGROUND,
xMargin: 20,
yMargin: 15
Expand Down
1 change: 1 addition & 0 deletions js/standardform/view/DecimalsInteractiveEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define( function( require ) {

class DecimalsInteractiveEquationNode extends Node {

//TODO options not used
/**
* @param {Property.<Quadratic|undefined>} quadraticProperty
* @param {Object} [options]
Expand Down
9 changes: 3 additions & 6 deletions js/standardform/view/IntegersGraphControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ define( function( require ) {
* @param {BooleanProperty} rootsVisibleProperty
* @param {Object} [options]
*/
constructor(
vertexVisibleProperty,
axisOfSymmetryVisibleProperty,
rootsVisibleProperty,
options
) {
constructor( vertexVisibleProperty, axisOfSymmetryVisibleProperty, rootsVisibleProperty, options ) {

options = _.extend( {

// superclass options
fill: GQColors.CONTROL_PANEL_BACKGROUND,
xMargin: 20,
yMargin: 15
Expand Down
1 change: 1 addition & 0 deletions js/standardform/view/IntegersInteractiveEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ define( function( require ) {

class IntegersInteractiveEquationNode extends Node {

//TODO option not used
/**
* @param {Property.<Quadratic|undefined>} quadraticProperty
* @param {Object} [options]
Expand Down
4 changes: 4 additions & 0 deletions js/standardform/view/SceneControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ define( function( require ) {
constructor( selectedSceneProperty, scenes, options ) {

options = _.extend( {

// superclass options
orientation: 'horizontal',
spacing: 20,
baseColor: 'white',
Expand All @@ -31,7 +33,9 @@ define( function( require ) {
}, options );

// touchArea optimized for spacing
assert && assert( options.touchAreaXDilation === undefined, 'SceneControl sets touchAreaXDilation' );
options.touchAreaXDilation = ( options.spacing / 2 ) - 1;
assert && assert( options.touchAreaYDilation === undefined, 'SceneControl sets touchAreaYDilation' );
options.touchAreaYDilation = 5;

const content = [];
Expand Down
2 changes: 2 additions & 0 deletions js/standardform/view/StandardFormEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ define( function( require ) {
constructor( options ) {

options = _.extend( {

// superclass options
font: GQFont.MATH_SYMBOL_FONT
} );

Expand Down
2 changes: 2 additions & 0 deletions js/vertexform/VertexFormScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ define( function( require ) {
constructor() {

const options = {

// superclass options
name: screenVertexFormString,
backgroundColorProperty: new Property( GQColors.SCREEN_BACKGROUND )
};
Expand Down
1 change: 0 additions & 1 deletion js/vertexform/model/VertexFormModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Model for the 'Vertex Form' screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
*/
define( function( require ) {
Expand Down
2 changes: 2 additions & 0 deletions js/vertexform/view/VertexFormEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ define( function( require ) {
constructor( options ) {

options = _.extend( {

// superclass options
font: GQFont.MATH_SYMBOL_FONT
} );

Expand Down
2 changes: 1 addition & 1 deletion js/vertexform/view/VertexFormScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* View for the 'Vertex Form' screen.
*
* @author Chris Malley (PixelZoom, Inc.)
* @author Andrea Lin
*/
define( function( require ) {
'use strict';
Expand Down
2 changes: 2 additions & 0 deletions js/vertexform/view/VertexGraphControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ define( function( require ) {
constructor( axisOfSymmetryVisibleProperty, directrixVisibleProperty, options ) {

options = _.extend( {

// superclass options
fill: GQColors.CONTROL_PANEL_BACKGROUND,
xMargin: 20,
yMargin: 15
Expand Down
3 changes: 2 additions & 1 deletion js/vertexform/view/VertexInteractiveEquationNode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018, University of Colorado Boulder

/**
* Renderer for standard form equation with integer cofficients that can be changed.
* Renderer for standard form equation with integer coefficients that can be changed.
* Form is y = ax^2 + bx + c, where a, b, and c can be changed with number pickers
*
* @author Andrea Lin
Expand Down Expand Up @@ -35,6 +35,7 @@ define( function( require ) {

class VertexInteractiveEquationNode extends Node {

//TODO options not used
/**
* @param {Property.<Quadratic|undefined>} quadraticProperty
* @param {Object} [options]
Expand Down

0 comments on commit 4962f36

Please sign in to comment.