Skip to content

BeakerNode

Overview

BeakerNode draws a pseudo-3D cylindrical beaker, with optional tick marks, containing a solution. Based on the value of solutionLevelProperty, it fills the beaker with solution from the bottom up. The Beaker and solution use flat style shading and highlights to provide pseudo-3D dimension.

This node expects the provided solutionLevelProperty that maps between 0 (empty) and 1 (full).

@author Marla Schulz <marla.schulz@colorado.edu>

Class BeakerNode

import { BeakerNode } from 'scenerystack/scenery-phet';

Constructor

new BeakerNode( solutionLevelProperty : TRangedProperty, providedOptions? : BeakerNodeOptions )

Instance Methods

dispose()

setTicksVisible( visible : boolean )

Type BeakerNodeOptions

import type { BeakerNodeOptions } from 'scenerystack/scenery-phet';
  • emptyBeakerFill?: TPaint
  • solutionFill?: TColor
  • solutionShadowFill?: TPaint
  • solutionGlareFill?: TPaint
  • beakerGlareFill?: TPaint
  • beakerHeight?: number
  • beakerWidth?: number
  • yRadiusOfEnds?: number
  • ticksVisible?: boolean
  • tickStroke?: TPaint
  • beakerStroke?: TPaint
  • lineWidth?: number
  • numberOfTicks?: number
  • majorTickMarkModulus?: number
  • & StrictOmit<NodeOptions, "children">

Source Code

See the source for BeakerNode.ts in the scenery-phet repository.