scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
159 lines (158 loc) • 9.36 kB
TypeScript
import { ICentralAxesLayoutManagerOptions } from "../Charting/LayoutManager/CentralAxesLayoutManager";
import { ILayoutManagerOptions } from "../Charting/LayoutManager/LayoutManager";
import { I2DSubSurfaceOptions, I2DSurfaceOptions } from "../Charting/Visuals/I2DSurfaceOptions";
import { IPieSurfaceOptions } from "../Charting/Visuals/SciChartPieSurface/IPieSurfaceOptions";
import { IPieSegmentOptions } from "../Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment";
import { SciChartPieSurface } from "../Charting/Visuals/SciChartPieSurface/SciChartPieSurface";
import { SciChartSurface, TWebAssemblyChart } from "../Charting/Visuals/SciChartSurface";
import { ELayoutManagerType } from "../types/LayoutManagerType";
import { TSciChart } from "../types/TSciChart";
import { TAnnotationDefinition } from "./buildAnnotations";
import { TAxis3DDefinition, TAxisDefinition } from "./buildAxis";
import { TSharedDataDefinition } from "./buildDataSeries";
import { TModifier3DDefinition, TModifierDefinition } from "./buildModifiers";
import { TSeriesDefinition, TSeriesDefinition3D } from "./buildSeries";
import { SciChartPolarSurface } from "../Charting/Visuals/SciChartPolarSurface";
import { SciChart3DSurface, TWebAssemblyChart3D } from "../Charting3D/Visuals/SciChart3DSurface";
import { I3DSurfaceOptions } from "../Charting3D/I3DSurfaceOptions";
import { TSciChart3D } from "../types/TSciChart3D";
import { ISciChartSubSurface } from "../Charting/Visuals/ISciChartSubSurface";
/**
* A definition that can be used to build a 2D Chart using {@link chartBuilder.buildChart}
*/
export interface ISciChart2DDefinition {
/** Optional {@link I2DSurfaceOptions} to pass to the surface */
surface?: I2DSurfaceOptions;
/** One or an array of {@link TAxisDefinition} to describe the X Axes. Defaults to a single numeric axis */
xAxes?: TAxisDefinition[] | TAxisDefinition;
/** One or an array of {@link TAxisDefinition} to describe the Y Axes. Defaults to a single numeric axis */
yAxes?: TAxisDefinition[] | TAxisDefinition;
/** One or an array of {@link TSeriesDefinition} to describe the renderable series */
series?: TSeriesDefinition[] | TSeriesDefinition;
/** A {@link TSharedDataDefinition} object that defines data that can be referenced by the series */
sharedData?: TSharedDataDefinition;
/** One or an array of {@link TModifierDefinition} to describe modifiers to apply to the chart */
modifiers?: TModifierDefinition[] | TModifierDefinition;
/** One or an array of {@link TAnnotationDefinition} to describe annotations to apply to the chart */
annotations?: TAnnotationDefinition[] | TAnnotationDefinition;
/**
* A function, or name of a registered OnCreated function that will be run after the chart is built,
* receiving the sciChartSurface as a parameter
*/
onCreated?: ((surface: SciChartSurface) => Promise<void>) | string;
/**
* Subcharts to be added to this surface
*/
subCharts?: ISubChartDefinition[];
/**
* Whether to create this chart using a dedicated webassembly context. See {@link SciChartSurface.createSingle}
*/
createSingle?: boolean;
}
export interface ISubChartDefinition {
/** Optional {@link I2DSubSurfaceOptions} to pass to the subSurface */
surface?: I2DSubSurfaceOptions;
/** One or an array of {@link TAxisDefinition} to describe the X Axes. Defaults to a single numeric axis */
xAxes?: TAxisDefinition[] | TAxisDefinition;
/** One or an array of {@link TAxisDefinition} to describe the Y Axes. Defaults to a single numeric axis */
yAxes?: TAxisDefinition[] | TAxisDefinition;
/** One or an array of {@link TSeriesDefinition} to describe the renderable series */
series?: TSeriesDefinition[] | TSeriesDefinition;
/** A {@link TSharedDataDefinition} object that defines data that can be referenced by the series */
sharedData?: TSharedDataDefinition;
/** One or an array of {@link TModifierDefinition} to describe modifiers to apply to the chart */
modifiers?: TModifierDefinition[] | TModifierDefinition;
/** One or an array of {@link TAnnotationDefinition} to describe annotations to apply to the chart */
annotations?: TAnnotationDefinition[] | TAnnotationDefinition;
}
/**
* A definition that can be used to build a Pie Chart using {@link chartBuilder.buildChart} or {@link chartBuilder.buildPieChart}
*/
export interface ISciChartPieDefinition {
/** Optional {@link IPieSurfaceOptions} to pass to the surface */
surface?: IPieSurfaceOptions;
/**
* Optional - The {@link IPieSegmentOptions} that specify the segments of the {@link SciChartPieSurface}
*/
segments?: IPieSegmentOptions[];
/**
* A function, or name of a registered OnCreated function that will be run after the chart is built,
* receiving the sciChartPieSurface as a parameter
*/
onCreated?: ((surface: SciChartPieSurface) => void) | string;
}
/**
* A definition that can be used to build a 3D Chart using {@link chartBuilder.buildChart} or {@link chartBuilder.build3DChart}
*/
export interface ISciChart3DDefinition {
/** Optional {@link I2DSurfaceOptions} to pass to the surface */
surface?: I3DSurfaceOptions;
/** One {@link TAxis3DDefinition} to describe the X Axis. */
xAxis?: TAxis3DDefinition;
/** One {@link TAxis3DDefinition} to describe the Y Axis. */
yAxis?: TAxis3DDefinition;
/** One {@link TAxis3DDefinition} to describe the Z Axis. */
zAxis?: TAxis3DDefinition;
/** One or an array of {@link TSeriesDefinition3D} to describe the renderable series */
series?: TSeriesDefinition3D[] | TSeriesDefinition3D;
/** A {@link TSharedDataDefinition} object that defines data that can be referenced by the series */
sharedData?: TSharedDataDefinition;
/** One or an array of {@link TModifier3DDefinition} to describe modifiers to apply to the chart */
modifiers?: TModifier3DDefinition[] | TModifier3DDefinition;
/**
* A function, or name of a registered OnCreated function that will be run after the chart is built,
* receiving the sciChartSurface as a parameter
*/
onCreated?: ((surface: SciChart3DSurface) => Promise<void>) | string;
/**
* Whether to create this chart using a dedicated webassembly context. See {@link SciChart3DSurface.createSingle}
*/
createSingle?: boolean;
}
export declare type TLayoutManagerDefinition = {
type: ELayoutManagerType.Default;
options?: ILayoutManagerOptions;
} | {
type: ELayoutManagerType.CentralAxes;
options?: ICentralAxesLayoutManagerOptions;
} | {
type: ELayoutManagerType.Synchronised;
options?: ILayoutManagerOptions;
} | {
type: ELayoutManagerType.Polar;
options?: ILayoutManagerOptions;
};
/**
* Construct a chart with {@link SciChartSurface} using a {@link ISciChart2DDefinition} which can be pure data.
* @remarks This method is async and must be awaited
* @param divElementId The Div Element ID where the {@link SciChartSurface} will reside
* @param definition the {@link ISciChart2DDefinition}
*/
export declare const build2DChart: (divElementId: string | HTMLDivElement, definition: ISciChart2DDefinition | string) => Promise<TWebAssemblyChart>;
/**
* Construct a chart with {@link SciChartPolarSurface} using a {@link ISciChart2DDefinition} which can be pure data.
* @remarks This method is async and must be awaited
* @param divElementId The Div Element ID where the {@link SciChartPolarSurface} will reside
* @param definition the {@link ISciChart2DDefinition}
*/
export declare const build2DPolarChart: (divElementId: string | HTMLDivElement, definition: ISciChart2DDefinition | string) => Promise<{
wasmContext: TSciChart;
sciChartSurface: SciChartPolarSurface;
}>;
/**
* Construct a chart with {@link SciChartPieSurface} using a {@link ISciChartPieDefinition} which can be pure data.
* @remarks This method is async and must be awaited
* @param divElementId The Div Element ID where the {@link SciChartPieSurface} will reside
* @param definition the {@link ISciChartPieDefinition}
*/
export declare const buildPieChart: (divElementId: string | HTMLDivElement, definition: ISciChartPieDefinition | string) => Promise<SciChartPieSurface>;
/**
* Construct a chart with {@link SciChart3DSurface} using a {@link ISciChart3DDefinition} which can be pure data.
* @remarks This method is async and must be awaited
* @param divElementId The Div Element ID where the {@link SciChart3DSurface} will reside
* @param definition the {@link ISciChart3DDefinition}
*/
export declare const build3DChart: (divElementId: string | HTMLDivElement, definition: ISciChart3DDefinition | string) => Promise<TWebAssemblyChart3D>;
export declare function buildSubCharts(definition: ISubChartDefinition | ISubChartDefinition[], parentSurface: SciChartSurface): ISciChartSubSurface[];
export declare function configure2DSurface(definition: ISciChart2DDefinition, sciChartSurface: SciChartSurface, wasmContext: TSciChart): void;
export declare function configure3DSurface(definition: ISciChart3DDefinition, sciChartSurface: SciChart3DSurface, wasmContext: TSciChart3D): void;