Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BoxSeries3D

Class for visualization of large sets of individually configurable 3D Boxes.

Add data with BoxSeries3D.invalidateData.

Style boxes with BoxSeries3D.setFillStyle.

Example usage:

 // Construct a grid of vertical boxes.
 const data = [
     { x: 0, z: 0 },
     { x: 1, z: 0 },
     { x: 0, z: 1 },
     { x: 1, z: 1 }
 ]
     // Map coords into **BoxData**.
     .map( coords => {
     const height = Math.random() * 100
     return {
         xCenter: coords.x,
         yCenter: height / 2,
         zCenter: coords.z,
         xSize: 1,
         ySize: height,
         zSize: 1
     }
 })
 const chart = lightningChart().Chart3D()
 const boxSeries = chart.addBoxSeries()
     .invalidateData( data )

Color shading style.

By default, BoxSeries3D uses Phong shading style.

This can be changed with BoxSeries3D.setColorShadingStyle(new ColorShadingStyles.Simple())

Index

Methods

attach

  • attach(entry: LegendBoxEntry, disposeOnClick?: undefined | false | true): this
  • Attach object to an legendBox entry

    Parameters

    • entry: LegendBoxEntry

      Object which has to be attached

    • disposeOnClick: undefined | false | true

      Flag that indicates whether the Attachable should be disposed/restored, when its respective Entry is clicked.

    Returns this

    Series itself for fluent interface

dispose

  • dispose(): this
  • Tell the owning chart to remove this component.

    Returns this

    Object itself.

getAutoScrollingEnabled

  • getAutoScrollingEnabled(): boolean
  • Get whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    Returns boolean

    true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

getColorShadingStyle

getDepthTestEnabled

  • getDepthTestEnabled(): boolean
  • Get 3D depth test enabled for this series.

    By default this is enabled, meaning that any series that is rendered after this series and is behind this series will not be rendered.

    Can be disabled to alter 3D rendering behavior.

    Returns boolean

    Depth test enabled?

getFillStyle

  • Get FillStyle of BoxSeries.

    Supports following FillStyles:

    • SolidFill: Single solid color for all boxes.
    • IndividualPointFill: Each box is colored according to its "color" property. If the property is not present, the box is colored with the IndividualPointFill objects' fall-back color.
    • PalettedFill: Each box is colored according to its "value" property and the PalettedFill objects'

    look up table.

    Returns FillStyle

    FillStyle object.

getHighlightOnHover

  • getHighlightOnHover(): boolean
  • Get boolean flag for whether object should highlight on mouse hover

    Returns boolean

    Boolean for if object should highlight on mouse hover or not.

getHighlighted

  • getHighlighted(): boolean

getIsUnderMouse

  • getIsUnderMouse(): boolean
  • Get boolean flag for whether object is currently under mouse or not

    Returns boolean

    Boolean for is object under mouse currently

getMouseInteractions

  • getMouseInteractions(): boolean
  • Get mouse interactions enabled or disabled. Disabled mouse-interactions will naturally prevent mouse-driven highlighting from ever happening.

    Returns boolean

    Mouse interactions state

getName

  • getName(): string
  • Get the name of the Component.

    Returns string

    The name of the Component.

getRoundedEdges

  • getRoundedEdges(): number | undefined
  • Get rounded edges of Boxes.

    NOTE: Rounded edges result in increased geometry precision, which in turn uses more rendering resources.

    Returns number | undefined

    Either a number in range [0, 1] describing the amount of rounding or undefined for disabled rounded edges.

getXMax

  • getXMax(): number | undefined
  • Returns number | undefined

    Max X value of the series

getXMin

  • getXMin(): number | undefined
  • Returns number | undefined

    Min X value of the series

getYMax

  • getYMax(): number | undefined
  • Returns number | undefined

    Max Y value of the series

getYMin

  • getYMin(): number | undefined
  • Returns number | undefined

    Min Y value of the series

getZMax

  • getZMax(): number | undefined
  • Returns number | undefined

    Max Z value of the series

getZMin

  • getZMin(): number | undefined
  • Returns number | undefined

    Min Z value of the series

