@nova-ui/charts
Version:
Nova Charts is a library created to provide potential consumers with solutions for various data visualizations that conform with the Nova Design Language. It's designed to solve common patterns identified by UX designers, but also be very flexible so that
40 lines (39 loc) • 1.89 kB
TypeScript
import { Subject } from "rxjs";
import { IElementPosition } from "./types";
import { INTERACTION_DATA_POINTS_EVENT, INTERACTION_DATA_POINT_EVENT } from "../../constants";
import { ChartPlugin } from "../common/chart-plugin";
import { IDataPointsPayload, InteractionType } from "../common/types";
/** Configuration for the popover plugin */
export interface IPopoverPluginConfig {
/** ID of the event stream the plugin will respond to */
eventStreamId?: typeof INTERACTION_DATA_POINTS_EVENT | typeof INTERACTION_DATA_POINT_EVENT;
/** The type of interaction that will trigger the showing and hiding of the popovers */
interactionType?: InteractionType;
}
/**
* This plugin listens for the INTERACTION_DATA_POINTS_EVENT by default and transforms received data into
* popover inputs. The listened event can be configured using the 'config.eventStreamId' property.
* The actual popover is handled by the ChartPopoverComponent.
*/
export declare class ChartPopoverPlugin extends ChartPlugin {
config: IPopoverPluginConfig;
/** Info about the data point(s) received in the most recent interaction event */
dataPoints: IDataPointsPayload;
/** Emits the popover's target position */
updatePositionSubject: Subject<IElementPosition>;
/** Emits an event indicating the popover should open */
openPopoverSubject: Subject<void>;
/** Emits an event indicating the popover should close */
closePopoverSubject: Subject<void>;
/** The target position of the popover */
popoverTargetPosition: IElementPosition;
/** The default plugin configuration */
DEFAULT_CONFIG: IPopoverPluginConfig;
private isOpen;
private readonly destroy$;
constructor(config?: IPopoverPluginConfig);
initialize(): void;
destroy(): void;
protected getAbsolutePosition(valuesArray: any[]): IElementPosition;
private processDataPoints;
}