import { AngleAxis, Annotation, Axis, type CreateModelOptions, EdgeRenderingMode, type IColorAxis, type IPlotModel, type IPlotView, type IRenderContext, LegendBase, LineStyle, MagnitudeAxis, Model, type OxyColor, type OxyRect, type OxyThickness, PlotElement, type PlotModelSerializeOptions, type ScreenPoint, Series, type TrackerEventArgs, TrackerHitResult } from '..'; /** * Specifies the coordinate system type. */ export declare enum PlotType { /** * XY coordinate system - two perpendicular axes */ XY = 0, /** * Cartesian coordinate system - perpendicular axes with the same scaling. * See http://en.wikipedia.org/wiki/Cartesian_coordinate_system */ Cartesian = 1, /** * Polar coordinate system - with radial and angular axes * See http://en.wikipedia.org/wiki/Polar_coordinate_system */ Polar = 2 } /** * Specifies the horizontal alignment of the titles. */ export declare enum TitleHorizontalAlignment { /** * Centered within the plot area. */ CenteredWithinPlotArea = 0, /** * Centered within the client view (excluding padding defined in PlotModel.Padding). */ CenteredWithinView = 1 } export interface CreatePlotModelOptions extends CreateModelOptions { axes?: Axis[]; series?: Series[]; annotations?: Annotation[]; legends?: LegendBase[]; plotType?: PlotType; plotMargins?: OxyThickness; padding?: OxyThickness; background?: OxyColor; plotAreaBackground?: OxyColor; textColor?: OxyColor; titleColor?: OxyColor; subtitleColor?: OxyColor; defaultFont?: string; defaultFontSize?: number; titleToolTip?: string; titleFont?: string; titleFontSize?: number; titleFontWeight?: number; subtitleFont?: string; subtitleFontSize?: number; subtitleFontWeight?: number; titlePadding?: number; clipTitle?: boolean; titleClippingLength?: number; plotAreaBorderColor?: OxyColor; plotAreaBorderThickness?: OxyThickness; edgeRenderingMode?: EdgeRenderingMode; assignColorsToInvisibleSeries?: boolean; isLegendVisible?: boolean; defaultColors?: OxyColor[]; axisTierDistance?: number; title?: string; subtitle?: string; titleHorizontalAlignment?: TitleHorizontalAlignment; } export declare const DefaultPlotModelOptions: CreatePlotModelOptions; export declare const ExtendedPlotModelOptions: { axes?: Axis[] | undefined; series?: Series[] | undefined; annotations?: Annotation[] | undefined; legends?: LegendBase[] | undefined; plotType?: PlotType | undefined; plotMargins?: OxyThickness | undefined; padding?: OxyThickness | undefined; background?: string | undefined; plotAreaBackground?: string | undefined; textColor?: string | undefined; titleColor?: string | undefined; subtitleColor?: string | undefined; defaultFont?: string | undefined; defaultFontSize?: number | undefined; titleToolTip?: string | undefined; titleFont?: string | undefined; titleFontSize?: number | undefined; titleFontWeight?: number | undefined; subtitleFont?: string | undefined; subtitleFontSize?: number | undefined; subtitleFontWeight?: number | undefined; titlePadding?: number | undefined; clipTitle?: boolean | undefined; titleClippingLength?: number | undefined; plotAreaBorderColor?: string | undefined; plotAreaBorderThickness?: OxyThickness | undefined; edgeRenderingMode?: EdgeRenderingMode | undefined; assignColorsToInvisibleSeries?: boolean | undefined; isLegendVisible?: boolean | undefined; defaultColors?: string[] | undefined; axisTierDistance?: number | undefined; title?: string | undefined; subtitle?: string | undefined; titleHorizontalAlignment?: TitleHorizontalAlignment | undefined; selectionColor?: string | undefined; }; /** * Represents a plot. */ export declare class PlotModel extends Model implements IPlotModel { /** * The bar series managers. */ private _barSeriesManagers; /** * The plot view that renders this plot. */ private _plotViewReference?; /** * The current color index. */ private _currentColorIndex; /** * Flags if the data has been updated. */ private _isDataUpdated; /** * The last update exception. */ private _lastPlotException?; /** * Initializes a new instance of the PlotModel class. */ constructor(opt?: CreatePlotModelOptions); private applyOptions; /** * Occurs when the tracker has been changed. */ trackerChanged?: (sender: any, event: TrackerEventArgs) => void; /** * Occurs when the plot has been updated. */ updated?: (sender: any) => void; /** * Occurs when the plot is about to be updated. */ updating?: (sender: any) => void; /** * Gets or sets the default font. */ defaultFont: string; /** * Gets or sets the default size of the fonts. */ defaultFontSize: number; private _actualPlotMargins; /** * The actual plot margins. */ get actualPlotMargins(): OxyThickness; /** * The plot view that renders this plot. * Only one view can render the plot at the same time. */ get plotView(): IPlotView | undefined; private readonly _annotations; /** * The annotations. */ get annotations(): Annotation[]; private readonly _axes; /** * The axes. */ get axes(): Axis[]; private readonly _legends; /** * The legends. */ get legends(): LegendBase[]; /** * The color of the background of the plot. * If the background color is set to OxyColors.Undefined or is otherwise invisible then the background will be determined by the plot view or exporter. */ background: OxyColor; /** * The default colors. */ defaultColors: OxyColor[]; /** * The edge rendering mode that is used for rendering the plot bounds and backgrounds. */ edgeRenderingMode: EdgeRenderingMode; /** * A value indicating whether invisible series should be assigned automatic colors. */ assignColorsToInvisibleSeries: boolean; /** * A value indicating whether the legend is visible. The titles of the series must be set to use the legend. */ isLegendVisible: boolean; /** * The padding around the plot. */ padding: OxyThickness; private _plotBounds; /** * The PlotBounds of the plot (in device units). */ get plotBounds(): OxyRect; /** * The total width of the plot (in device units). */ get width(): number; /** * The total height of the plot (in device units). */ get height(): number; private _plotAndAxisArea; /** * The area including both the plot and the axes. Outside legends are rendered outside this rectangle. */ get plotAndAxisArea(): OxyRect; private _plotArea; /** * The plot area. This area is used to draw the series (not including axes or legends). */ get plotArea(): OxyRect; /** * The distance between two neighborhood tiers of the same AxisPosition. */ axisTierDistance: number; /** * The color of the background of the plot area. */ plotAreaBackground: OxyColor; /** * The color of the border around the plot area. */ plotAreaBorderColor: OxyColor; /** * The thickness of the border around the plot area. */ plotAreaBorderThickness: OxyThickness; /** * The margins around the plot (this should be large enough to fit the axes). * If any of the values is set to NaN, the margin is adjusted to the value required by the axes. */ plotMargins: OxyThickness; /** * The type of the coordinate system. */ plotType: PlotType; private readonly _series; /** * The series. */ get series(): Series[]; /** * The rendering decorator. */ renderingDecorator?: (context: IRenderContext) => IRenderContext; /** * The subtitle. */ subtitle?: string; /** * The subtitle font. If this property is null, the Title font will be used. */ subtitleFont?: string; /** * The size of the subtitle font. */ subtitleFontSize: number; /** * The subtitle font weight. */ subtitleFontWeight: number; /** * The default color of the text in the plot (titles, legends, annotations, axes). */ textColor: OxyColor; /** * The title. */ title?: string; /** * The title tool tip. */ titleToolTip?: string; /** * The color of the title. * If the value is null, the TextColor will be used. */ titleColor: OxyColor; /** * A value indicating whether to clip the title. The default value is true. */ clipTitle: boolean; /** * The length of the title clipping rectangle (fraction of the available length of the title area). The default value is 0.9. */ titleClippingLength: number; /** * The color of the subtitle. */ subtitleColor: OxyColor; /** * The horizontal alignment of the title and subtitle. */ titleHorizontalAlignment: TitleHorizontalAlignment; private _titleArea; /** * The title area. */ get titleArea(): OxyRect; /** * The title font. */ titleFont?: string; /** * The size of the title font. */ titleFontSize: number; /** * The title font weight. */ titleFontWeight: number; /** * The padding around the title. */ titlePadding: number; private _defaultAngleAxis?; /** * The default angle axis. */ get defaultAngleAxis(): AngleAxis | undefined; private _defaultMagnitudeAxis?; /** * The default magnitude axis. */ get defaultMagnitudeAxis(): MagnitudeAxis | undefined; private _defaultXAxis?; /** * The default X axis. */ get defaultXAxis(): Axis | undefined; private _defaultYAxis?; /** * The default Y axis. */ get defaultYAxis(): Axis | undefined; private _defaultColorAxis?; /** * The default color axis. */ get defaultColorAxis(): IColorAxis | undefined; /** * Gets the actual title font. */ protected get actualTitleFont(): string; /** * Gets the actual subtitle font. */ protected get actualSubtitleFont(): string; /** * Attaches this model to the specified plot view. * @param plotView The plot view. * @remarks Only one plot view can be attached to the plot model. * The plot model contains data (e.g. axis scaling) that is only relevant to the current plot view. */ attachPlotView(plotView?: IPlotView): void; /** * Invalidates the plot. * @param updateData Updates all data sources if set to true. */ invalidatePlot(updateData: boolean): void; /** * Gets the first axes that covers the area of the specified point. * @param pt The point. */ getAxesFromPoint(pt: ScreenPoint): [Axis?, Axis?]; /** * Gets the default color from the DefaultColors palette. * @returns The next default color. */ getDefaultColor(): OxyColor; /** * Gets the default line style. * @returns The next default line style. */ getDefaultLineStyle(): LineStyle; /** * Gets a series from the specified point. * @param point The point. * @param limit The limit. * @returns The nearest series. */ getSeriesFromPoint(point: ScreenPoint, limit?: number): Series | undefined; /** * Returns a string that represents this instance. * @returns A string that represents this instance. */ toString(): string; /** * Gets any exception thrown during the last IPlotModel.Update call. * @returns The exception or null if there was no exception. */ getLastPlotException(): Error | null | undefined; /** * Updates all axes and series. * 0. Updates the owner PlotModel of all plot items (axes, series and annotations) * 1. Updates the data of each Series (only if updateData==true). * 2. Ensure that all series have axes assigned. * 3. Updates the max and min of the axes. * @param updateData if set to true, all data collections will be updated. */ update(updateData: boolean): void; /** * Gets the axis for the specified key. * @param key The axis key. * @returns The axis that corresponds with the key. * @throws Error if the axis with the specified key cannot be found. */ getAxis(key: string): Axis; /** * Gets the axis for the specified key, or returns a default value. * @param key The axis key. * @param defaultAxis The default axis. * @returns defaultAxis if key is empty or does not exist; otherwise, the axis that corresponds with the key. */ getAxisOrDefault(key: string, defaultAxis: Axis): Axis; /** * Resets all axes in the model. */ resetAllAxes(): void; /** * Pans all axes. * @param dx The horizontal distance to pan (screen coordinates). * @param dy The vertical distance to pan (screen coordinates). */ panAllAxes(dx: number, dy: number): void; /** * Zooms all axes. * @param factor The zoom factor. */ zoomAllAxes(factor: number): void; /** * Raises the TrackerChanged event. * @param result The result. */ raiseTrackerChanged(result?: TrackerHitResult): void; /** * Raises the TrackerChanged event. * @param result The result. */ protected onTrackerChanged(result: TrackerHitResult): void; /** * Gets all elements of the model, top-level elements first. * @returns An iterator of the elements. */ protected getHitTestElements(): PlotElement[]; /** * Raises the Updated event. */ protected onUpdated(): void; /** * Raises the Updating event. */ protected onUpdating(): void; /** * Updates the axis transforms. */ private updateAxisTransforms; /** * Enforces the same scale on all axes. */ private enforceCartesianTransforms; /** * Updates the intervals (major and minor step values). */ private updateIntervals; /** * Finds and sets the default horizontal and vertical axes (the first horizontal/vertical axes in the Axes collection). */ private ensureDefaultAxes; /** * Resets the default color index. */ private resetDefaultColor; /** * Updates maximum and minimum values of the axes from values of all data series. * @param isDataUpdated if set to true, the data has been updated. */ private updateMaxMin; /** * Updates the bar series managers. */ private updateBarSeriesManagers; /** * Updates category axes that are not managed by a BarSeriesManager. */ private updateUnmanagedCategoryAxes; /** * Renders the plot with the specified rendering context within the given rectangle. * @param rc The rendering context. * @param rect The plot bounds. */ render(rc: IRenderContext, rect: OxyRect): Promise; /** * Renders the plot with the specified rendering context. * @param rc The rendering context. * @param rect The plot bounds. */ protected renderOverride(rc: IRenderContext, rect: OxyRect): Promise; /** * Renders the specified error message. * @param rc The rendering context. * @param title The title. * @param errorMessage The error message. * @param fontSize The font size. The default value is 12. */ private renderErrorMessage; /** * Adjusts the plot margins. * @param rc The render context. * @returns true if the margins were adjusted. */ private adjustPlotMargins; /** * Adjust the positions of parallel axes, returns total size * @param parallelAxes The parallel axes. * @returns The maximum value of the position tier. */ private adjustAxesPositions; /** * Measures the size of the title and subtitle. * @param rc The rendering context. * @returns Size of the titles. */ private measureTitles; /** * Renders the annotations. * @param rc The render context. * @param layer The layer. */ private renderAnnotations; /** * Renders the axes. * @param rc The render context. * @param layer The layer. */ private renderAxes; private renderLegends; /** * Renders the series backgrounds. * @param rc The render context. */ private renderBackgrounds; /** * Renders the border around the plot area. * @param rc The render context. * @remarks The border will only by rendered if there are axes in the plot. */ private renderBox; /** * Renders the series. * @param rc The render context. */ private renderSeries; /** * Renders the plot elements. * @param plotElements The plot elements. * @param rc The render context. * @param renderAction The render action. */ private renderPlotElements; /** * Renders the title and subtitle. * @param rc The render context. */ private renderTitle; /** * Calculates the plot area (subtract padding, title size and outside legends) * @param rc The rendering context. */ private updatePlotArea; toJSON(opt?: PlotModelSerializeOptions): any; private arrayToJson; } //# sourceMappingURL=PlotModel.d.ts.map