import { EventHandler } from "../../Core/EventHandler"; import { MouseManager } from "../../Core/Mouse/MouseManager"; import { ObservableArray } from "../../Core/ObservableArray"; import { VisibilityObserver } from "../../Core/ObserveVisibility"; import { PropertyChangedEventArgs } from "../../Core/PropertyChangedEventArgs"; import type { Rect } from "../../Core/Rect"; import type { Thickness } from "../../Core/Thickness"; import type { TActualRenderer } from "./GpuCompletionProbe"; import { ESurfaceType } from "../../types/SurfaceType"; import type { EThemeProviderType } from "../../types/ThemeProviderType"; import type { TSciChart } from "../../types/TSciChart"; import type { TSciChart3D } from "../../types/TSciChart3D"; import type { TSciChartSurfaceCanvases } from "../../types/TSciChartSurfaceCanvases"; import type { IChartModifierBase } from "../ChartModifiers/ChartModifierBase"; import type { IThemePartial, IThemeProvider } from "../Themes/IThemeProvider"; import type { AdornerLayer } from "./Annotations/AdornerLayer"; import type { IAnnotation } from "./Annotations/IAnnotation"; import type { AxisCore } from "./Axis/AxisCore"; import type { ISciChartLoader } from "./loader"; import type { TDpiChangedEventArgs } from "./TextureManager/DpiHelper"; import { UpdateSuspender } from "./UpdateSuspender"; import type { TLicenseContext } from "../../types/LicenseContext"; import { SciChartSurfaceCore } from "./SciChartSurfaceCore"; import type { ISciChartSurfaceNative } from "./ISciChartSurfaceNative"; import type { TSciChartModuleName } from "./moduleLoader"; export type TSciChartConfig = { /** * The url where the wasm file is located * * As of v4.0 the .data file is embedded in the wasm file. You may need to remove config in your build process that tries to copy the .data file */ wasmUrl?: string; /** * The url where the no-simd fallback for wasm is located * * This needs to be served when {@link SciChartDefaults.useWasmSimd} is any option other than "Always" and will be loaded as a fallback * for browsers that do not support wasm Simd (Chrome v90 or below - 2021, Safari v16.3 or below - 2023, Firefox v88 or below - 2021). * * if wasmNoSimdUrl is not provided, we will try to calculate it from the provided wasmUrl or other defaults. */ wasmNoSimdUrl?: string; /** * The url where the wasm64 (Memory64) variant of the wasm file is located. * * This needs to be served when {@link SciChartDefaults.useWasm64} is any option other than "Never" and is only * used on browsers that support both Memory64 and SIMD. If not provided, it is derived from {@link wasmUrl} * (or the default) by inserting `-64` before the `.wasm` extension, e.g. scichart.wasm -> scichart-64.wasm. * That derivation is generic, so the union (one-wasm) build needs no special casing here. */ wasm64Url?: string; /** * Base URL for the optional native wasm modules (`scichart-data.wasm` and friends) in the * modular build shape. Defaults to the directory `wasmUrl` points at, or the page root. * Has no effect on the static build, which contains every module already. */ modulesUrl?: string; /** Internal testing use only */ testWasm?: TSciChart | TSciChart3D; }; export interface ISurfaceOptionsBase { /** * Optional - extra native wasm modules to load before this surface is constructed. * * Chart creation loads only what the chart itself needs, so a feature living in a separate * module has to be asked for. Name it here and it is loaded and ready by the time `create()` * resolves: * * ```ts * const { sciChartSurface, wasmContext } = await SciChartSurface.create(div, { modules: ["data"] }); * ``` * * Equivalent to awaiting {@link ensureModule} yourself, or to the `init*` helper an extension * package exports (`initSciChartData` in `scichart-data`, which additionally narrows * `wasmContext` to a type from which the module's own members are reachable - this option * cannot do that, because it does not know at compile time which modules you named). * * Applied per surface, not per page: the shared master wasm context is created once, so a page * whose first chart asks for nothing and whose second asks for `"data"` still gets it. * Idempotent and race-safe - naming an already-loaded module costs nothing, and in the static * (monolithic) build there is nothing to load. */ modules?: TSciChartModuleName[]; /** * Allows you to set custom Id for the surface; * @remarks If skipped the Id will be auto-generated */ id?: string; /** * Optional - The theme applied to the {@link SciChartSurfaceBase} on startup * @remarks see {@link IThemeProvider} for properties which can affect SciChart theme. Two default * themes are included out of the box {@link SciChartJSLightTheme} and {@link SciChartJSDarkTheme}. * Custom themes may be created by implementing {@link IThemeProvider} */ theme?: IThemeProvider | ({ type: string | EThemeProviderType; } & IThemePartial); /** * Allows you to customize the loading elements or animation as part of the HTML page / DOM when a {@link SciChartSurface} * or {@link SciChart3DSurface} is loading WebAssembly. * * Set to false for disabling. */ loader?: false | ISciChartLoader | { type: string; options?: any; }; /** * Sets a `touch-action` property to the canvas style. * Useful if touch interactions in browser should be configured. * https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action * * @remarks By default a chart will use `touch-action: none` to prevent the default browser behavior. */ touchAction?: string; /** * Optional - the width aspect ratio of the {@link SciChartSurfaceBase}. By default SciChart will scale to fit the parent Div. * However if height of the div is not provided it will use width/height aspect ratio to calculate the height. The default ratio is 3/2. */ widthAspect?: number; /** * Optional - the height aspect ratio of the {@link SciChartSurfaceBase}. By default SciChart will scale to fit the parent Div. * However if height of the div is not provided it will use width/height aspect ratio to calculate the height. The default ratio is 3/2. */ heightAspect?: number; /** * Optional - the option of disabling / enabling scaling of the {@link SciChartSurfaceBase}. * If false - the {@link SciChartSurfaceBase} will take the height and width of parent div without scaling. */ disableAspect?: boolean; /** * Optional - when true, charts that are out of the viewport will be frozen (pausing rendering). Data updates can resume * Once the chart is in view again, rendering will resume. This can be useful for performance optimization. */ freezeWhenOutOfView?: boolean; /** * The engine has an internal loop based on requestAnimationFrame which triggers a chart draw on any surfaces that have been invalidated. * If you have your own requestAnimationFrame based drawing you wish to synchronise with, you can disable the engine loop by setting this to true. * If you do this you are then responsible for calling webassemblyContext.TSRRequestDraw() which will immediately draw all surfaces belonging to the webassemblyContext that have been invalidated. * Note that 2D and 3D charts, and all charts created using createSingle have separate webassemblyContexts so you must call TSRRequestDraw() on each one. * This setting is applied to the webassembly context when a chart is created, so for SciChartSurface.create this will change the behaviour of all existing charts created using SciChartSurface.create. */ disableEngineLoop?: boolean; } /** * @summary The base class for 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 declare abstract class SciChartSurfaceBase extends SciChartSurfaceCore implements ISciChartSurfaceNative { /** * Gets or sets the application-wide default theme. See {@link IThemeProvider} for details */ static DEFAULT_THEME: IThemeProvider; /** * The master WebGL canvas * @remarks WARNING: Do not set this property, this is set internally by SciChart when initializing mutliple charts */ static domMasterCanvas: HTMLCanvasElement; /** * Global property defining whether the WebGL render target is anti-aliased or not. This will affect all SciChartSurfaces (2D & 3D) * in the application. * @remarks Defaults to FALSE for crisp gridlines and lines. Individual line series and text labels are * chart parts are automatically anti-aliased */ static AntiAliasWebGlBackbuffer: boolean; /** * One slot behind both statics. A plain static field would be *shadowed* by a subclass * assignment (`SciChart3DSurface.autoDisposeWasmContext = true` creates an own-property that * code reading `SciChartSurface.autoDisposeWasmContext` never sees). One wasm module now * serves both 2D and 3D, so the two spellings must agree or auto-dispose is half-wired. * A setter inherited from this class is invoked by subclass assignment, so it cannot be * shadowed. */ private static wasmContextDisposeTimeoutValue; /** @ignore */ private static autoDisposeWasmContextValue; /** @ignore */ private static autoDeleteSurfaceOnSameRootValue; /** * Defines a delay of the shared wasmContext auto-dispose if {@link autoDisposeWasmContext} is enabled. */ static get wasmContextDisposeTimeout(): number; static set wasmContextDisposeTimeout(value: number); /** * Defines if the shared wasmContext ({@link TSciChart | WebAssembly Context}) should be deleted after all of the surfaces that use it are deleted. * @remarks Since v6 one wasm module serves both 2D and 3D charts, so this setting is shared: * setting it via `SciChartSurface` or `SciChart3DSurface` affects both families. */ static get autoDisposeWasmContext(): boolean; static set autoDisposeWasmContext(value: boolean); /** * Defines what happens when a shared-context surface ({@link SciChartSurface.create} / {@link SciChart3DSurface.create}) * is created on a root element another live surface still uses. When true (default) the previous surface is deleted * automatically; when false the creation throws. Surfaces with {@link isLifecycleManagedExternally} are never * auto-deleted - creating on their root always throws. * @remarks Shared by 2D and 3D, like {@link autoDisposeWasmContext}. */ static get autoDeleteSurfaceOnSameRoot(): boolean; static set autoDeleteSurfaceOnSameRoot(value: boolean); /** * Defines if charts should rerender when the tab becomes active. * @remarks * Enabled by default. Purpose of this behavior is to deal with the issue of canvas data being cleared on an inactive tab . */ static invalidateOnTabVisible: boolean; /** * @internal * Resets {@link domMasterCanvas} to a minimal size once no destinations remain, so the * leftover dimensions from a previous chart don't bleed into the next chart's main-window * size — SCJS-1321 reads this value when initializing a new (2D or 3D) WASM context, and * {@link changeMasterCanvasViewportSize} only ever grows the master canvas, never shrinks it. * * Only safe when both destination lists are empty: a still-active WASM context has its * SCRTSetMainWindowSize set to the current (possibly larger) master extents, and shrinking * under it would cause render misalignment until that chart's next resize. */ static shrinkMasterCanvasToFitDestinations(): void; /** * Logs (and returns) the SciChart.js engine configuration: the WASM pointer model * (wasm64 / wasm32), whether SIMD is used, and the renderer (WebGPU / WebGL) — together with * the {@link SciChartDefaults} settings and browser feature-detection that produced each choice. * * The values come from the same resolution functions the loader uses to pick the binary * (`shouldUseWasm64()` / `shouldUseSimd()`), so they reflect what is actually loaded for the * current `SciChartDefaults`. Call it after configuring `SciChartDefaults`. * * @example * SciChartDefaults.useWasm64 = EUseWasm64.Auto; * SciChartSurfaceBase.debugWasmWebGPU(); * * @returns `{ wasm64, simd, webGpu, details }` describing the active engine. */ static debugWasmWebGPU(): { wasm64: boolean; simd: boolean; webGpu: boolean; details: Record; }; /** * Deletes the shared wasmContext ({@link TSciChart | WebAssembly Context}) used by the charts instantiated with {@link SciChartSurface.create} or {@link SciChart3DSurface.create}. */ static disposeSharedWasmContext(): void; /** * Sets the runtime license key. Use for full licenses or trials only, not developer licenses. * @param keyCode */ static setRuntimeLicenseKey(keyCode: string): void; /** * Causes SciChart to always use its built in community non-commercial license. This stops it attempting to look for the license wizard * Usage of the community license constitutes acceptance of the terms at https://www.scichart.com/community-licensing/ */ static UseCommunityLicense(): void; /** * Sets the endpoint for validating a runtime license key with the server. Must be a relative path. * @default api/license * @param endpoint */ static setServerLicenseEndpoint(endpoint: string): void; /** * Sets function that will be called by the framework to validate a runtime license from the server, * if you need to add additional handling, such as custom authentication. * The request sent to the server must include the queryString section passed in, which does not come with a leading ? * @param callback */ static setLicenseCallback(callback: (queryString: string) => Promise): void; static resolveOptions(options: ISurfaceOptionsBase): ISurfaceOptionsBase; /** * A propertyChanged EventHandler. See {@link EventHandler} for how to subscribe to and be * notified when a property changes on the {@link SciChartSurfaceBase} */ readonly propertyChanged: EventHandler; /** * An {@link ObservableArray} of {@link IChartModifierBase} derived types. Chart Modifiers provide behavior such as zooming, panning, * tooltips, legends and more in SciChart's High Performance Realtime * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}. * You can use our built in modifiers (see derived types of {@link ChartModifierBase}, or create your own for custom interaction behavior. */ readonly chartModifiers: ObservableArray; /** * The {@link HTMLCanvasElement} which is the WebGL canvas that SciChart draws to */ domCanvasWebGL: HTMLCanvasElement; /** * The {@link MouseManager} subscribes to mouse events on the {@link domChartRoot} and routes them to components within SciChart */ mouseManager: MouseManager; /** * The {@link IThemeProvider} provides colors, brushes and theme information for the current {@link SciChartSurfaceBase} */ /** For serialization Only. The name of the onCreated function applied by the builder api */ onCreatedName: string; /** * @summary Gets the collection of {@link IAnnotation} - annotations, markers or shapes drawn over the top of a {@link SciChartSurface} * @description A {@link SciChartSurface} can have zero to many {@link IAnnotation | Annotations}. * * The Annotations are drawn using our WebGL / WebAssembly rendering engine, but some use SVG for maximum configurability. * See derived types of {@link IAnnotation} such as {@link BoxAnnotation}, {@link LineAnnotation} etc... * * Use this collection to add and remove Annotations to the chart. * @remarks * Adding an Annotation to the chart causes it to automatically redraw. Note that annotations do not pariticpate in autoranging, * meaning a chart will zoom to fit data and chart series but not annotations */ readonly annotations: ObservableArray; /** * @summary Gets the collection of {@link IAnnotation} - modifier annotations, markers or shapes drawn over the top of a {@link SciChartSurface} * @description A {@link SciChartSurface} can have zero to many {@link IAnnotation | Annotations}. * * The Annotations are drawn using our WebGL / WebAssembly rendering engine, but some use SVG for maximum configurability. * See derived types of {@link IAnnotation} such as {@link BoxAnnotation}, {@link LineAnnotation} etc... * * Use this collection to add and remove Modifier Annotations to the chart. * @remarks * Adding an Modifier Annotation to the chart causes it to automatically redraw. Note that annotations do not pariticpate in autoranging, * meaning a chart will zoom to fit data and chart series but not annotations */ readonly modifierAnnotations: ObservableArray; adornerLayer: AdornerLayer; abstract isInvalidated: boolean; readonly suspender: UpdateSuspender; /** * An event handler which notifies its subscribers when a chart was requested to redraw initially. */ redrawRequested: EventHandler; /** * An event handler which notifies its subscribers when a layout stage in render process has finished. */ layoutMeasured: EventHandler; /** * An event handler which notifies its subscribers when animations stage in render process has finished. */ genericAnimationsRun: EventHandler; /** * An event handler which notifies its subscribers when the CPU has finished issuing this * frame's render instructions and handed them to the GPU. * @remarks Not applicable to sub-charts. * * Fires on both backends at the same point in the frame: after every draw call has been * issued (WebGL) or the command buffer has been submitted (WebGPU). Nothing has been drawn * when this fires. Pair it with {@link renderInstructionsCompleted} to bracket the GPU: the span between * them is queue wait plus execution. Replaces {@link renderedToWebGl}. */ readonly renderInstructionsSubmitted: EventHandler; /** * An event handler which notifies its subscribers when the GPU has finished drawing a frame, so * the frame's pixels exist in the canvas. * @remarks Not applicable to sub-charts. * * This is the only render event that waits for the GPU. It is raised asynchronously, some time * after {@link renderInstructionsSubmitted}: * * - **WebGL**: a fence (`gl.fenceSync`) is placed behind the frame's draw commands and polled * without blocking; the event fires once the GPU has passed it. * - **WebGPU**: from `GPUQueue.onSubmittedWorkDone()`. * * It can land AFTER {@link SciChartSurfaceCore.frameCommitted}: that event only means the main * thread handed the frame to the compositor. The pixels reach the screen at the next display * refresh after this event. The GPU work is shared (one WebGL context or one GPUDevice serves every surface), so * with several surfaces this reflects all of their submitted work, not just this surface's. * * Nothing is measured unless something is subscribed, so leaving this alone costs nothing. */ readonly renderInstructionsCompleted: EventHandler; /** * An event handler which notifies its subscribers when the draw calls of a frame have been * issued. Fires at the same moment as {@link renderInstructionsSubmitted}, on both backends. * @remarks Not applicable to sub-charts. * * @deprecated Use {@link renderInstructionsSubmitted}, which marks the same moment under a name * that says what happens: nothing has been rendered when this fires, on either backend. Kept * firing unchanged for compatibility. */ renderedToWebGl: EventHandler; /** * An event handler which notifies its subscribers immediately before the frame is copied from * the shared master canvas into this surface's own canvas. * @remarks Not applicable to sub-charts. * * **Only copy-canvas surfaces raise this**, so it never fires under WebGPU, nor on a surface * built with `createSingle`: those render straight into their own canvas and have no copy step * at all. Its presence is therefore how you tell the two shapes apart at run time. * * Pairs with {@link renderedToDestination}, which fires on the other side of the copy. Neither * waits for the GPU: the copy is a `drawImage` into an accelerated 2D canvas, which Skia's GPU * backend RECORDS rather than executes - the work needs a flush and a submit afterwards. So * this event means "the copy is about to be issued", and its partner means "issued", not * "done". For "the pixels exist" use {@link renderInstructionsCompleted}, which is the only * render event that waits for the GPU. */ readonly copyToDestinationStarted: EventHandler; /** * An event handler which notifies its subscribers when the frame's copy or submit has been * issued by the CPU. A CPU-side marker, despite the name. * @remarks Not applicable to sub-charts. * * @deprecated Use {@link renderInstructionsCompleted} for "the pixels exist", which waits for the GPU on * both backends. This event fires from the copy-to-canvas step (WebGL copy-canvas surfaces) or * right after submit (everything else) and does NOT wait for the GPU: on a GPU-heavy scene it * fires over 100 ms before the frame is drawn. Kept firing unchanged for compatibility. */ renderedToDestination: EventHandler; hasInvalidState: boolean; isWebGLContextActive: boolean; protected themeProviderProperty: IThemeProvider; protected previousThemeProviderProperty: IThemeProvider; protected isInitializedProperty: boolean; protected backgroundProperty: string; protected touchActionProperty: string; protected widthAspect: number; protected heightAspect: number; protected disableAspect: boolean; protected loaderJson: any; protected createSuspended: boolean; protected visibilityObserver: VisibilityObserver; protected cleanupLockToken: () => boolean; private sharedWasmContext; private seriesViewRectProperty; private freezeWhenOutOfViewProperty; /** * Creates an instance of a SciChartSurfaceBase * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} or {@link TSciChart | SciChart 3D WebAssembly Context} * containing native methods and access to our WebGL2 WebAssembly Rendering Engine * @param canvases A list of {@link TSciChartSurfaceCanvases} to draw to */ protected constructor(webAssemblyContext: TSciChart | TSciChart3D, canvases?: TSciChartSurfaceCanvases); /** * Gets or sets the SciChartSurface Background as an HTML color code */ get background(): string; /** * Gets or sets the SciChartSurface Background as an HTML color code * @remarks Allowable values are colors e.g. 'Red', '#FF00FF', 'rgba(255,0,0,1)'. * Also, main surface background supports gradients 'linear-gradient(45deg, rgb(255,0,0,1), rgb(0,0,255,1))', * or background images e.g. 'url('https://somewebsite.com/someimage.png')'. * Sub-charts, however, support only basic formats. * @param background The HTML color code */ set background(background: string); /** * Gets the Surface Type. See {@link ESurfaceType} for list of values */ abstract get surfaceType(): ESurfaceType; get isCopyCanvasSurface(): HTMLCanvasElement; /** * The renderer this surface has actually drawn with, or undefined before its first frame. * * @remarks * Decided by the context the surface canvas holds, not by what was requested. The requested * renderer (localStorage `IS_WEB_GPU`, reported by `WebGpuHelper.getWebGpuSupported()`) is a * setting, and the library falls back to WebGL silently when WebGPU cannot come up. A page-wide * `GPUDevice` proves only that WebGPU came up somewhere on the page, not that this surface used it. * * The engine creates the WebGPU context on the surface's own canvas. Under WebGL that canvas is * either a 2d copy target (shared master context) or the surface's own webgl2 canvas, and asking * it for a "webgpu" context returns null without creating anything. Before the first frame the * canvas may hold no context at all, and getContext would CREATE one, so this stays undefined * until the surface has rendered. */ get actualRenderer(): TActualRenderer | undefined; /** * Arms the GPU-completion probe for the frame that was just handed to the GPU and raises * {@link renderInstructionsCompleted} when it resolves. Called by the draw loops right after * {@link renderInstructionsSubmitted}. Returns immediately when nothing is subscribed. */ protected raiseRenderInstructionsCompletedWhenDone(isInvalidated: boolean): void; /** * Waits for the GPU behind {@link raiseRenderInstructionsCompletedWhenDone}: WebGL2 fence queue * and poll loop, or WebGPU onSubmittedWorkDone. Registered with `addDeletable` in the * constructor so pending fences are released with the surface. */ private readonly gpuCompletionProbe; /** * Set by the drawing loop once the first frame has been drawn; gates {@link actualRenderer}. */ protected hasRenderedFrame: boolean; /** * First definite answer of {@link actualRenderer}; undefined until the probe could run. */ private cachedActualRenderer; /** * Set by the copy-to-canvas step once the destination canvas holds its 2d context; gates * {@link actualRenderer} for copy-canvas surfaces under WebGL. * @ignore */ destinationCanvasHasContext: boolean; /** * True when this surface draws into the shared {@link SciChartSurfaceBase.domMasterCanvas}, so screen-space brush textures must be * sized relative to it. False under WebGPU: there each surface renders straight into its own canvas swapchain. */ get isMasterCanvasRenderTarget(): boolean; /** * Gets the Series View {@link Rect}, a rectangle relative to the entire size of the {@link SciChartSurfaceBase} */ get seriesViewRect(): Rect; get viewRect(): Rect; /** Gets the viewRect of the entire chart, e.g. parent surface of a sub-chart */ abstract get chartViewRect(): Rect; get clipRect(): Rect; get otherSurfaces(): SciChartSurfaceBase[]; /** * Used internally - gets isInitialized flag */ get isInitialized(): boolean; /** * @inheritDoc */ get isSuspended(): boolean; /** * @inheritDoc */ resumeUpdates(options?: { force?: boolean; invalidateOnResume?: boolean; }): void; /** * @inheritDoc */ suspendUpdates(): void; /** * @inheritDoc */ applyTheme(themeProvider: IThemeProvider): void; /** * Used internally - gets the previous {@link IThemeProvider} */ get themeProvider(): IThemeProvider; /** * Used internally - gets the previous {@link IThemeProvider} */ get previousThemeProvider(): IThemeProvider; get isPolar(): boolean; /** * When true, charts that are out of the viewport will be frozen (pausing rendering). Data updates can resume * Once the chart is in view again, rendering will resume. This can be useful for performance optimization. */ set freezeWhenOutOfView(freezeWhenOutOfView: boolean); /** * When true, charts that are out of the viewport will be frozen (pausing rendering). Data updates can resume * Once the chart is in view again, rendering will resume. This can be useful for performance optimization. */ get freezeWhenOutOfView(): boolean; /** * Silences the memory-debug warning that the chart root element was detached from the DOM before this * surface was deleted. For wrappers (e.g. scichart-react) that remove the root first and delete the surface later. * Defaults to {@link SciChartDefaults.suppressDetachedRootWarning}. */ suppressDetachedRootWarning: boolean; /** * Silences the development warnings about deleting this surface more than once. For wrappers whose cleanup * may delete a surface that was already deleted. Defaults to {@link SciChartDefaults.suppressRepeatedDeleteWarning}. */ suppressRepeatedDeleteWarning: boolean; /** * Marks a surface whose lifecycle is owned by a wrapper (e.g. scichart-react). Silences the same warnings as * {@link suppressDetachedRootWarning} and {@link suppressRepeatedDeleteWarning}, and the surface is never * auto-deleted by {@link autoDeleteSurfaceOnSameRoot} - creating another surface on its root throws instead. */ isLifecycleManagedExternally: boolean; /** * @inheritDoc */ delete(clearHtml?: boolean): 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. */ abstract invalidateElement(options?: { force?: boolean; svgOnly?: boolean; }): void; abstract getSeriesViewRectPadding(scaled: boolean): Thickness; /** * Gets the main WebGL or 2D canvas */ getMainCanvas(): HTMLCanvasElement; /** * Sets the Series View {@link Rect}, a rectangle relative to the entire size of the {@link SciChartSurfaceBase} * @param seriesViewRect a {@link Rect} which defines the portion of the view for drawing series */ setSeriesViewRect(seriesViewRect: Rect): void; /** * Gets the {@link AxisCore | XAxis} which matches the axisId. Returns undefined if not axis found * @param axisId The AxisId to search for */ abstract getXAxisById(axisId: string): AxisCore | undefined; /** * Gets the default {@link AxisCore | XAxis}, which is the first X axis attached to the surface. */ abstract getDefaultXAxis(): AxisCore | undefined; /** * Gets the {@link AxisCore | YAxis} which matches the axisId. Returns undefined if not axis found * @param axisId The AxisId to search for */ abstract getYAxisById(axisId: string): AxisCore | undefined; /** * Gets the default {@link AxisCore | YAxis}, which is the first Y axis attached to the surface. */ abstract getDefaultYAxis(): AxisCore | undefined; /** * Used internally, the flag is set after {@link SciChartSurfaceBase} is initialized */ setIsInitialized(): void; getLicenseContext(): TLicenseContext; /** * Used internally - updates watermark */ abstract updateWatermark(left: number, bottom: number): void; /** * @inheritDoc */ onDpiChanged(args: TDpiChangedEventArgs): void; /** * Creates a promise which resolves when the chart is updated to the next fully rendered state * * @remarks * If the surface is initialized with `createSingle` the promise resolves after the main `render` function is executed. * Otherwise, if it is initialized with `create` - the promise resolves after image data is copied to the 2D canvas. */ nextStateRender(options?: { resumeBefore?: boolean; suspendAfter?: boolean; invalidateOnResume?: boolean; }): Promise; /** * Gets Chart Modifier Groups, is used for sharing events between chart modifiers */ get chartModifierGroups(): string[]; protected clearRootElement(clearHtml: boolean): void; protected applyOptions(options: ISurfaceOptionsBase): void; /** * Detaches a {@link ChartModifierBase2D} from the {@link SciChartSurfaceBase} * @param chartModifier */ protected detachChartModifier(chartModifier: IChartModifierBase): void; /** * Attaches a {@link ChartModifierBase2D} to the {@link SciChartSurfaceBase} * @param chartModifier */ protected attachChartModifier(chartModifier: IChartModifierBase): void; /** * @summary Notifies subscribers of {@link SciChartSurfaceBase.propertyChanged} that a property has changed and the chart requires redrawing * @description SciChart provides fully reactive components, changing any property or changing data will cause the {@link SciChartSurfaceBase} to * redraw where necessary. This method notifies subscribers of the {@link SciChartSurfaceBase.propertyChanged} {@link EventHandler} * that a property has changed. * @param propertyName The name of the property which has changed */ protected notifyPropertyChanged(propertyName: string): void; protected changeMasterCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void; protected changeWebGLCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void; /** * Adds or updates clipPath definitions on an SVG canvas * @param svgElement * @param seriesViewRect * @param surfaceViewRect */ setSvgClipPathDefinitions(svgElement: SVGSVGElement, seriesViewRect: Rect, surfaceViewRect: Rect): void; private detachAnnotation; private attachAnnotation; } export declare const createChartDestination: (canvas: HTMLCanvasElement) => { canvas: HTMLCanvasElement; GetHeight(): any; GetWidth(): any; GetID(): any; }; /** @ignore */ export declare const getMasterCanvas: () => HTMLCanvasElement; export { shouldUseSimd, shouldUseWasm64, getWasmLoadErrorMessage } from "./wasmModuleSelection"; /** @ignore */ export declare const getLocateFile: (sciChartConfig: TSciChartConfig, useWasm64?: boolean) => (path: string, prefix: string) => string;