Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PublicEngine

Interface for public parts of engine.

Index

Properties

container

container : HTMLDivElement

HTML Div element that contains the rendering Engine.

restoreMouseStyle

restoreMouseStyle : function

Restore Mouse style.

param

Key generated using 'setMouseStyle'

    • Parameters

      • key: undefined | number

      Returns void

scale

scale : LinearScaleXY

Scale of Engine. (Screen)

setMouseStyle

setMouseStyle : function

Set Mouse style.

param

Name of a Mouse preset in js.

param

Key for existing request to refresh

returns

Key that can be used to restore Mouse style

    • Parameters

      • presetName: string
      • existingKey: undefined | number

      Returns number

Methods

captureFrame

  • captureFrame(type?: undefined | string, encoderOptions?: undefined | number): Blob
  • Capture state of rendering Engines canvas. Returns the captured image as a Blob-object.

    Has two optional parameters which directly reference JavaScript API HTMLCanvasElement.toDataURL:

    https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL

    Parameters

    • type: undefined | string

      A DOMString indicating the image format. The default format type is image/png.

    • encoderOptions: undefined | number

      A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored.

    Returns Blob

    JavaScript Blob whose 'type' depends on what was passed to 'type' parameter of this method. Defaults to image/png

clientLocation2Engine

  • clientLocation2Engine(x: number, y: number): Point
  • Translates client location (that originates at top-left of browser) to engines space (originated at engine canvas' bottom-left)

    Parameters

    • x: number

      Location of X in browser

    • y: number

      Location of Y in browser

    Returns Point

engineLocation2Client

  • engineLocation2Client(x: number, y: number): Point
  • Translates engine location (originated at engine canvas' bottom-left) to client space (that originates at top-left of browser).

    Parameters

    • x: number

      Location of X in engine

    • y: number

      Location of Y in engine

    Returns Point

layout

  • layout(): void
  • Calculate the layout again. This should be called when the container of chart is resized.

    Returns void

renderFrame

  • renderFrame(width: number, height: number, noFlip?: undefined | false | true): Uint8Array
  • Render a frame of specific size to a ArrayBuffer.

    Mainly for Node JS usage. In browser the chart itself will not be resized correctly.

    Parameters

    • width: number

      Horizontal resolution

    • height: number

      Vertical resolution

    • noFlip: undefined | false | true

      Leave the image upside down

    Returns Uint8Array