b98c34e2b02d37febca2404db67f8cd31fc6f84ff0f375f3d5f4f65cddf1577e062213d806b5b2eae574f2274f6a8925bbe47fc62ae7d27715f39c61cd7b11 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import Scale from '../scale/Scale.js';
  2. import BoundingRect from 'zrender/lib/core/BoundingRect.js';
  3. import Model from '../model/Model.js';
  4. import { AxisBaseModel } from './AxisBaseModel.js';
  5. import Axis from './Axis.js';
  6. import { AxisBaseOption } from './axisCommonTypes.js';
  7. import SeriesData from '../data/SeriesData.js';
  8. import { DimensionName, ScaleTick } from '../util/types.js';
  9. /**
  10. * Get axis scale extent before niced.
  11. * Item of returned array can only be number (including Infinity and NaN).
  12. *
  13. * Caution:
  14. * Precondition of calling this method:
  15. * The scale extent has been initialized using series data extent via
  16. * `scale.setExtent` or `scale.unionExtentFromData`;
  17. */
  18. export declare function getScaleExtent(scale: Scale, model: AxisBaseModel): {
  19. extent: number[];
  20. fixMin: boolean;
  21. fixMax: boolean;
  22. };
  23. export declare function niceScaleExtent(scale: Scale, inModel: AxisBaseModel): void;
  24. /**
  25. * @param axisType Default retrieve from model.type
  26. */
  27. export declare function createScaleByModel(model: AxisBaseModel, axisType?: string): Scale;
  28. /**
  29. * Check if the axis cross 0
  30. */
  31. export declare function ifAxisCrossZero(axis: Axis): boolean;
  32. /**
  33. * @param axis
  34. * @return Label formatter function.
  35. * param: {number} tickValue,
  36. * param: {number} idx, the index in all ticks.
  37. * If category axis, this param is not required.
  38. * return: {string} label string.
  39. */
  40. export declare function makeLabelFormatter(axis: Axis): (tick: ScaleTick, idx?: number) => string;
  41. export declare function getAxisRawValue(axis: Axis, tick: ScaleTick): number | string;
  42. /**
  43. * @param axis
  44. * @return Be null/undefined if no labels.
  45. */
  46. export declare function estimateLabelUnionRect(axis: Axis): BoundingRect;
  47. /**
  48. * @param model axisLabelModel or axisTickModel
  49. * @return {number|String} Can be null|'auto'|number|function
  50. */
  51. export declare function getOptionCategoryInterval(model: Model<AxisBaseOption['axisLabel']>): number | "auto" | ((index: number, value: string) => boolean);
  52. /**
  53. * Set `categoryInterval` as 0 implicitly indicates that
  54. * show all labels reguardless of overlap.
  55. * @param {Object} axis axisModel.axis
  56. */
  57. export declare function shouldShowAllLabels(axis: Axis): boolean;
  58. export declare function getDataDimensionsOnAxis(data: SeriesData, axisDim: string): DimensionName[];
  59. export declare function unionAxisExtentFromData(dataExtent: number[], data: SeriesData, axisDim: string): void;