GraphLine | myPhysicsLab Docs

Hierarchy (view full)

Implements

Constructors

constructor

  • new GraphLine(name, varsList, opt_capacity?): GraphLine
  • Parameters

    • name: string
    • varsList: VarsList
    • Optional opt_capacity: number

    Returns GraphLine

Properties

Private dataPoints_

Private drawColor_

drawColor_: string = 'lime'

Private drawMode_

Private hotSpotColor_

hotSpotColor_: string = 'red'

Private lineWidth_

lineWidth_: number = 1.0

Private styles_

Private varsList_

xTransform

xTransform: ((x, y) => number) = ...

Type declaration

    • (x, y): number
    • Parameters

      • x: number
      • y: number

      Returns number

Private xVarParam_

Private xVar_

xVar_: number = -1

yTransform

yTransform: ((x, y) => number) = ...

Type declaration

    • (x, y): number
    • Parameters

      • x: number
      • y: number

      Returns number

Private yVarParam_

Private yVar_

yVar_: number = -1

Static RESET

RESET: "RESET" = ...

Methods

Private addGraphStyle

  • addGraphStyle(): void
  • Returns void

addObserver

  • addObserver(observer): void
  • Returns void

addParameter

  • addParameter(parameter): void
  • Returns void

broadcast

  • broadcast(evt): void
  • Returns void

broadcastParameter

  • broadcastParameter(name): void
  • Parameters

    • name: string

    Returns void

Private buildMenu

  • buildMenu(): void
  • Returns void

Protected getBroadcast

  • getBroadcast(): boolean
  • Returns boolean

    whether broadcasting is enabled for this Subject

getChanged

  • getChanged(): boolean
  • Returns boolean

    whether this SimObject has changed

getClassName

  • getClassName(): string
  • Returns string

    name of class of this object.

getColor

  • getColor(): string
  • Returns string

    the color used when drawing the graph

getDrawingMode

getGraphPoints

getGraphStyle

  • getGraphStyle(index): GraphStyle
  • Parameters

    • index: number

    Returns GraphStyle

    the GraphStyle for that position

getHotSpotColor

  • getHotSpotColor(): string
  • Returns string

    the color used when drawing the hot spot (most recent point)

getLineWidth

  • getLineWidth(): number
  • Returns number

    thickness of line in screen coordinates

getName

  • getName(): string
  • Returns string

    name the language-independent name of this Subject

getObservers

  • getObservers(): Observer[]
  • Returns Observer[]

    a copy of the list of Observers of this Subject.

getParameter

  • getParameter(name): Parameter
  • Parameters

    • name: string

    Returns Parameter

    the Parameter with the given name

getParameterBoolean

getParameterNumber

getParameterString

getParameters

  • getParameters(): Parameter[]
  • Returns Parameter[]

    a copy of the list of available Parameters for this Subject

getVarsList

  • getVarsList(): VarsList
  • Returns VarsList

    the VarsList that this is collecting from.

getXVarName

  • getXVarName(): string
  • Returns string

    variable name or empty string in case index is -1

getXVariable

  • getXVariable(): number
  • Returns number

    the index of X variable in the VarsList, or -1 if no X variable is being collected.

getYVarName

  • getYVarName(): string
  • Returns string

    variable name or empty string in case index is -1

getYVariable

  • getYVariable(): number
  • Returns number

    the index of Y variable in the VarsList, or -1 if no Y variable is being collected.

memorize

  • memorize(): void
  • Returns void

observe

  • observe(event): void
  • Returns void

removeObserver

  • removeObserver(observer): void
  • Returns void

removeParameter

  • removeParameter(parameter): void
  • Returns void

reset

  • reset(): void
  • Returns void

resetStyle

  • resetStyle(): void
  • Returns void

Protected setBroadcast

  • setBroadcast(value): boolean
  • Parameters

    • value: boolean

    Returns boolean

    the previous value

setColor

  • setColor(color): void
  • Parameters

    • color: string

    Returns void

setDrawingMode

  • setDrawingMode(value): void
  • Returns void

setHotSpotColor

  • setHotSpotColor(color): void
  • Parameters

    • color: string

    Returns void

setLineWidth

  • setLineWidth(value): void
  • Parameters

    • value: number

    Returns void

setXVariable

  • setXVariable(xVar): void
  • Parameters

    • xVar: string | number

    Returns void

setYVariable

  • setYVariable(yVar): void
  • Parameters

    • yVar: string | number

    Returns void

toString

  • toString(): string
  • Returns string

toStringShort

  • toStringShort(): string
  • Returns string

    a minimal string representation of this object.