invalidateData

  • Method for invalidating Box data. Accepts an Array of BoxDataCentered objects.

    Properties that must be defined for each NEW Box:

    • "xCenter", "yCenter", "zCenter" | coordinates of Box in Axis values.
    • "xSize", "ySize", "zSize" | size of Box in Axis values.

    ( if altering a previously created Box, these are not necessary )

    Optional properties:

    • "id": If supplied, the Box can be altered afterwards by supplying different data with the same "id"
    • "color": If supplied, the Box will be coloured with that color,

    but only when the BoxSeries is styled as IndividualPointFill

    • "value"

    Look-up value to be used when the BoxSeries is styled as PalettedFill.

    Example usage:

    • Add an unidentified Box - in this case the Box can not be altered afterwards.
     BoxSeries3D.invalidateData([
         { xCenter: 0, yCenter: 0, zCenter: 0, xSize: 1, ySize: 1, zSize: 1 }
     ])
    
    • Add an identified Box and alter its 'color' property afterwards.
     const id = "anything-unique"
     BoxSeries3D
         .setFillStyle( new IndividualPointFill() )
         .invalidateData([
             { id, xCenter: 0, yCenter: 0, zCenter: 0, xSize: 1, ySize: 1, zSize: 1 }
         ])
     setTimeout(() => {
         BoxSeries3D.invalidateData([ { id, color: ColorRGBA( 0, 255, 0 ) } ])
     }, 2000)
    

    Parameters

    Returns this

  • Method for invalidating Box data. Accepts an Array of BoxDataBounds objects.

    NOTE: Internally transforms all data into BoxDataCentered format, meaning that this method is slightly slower than the alternative.

    Properties that must be defined for each NEW Box:

    • "xMin", "xMax" | bounds of Box on X Axis.
    • "yMin", "yMax" | bounds of Box on X Axis.
    • "zMin", "zMax" | bounds of Box on X Axis.

    ( if altering a previously created Box, these are not necessary )

    Optional properties:

    • "id": If supplied, the Box can be altered afterwards by supplying different data with the same "id"
    • "color": If supplied, the Box will be coloured with that color,

    but only when the BoxSeries is styled as IndividualPointFill

    • "value"

    Look-up value to be used when the BoxSeries is styled as PalettedFill.

    Example usage:

    • Add an unidentified Box - in this case the Box can not be altered afterwards.
     BoxSeries3D.invalidateData([
         { xMin: 0, yMin: 0, zMin: 0, xMax: 1, yMax: 1, zMax: 1 }
     ])
    
    • Add an identified Box and alter its 'color' property afterwards.
     const id = "anything-unique"
     BoxSeries3D
         .setFillStyle( new IndividualPointFill() )
         .invalidateData([
             { id, xMin: 0, yMin: 0, zMin: 0, xMax: 1, yMax: 1, zMax: 1 }
         ])
     setTimeout(() => {
         BoxSeries3D.invalidateData([ { id, color: ColorRGBA( 0, 255, 0 ) } ])
     }, 2000)
    

    Parameters

    Returns this

isDisposed

  • isDisposed(): boolean
  • Returns boolean

    TODO: True for enabled and false for disabled

offHighlight

  • offHighlight(token: Token): boolean
  • Unsubscribe from Highlight object event. This is called whenever an object is highlighted

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

    True if the unsubscription was successful.

offMouseClick

  • offMouseClick(token: Token): boolean
  • Remove event listener from Mouse Click Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDoubleClick

  • offMouseDoubleClick(token: Token): boolean
  • Remove event listener from Mouse Double Click Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDown

  • offMouseDown(token: Token): boolean
  • Remove event listener from Mouse Down Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDrag

  • offMouseDrag(token: Token): boolean
  • Remove event listener from Mouse Drag Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDragStart

  • offMouseDragStart(token: Token): boolean
  • Remove event listener from Mouse Drag Start Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDragStop

  • offMouseDragStop(token: Token): boolean
  • Remove event listener from Mouse Drag Stop Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseEnter

  • offMouseEnter(token: Token): boolean
  • Remove event listener from Mouse Enter Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseLeave

  • offMouseLeave(token: Token): boolean
  • Remove event listener from Mouse Leave Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseMove

  • offMouseMove(token: Token): boolean
  • Remove event listener from Mouse Move Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseUp

  • offMouseUp(token: Token): boolean
  • Remove event listener from Mouse Up Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseWheel

  • offMouseWheel(token: Token): boolean
  • Remove event listener from Mouse Wheel Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchEnd

  • offTouchEnd(token: Token): boolean
  • Remove event listener from Touch End Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchMove

  • offTouchMove(token: Token): boolean
  • Remove event listener from Touch Move Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchStart

  • offTouchStart(token: Token): boolean
  • Remove event listener from Touch Start Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

onHighlight

  • onHighlight(handler: function): Token
  • Subscribe to highlight object event. This is called whenever an object is highlighted.

    Parameters

    • handler: function

      Function that is called when event is triggered.

        • Parameters

          • isHighlighted: boolean

          Returns void

    Returns Token

    Token that can be used to unsubscribe from the event.

