Options
All
  • Public
  • Public/Protected
  • All
Menu
summary

A JavaScript 3D Surface Mesh or Surface Plot chart type rendering a 2-dimensional array of data as color and height values SciChart's High Performance Real-time JavaScript 3D Chart Library

description

Surface meshes are a 3D representation of 2-dimensional arrays of data, rendered as a height-map with optional colors on the chart. The SurfaceMeshRenderableSeries3D assumes the cells are equal size, and spaced along the X,Z axis according to properties on the UniformGridDataSeries3D.

For a code sample how to initialize a surface mesh, see below

// Create an empty 2D array using the helper function zeroArray2D
const heightMapArray: number[][] = zeroArray2D([height, width]);
// todo: fill the zValues 2d array with values

// Create a UniformGridDataSeries3D passing in height values
const dataSeries = new UniformGridDataSeries3D(wasmContext, {
      yValues: heightmapArray,
      xStep: 1,
      zStep: 1,
      dataSeriesName: "Uniform Surface Mesh"
  });

// Create a color map with gradient colors
const colorMap = new GradientColorPalette(wasmContext, {
       gradientStops: [
           { offset: 1, color: "#8B0000" },
           { offset: 0.9, color: "#FF0000" },
           { offset: 0.7, color: "#FF0000" },
           { offset: 0.5, color: "#ADFF2F" },
           { offset: 0.3, color: "#00FFFF" },
           { offset: 0.1, color: "#0000FF" },
           { offset: 0, color: "#1D2C6B" }
       ]
   });

// Create a SurfaceMeshRenderableSeries3D
const series = new SurfaceMeshRenderableSeries3D(wasmContext, {
       dataSeries,
       minimum: 0,
       maximum: 0.5,
       opacity: 0.9,
       cellHardnessFactor: 1.0,
       shininess: 0,
       lightingFactor: 0.8,
       highlight: 1.0,
       stroke: "rgba(24,139,34,0.5)",
       strokeThickness: 2.0,
       contourStroke: "rgba(24,139,34,0.5)",
       contourInterval: 2,
       contourOffset: 0,
       contourStrokeThickness: 2,
       drawSkirt: false,
       drawMeshAs: EDrawMeshAs.SOLID_WIREFRAME,
       meshColorPalette: colorMap,
       isVisible: true
   });

// Add the Surface Mesh to the chart
sciChart3DSurface.renderableSeries.add(series);

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly id

id: string

A unique Id for the IRenderableSeries3D

invalidateParentCallback

invalidateParentCallback: () => void

A callback function which notifies the parent SciChart3DSurface that data or properties have changed and the 3D Scene needs redrawing

Type declaration

    • (): void
    • Returns void

Protected Readonly webAssemblyContext

webAssemblyContext: TSciChart3D

The SciChart 3D WebAssembly Context containing native methods and access to our WebGL2 WebAssembly Drawing Engine

Accessors

cellHardnessFactor

  • get cellHardnessFactor(): number
  • set cellHardnessFactor(cellHardnessFactor: number): void
  • Gets or sets the cell hardness factor, a number used to calculate lighting effects.

    remarks

    Defaults to 1

    Returns number

  • Gets or sets the cell hardness factor, a number used to calculate lighting effects.

    remarks

    Defaults to 1

    Parameters

    • cellHardnessFactor: number

    Returns void

colorMapTextureSize

  • get colorMapTextureSize(): Size
  • set colorMapTextureSize(colorMapTextureSize: Size): void
  • Gets or sets the Colormap texture size.

    remarks

    This defaults to [1024,1] and simply sets the resolution of color mapping. Leave default in normal operation

    Returns Size

  • Gets or sets the Colormap texture size.

    remarks

    This defaults to [1024,1] and simply sets the resolution of color mapping. Leave default in normal operation

    Parameters

    • colorMapTextureSize: Size

    Returns void

contourInterval

  • get contourInterval(): number
  • set contourInterval(contourInterval: number): void

contourOffset

  • get contourOffset(): number
  • set contourOffset(contourOffset: number): void

contourStroke

  • get contourStroke(): string
  • set contourStroke(contourStroke: string): void
  • Gets or sets the contour stroke as an HTML Color Code

    Returns string

  • Gets or sets the contour stroke as an HTML Color Code

    Parameters

    • contourStroke: string

    Returns void

contourStrokeThickness

  • get contourStrokeThickness(): number
  • set contourStrokeThickness(contourStrokeThickness: number): void
  • Gets or sets the stroke thickness of contour lines on the SurfaceMeshRenderableSeries3D

    Returns number

  • Gets or sets the stroke thickness of contour lines on the SurfaceMeshRenderableSeries3D

    Parameters

    • contourStrokeThickness: number

    Returns void

dataSeries

drawMeshAs

  • Gets or sets the EDrawMeshAs, whether the mesh is drawn as wireframe, solid, with or without contours etc...

    remarks

    Default value is SOLID_WIREFRAME. For contours, choose SOLID_WITH_CONTOURS

    Returns EDrawMeshAs

  • Gets or sets the EDrawMeshAs, whether the mesh is drawn as wireframe, solid, with or without contours etc...

    remarks

    Default value is SOLID_WIREFRAME. For contours, choose SOLID_WITH_CONTOURS

    Parameters

    Returns void

drawSkirt

  • get drawSkirt(): boolean
  • set drawSkirt(drawSkirt: boolean): void
  • When true, draws a skirt from the edge of the mesh to zero (solid walls on the left, right, top, bottom side)

    Returns boolean

  • When true, draws a skirt from the edge of the mesh to zero (solid walls on the left, right, top, bottom side)

    Parameters

    • drawSkirt: boolean

    Returns void

