31d608ae3e84506258d2bae65c2fb7cc5e232f86f8756940e5e030715a0b8d671912a981d640d76deb59d331b1120877dafd9ff55c759fe2914c70045b543d 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import BarSeriesModel from '../chart/bar/BarSeries.js';
  2. import Axis2D from '../coord/cartesian/Axis2D.js';
  3. import GlobalModel from '../model/Global.js';
  4. import { StageHandler, Dictionary } from '../util/types.js';
  5. /**
  6. * {
  7. * [coordSysId]: {
  8. * [stackId]: {bandWidth, offset, width}
  9. * }
  10. * }
  11. */
  12. declare type BarWidthAndOffset = Dictionary<Dictionary<{
  13. bandWidth: number;
  14. offset: number;
  15. offsetCenter: number;
  16. width: number;
  17. }>>;
  18. export interface BarGridLayoutOptionForCustomSeries {
  19. count: number;
  20. barWidth?: number | string;
  21. barMaxWidth?: number | string;
  22. barMinWidth?: number | string;
  23. barGap?: number | string;
  24. barCategoryGap?: number | string;
  25. }
  26. interface LayoutOption extends BarGridLayoutOptionForCustomSeries {
  27. axis: Axis2D;
  28. }
  29. export declare type BarGridLayoutResult = BarWidthAndOffset[string][string][];
  30. /**
  31. * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.
  32. */
  33. export declare function getLayoutOnAxis(opt: LayoutOption): BarGridLayoutResult;
  34. export declare function prepareLayoutBarSeries(seriesType: string, ecModel: GlobalModel): BarSeriesModel[];
  35. export declare function makeColumnLayout(barSeries: BarSeriesModel[]): BarWidthAndOffset;
  36. /**
  37. * @param barWidthAndOffset The result of makeColumnLayout
  38. * @param seriesModel If not provided, return all.
  39. * @return {stackId: {offset, width}} or {offset, width} if seriesModel provided.
  40. */
  41. declare function retrieveColumnLayout(barWidthAndOffset: BarWidthAndOffset, axis: Axis2D): typeof barWidthAndOffset[string];
  42. declare function retrieveColumnLayout(barWidthAndOffset: BarWidthAndOffset, axis: Axis2D, seriesModel: BarSeriesModel): typeof barWidthAndOffset[string][string];
  43. export { retrieveColumnLayout };
  44. export declare function layout(seriesType: string, ecModel: GlobalModel): void;
  45. export declare function createProgressiveLayout(seriesType: string): StageHandler;