option.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import { Axis } from '../../../types/axis';
  2. import { AxisType, DualAxesOptions, GeometryColumnOption, GeometryLineOption, GeometryOption } from '../types';
  3. /**
  4. * 根据 GeometryOption 判断 geometry 是否为 line
  5. */
  6. export declare function isLine(geometryOption: GeometryOption): geometryOption is GeometryLineOption;
  7. /**
  8. * 根据 GeometryOption 判断 geometry 是否为 Column
  9. */
  10. export declare function isColumn(geometryOption: GeometryOption): geometryOption is GeometryColumnOption;
  11. /**
  12. * 获取 GeometryOption
  13. * @param geometryOption
  14. * @param axis
  15. */
  16. export declare function getGeometryOption(xField: string, yField: string, geometryOption: GeometryOption): GeometryOption;
  17. /**
  18. * 兼容一些属性 为 arr 和 obj 的两种情况, 如 yAxis,annotations
  19. * 为了防止左右 yField 相同,导致变成 object 之后被覆盖,所以都转变成数组的形式
  20. * @param yField
  21. * @param transformAttribute
  22. */
  23. export declare function transformObjectToArray(yField: DualAxesOptions['yField'], transformAttribute: Record<string, any> | any[]): any[];
  24. /**
  25. * 获取默认值
  26. * @param yAxis
  27. * @param axisType
  28. */
  29. export declare function getYAxisWithDefault(yAxis: Axis, axisType: AxisType): Axis;