Create Visual Components

These operations instantiate new visual elements.


msc.layout(type, params)

Creates a layout.


msc.linearGradient(params)

Creates a linear gradient.

  • params (Object): contains x1, y1, x2, and y2 properties
  • Return type: LinearGradient

scene.mark(type, params)

Creates a mark in a scene.

  • type: mark type
  • params (Object): contains mark properties
  • Return type: Mark

msc.renderer(type, domId)

Creates a renderer.

  • type (String): type of renderer; possible values are "svg" and "webgl"
  • domId (String): ID of the SVG or Canvas element
  • Return type: Renderer

msc.scene(params)

Creates a scene.

  • params (Object, optional):
    • fillColor: background color of the scene
  • Return type: Scene