Skip to content

Commit

Permalink
Improving imports and allowing using scenery-phet without initialize-…
Browse files Browse the repository at this point in the history
…globals, see phetsims/phet-lib#6
  • Loading branch information
jonathanolson committed Mar 5, 2024
1 parent 59eee4b commit 47c897a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"phet-lib": "~0.0.4"
"phet-lib": "file:../phet-lib"
},
"devDependencies": {
"vite": "^5.1.0",
Expand Down
16 changes: 13 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import './main.css';
// import Bounds2 from '../../dot/js/Bounds2.ts';

import { platform } from 'phet-lib/phet-core';
import { Bounds2 } from 'phet-lib/dot';
import { Bounds2, Range } from 'phet-lib/dot';
import { Property, NumberProperty, PatternStringProperty, StringProperty } from 'phet-lib/axon';
import { Node, Display, Text, VBox, Font, AlignBox, AnimatedPanZoomListener } from 'phet-lib/scenery';
import { TextPushButton } from 'phet-lib/sun';
import { TextPushButton, AccordionBox } from 'phet-lib/sun';
import { ArrowNode, NumberControl, Drawer } from 'phet-lib/scenery-phet';
import { Animation } from 'phet-lib/twixt';
import { StringUtils } from 'phet-lib/phetcommon';

// @ts-ignore
window.assertions.enableAssert();
Expand Down Expand Up @@ -62,7 +65,11 @@ const mainBox = new VBox( {
} ),
new Text( new PatternStringProperty( buttonPressPatternString, { count: countProperty } ), {
font: font
} )
} ),
new NumberControl( 'Count', countProperty, new Range( 0, 100 ), {} ),
new ArrowNode( 0, 0, 100, 0, {} ),
new AccordionBox( new Text( 'Accordion Box' ) ),
new Drawer( new Text( 'Accordion Box' ) )
]
} );

Expand Down Expand Up @@ -106,3 +113,6 @@ display.updateOnRequestAnimationFrame( dt => {

zoomListener.step( dt );
} );

console.log( Animation );
console.log( StringUtils );

0 comments on commit 47c897a

Please sign in to comment.