UNPKG

@zhouchangju/standard-chart

Version:

标准范式组件

52 lines (51 loc) 1.99 kB
import { type default as CartesianAxisView } from 'echarts/lib/component/axis/CartesianAxisView'; import { Text } from 'echarts/lib/util/graphic'; import { TextStyleProps, Rect, BoundingRect } from 'zrender'; import type { AxisElementInfos, AxisElementType } from './types'; import { Dictionary, TextCommonOption } from 'echarts/lib/util/types'; import { CartesianAxisOption } from 'echarts/lib/coord/cartesian/AxisModel'; /** * 从 view 实例获取轴标签元素 */ export declare function getAxisLabelEls(compView: CartesianAxisView): Text[]; /** * 从 view 实例获取轴标题元素 */ export declare function getAxisNameEls(compView: CartesianAxisView): Text[]; export declare const axisElementInfo: AxisElementInfos; /** * 为了坐标轴里各个部分的zr元素对应的echarts类型。 * @description 因为dvZ配置项需要根据元素所属的类型(轴标签、轴线等)设置图形元素的层级, * 但是zr元素属于视图层,没有echarts里axisLabel、axisLine的概念, * 所以需要这样一个根据zr元素id确定其类型的方法 */ export declare class AxisElementTypeDispatcher { types: AxisElementType[]; constructor(); getElementType(anid: string): AxisElementType; } interface TextStyleOption extends TextCommonOption { rich?: Dictionary<TextCommonOption>; } /** * 将ECharts的style转换为ZRender的style * 主要是针对text的属性做了转换 * @param style * @returns */ export declare function toZRenderStyle(style: TextStyleOption): TextStyleProps; /** * 预绘制axis.name,计算其实际占据的高宽 * @param axisOption * @param isXAxis * @returns */ export declare function preRenderAxisName(axisOption: CartesianAxisOption, padding?: number[]): Rect; /** * 预绘制axis.name,计算其实际占据的高宽 * @param axisOption * @param isXAxis * @returns */ export declare function getHeightOfAxisLabel(axisOption: CartesianAxisOption, text?: string): BoundingRect; export {};