Skip to content

BicyclePumpNode

Overview

This is a graphical representation of a bicycle pump. A user can move the handle up and down.

@author John Blanco @author Siddhartha Chinthapally (Actual Concepts) @author Chris Klusendorf (PhET Interactive Simulations) @author Saurabh Totey

Class BicyclePumpNode

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

Constructor

new BicyclePumpNode( numberProperty : TProperty<number>, rangeProperty : TReadOnlyProperty<Range>, providedOptions? : BicyclePumpNodeOptions )

Instance Methods

reset()

dispose()

Instance Properties

nodeEnabledProperty : TProperty<boolean>

(readonly)

hoseAttachmentOffset : Vector2

(readonly)

Type BicyclePumpNodeOptions

import type { BicyclePumpNodeOptions } from 'scenerystack/scenery-phet';
  • width?: number
  • height?: number
  • handleFill?: TColor
    various colors used by the pump
  • shaftFill?: TColor
  • bodyFill?: TColor
  • bodyTopFill?: TColor
  • indicatorBackgroundFill?: TColor
  • indicatorRemainingFill?: TColor
  • hoseFill?: TColor
  • baseFill?: TColor
  • hoseCurviness?: number
    greater value = curvy hose, smaller value = straighter hose
  • hoseAttachmentOffset?: Vector2
    where the hose will attach externally relative to the origin of the pump
  • nodeEnabledProperty?: TProperty<boolean> | null
    Determines whether the pump will interactive. If the pump's range changes, the pumps indicator will update regardless of enabledProperty. If null, this Property will be created.
  • injectionEnabledProperty?: TProperty<boolean>
    {BooleanProperty} - determines whether the pump is able to inject particles when the pump is still interactive. This is needed for when a user is pumping in particles too quickly for a model to handle (so the injection needs throttling), but the pump should not become non-interactive as a result, see https://github.com/phetsims/states-of-matter/issues/276
  • handleTouchAreaXDilation?: number
    pointer areas
  • handleTouchAreaYDilation?: number
  • handleMouseAreaXDilation?: number
  • handleMouseAreaYDilation?: number
  • dragListenerOptions?: StrictOmit<SoundDragListenerOptions, "drag" | "tandem">
    Options passed to the drag listeners.
  • keyboardDragListenerOptions?: StrictOmit<SoundKeyboardDragListenerOptions, "drag" | "keyboardDragDirection" | "tandem">
  • handleCursor?: "ns-resize"
    cursor for the pump handle when it's enabled
  • numberOfParticlesPerPumpAction?: number
    Number of particles released by the pump during one pumping action.
  • addParticlesOneAtATime?: boolean
    If false, particles are added as a batch at the end of each pumping motion.
  • & NodeOptions

Source Code

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