Code Monkey home page Code Monkey logo

beers-law-lab's People

Contributors

agustinvallejo avatar andrewadare avatar arouinfar avatar chrisklus avatar jbphet avatar jessegreenberg avatar jonathanolson avatar katiewoe avatar marlitas avatar mattpen avatar mbarlow12 avatar mjkauzmann avatar phet-dev avatar phet-steele avatar phetbrand avatar pixelzoom avatar samreid avatar universeandmore avatar zepumph avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beers-law-lab's Issues

Concentration meter doesn't update when dropper stream stops

Steps to reproduce:

  1. Load 1st tab (Concentration)
  2. Select "Solution" (dropper)
  3. Place the Concentration meter's sensor directly below the dropper (centered and above the liquid)
  4. Press the dropper's button (liquid comes out, concentration meter properly reads the maximum concentration for the solute).
  5. Release the dropper's button.

Expected: Concentration meter goes back to zero (if it's still above the liquid level)
Actual: Concentration meter stays at the maximum concentration for the solute.

bll-dropper-stream-concentration

jquery shim is not used

In beers-law-lab-config.js I saw this shim:

  shim: {
    jquery: { exports: "$" }
  },

But I think it is unused and should be removed.

multi-touch: Evaporation slider reset is a bit weird

If you load the Concentration tab on a tablet, and drag both the evaporation slider and top faucet (so that it is evaporating faster than water is being added), once it hits zero fluid evaporation will stop and it will start filling.

When you move the finger that was on the evaporation slider (still pressed down), it will switch to that rate of evaporation and start evaporating again.

use axon.PropertySet

Fluid is currently defined as:

  // imports
  var Property = require( "AXON/Property" );

  /**
   * @param {Color} color
   * @constructor
   */
  function Fluid( color ) {
    this.color = new Property( color );
  }

  Fluid.prototype = {
    reset: function() {
      this.color.reset();
    }
  };

  return Fluid;

If it were rewritten to use PropertySet, it would be defined as:

  // imports
  var PropertySet = require( "AXON/PropertySet" );
  var inherit = require( 'PHET_CORE/inherit' );

  /**
   * @param {Color} color
   * @constructor
   */
  function Fluid( color ) {
    PropertySet.call( this, {color: color} );
  }

  return inherit( PropertySet, Fluid );

The latter makes it possible to get/set the value directly, using

thisSolution.color = ConcentrationSolution.createColor( thisSolution.solvent, thisSolution.solute.get(), thisSolution.concentration.get() );

instead of

thisSolution.color.set( ConcentrationSolution.createColor( thisSolution.solvent, thisSolution.solute.get(), thisSolution.concentration.get() ) );

Property links would also need to be changed, if you convert to PropertySet. Not a big deal since there is just one property in this case, but just thought I would bring it up discussion because (a) it relates to uniformity between sims (b) if you add other properties to Fluid later, it will manage them well (automatically remember to reset them, etc) (c) the constructor is a bit shorter and (d) es5 get/set can be more convenient that Property.get() and Property.set()

Why is VisibleColor.colorTable lazily created?

It is not clear from the code or comments why VisibleColor.colorTable is lazily created. I recommend to create it eagerly or document why it is necessary to create lazily. Also, I tested creating the table eagerly and did not see any perceptible performance difference on Win8/Chrome on iPad3/Safari.

multi-touch: switching from the dropper to the shaker while dispensing causes concentration readout bug

A close cousin to #22 for multi-touch (on a tablet)

  1. Switch to the dropper
  2. Move the concentration meter directly under the dropper
  3. Start the dropper's flow with finger A (hold down). Concentration goes up to match the dropper's concentration.
  4. Switch to the shaker with finger B (keep holding finger A)
    The concentration meter should still read the high value, while being above the beaker's fluid level in shaker mode. In addition, it keeps filling.

We should figure out a good way to stop the shaker/dropper action when the mode switches.

Multi-touch four-finger cancel bug on iPad 3

  1. Open the first tab, and drag out the concentration meter with 1 finger (keep it held down)
  2. Place three other fingers down, and drag all four to the right/left. This will trigger swapping between applications on iOS, and should issue an immediate touchcancel event.

Expected: Concentration meter drag stops, and stays where it is.
Actual: Concentration meter sensor moves away from the wire, and the next drag on it is offset a significant amount.

Typo in Sim Credits

Thank you to RSC text reads "Conversation of this simulation..." when it should read "Conversion of this simulation...

artifacts at bottom of cuvette when it's resized (iPad)

See red horizontal lines at bottom of cuvette in screenshot below. Similar lines with other solutions, with the lines matching the color of the solution.

iPad2, iOS 6.1.3, Safari 6.0. Happens 100% of the time. Have not seen this on other platforms.

cuvette

compute width of Concentration text field

ConcentrationControl uses this bit of ugly code, which assumes that the value is 3 digits, and the units are 3 characters (XXX).

var valueDisplay = new Text( '400 XXX', { font: FONT } ); //TODO too many assumptions here, and doesn't work for i18n

Discuss single vs double quotation marks

I recall we discussed single vs double quotation marks a while ago. In the interest of consistency (making it easy to search and find things) I am leaning toward single quotation marks, and double quotation marks for nested/quoted strings. Not a big deal but thought I would bring it up for discussion as part of this code review.

Still able to shake in a lot of solute when saturated

When shaking in lots of solute, it shows the text "saturated!". If you try to shake more solute then, no more solute comes out. However, if it says "saturated" you can continue to shake more and more solute from the shaker if you were already shaking it. Should we change this behavior to make it so the shaker runs out of solute when saturated, while you are shaking it?

Tested on iPad3, iOS7, Mobile Safari 7.

faucet handle issues (Firefox)

Firefox 22.0

Two things noticed:

(1) There's a vertical while line between the flange and the shaft, perhaps a tiny bit of horizontal space?

(2) After dragging the faucet knob, it sometimes shifts up or down a pixel or two when you release it.

ArrowButton methods should probably be on the prototype

ArrowButton declares setEnabled on an instance-by-instance basis instead of once in the prototype. If there is a good reason for this, it should be documented. Otherwise, I would recommend to move it to the prototype.

remove SimpleDragHandler workaround in MovableDragHandler

If and when phetsims/scenery#66 is addressed, remove the workaround that keeps track of the drag target. Specifically, delete this like and any lines that depend on it:

var target = null; // workaround for scenery#66 (currentTarget is null in drag function)

There also has been talk of deprecating SimpleDragHandler, but that becomes less likely as it proliferates.

Omit unused function parameters

version.js contains this declaration:

define( function( require ) {
  "use strict";
  return function() { return "0.0.0-13"; };
} );

I recommend (in this case and others) to omit unused function parameters (in this case require), it just seems like a faint code smell.

ArrowButton.Direction discussion

ArrowButton declares

  // direction that the arrow points
  ArrowButton.Direction = {
    'LEFT': 0,
    'RIGHT': 1
  };

And the client side usage is:

new ArrowButton( ArrowButton.Direction.LEFT, ...

I fail to see the advantage of this additional code. IMO the javascripty way to do this is:

new ArrowButton( 'left', ...

If after discussion we decide to keep the enum pattern, then the quotes around 'LEFT' and 'RIGHT' should be removed.

dynamic text shifts up and down

Mac OS 10.8.4, Firefox 22.0, BLL 1.0.0 ('svg' renderer).

Value displayed in the AT Detector shifts up and down as it changes.

Yellow arrows appear and disappear on iPad3

When swiping across to drag the shaker for the first time, the yellow arrows appear and disappear as the pointer moves on/off from the beaker (happens multiple times). If you just tap the beaker to drag it (instead of swiping across) the arrows flicker on then off.

Troubleshooting information
Name: Concentration
URL: http://www.colorado.edu/physics/phet/dev/html/concentration/1.0.0-rc.1/concentration_en.html
Version: 1.0.0-rc.1
Features missing: fullscreen
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53
Language: en-us
Window: 1024x672
Pixel Ratio: 2/1

ArrowButton does not support typical node options

ArrowButton.js cannot be scaled, positioned, rotated, opacity changed, etc by passing in an options object, even thought it supports an options object (for other options). If this is truly destined for common code, then it should probably support those options.

no navbar on iPad4

Navbar was absent when she was using the chrome browser. Not sure if she's got the latest software. I'll try to recreate this on another iPad when I get ahold of one.

text looks crappy on IE9 (svg)

Win7 Home Premium, 64-bit, 6.2 (Build 7600)
IE 9.0.8112.16421 (update 9.0.12)
Beer's Law Lab 1.0.0 (renderer:svg)

See attached screenshot. Text looks awful.

ie9-crappy-text

Text kerning changes in Remove Solute button

Testing: http://phet.colorado.edu/sims/html/beers-law-lab/latest/beers-law-lab_en.html
Two different versions of this bug exist depending on the OS/Chrome version:

V1 - Observed in Mac OSX 10.8.4, Chrome 28.0.1500.71
Spacing between characters in Remove Solute label increases after mouse-over of button. Changes back to original kerning after use of button.

ORIGINAL SPACING
screenshot_23

AFTER MOUSEOVER
screenshot_22

V2 - Observed in Chromebook, Chrome v.28.0.1500.68
Spacing between characters in Remove Solute text decreases after use of the button. Does not change back. See attached screenshots.

BEFORE
before use

AFTER
after use

text quality issues

Reported by Trish via email:

Trish computer: Windows 7 Professional Dell Vostro 3300 laptop, i5 CPU M460 @2.53 Ghz, 32 bit operating system, NVIDIA GeForce 310 M,

IE 9.1.06 everything looks fine

Chrome Version 27.0.1453.110 m – 1. label on concentration nM – blend together 2. Bottom bar cuts off when resized 3. blurry text 4. Chemical names cut off see in particular cobalt chloride

Firefox version 21.0 – 1. chem names font inconsistent tab 1 to tab 2 2. Text on grey control panels is not very distinct because fine lined (the white on green might look poor on the image capture, but it is more clear on my screen)

Chrome:

beerlaw_chrome_conclabel

Firefox:

beerslaws_firefox_chemnames

Chrome:

beerslaw_chrome_chemname2

Firefox:

beerslaw_firefox_window_1

Firefox:

beerslaws_firefox_window_2

IE:

beerslaws_ie_chemnames_1

Chrome:

beerslaw_chrome_window_2

Chrome:

beerslaw_chrome_window_1

IE:

beerslaws_ie_window_1

Chrome:

beerslaw_chrome_chemname

IE:

beerslaws_ie_window_2

shaker particles performance

Issue to track general Scenery performance issues on the sim.

Main one seems to be the 5 FPS I'm getting on the iPad 3 when dragging the shaker on the 1st tab (almost assuredly due to the particles, I'll look into performance).

The 2nd tab's drop-down menu also seems to be somewhat slow opening and closing.

ArrowButton directions are reversed

When creating new ArrowButton( ArrowButton.Direction.RIGHT,... it actually points to the left and moves the slider to the left (and likewise LEFT points right). Am I confused or should this be fixed?

Surface Weirdness with "Touch and Hold"

On the Surface with version 0.0.0-17 and all three browsers (Chrome, IE, Firefox) there is some weirdness associated with touch and hold... for instance when you use the tweakers in "fire on hold" mode. In chrome the tweaker stays active when you release it, in IE you can end up bringing up a right click menu, and so on...

Such a quirky device...

text on shaker changes while dragging

Firefox 22.0.

Drag the shaker and its text label gets bolder. Release it and it returns to normal. Also gets bolder while resize the browser window.

beers-law-lab.ToggleButton should coalesce with sun.ToggleButton

Beers law lab Toggle Button looks like it wants to fill the same role as sun.ToggleButton. We should try to coalesce them. Things to keep from sun.ToggleButton? It supports any node as content, not just images. Things to keep from BLL.ToggleButton? Enabled/disabled flag.

BLLSymbols should be an object literal not a function with fields

BLLSymbols is currently defined as:

  function BLLSymbols() {}

  BLLSymbols.COBALT_II_NITRATE = toSubscript( "Co(NO3)2" );
  ...
  BLLSymbols.WATER = toSubscript( "H2O" );
  return BLLSymbols;

But it is a bit confusing because it is always accessed statically and never as a function. I would recommend to rewrite as:

return {COBALT_II_NITRATE:toSubscript( "Co(NO3)2" ),...};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.