import type { IDisplayObject, IRendererEvents, IRendererEvent, IPointerEvent, IMargin, IDeform } from "./backend/Renderer"; import type { IBounds } from "../util/IBounds"; import type { Container } from "./Container"; import type { Role, AriaLive } from "../util/Accessibility"; import type { NumberFormatter } from "../util/NumberFormatter"; import type { DateFormatter } from "../util/DateFormatter"; import type { DurationFormatter } from "../util/DurationFormatter"; import type { DataItem, IComponentDataItem } from "./Component"; import type { Graphics } from "./Graphics"; import type { IPoint } from "../util/IPoint"; import type { ListTemplate } from "../util/List"; import type { Tooltip } from "./Tooltip"; import { Entity, IEntitySettings, IEntityPrivate, IEntityEvents } from "../util/Entity"; import { Template } from "../util/Template"; import { Percent } from "../util/Percent"; import { EventDispatcher, Events, EventListener } from "../util/EventDispatcher"; import { IDisposer, MultiDisposer, CounterDisposer } from "../util/Disposer"; /** * An [[EventDispatcher]] for [[Sprite]]. * * @see {@link https://www.amcharts.com/docs/v5/concepts/events/} for more info */ declare class SpriteEventDispatcher> extends EventDispatcher { protected static RENDERER_EVENTS: { [K in keyof IRendererEvents]?: >(this: SpriteEventDispatcher, event: IRendererEvents[K]) => void; }; protected _sprite: Sprite; protected _rendererDisposers: { [K in keyof IRendererEvents]?: CounterDisposer; }; protected _dispatchParents: boolean; constructor(sprite: Sprite); protected _makePointerEvent(key: K, event: IRendererEvent): ISpritePointerEvent & { type: K; }; protected _onRenderer(key: Key, dispatch: (this: this, event: IRendererEvents[Key]) => void): IDisposer; protected _on(once: boolean, type: Key | null, callback: any, context: C, shouldClone: boolean, dispatch: (type: Key, event: E[Key]) => void, debounceDelay?: number): EventListener; /** * Stops the event being handled from being dispatched on the element's * parents. Call it in an event handler, e.g.: * * ```TypeScript * element.events.on("pointerdown", function(ev) { * // Do something here and prevent from "pointerdown" bubbling up * // ... * ev.target.events.stopParentDispatch(); * }); * ``` * ```JavaScript * element.events.on("pointerdown", function(ev) { * // Do something here and prevent from "pointerdown" bubbling up * // ... * ev.target.events.stopParentDispatch(); * }); * ``` */ stopParentDispatch(): void; /** * @ignore */ dispatchParents(type: Key, event: E[Key]): void; } export interface ISpriteSettings extends IEntitySettings { /** * X position in the parent: pixels from its left edge, or a [[Percent]] of * its inner width, measured from inside its left padding. */ x?: number | Percent | null; /** * Y position in the parent: pixels from its top edge, or a [[Percent]] of * its inner height, measured from inside its top padding. */ y?: number | Percent | null; /** * Width in pixels, or a [[Percent]] of the parent's inner width. In a * horizontal layout, a percent width is a share of the width the other * children leave. */ width?: number | Percent | null; /** * Height in pixels, or a [[Percent]] of the parent's inner height. In a * vertical layout, a percent height is a share of the height the other * children leave. */ height?: number | Percent | null; /** * Maximum allowed width in pixels. */ maxWidth?: number | null; /** * Maximum allowed height in pixels. */ maxHeight?: number | null; /** * Minimum allowed width in pixels. */ minWidth?: number | null; /** * Minimum allowed height in pixels. */ minHeight?: number | null; /** * Opacity, from `0` (transparent) to `1` (opaque). * * The theme's `"default"` state has `opacity: 1`, so `show()`, and leaving a * state that changes `opacity`, bring it back to `1`, not to a value set * here. To come back to another value, set it in the `"default"` state too: * `sprite.states.create("default", { opacity: 0.5 })`. * * @default 1 */ opacity?: number; /** * Rotation in degrees, clockwise, around the point set by `centerX` and * `centerY`. * * @default 0 */ rotation?: number; /** * Scale, around the point set by `centerX` and `centerY`: below `1` * shrinks the element, above `1` enlarges it. * * @default 1 */ scale?: number; /** * The point of the element that is placed at its `x` position, and that * it rotates and scales around: pixels from its left edge, or a percent of * its width. */ centerX?: number | Percent; /** * The point of the element that is placed at its `y` position, and that * it rotates and scales around: pixels from its top edge, or a percent of * its height. */ centerY?: number | Percent; /** * Left margin in pixels. */ marginLeft?: number; /** * Right margin in pixels. */ marginRight?: number; /** * Top margin in pixels. */ marginTop?: number; /** * Bottom margin in pixels. */ marginBottom?: number; /** * Whether the element is shown. Unlike `show()` and `hide()`, it does not * animate. * * @default true */ visible?: boolean; /** * Positioning of the element. * * `"absolute"` leaves the element out of its parent's layout and size: it * is placed by its `x` and `y` only. * * @default "relative" */ position?: "absolute" | "relative"; /** * Horizontal shift in pixels. Can be negative to shift leftward. */ dx?: number; /** * Vertical shift in pixels. Can be negative to shift upward. */ dy?: number; /** * Makes the element respond to the pointer. Adding a pointer event * listener to it turns this on. */ interactive?: boolean; /** * Text of the element's tooltip. It can hold data placeholders, such as * `{value}`. */ tooltipText?: string; /** * HTML content of the element's tooltip, shown in place of `tooltipText`. * * @since 5.2.11 */ tooltipHTML?: string; /** * Where on the element the tooltip points, horizontally: pixels from its * left edge, or a percent of its width. * * @default am5.percent(50) */ tooltipX?: number | Percent; /** * Where on the element the tooltip points, vertically: pixels from its top * edge, or a percent of its height. * * @default am5.percent(50) */ tooltipY?: number | Percent; /** * The [[Tooltip]] to show for the element. If not set, the nearest * parent's is used. */ tooltip?: Tooltip; /** * Where the tooltip points: `"fixed"` at `tooltipX` and `tooltipY`, or * `"pointer"` at the pointer, following it. * * @default "fixed" */ tooltipPosition?: "fixed" | "pointer"; /** * If `false`, the element's bounds are not measured, so it takes no part * in its parent's layout or size. * * @default true */ isMeasured?: boolean; /** * Field in the data item's data object that holds settings for this * element, applied over its template's. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/template-fields/} for more info */ templateField?: string; /** * Lets the user drag the element. Touches that start on it no longer * scroll the page. */ draggable?: boolean; /** * Makes the element receive mouse wheel events. While the pointer is over * it, the wheel no longer scrolls the page. */ wheelable?: boolean; /** * A [[NumberFormatter]] to use for this element instead of the root's. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info */ numberFormatter?: NumberFormatter | undefined; /** * A [[DateFormatter]] to use for this element instead of the root's. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info */ dateFormatter?: DateFormatter | undefined; /** * A [[DurationFormatter]] to use for this element instead of the root's. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info */ durationFormatter?: DurationFormatter | undefined; /** * Setting that a click or tap toggles between `true` and `false`: * `"active"` or `"disabled"`. `"none"` turns toggling off. */ toggleKey?: "disabled" | "active" | "none" | undefined; /** * Applies the element's `"active"` state while `true`. */ active?: boolean; /** * Applies the element's `"disabled"` state while `true`. It changes only * the look: the element still responds to the pointer. */ disabled?: boolean; /** * An SVG filter to apply to the element. * * IMPORTANT: SVG filters are not supported in some browsers, e.g. Safari. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/#SVG_filters} for more info * @ignore todo: figure out if we still need this */ filter?: string; /** * CSS cursor to show while the pointer is over the element, e.g. * `"pointer"`. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor} for more info */ cursorOverStyle?: string; /** * If `false`, the element is left out of exported images of the chart. */ exportable?: boolean; /** * Layer to draw the element on: elements on higher layers show in front of * those on lower ones. If not set, the element is on its parent's layer. */ layer?: number; /** * Margins in pixels that make the element's layer larger than the chart, * or, when negative, smaller. * * @since @5.2.39 */ layerMargin?: IMargin; /** * Hides the element whatever its `visible` setting, even when `show()` is * called. */ forceHidden?: boolean; /** * Plays the element's reveal animation, as `appear()` does, when it is * first drawn: a chart fades in, a series grows its columns or lines from * the base. A series waits for its first data. It plays once: data updates * do not replay it, but turning the setting off and on again does. * Elements made from a template play as each one is made. * * An element that starts hidden (`visible: false`, or hidden in code before * it is drawn) stays hidden. An `animations` entry on the same setting, * such as a pulsing `opacity`, keeps playing. * * This is how a JSON config gets the opening animation, as a config cannot * call `appear()`. * * ```TypeScript * chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 }); * series.setAll({ autoAppear: true, appearDuration: 1000 }); * ``` * ```JavaScript * chart.setAll({ autoAppear: true, appearDuration: 1000, appearDelay: 100 }); * series.setAll({ autoAppear: true, appearDuration: 1000 }); * ``` * * @default false * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/} for more info * @since 5.21.0 */ autoAppear?: boolean; /** * Duration of the `autoAppear` animation, in milliseconds. Without it, the * element's `stateAnimationDuration` is used. * * @since 5.21.0 */ appearDuration?: number; /** * Milliseconds to wait before the `autoAppear` animation starts. The * element stays hidden until then. * * @default 0 * @since 5.21.0 */ appearDelay?: number; /** * Makes the element and its children ignore the pointer, even with * `interactive: true` or event listeners set. * * @since 5.0.21 */ forceInactive?: boolean; /** * When the element's tooltip shows: * * `"hover"` (default) - while the pointer is over the element, or after * a tap on it until a tap elsewhere. * * `"always"` - all the time. To show tooltips of several elements at * once, give each its own [[Tooltip]] (`tooltip`). * * `"click"` - after a click or tap on the element, until a click * anywhere else on the page. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/tooltips/#Sticky_tooltips} for more info * @default "hover" * @since 5.0.16 */ showTooltipOn?: "hover" | "always" | "click"; /** * Draws the element sharply, with minimal anti-aliasing: its position is * rounded to whole pixels, and `strokeWidth` is adjusted to the device * pixel ratio, so lines may look thinner than expected. * * NOTE: it may not work well on several elements that are meant to fit * together exactly. * * @default false * @since 5.3.0 */ crisp?: boolean; /** * Blur radius in pixels, from `0` (no blur) up. * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ blur?: number; /** * Brightness. * * * `0` - completely black * * `1` - no changes (default) * * `>1` - brighter * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ brightness?: number; /** * Contrast. * * * `0` - completely gray * * `1` - no changes (default) * * `>1` - more contrast * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ contrast?: number; /** * Saturation. * * * `0` - grayscale * * `1` - no changes (default) * * `>1` - more saturated * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ saturate?: number; /** * Sepia tone, from `0` (no changes) to `1` (full sepia). * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ sepia?: number; /** * Color inversion, from `0` (no changes) to `1` (fully inverted colors). * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ invert?: number; /** * Rotates the hue of all colors by this many degrees, from `0` to `360`. * * IMPORTANT: This setting is not supported in Safari browsers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/filters/} for more info * @since 5.5.0 */ hue?: number; /** * An internal order by which focusable elements will be selected within the * chart. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Focusing_elements} for more info */ tabindexOrder?: number; /** * Simulate hover on an element when it gains focus, including changing hover * appearance and displaying a tooltip if applicable. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Focusing_elements} for more info */ hoverOnFocus?: boolean; /** * Can element be focused, i.e. selected using TAB key. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Focusing_elements} for more info */ focusable?: boolean; /** * An identifier by which to group common elements into focusable groups. * * If set, only the first element in he group will be focusable via TAB key. * When it is selected, the rest of the elements in the same group can be * selected using arrow keys. * * It allows users to TAB-through chart elements quickly without the need * to TAB into each and every element. * * It's up to implementer of the charts to provide meaningful `ariaLabel` to * the element, which advertises this capability and provides adequate * instructions. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Grouping_focusable_elements} for more info * @since 5.0.6 */ focusableGroup?: string | number; /** * If set, the text will be read out (announced) by a screen reader when * focused element is "clicked" (by pressing ENTER or SPACE). * * @since 5.10.8 */ clickAnnounceText?: string; /** * Element's role. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Roles} for more info */ role?: Role; /** * `aria-live` setting. */ ariaLive?: AriaLive; /** * `aria-checked` setting. * * This setting is ignored unless `role` is one of the following: * * `"checkbox"` * * `"option"` * * `"radio"` * * `"menuitemcheckbox"` * * `"menuitemradio"` * * `"treeitem"` * * On a toggle `"button"` (one with `toggleKey`) it is exposed as * `aria-pressed`. */ ariaChecked?: boolean; /** * `aria-expanded` setting: whether the content the element shows or hides * (e.g. a task's subtasks, a node's children) is shown. * * @see {@link https://w3c.github.io/aria/#aria-expanded} for more info * @since 5.21.0 */ ariaExpanded?: boolean; /** * `aria-current` setting. * * @see {@link https://w3c.github.io/aria/#aria-current} for more info * @since 5.9.8 */ ariaCurrent?: string; /** * `aria-selected` setting. * * @see {@link https://w3c.github.io/aria/#aria-selected} for more info * @since 5.9.8 */ ariaSelected?: boolean; /** * `aria-hidden` setting. */ ariaHidden?: boolean; /** * Label for the element to use for screen readers. * * @see {@link https://www.amcharts.com/docs/v5/concepts/accessibility/#Screen_reader} for more info */ ariaLabel?: string; /** * `aria-orientation` setting. */ ariaOrientation?: string; /** * `aria-valuenow` setting. */ ariaValueNow?: string; /** * `aria-valuemin` setting. */ ariaValueMin?: string; /** * `aria-valuemax` setting. */ ariaValueMax?: string; /** * `aria-valuetext` setting. */ ariaValueText?: string; /** * `aria-controls` setting. */ ariaControls?: string; } export interface ISpritePrivate extends IEntityPrivate { /** * @ignore */ customData?: any; /** * A 2x2 transform applied around the element's position after its * rotation and scale. * * @ignore */ deform?: IDeform | null; /** * @ignore */ x?: number; /** * @ignore */ y?: number; /** * @ignore */ width?: number; /** * @ignore */ height?: number; /** * @ignore */ visible?: boolean; /** * `true` while the element shows its tooltip. */ showingTooltip?: boolean; /** * @ignore */ touchHovering?: boolean; /** * @ignore */ focusElement?: { dom: HTMLDivElement; disposers: Array; }; /** * An element whose tooltip point and colors the tooltip uses, in place of * this element's. */ tooltipTarget?: Graphics; /** * @ignore */ list?: ListTemplate; /** * @ignore */ maxWidth?: number | null; /** * @ignore */ maxHeight?: number | null; /** * @ignore */ minWidth?: number | null; /** * @ignore */ minHeight?: number | null; /** * If set to `false`, its tabindex will be set to -1, so it does not get * focused with TAB, regardless whether its public setting `focusable` is * set to `true`. * * @since 5.3.16 */ focusable?: boolean; /** * If set to `true`, the sprite gets no focus element, so it is left out of * keyboard navigation and screen readers even if `focusable` is `true`. * * Used for map objects that their series leaves out with `include` or * `exclude`. * * @ignore */ focusExcluded?: boolean; /** * If set to `true`, the sprite is outside the visible area (e.g. a map * object panned or zoomed away): it is not a TAB stop, but screen readers * can still read it. * * @ignore */ focusOutOfView?: boolean; /** * Checks that the pointer is within the element's bounds before * dispatching `"pointerover"`. This prevents ghost tooltips that sometimes * appear while the pointer moves over interactive elements. * * It is `true` by default on `Rectangle` and `Circle`. * * @since 5.5.0 */ trustBounds?: boolean; /** * The last point the tooltip was shown at, so it is not shown again at the * same place. * * @since 5.11.3 */ lastTooltipCoords?: IPoint; } /** * Event object of a pointer interaction. */ export interface ISpritePointerEvent { /** * Original event object that caused the interaction, e.g. [[MouseEvent]]. */ originalEvent: IPointerEvent; /** * The point of the event, relative to the root. */ point: IPoint; /** * `true` if the event was generated by code rather than by user * interaction. */ simulated: boolean; /** * Whether event originated in chart's container or its children. */ native?: boolean; /** * The element on which the event occurred. */ target: Sprite; } export interface ISpriteEvents extends IEntityEvents { /** * The element's data item changed. */ dataitemchanged: { oldDataItem: DataItem | undefined; newDataItem: DataItem | undefined; }; /** * The element's position changed. */ positionchanged: {}; /** * The element's bounds changed. */ boundschanged: {}; /** * Dragging of the element started: the pointer moved more than 5 pixels * after pressing on it. */ dragstart: ISpritePointerEvent; /** * Dragging of the element stopped. */ dragstop: ISpritePointerEvent; /** * The element moved while being dragged. */ dragged: ISpritePointerEvent; /** * The element was clicked or tapped. A press and release more than 5 * pixels apart is not a click. */ click: ISpritePointerEvent; /** * The element was clicked with the right mouse button. */ rightclick: ISpritePointerEvent; /** * The element was clicked with the middle mouse button. */ middleclick: ISpritePointerEvent; /** * The element was double-clicked or double-tapped. Also dispatched on its * parents. */ dblclick: ISpritePointerEvent; /** * The pointer moved over the element. */ pointerover: ISpritePointerEvent; /** * The pointer left the element. */ pointerout: ISpritePointerEvent; /** * A pointer button was pressed, or a touch started, over the element. Also * dispatched on its parents. */ pointerdown: ISpritePointerEvent; /** * A pointer button was released, or a touch ended, over the element. */ pointerup: ISpritePointerEvent; /** * A pointer button was released, or a touch ended, anywhere in the window, * even outside the chart. */ globalpointerup: ISpritePointerEvent; /** * The pointer moved anywhere in the window, even outside the chart. */ globalpointermove: ISpritePointerEvent; /** * A pointer button was pressed, or a touch started, anywhere in the * window, even outside the chart. */ globalpointerdown: ISpritePointerEvent; /** * The mouse wheel turned while the pointer was over the element. Also * dispatched on its parents. */ wheel: { originalEvent: WheelEvent; point: IPoint; }; /** * Invoked when element gains focus. */ focus: { originalEvent: FocusEvent; target: Sprite; }; /** * Invoked when element loses focus. */ blur: { originalEvent: FocusEvent; target: Sprite; }; } /** * Base class of all visual elements. * * @important */ export declare abstract class Sprite extends Entity { _settings: ISpriteSettings; _privateSettings: ISpritePrivate; _events: ISpriteEvents; events: SpriteEventDispatcher>; abstract _display: IDisplayObject; _adjustedLocalBounds: IBounds; _localBounds: IBounds; static className: string; static classNames: Array; _parent: Container | undefined; protected _dataItem: DataItem | undefined; protected _templateField: Template | undefined; protected _sizeDirty: boolean; _isDragging: boolean; protected _dragEvent: ISpritePointerEvent | undefined; protected _dragPoint: IPoint | undefined; protected _isHidden: boolean; protected _isShowing: boolean; protected _isHiding: boolean; protected _isDown: boolean; _downPoint: IPoint | undefined; _downPoints: { [index: number]: IPoint; }; _toggleDp: IDisposer | undefined; protected _dragDp: MultiDisposer | undefined; protected _tooltipDp: MultiDisposer | undefined; protected _hoverDp: MultiDisposer | undefined; protected _focusDp: MultiDisposer | undefined; protected _tooltipMoveDp: IDisposer | undefined; protected _tooltipPointerDp: MultiDisposer | undefined; protected _virtualParent: Container | undefined; protected _afterNew(): void; /** * Marks a setting as changed, so the element reads it again, running its * adapters, on the next frame. * * @param key Setting key */ markDirtyKey(key: Key): void; _markDirtyKey(key: Key): void; _markDirtyPrivateKey(key: Key): void; protected _removeTemplateField(): void; protected _createEvents(): SpriteEventDispatcher>; _processTemplateField(): void; _setDataItem(dataItem?: DataItem): void; /** * The element's [[DataItem]], or, if it has none, its nearest parent's. * * NOTE: data items are assigned automatically in most cases where it * matters. Set one only if you know what you are doing. * * @param value Data item */ set dataItem(value: DataItem | undefined); /** * @return DataItem */ get dataItem(): DataItem | undefined; protected _addPercentageSizeChildren(): void; protected _addPercentagePositionChildren(): void; /** * @ignore */ markDirtyPosition(): void; protected updatePivotPoint(): void; _beforeChanged(): void; protected _handleStates(): void; _changed(): void; /** * @ignore * @todo should this be user-accessible? */ dragStart(e: ISpritePointerEvent): void; /** * @ignore * @todo should this be user-accessible? */ dragStop(e: ISpritePointerEvent): void; protected _handleOver(): void; protected _handleOut(): void; protected _handleUp(e: ISpritePointerEvent): void; _hasMoved(e: ISpritePointerEvent): boolean; _hasDown(): boolean; protected _handleDown(e: ISpritePointerEvent): void; /** * @ignore * @todo should this be user-accessible? */ dragMove(e: ISpritePointerEvent): true | undefined; _updateSize(): void; _getBounds(): void; /** * Returns how deep the element is in the tree: the number of parents it * has. * * @return Depth */ depth(): number; /** * @ignore */ markDirtySize(): void; /** * @ignore */ markDirtyBounds(): void; /** * @ignore */ markDirtyAccessibility(): void; /** * @ignore */ markDirtyLayer(): void; /** * @ignore */ markDirty(): void; _updateBounds(): void; _fixMinBounds(bounds: IBounds): void; protected _removeParent(parent: Container | undefined): void; protected _appeared: boolean; protected _appearApplied: boolean; /** * Hidden by `appear()` or `autoAppear` until it shows: not hidden on purpose. * * @ignore */ _appearPending: boolean; /** * Whether `autoAppear` can play yet. A series waits for its data. */ protected _autoAppearReady(): boolean; /** * Plays `autoAppear` the first time the element is drawn, and again when * the setting is turned off and on. A container does this before it * prepares its children, so that hiding it and its data items is part of * the same frame. */ protected _applyAutoAppear(): void; protected _replayDeclaredAnimations(): void; _clearDirty(): void; /** * Hovers the element as if the pointer were over it: applies its hover * state and shows its tooltip. */ hover(): void; /** * Ends a hover, as if the pointer left the element: hides its tooltip and * takes it out of its hover state. */ unhover(): void; /** * Shows the element's [[Tooltip]]. Does nothing if the element has no * `tooltipText` or `tooltipHTML`. * * @param point Point to point at, relative to the root; used only with `tooltipPosition: "pointer"` * @return Promise */ showTooltip(point?: IPoint): Promise | undefined; /** * Hides the element's [[Tooltip]]. * * @return Promise */ hideTooltip(): Promise | undefined; _getTooltipPoint(): IPoint; /** * Returns the element's [[Tooltip]]: its own `tooltip`, or else the nearest * parent's. * * @return Tooltip */ getTooltip(): Tooltip | undefined; _updatePosition(): void; /** * Returns the element's X position in pixels, relative to its parent, * without `dx`. * * @return X (px) */ x(): number; /** * Returns the element's Y position in pixels, relative to its parent, * without `dy`. * * @return Y (px) */ y(): number; protected _dispose(): void; /** * @ignore */ adjustedLocalBounds(): IBounds; /** * Returns local coordinates of the element's bounds. * * @ignore * @return Local bounds */ localBounds(): IBounds; /** * Returns the element's bounds in its parent's coordinates. * * @ignore * @return Bounds */ bounds(): IBounds; /** * Returns global coordinates of the element's bounds. * * @ignore * @return Global bounds */ globalBounds(): IBounds; /** * Returns global bounds of the element's shape, for its focus element. * * Same as `globalBounds()`, except that an element that is not measured * (a pie slice, a map polygon) is measured here, so that it can be focused. * * @ignore * @return Global bounds */ _focusBounds(): IBounds; protected _toGlobalBounds(bounds: IBounds): IBounds; protected _onShow(_duration?: number): void; protected _onHide(_duration?: number): void; /** * Plays the reveal animation: hides the element at once, then shows it, * whether it was hidden or not. * * @param duration Duration of the animation in milliseconds * @param delay Milliseconds to wait before showing the element * @return Promise */ appear(duration?: number, delay?: number): Promise; /** * Shows the element and returns a `Promise` that resolves when its * showing animations finish. * * ```TypeScript * series.show().then(function(ev) { * console.log("Series is now fully visible"); * }) * ``` * ```JavaScript * series.show().then(function(ev) { * console.log("Series is now fully visible"); * }) * ``` * * @param duration Animation duration in milliseconds * @return Promise */ show(duration?: number): Promise; /** * Hides the element and returns a `Promise` that resolves when its hiding * animations finish. * * ```TypeScript * series.hide().then(function(ev) { * console.log("Series finished hiding"); * }) * ``` * ```JavaScript * series.hide().then(function(ev) { * console.log("Series finished hiding"); * }) * ``` * * @param duration Animation duration in milliseconds * @return Promise */ hide(duration?: number): Promise; /** * Returns `true` if the element was hidden with `hide()`, even while its * hiding animation still plays. For the `visible` setting, use * `isVisible()`. * * @return Is hidden? */ isHidden(): boolean; /** * Returns `true` while the element's showing animation plays. * * @return Is showing? */ isShowing(): boolean; /** * Returns `true` while the element's hiding animation plays. * * @return Is hiding? */ isHiding(): boolean; /** * Returns `true` if the pointer is over the element. * * @return Is hovered? */ isHover(): boolean; /** * Returns `true` if this element does currently have focus. * * @return Is focused? */ isFocus(): boolean; /** * Returns `true` while the element is being dragged. * * @return Is dragged? */ isDragging(): boolean; /** * Returns `false` if either the public or the private setting `visible` is * `false`, or `forceHidden` is `true`. * * @return Visible? */ isVisible(): boolean; /** * Same as `isVisible()`, except it checks all ascendants, too. * * @since 5.2.7 * @return Visible? */ isVisibleDeep(): boolean; /** * Returns the element's opacity multiplied by those of all its parents. * * @return Opacity * @since 5.2.11 */ compositeOpacity(): number; /** * Returns the element's scale multiplied by those of all its parents. * * @return Scale * @since 5.9.2 */ compositeScale(): number; /** * Returns the element's rotation plus those of all its parents, in * degrees. * * @return Rotation * @since 5.9.2 */ compositeRotation(): number; /** * Returns the element's width in pixels. * * @return Width (px) */ width(): number; /** * Returns the most width the element may take, in pixels: its `maxWidth`, * a fixed `width`, or else its parent's inner width. * * @return Maximum width (px) */ maxWidth(): number; /** * Returns the most height the element may take, in pixels: its * `maxHeight`, a fixed `height`, or else its parent's inner height. * * @return Maximum height (px) */ maxHeight(): number; /** * Returns the element's height in pixels. * * @return Height (px) */ height(): number; protected _findStaticTemplate(f: (template: Template) => boolean): Template | undefined; _walkParents(f: (parent: Sprite) => void): void; protected _walkParent(f: (parent: Sprite) => void): void; set virtualParent(parent: Container | undefined); /** * Parent [[Container]] of this element. * * @return Parent container */ get parent(): Container | undefined; _setParent(parent: Container, updateChildren?: boolean): void; /** * Returns the [[NumberFormatter]] of the element: its own * `numberFormatter`, or else the one of the [[Root]]. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info * @return NumberFormatter instance */ getNumberFormatter(): NumberFormatter; /** * Returns the [[DateFormatter]] of the element: its own `dateFormatter`, * or else the one of the [[Root]]. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info * @return DateFormatter instance */ getDateFormatter(): DateFormatter; /** * Returns the [[DurationFormatter]] of the element: its own * `durationFormatter`, or else the one of the [[Root]]. * * @see {@link https://www.amcharts.com/docs/v5/concepts/using-formatters/} for more info * @return DurationFormatter instance */ getDurationFormatter(): DurationFormatter; /** * Converts a point within the element to a point relative to the root. * * @param point Point within the element * @return Point relative to the root */ toGlobal(point: IPoint): IPoint; /** * Converts a point relative to the root to a point within the element. * * @param point Point relative to the root * @return Point within the element */ toLocal(point: IPoint): IPoint; _getDownPoint(): IPoint | undefined; _getDownPointId(): number | undefined; /** * Moves the element to the end of its parent's children, so it is drawn * over its siblings, or, in a layout, placed last. */ toFront(): void; /** * Moves the element to the start of its parent's children, so it is drawn * under its siblings, or, in a layout, placed first. */ toBack(): void; } export {}; //# sourceMappingURL=Sprite.d.ts.map