onMouseClick

  • Add event listener to Mouse Click Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDoubleClick

  • Add event listener to Mouse Double Click Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDown

  • Add event listener to Mouse Down Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDrag

onMouseDragStart

onMouseDragStop

onMouseEnter

  • Add event listener to Enter Event

    Parameters

    Returns Token

    Token of the event listener

onMouseLeave

  • Add event listener to Mouse Leave Event

    Parameters

    Returns Token

    Token of the event listener

onMouseMove

  • Add event listener to Mouse Move Event

    Parameters

    Returns Token

    Token of the event listener

onMouseUp

  • Add event listener to Mouse Up Event

    Parameters

    Returns Token

    Token of the event listener

onMouseWheel

onTouchEnd

  • Subscribe to Touch End event

    Parameters

    Returns Token

    Token of subscription

onTouchMove

onTouchStart

restore

  • restore(): this
  • Tell the owning chart to restore this component.

    Returns this

    Object itself.

setAutoScrollingEnabled

  • setAutoScrollingEnabled(enabled: boolean): this
  • Set whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    By setting this to false, any series can be removed from axis scrolling/fitting.

     // Example syntax, remove series from automatic scrolling / fitting.
     LineSeries.setAutoScrollingEnabled(false)
    

    Parameters

    • enabled: boolean

      true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

    Returns this

    Object itself for fluent interface.

setColorShadingStyle

  • Set Color Shading Style for series.

    Shading style changes the visual style of the rendering. See ColorShadingStyles for available shading styles.

    Use Simple color shading style:

    series3D.setShadingStyle(new ColorShadingStyles.Simple())
    

    Use Phong color shading style:

    series3D.setShadingStyle(new ColorShadingStyles.Phong())
    

    Configuring specular highlight for Phong shading style:

    series3D.setShadingStyle(new ColorShadingStyles.Phong({
         specularReflection: 0.5,
         specularColor: ColorRGBA(255, 255, 255)
    }))
    

    Parameters

    Returns this

    Object itself for fluent interface.

setDepthTestEnabled

  • setDepthTestEnabled(enabled: boolean): this
  • Set 3D depth test enabled for this series.

    By default this is enabled, meaning that any series that is rendered after this series and is behind this series will not be rendered.

    Can be disabled to alter 3D rendering behavior.

     // Example syntax, disable depth test.
     pointSeries3D.setDepthTestEnabled(false)
    

    Parameters

    • enabled: boolean

      Depth test enabled?

    Returns this

    Object itself for fluent interface.

setFillStyle

  • Set FillStyle of BoxSeries.

    Supports following FillStyles:

    • SolidFill: Single solid color for all boxes.
    • IndividualPointFill: Each box is colored according to its "color" property. If the property is not present, the box is colored with the IndividualPointFill objects' fall-back color.
    • PalettedFill: Each box is colored according to its "value" property and the PalettedFill objects'

    look up table.

    Parameters

    Returns this

    Object itself.

setHighlightOnHover

  • setHighlightOnHover(state: boolean): this
  • Set highlight on mouse hover enabled or disabled.

    Mouse interactions have to be enabled on the component for this to function as expected. See setMouseInteractions for more information.

    Parameters

    • state: boolean

      True if highlighting on mouse hover, false if no highlight on mouse hover

    Returns this

    Object itself for fluent interface.

setHighlighted

  • setHighlighted(highLight: boolean): this
  • Enable or disable forced highlighting of component

    Parameters

    • highLight: boolean

      True for enabled and false for disabled

    Returns this

    component itself for fluent interface

setMouseInteractions

  • setMouseInteractions(state: boolean): this
  • Set component mouse interactions enabled or disabled.

    Disabling mouse interactions means that the objects below this component can be interacted through it.

    Possible side-effects from disabling mouse interactions:

    • Mouse events are not triggered. For example, onMouseMove.
    • Mouse driven highlighting will not work.

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns this

    Object itself for fluent interface

setName

  • setName(name: string): this
  • Sets the name of the Component updating attached LegendBox entries

    Parameters

    • name: string

      Name of the Component

    Returns this

    Object itself

setRoundedEdges

  • setRoundedEdges(roundness: number | undefined): this
  • Set rounded edges of Boxes.

    NOTE: Rounded edges result in increased geometry precision, which in turn uses more rendering resources.

    Parameters

    • roundness: number | undefined

      Either a number in range [0, 1] describing the amount of rounding or undefined to disable rounded edges.

    Returns this

    Object itself for fluent interface.