UNPKG

1.41 kBTypeScriptView Raw
1import View from '../chart/view';
2import { DIRECTION } from '../constant';
3import { Attribute } from '../dependents';
4import Geometry from '../geometry/base';
5import { LegendCfg, LegendItem } from '../interface';
6/**
7 * @ignore
8 * get the legend layout from direction
9 * @param direction
10 * @returns layout 'horizontal' | 'vertical'
11 */
12export declare function getLegendLayout(direction: DIRECTION): 'vertical' | 'horizontal';
13/** item of @antv/component legend */
14declare type ComponentLegendItem = Omit<LegendItem, 'marker'> & {
15 marker: any;
16};
17/**
18 * @ignore
19 * get the legend items
20 * @param view
21 * @param geometry
22 * @param attr
23 * @param themeMarker
24 * @param markerCfg
25 * @returns legend items
26 */
27export declare function getLegendItems(view: View, geometry: Geometry, attr: Attribute, themeMarker: object, userMarker: LegendCfg['marker']): ComponentLegendItem[];
28/**
29 *
30 * @ignore
31 * custom legend 的 items 获取
32 * @param themeMarker
33 * @param userMarker
34 * @param customItems
35 */
36export declare function getCustomLegendItems(themeMarker: object, userMarker: object, customItems: LegendItem[]): LegendItem[];
37/**
38 * get the legend cfg from theme, will mix the common cfg of legend theme
39 *
40 * @param theme view theme object
41 * @param direction legend direction
42 * @returns legend theme cfg
43 */
44export declare function getLegendThemeCfg(theme: object, direction: string): object;
45export {};