heightScaleFactor

  • get heightScaleFactor(): number
  • set heightScaleFactor(heightScaleFactor: number): void
  • Gets or sets the height scale factor for the SurfaceMeshRenderableSeries3D.

    remarks

    Default value is 1. A height scale factor of 0 makes the mesh flat, and 0.5 means all heights are multiplied by 0.5 etc...

    Returns number

  • Gets or sets the height scale factor for the SurfaceMeshRenderableSeries3D.

    remarks

    Default value is 1. A height scale factor of 0 makes the mesh flat, and 0.5 means all heights are multiplied by 0.5 etc...

    Parameters

    • heightScaleFactor: number

    Returns void

highlight

  • get highlight(): number
  • set highlight(highlight: number): void
  • Gets or sets the highlight factor, a number used to calculate lighting effects.

    remarks

    Defaults to 0.05

    Returns number

  • Gets or sets the highlight factor, a number used to calculate lighting effects.

    remarks

    Defaults to 0.05

    Parameters

    • highlight: number

    Returns void

isVisible

  • get isVisible(): boolean
  • set isVisible(isVisible: boolean): void

lightingFactor

  • get lightingFactor(): number
  • set lightingFactor(lightingFactor: number): void
  • Gets or sets the lighting factor, a number used to calculate lighting effects.

    remarks

    Defaults to 0.8

    Returns number

  • Gets or sets the lighting factor, a number used to calculate lighting effects.

    remarks

    Defaults to 0.8

    Parameters

    • lightingFactor: number

    Returns void

maximum

  • get maximum(): number
  • set maximum(maximum: number): void

meshColorPalette

meshPaletteMode

  • Gets or sets the EMeshPaletteMode, which defines how heightmaps are treated.

    remarks

    Defaults to HEIGHT_MAP_INTERPOLATED

    Returns EMeshPaletteMode

  • Gets or sets the EMeshPaletteMode, which defines how heightmaps are treated.

    remarks

    Defaults to HEIGHT_MAP_INTERPOLATED

    Parameters

    Returns void

meshResolution

  • Gets or sets the EMeshResolution, the amount of oversampling when creating a mesh.

    remarks

    Defaults to 1x.

    Returns EMeshResolution

  • Gets or sets the EMeshResolution, the amount of oversampling when creating a mesh.

    remarks

    Defaults to 1x.

    Parameters

    Returns void

minimum

  • get minimum(): number
  • set minimum(minimum: number): void

opacity

  • get opacity(): number
  • set opacity(opacity: number): void
  • Gets or sets an optional Opacity from 0.0 (fully transparent) - 1.0 (fully opaque)

    inheritdoc

    Returns number

  • Gets or sets an optional Opacity from 0.0 (fully transparent) - 1.0 (fully opaque)

    inheritdoc

    Parameters

    • opacity: number

    Returns void

paletteProvider

parentSurface

pointMarker

sceneEntity

shininess

  • get shininess(): number
  • set shininess(shininess: number): void
  • Gets or sets an optional Shininess factor, passed to 3D rendering shaders to make shiny objects

    inheritdoc

    Returns number

  • Gets or sets an optional Shininess factor, passed to 3D rendering shaders to make shiny objects

    inheritdoc

    Parameters

    • shininess: number

    Returns void

stroke

  • get stroke(): string
  • set stroke(stroke: string): void
  • Gets or sets the stroke color as an HTML Color code

    inheritdoc

    Returns string

  • Gets or sets the stroke color as an HTML Color code

    inheritdoc

    Parameters

    • stroke: string

    Returns void

strokeThickness

  • get strokeThickness(): number
  • set strokeThickness(strokeThickness: number): void
  • Gets or sets the stroke thickness of mesh wireframe lines on the SurfaceMeshRenderableSeries3D

    Returns number

  • Gets or sets the stroke thickness of mesh wireframe lines on the SurfaceMeshRenderableSeries3D

    Parameters

    • strokeThickness: number

    Returns void

type

yOffset

  • get yOffset(): number
  • set yOffset(yOffset: number): void
  • Gets or sets a Y-offset or height-offset in world coordinates.

    remarks

    Defaults to 0. When setting to a value such as 10, the entire SurfaceMeshRenderableSeries3D will be offset to height=10

    Returns number

  • Gets or sets a Y-offset or height-offset in world coordinates.

    remarks

    Defaults to 0. When setting to a value such as 10, the entire SurfaceMeshRenderableSeries3D will be offset to height=10

    Parameters

    • yOffset: number

    Returns void

Methods

applyTheme

Protected dataSeriesDataChanged

  • dataSeriesDataChanged(): void
  • Is being called when the data for the underlying DataSeries changes

    Returns void

delete

  • delete(): void
  • Deletes native (WebAssembly) memory used by this type, after which it cannot be used.

    remarks

    Call .delete() before finishing with the object to ensure that WebAssmembly memory leaks do not occur.

    All elements within SciChart's High Performance Realtime JavaScript Charts which implement IDeletable must be deleted manually to free native (WebAssembly) memory

    Returns void

Protected enrichHitTest

hitTest

  • Performs a HitTest operation on the series, returning the SeriesInfo3D containing the enriched Hit-Test result. This contains information about the hit-test operation such as the values of the data under the mouse and location of the data under the mouse in 3D world coordinates. This may be used for tooltips, selection or inspection of the 3d scene through mouse-clicks

    Parameters

    • screenPoint: Point

      The screen point (X,Y pixel coordinate in 2D space)

    Returns SeriesInfo3D

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void

onAttach

onDetach

  • onDetach(): void

onDpiChanged

Protected setSceneEntity

Generated using TypeDoc