Skip to content

Commit

Permalink
convert _.extend to PHET_CORE/merge, phetsims/phet-core#71
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 17, 2019
1 parent 908e27b commit 2493d0c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions js/common/model/Capacitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ define( require => {
const Bounds3 = require( 'DOT/Bounds3' );
const Bounds3IO = require( 'DOT/Bounds3IO' );
const BoxShapeCreator = require( 'SCENERY_PHET/capacitor/BoxShapeCreator' );
const capacitorLabBasics = require( 'CAPACITOR_LAB_BASICS/capacitorLabBasics' );
const CapacitorConstants = require( 'SCENERY_PHET/capacitor/CapacitorConstants' );
const capacitorLabBasics = require( 'CAPACITOR_LAB_BASICS/capacitorLabBasics' );
const CircuitLocation = require( 'CAPACITOR_LAB_BASICS/common/model/CircuitLocation' );
const CircuitSwitch = require( 'CAPACITOR_LAB_BASICS/common/model/CircuitSwitch' );
const CLBConstants = require( 'CAPACITOR_LAB_BASICS/common/CLBConstants' );
const DerivedProperty = require( 'AXON/DerivedProperty' );
const DerivedPropertyIO = require( 'AXON/DerivedPropertyIO' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );
const NumberIO = require( 'TANDEM/types/NumberIO' );
const NumberProperty = require( 'AXON/NumberProperty' );
const Property = require( 'AXON/Property' );
Expand All @@ -50,7 +51,7 @@ define( require => {
function Capacitor( config, circuitConnectionProperty, tandem, options ) {

// options that populate the capacitor with various geometric properties
options = _.extend( {
options = merge( {
plateWidth: CapacitorConstants.PLATE_WIDTH_RANGE.defaultValue,
plateSeparation: CapacitorConstants.PLATE_SEPARATION_RANGE.defaultValue
}, options );
Expand Down
3 changes: 2 additions & 1 deletion js/common/model/CircuitConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define( require => {
const CapacitorConstants = require( 'SCENERY_PHET/capacitor/CapacitorConstants' );
const capacitorLabBasics = require( 'CAPACITOR_LAB_BASICS/capacitorLabBasics' );
const CircuitState = require( 'CAPACITOR_LAB_BASICS/common/model/CircuitState' );
const merge = require( 'PHET_CORE/merge' );
const YawPitchModelViewTransform3 = require( 'SCENERY_PHET/capacitor/YawPitchModelViewTransform3' );

// Constants with default assignments
Expand All @@ -35,7 +36,7 @@ define( require => {
*/
create: function( options ) {

return _.extend( {
return merge( {
modelViewTransform: new YawPitchModelViewTransform3(),
capacitorXSpacing: CAPACITOR_X_SPACING,
capacitorYSpacing: CAPACITOR_Y_SPACING,
Expand Down
5 changes: 3 additions & 2 deletions js/common/view/HingePointNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define( require => {
const Circle = require( 'SCENERY/nodes/Circle' );
const CLBConstants = require( 'CAPACITOR_LAB_BASICS/common/CLBConstants' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );

// constants
const HINGE_POINT_RADIUS = 8;
Expand All @@ -26,13 +27,13 @@ define( require => {
*/
function HingePointNode( options ) {

options = _.extend( {
options = merge( {
fill: CLBConstants.CONNECTION_POINT_COLOR,
lineWidth: 3,
stroke: CLBConstants.CONNECTION_POINT_COLOR,
innerPinRadius: PIN_RADIUS,
pinFillColor: CLBConstants.PIN_COLOR
} );
}, options );
Circle.call( this, HINGE_POINT_RADIUS, options );

// Inner circle of hings
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/control/CLBViewControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ define( require => {
const capacitorLabBasics = require( 'CAPACITOR_LAB_BASICS/capacitorLabBasics' );
const CLBConstants = require( 'CAPACITOR_LAB_BASICS/common/CLBConstants' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );
const Node = require( 'SCENERY/nodes/Node' );
const Panel = require( 'SUN/Panel' );
const PhetFont = require( 'SCENERY_PHET/PhetFont' );
Expand Down Expand Up @@ -44,7 +45,7 @@ define( require => {
*/
function CLBViewControlPanel( model, tandem, options ) {

options = _.extend( {
options = merge( {
maxTextWidth: 250,
alignGroup:null
}, options );
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/control/VoltmeterToolboxPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ define( require => {
const EventType = require( 'TANDEM/EventType' );
const HBox = require( 'SCENERY/nodes/HBox' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );
const Node = require( 'SCENERY/nodes/Node' );
const NumberProperty = require( 'AXON/NumberProperty' );
const Panel = require( 'SUN/Panel' );
Expand All @@ -41,7 +42,7 @@ define( require => {
*/
function VoltmeterToolboxPanel( dragBounds, timerNode, voltmeterNode, modelViewTransform, isDraggedProperty,
timerVisibleProperty, voltmeterVisibleProperty, tandem, options ) {
options = _.extend( {
options = merge( {
includeTimer: true,
alignGroup: null
}, options );
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/drag/DragHandleValueNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ define( require => {
// modules
const capacitorLabBasics = require( 'CAPACITOR_LAB_BASICS/capacitorLabBasics' );
const inherit = require( 'PHET_CORE/inherit' );
const merge = require( 'PHET_CORE/merge' );
const Node = require( 'SCENERY/nodes/Node' );
const PhetFont = require( 'SCENERY_PHET/PhetFont' );
const RichText = require( 'SCENERY/nodes/RichText' );
Expand Down Expand Up @@ -40,7 +41,7 @@ define( require => {
*/
function DragHandleValueNode( label, value, unitsPattern, options ) {

options = _.extend( { tandem: Tandem.optional }, options );
options = merge( { tandem: Tandem.optional }, options );

Node.call( this );

Expand Down

0 comments on commit 2493d0c

Please sign in to comment.