Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Dec 19, 2024
0 parents commit a1188d5
Show file tree
Hide file tree
Showing 22 changed files with 1,307 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/
build/
node_modules/
*.iml
.DS_Store
.DS_Store?
*.sublime-project
*.sublime-workspace
.eslintcache
5 changes: 5 additions & 0 deletions Gruntfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2024, University of Colorado Boulder


// use chipper's gruntfile
module.exports = require( '../chipper/js/grunt/commonjs/gruntMain.js' );
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Membrane Channels
================

"Membrane Channels" is an educational simulation in HTML5, by <a href="https://phet.colorado.edu/" target="_blank">PhET
Interactive Simulations</a>
at the University of Colorado Boulder.

*This simulation is under development and has not been published.*

### Documentation

The <a href="https://github.com/phetsims/phet-info/blob/main/doc/phet-development-overview.md" target="_blank">PhET
Development Overview</a> is the most complete guide to PhET Simulation Development. This guide includes how to obtain
simulation code and its dependencies, notes about architecture & design, how to test and build the sims, as well as
other important information.

### License

See the <a href="https://github.com/phetsims/membrane-channels/blob/main/LICENSE" target="_blank">LICENSE</a>
91 changes: 91 additions & 0 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"comment": "# membrane-channels 1.0.0-dev.1 Tue Apr 09 2019 12:10:58 GMT-0600 (Mountain Daylight Time)",
"assert": {
"sha": "d8a2e8992420327ff72a6fc4bb93ec76549ded0e",
"branch": "main"
},
"axon": {
"sha": "2da6c6173a0ed6bedc1dad8a5fffac27faaf5259",
"branch": "main"
},
"brand": {
"sha": "40dd405ec950d10e15e957cbda3d97362e925bef",
"branch": "main"
},
"chipper": {
"sha": "9ad482f12f8a23b5db133fff1f83d2188ea1ca71",
"branch": "main"
},
"dot": {
"sha": "0c7f66f353443ca23cc3e6b6e81ddba94d5fb120",
"branch": "main"
},
"joist": {
"sha": "5be6cce9af6453fba670869c85cb3d9d378af7fd",
"branch": "main"
},
"kite": {
"sha": "95999b737aad44dde813fee32661ea196fc400b9",
"branch": "main"
},
"phet-core": {
"sha": "98d20de43c3360cb8e10109401ab44b6e6bc6986",
"branch": "main"
},
"phet-io": {
"sha": "de3ba60fc9c2359d1ef3dac7cc413edbe2435dad",
"branch": "main"
},
"phet-io-wrapper-classroom-activity": {
"sha": "248958109c8d3b73b5f9d6c31015b2c8b5016571",
"branch": "main"
},
"phet-io-wrapper-lab-book": {
"sha": "e5309c0d655079dede0616b5aa637e624e978242",
"branch": "main"
},
"phet-io-wrappers": {
"sha": "160f6c61f3533694a8c2b8fc58e29622381014da",
"branch": "main"
},
"phetcommon": {
"sha": "6d7cec347b7c30faff7e99956a87eb10e535dafa",
"branch": "main"
},
"phetmarks": {
"sha": "4e089c3241fab3c6c99820a3be8349469bf20191",
"branch": "main"
},
"query-string-machine": {
"sha": "aeac99bd3badf40473561fd2e31928aa3d58b86b",
"branch": "main"
},
"scenery": {
"sha": "803d3ffd4ac75b784417e901d8fcc9f88bf26dd0",
"branch": "main"
},
"scenery-phet": {
"sha": "c6912dbdc482b28e385212d090ad55eb731e6095",
"branch": "main"
},
"sherpa": {
"sha": "22d2ea6a9a2ea4f575f87e6c1a4914f6200d9197",
"branch": "main"
},
"membrane-channels": {
"sha": "b271af956e7ba8c1f0b7f3dc6cf89e4e63a4f648",
"branch": "main"
},
"sun": {
"sha": "639af54466a1c654d61708c61b870f18d76c58ef",
"branch": "main"
},
"tambo": {
"sha": "06b7bb5cbda692908149f95f64b261d13bbe774f",
"branch": "main"
},
"tandem": {
"sha": "e20d57b80b322a9a7afd77e80d64d99988137238",
"branch": "main"
}
}
1 change: 1 addition & 0 deletions doc/implementation-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO implementation overview
1 change: 1 addition & 0 deletions doc/model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO model description
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2024, University of Colorado Boulder

