import { Dataset } from "../core/dataset"; import { DatumFormatter } from "../core/formatters"; import { AttributeToProjector, IAccessor, Point, SimpleSelection } from "../core/interfaces"; import { Scale } from "../scales/scale"; import * as Utils from "../utils"; import { ProxyDrawer } from "../drawers/drawer"; import { IAccessorScaleBinding, IPlotEntity } from "./"; import { Plot } from "./plot"; export interface IPiePlotEntity extends IPlotEntity { strokeSelection: SimpleSelection; } export declare class Pie extends Plot { private static _INNER_RADIUS_KEY; private static _OUTER_RADIUS_KEY; private static _SECTOR_VALUE_KEY; private _startAngle; private _endAngle; private _startAngles; private _endAngles; private _labelFormatter; private _labelsEnabled; private _strokeDrawers; /** * @constructor */ constructor(); protected _setup(): void; computeLayout(origin?: Point, availableWidth?: number, availableHeight?: number): this; addDataset(dataset: Dataset): this; protected _addDataset(dataset: Dataset): this; removeDataset(dataset: Dataset): this; protected _removeDatasetNodes(dataset: Dataset): void; protected _removeDataset(dataset: Dataset): this; selections(datasets?: Dataset[]): SimpleSelection; protected _onDatasetUpdate(): void; protected _createDrawer(): ProxyDrawer; entities(datasets?: Dataset[]): IPiePlotEntity[]; /** * Gets the AccessorScaleBinding for the sector value. */ sectorValue(): IAccessorScaleBinding; /** * Sets the sector value to a constant number or the result of an Accessor. * * @param {number|Accessor} sectorValue * @returns {Pie} The calling Pie Plot. */ sectorValue(sectorValue: number | IAccessor): this; /** * Sets the sector value to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. * * @param {S|Accessor} sectorValue * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ sectorValue(sectorValue: S | IAccessor, scale: Scale): this; /** * Gets the AccessorScaleBinding for the inner radius. */ innerRadius(): IAccessorScaleBinding; /** * Sets the inner radius to a constant number or the result of an Accessor. * * @param {number|Accessor} innerRadius * @returns {Pie} The calling Pie Plot. */ innerRadius(innerRadius: number | IAccessor): any; /** * Sets the inner radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. * * @param {R|Accessor} innerRadius * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ innerRadius(innerRadius: R | IAccessor, scale: Scale): any; /** * Gets the AccessorScaleBinding for the outer radius. */ outerRadius(): IAccessorScaleBinding; /** * Sets the outer radius to a constant number or the result of an Accessor. * * @param {number|Accessor} outerRadius * @returns {Pie} The calling Pie Plot. */ outerRadius(outerRadius: number | IAccessor): this; /** * Sets the outer radius to a scaled constant value or scaled result of an Accessor. * The provided Scale will account for the values when autoDomain()-ing. * * @param {R|Accessor} outerRadius * @param {Scale} scale * @returns {Pie} The calling Pie Plot. */ outerRadius(outerRadius: R | IAccessor, scale: Scale): this; /** * Gets the start angle of the Pie Plot * * @returns {number} Returns the start angle */ startAngle(): number; /** * Sets the start angle of the Pie Plot. * * @param {number} startAngle * @returns {Pie} The calling Pie Plot. */ startAngle(angle: number): this; /** * Gets the end angle of the Pie Plot. * * @returns {number} Returns the end angle */ endAngle(): number; /** * Sets the end angle of the Pie Plot. * * @param {number} endAngle * @returns {Pie} The calling Pie Plot. */ endAngle(angle: number): this; /** * Get whether slice labels are enabled. * * @returns {boolean} Whether slices should display labels or not. */ labelsEnabled(): boolean; /** * Sets whether labels are enabled. * * @param {boolean} labelsEnabled * @returns {Pie} The calling Pie Plot. */ labelsEnabled(enabled: boolean): this; /** * Gets the Formatter for the labels. */ labelFormatter(): DatumFormatter; /** * Sets the Formatter for the labels. The labelFormatter will be fed each pie * slice's value as computed by the `.sectorValue()` accessor, as well as the * datum, datum index, and dataset associated with that bar. * * @param {Formatter} formatter * @returns {Pie} The calling Pie Plot. */ labelFormatter(formatter: DatumFormatter): this; entitiesAt(queryPoint: Point): IPiePlotEntity[]; protected _propertyProjectors(): AttributeToProjector; private _updatePieAngles(); private _pieCenter(); protected _getDataToDraw(): Utils.Map; protected static _isValidData(value: any): boolean; protected _pixelPoint(datum: any, index: number, dataset: Dataset): { x: number; y: number; }; protected _additionalPaint(time: number): void; private _generateStrokeDrawSteps(); private _sliceIndexForPoint(p); private _drawLabels(); }