@ebay/ui-core-react
Version:
Skin components build off React
53 lines • 1.99 kB
TypeScript
import type Highcharts from "highcharts";
/**
* Extended column point with internal properties used during the translate phase.
* `shapeArgs`, `shapeType`, `shapeY`, and `dlBox` are Highcharts internals
* that the eBayColumns extension modifies for custom rounded-corner rendering.
*/
export interface ColumnPointInternal extends Highcharts.Point {
shapeType: string;
shapeY: number;
dlBox: Highcharts.BBoxObject;
shapeArgs: Highcharts.SVGAttributes;
label?: string;
}
/**
* Extended column series options with custom top/bottom flags
* used to control which ends of stacked bars get rounded corners.
*/
export interface ColumnSeriesOptions extends Highcharts.SeriesColumnOptions {
top?: boolean;
bottom?: boolean;
}
interface ColumnSeries {
options: ColumnSeriesOptions;
points: ColumnPointInternal[];
}
/**
* Augment the Highcharts module with the internal `seriesTypes` registry.
*
* Highcharts source defines a `SeriesTypeRegistry` interface
* (see highcharts/ts/Core/Series/SeriesType.ts) that maps series type
* names to their constructors, but it is not included in the published
* type definitions. We re-declare it here so the `eBayColumns` extension
* can access `highcharts.seriesTypes.column.prototype` without type casts.
*/
declare module "highcharts" {
interface SeriesTypeRegistry {
column: {
prototype: ColumnSeries;
};
}
const seriesTypes: SeriesTypeRegistry;
}
/**
* Extends the Highcharts column series translate function to render
* rounded corners on bar tops/bottoms and visual gaps between stacked segments.
*
* - When `options.top` is set, the top corners are rounded.
* - When `options.bottom` is set, the bottom corners are rounded and no gap is subtracted.
* - Non-bottom bars get 4px subtracted from their height to create a visual gap.
*/
export declare function eBayColumns(highcharts: typeof Highcharts): void;
export {};
//# sourceMappingURL=bar-chart.d.ts.map