/**
* ESLint configuration for membrane-channels.
*
* @author Sam Reid (PhET Interactive Simulations)
* @author Michael Kauzmann (PhET Interactive Simulations)
*/

import simEslintConfig from '../perennial-alias/js/eslint/config/sim.eslint.config.mjs';
import banTSCommentConfig from '../perennial-alias/js/eslint/config/util/banTSCommentConfig.mjs';

export default [
...simEslintConfig,
...banTSCommentConfig
];
3 changes: 3 additions & 0 deletions images/license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
27 changes: 27 additions & 0 deletions js/MembraneChannelsStrings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2024, University of Colorado Boulder

/* eslint-disable */
/* @formatter:off */

/**
* Auto-generated from modulify, DO NOT manually modify.
*/

import getStringModule from '../../chipper/js/browser/getStringModule.js';
import type LocalizedStringProperty from '../../chipper/js/browser/LocalizedStringProperty.js';
import membraneChannels from './membraneChannels.js';

type StringsType = {
'membrane-channels': {
'titleStringProperty': LocalizedStringProperty;
};
'screen': {
'nameStringProperty': LocalizedStringProperty;
}
};

const MembraneChannelsStrings = getStringModule( 'MEMBRANE_CHANNELS' ) as StringsType;

membraneChannels.register( 'MembraneChannelsStrings', MembraneChannelsStrings );

export default MembraneChannelsStrings;
29 changes: 29 additions & 0 deletions js/common/MembraneChannelsColors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2024, University of Colorado Boulder

/**
* Defines the colors for this sim.
*
* All simulations should have a Colors.js file, see https://github.com/phetsims/scenery-phet/issues/642.
*
* For static colors that are used in more than one place, add them here.
*
* For dynamic colors that can be controlled via colorProfileProperty.js, add instances of ProfileColorProperty here,
* each of which is required to have a default color. Note that dynamic colors can be edited by running the sim from
* phetmarks using the "Color Edit" mode.
*
* @author Sam Reid (PhET Interactive Simulations, and Jesse Greenberg (PhET Interactive Simulations)
*/

import { ProfileColorProperty } from '../../../scenery/js/imports.js';
import membraneChannels from '../membraneChannels.js';

const MembraneChannelsColors = {

// Background color for screens in this sim
screenBackgroundColorProperty: new ProfileColorProperty( membraneChannels, 'background', {
default: 'white'
} )
};

membraneChannels.register( 'MembraneChannelsColors', MembraneChannelsColors );
export default MembraneChannelsColors;
20 changes: 20 additions & 0 deletions js/common/MembraneChannelsConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2024, University of Colorado Boulder

/**
* Constants used throughout this simulation.
*
* @author Sam Reid (PhET Interactive Simulations, and Jesse Greenberg (PhET Interactive Simulations)
*/

import membraneChannels from '../membraneChannels.js';

const MembraneChannelsConstants = {

SCREEN_VIEW_X_MARGIN: 15,
SCREEN_VIEW_Y_MARGIN: 15

//TODO
};

membraneChannels.register( 'MembraneChannelsConstants', MembraneChannelsConstants );
export default MembraneChannelsConstants;
29 changes: 29 additions & 0 deletions js/common/MembraneChannelsQueryParameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2024, University of Colorado Boulder

/**
* Defines query parameters that are specific to this simulation.
* Run with ?log to print query parameters and their values to the browser console at startup.
*
* @author Sam Reid (PhET Interactive Simulations, and Jesse Greenberg (PhET Interactive Simulations)
*/

import logGlobal from '../../../phet-core/js/logGlobal.js';
import membraneChannels from '../membraneChannels.js';

const SCHEMA_MAP = {
//TODO add schemas for query parameters
};

const MembraneChannelsQueryParameters = QueryStringMachine.getAll( SCHEMA_MAP );

