scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
112 lines (111 loc) • 4.52 kB
TypeScript
import { EventHandler } from "../../Core/EventHandler";
import { IDeletable } from "../../Core/IDeletable";
import { Rect } from "../../Core/Rect";
import { Size } from "../../types/Size";
import { ESurfaceType } from "../../types/SurfaceType";
import { IThemeable } from "../Themes/IThemeable";
import { IThemeProvider } from "../Themes/IThemeProvider";
/**
* @summary Defines the interface to a 2D Cartesian {@link SciChartSurface} or 3D Cartesian {@link SciChart3DSurface} within SciChart -
* High Performance Realtime {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
* @remarks
* See derived types {@link SciChartSurface} (2D Charts) and {@link SciChart3DSurface} (3D Charts) for more specific instructions on how
* to use the SciChartSurface and create a 2D or 3D {@link https://www.scichart.com/javascript-chart-features | JavaScript Chart}
*/
export interface ISciChartSurfaceBase extends IDeletable, IThemeable {
/**
* Gets the ISciChartSurfaceBase Id
*/
readonly id: string;
/**
* The {@link HTMLDivElement} which is the dom chart root
*/
readonly domChartRoot: HTMLDivElement;
/**
* The inner {@link HTMLDivElement} div element
*/
readonly domDivContainer: HTMLDivElement;
/**
* The inner {@link HTMLDivElement} div element placed on the background
*/
readonly domSeriesBackground: HTMLDivElement;
/**
* The {@link HTMLCanvasElement} which is the HTML5 canvas which SciChart draws overlays (cursors, tooltips) to
*/
readonly domCanvas2D: HTMLCanvasElement;
/**
* Used internally - gets the previous {@link IThemeProvider}
*/
readonly themeProvider: IThemeProvider;
/**
* Used internally - gets isDeleted flag
*/
readonly isDeleted: boolean;
/**
* Used internally - gets other SciChartSurfaces
*/
readonly otherSurfaces: ISciChartSurfaceBase[];
readonly viewRect: Rect;
/**
* An event handler which notifies its subscribers when a render operation has finished. Use this
* to time render performance, or to update elements of the chart or your UI on redraw.
*/
rendered: EventHandler<boolean>;
/**
* An event handler which notifies its subscribers when a render operation starts. Use this
* to update elements of the chart for the current render. Any updates made here will not trigger a subsequent render.
*/
preRender: EventHandler<any>;
/**
* An event handler which notifies its subscribers when a chart root element was resized.
*/
resized: EventHandler<Size>;
/**
* The {@link SVGSVGElement} which is the SVG canvas which SciChart adds elements (tooltips, annotations) to
*/
domSvgContainer: SVGSVGElement;
/**
* The {@link SVGSVGElement} which is the SVG adorner layer canvas, is used for annotation adorners
*/
domSvgAdornerLayer: SVGSVGElement;
/**
* The {@link SVGSVGElement} placed on the background and could be used instead of {@link domSvgContainer}
*/
domBackgroundSvgContainer: SVGSVGElement;
/**
* Changes the Viewport Size of the {@link SciChartSurfaceBase}
* @param width
* @param height
*/
changeViewportSize(width: number, height: number): void;
/**
* Changes the Viewport Size of the {@link SciChartSurfaceBase}
* @param width
* @param height
*/
onResize(width: number, height: number): void;
/**
* Add an IDeleteable object to the surface which will have its delete method called when the surface is deleted
*/
addDeletable(deletable: IDeletable): void;
/**
* Call invalidateElement() to trigger a redraw of the {@link SciChartSurfaceBase}. SciChart's WebGL WebAssembly rendering
* engine will schedule a redraw a the next time the renderer is free.
*/
invalidateElement(options?: {
force?: boolean;
}): void;
/**
* Deletes native (WebAssembly) memory used by this type, after which it cannot be used.
*/
delete(clearHtml?: boolean): void;
/**
* Applies a theme (defined by IThemeProvider) to the current element
* @param themeProvider The theme data to apply
*/
applyTheme(themeProvider: IThemeProvider): void;
/**
* Gets the Surface Type. See {@link ESurfaceType} for list of values
*/
surfaceType: ESurfaceType;
}