scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
61 lines (60 loc) • 3.32 kB
TypeScript
import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase";
import { EAnnotationClippingMode } from "../../../types/AnnotationClippingMode";
import { DomAnnotationBase, IDomAnnotationOptions } from "./DomAnnotationBase";
/**
* Options passed to the constructor of a {@link SvgAnnotationBase}, used to configure it at instantiation time
*/
export interface ISvgAnnotationBaseOptions extends IDomAnnotationOptions {
}
/**
* The Base class for an {@link AnnotationBase | Annotation} which draws using an HTML5 SVG canvas
*/
export declare abstract class SvgAnnotationBase extends DomAnnotationBase {
/** @inheritDoc */
readonly isSvgAnnotation: boolean;
protected nextSibling: Element;
protected svgDOMRect: DOMRect;
private svgProperty;
private svgRootProperty;
/**
* Creates an instance of an SvgAnnotationbase
* @param options Optional parameters of type {@link ISvgAnnotationBaseOptions} used to configure the annotation on construction
*/
protected constructor(options?: ISvgAnnotationBaseOptions);
/** @inheritDoc */
onDetach(): void;
/**
* Updates the annotation position, with the {@link CoordinateCalculatorBase | Coordinate Calculators} passed in
* @param xCalc The XAxis {@link CoordinateCalculatorBase | CoordinateCalculator} applied to this annotation
* @param yCalc The YAxis {@link CoordinateCalculatorBase | CoordinateCalculator} applied to this annotation
* @param xCoordSvgTrans X-coordinate translation which is needed to use SVG canvas having the whole chart size
* @param yCoordSvgTrans Y-coordinate translation which is needed to use SVG canvas having the whole chart size
*/
update(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, xCoordSvgTrans: number, yCoordSvgTrans: number): void;
/** @inheritDoc */
delete(): void;
get svg(): SVGElement;
protected getSvgDomRect(): DOMRect;
protected clear(): void;
/**
* Called to create the SVG Dom Element right before it is added to the parent chart
* @param xCalc The XAxis {@link CoordinateCalculatorBase | CoordinateCalculator} applied to this annotation
* @param yCalc The YAxis {@link CoordinateCalculatorBase | CoordinateCalculator} applied to this annotation
* @param xCoordSvgTrans X-coordinate translation which is needed to use SVG canvas having the whole chart size
* @param yCoordSvgTrans Y-coordinate translation which is needed to use SVG canvas having the whole chart size
*/
protected create(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, xCoordSvgTrans: number, yCoordSvgTrans: number): void;
/**
* Gets the {@link SVGSVGElement | SVG Element} at the root of this annotation
*/
protected get svgRoot(): SVGSVGElement;
protected selectLayerRoot(): void;
protected setSvgAttribute(attributeName: string, value: number): void;
protected setSvg(svg: SVGElement): void;
protected applyClipping(svgString: string, clipping: EAnnotationClippingMode | string): string;
protected notifyPropertyChanged(propertyName: string): void;
protected getSize(): {
width: number;
height: number;
};
}