// The schema map is a read-only part of the public API, in case schema details (e.g. validValues) are needed elsewhere.
MembraneChannelsQueryParameters.SCHEMA_MAP = SCHEMA_MAP;

membraneChannels.register( 'MembraneChannelsQueryParameters', MembraneChannelsQueryParameters );

// Log query parameters
logGlobal( 'phet.chipper.queryParameters' );
logGlobal( 'phet.preloads.phetio.queryParameters' );
logGlobal( 'phet.membraneChannels.MembraneChannelsQueryParameters' );

export default MembraneChannelsQueryParameters;
43 changes: 43 additions & 0 deletions js/membrane-channels-main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2024, University of Colorado Boulder

/**
* Main entry point for the sim.
*
* @author Sam Reid (PhET Interactive Simulations, and Jesse Greenberg (PhET Interactive Simulations)
*/

import Sim, { SimOptions } from '../../joist/js/Sim.js';
import simLauncher from '../../joist/js/simLauncher.js';
import Tandem from '../../tandem/js/Tandem.js';
import MembraneChannelsScreen from './membrane-channels/MembraneChannelsScreen.js';
import MembraneChannelsStrings from './MembraneChannelsStrings.js';
import './common/MembraneChannelsQueryParameters.js';

// Launch the sim. Beware that scenery Image nodes created outside simLauncher.launch() will have zero bounds
// until the images are fully loaded. See https://github.com/phetsims/coulombs-law/issues/70#issuecomment-429037461
simLauncher.launch( () => {

const titleStringProperty = MembraneChannelsStrings[ 'membrane-channels' ].titleStringProperty;

const screens = [
new MembraneChannelsScreen( { tandem: Tandem.ROOT.createTandem( 'membraneChannelsScreen' ) } )
];

const options: SimOptions = {

//TODO fill in credits, all of these fields are optional, see joist.CreditsNode
credits: {
leadDesign: '',
softwareDevelopment: '',
team: '',
contributors: '',
qualityAssurance: '',
graphicArts: '',
soundDesign: '',
thanks: ''
}
};

const sim = new Sim( titleStringProperty, screens, options );
sim.start();
} );
44 changes: 44 additions & 0 deletions js/membrane-channels/MembraneChannelsScreen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2024, University of Colorado Boulder

/**
* TODO Describe this class and its responsibilities.
*
* @author Sam Reid (PhET Interactive Simulations, and Jesse Greenberg (PhET Interactive Simulations)
*/

import Screen, { ScreenOptions } from '../../../joist/js/Screen.js';
import optionize from '../../../phet-core/js/optionize.js';
import MembraneChannelsColors from '../common/MembraneChannelsColors.js';
import membraneChannels from '../membraneChannels.js';
import MembraneChannelsStrings from '../MembraneChannelsStrings.js';
import MembraneChannelsModel from './model/MembraneChannelsModel.js';
import MembraneChannelsScreenView from './view/MembraneChannelsScreenView.js';

type SelfOptions = {
//TODO add options that are specific to MembraneChannelsScreen here
};

type MembraneChannelsScreenOptions = SelfOptions & ScreenOptions;

export default class MembraneChannelsScreen extends Screen<MembraneChannelsModel, MembraneChannelsScreenView> {

public constructor( providedOptions: MembraneChannelsScreenOptions ) {

const options = optionize<MembraneChannelsScreenOptions, SelfOptions, ScreenOptions>()( {
name: MembraneChannelsStrings.screen.nameStringProperty,

//TODO add default values for optional SelfOptions here

//TODO add default values for optional ScreenOptions here
backgroundColorProperty: MembraneChannelsColors.screenBackgroundColorProperty
}, providedOptions );

super(
() => new MembraneChannelsModel( { tandem: options.tandem.createTandem( 'model' ) } ),
model => new MembraneChannelsScreenView( model, { tandem: options.tandem.createTandem( 'view' ) } ),
options
);
}
}

membraneChannels.register( 'MembraneChannelsScreen', MembraneChannelsScreen );
Loading

0 comments on commit a1188d5

Please sign in to comment.