9c6b15c11f8963eb5061d6027eef4c73efacb25aa7b9e10ba046252aa50ef53a73035d785f59add1ac33d3c58926927d0961afb7206c0c67e6f07cd82c4401 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import BoundingRect, { RectLike } from 'zrender/lib/core/BoundingRect.js';
  2. import { BrushType } from '../helper/BrushController.js';
  3. import { BrushAreaParamInternal } from './BrushModel.js';
  4. export interface BrushSelectableArea extends BrushAreaParamInternal {
  5. boundingRect: BoundingRect;
  6. selectors: BrushCommonSelectorsForSeries;
  7. }
  8. /**
  9. * Key of the first level is brushType: `line`, `rect`, `polygon`.
  10. * See moudule:echarts/component/helper/BrushController
  11. * function param:
  12. * {Object} itemLayout fetch from data.getItemLayout(dataIndex)
  13. * {Object} selectors {point: selector, rect: selector, ...}
  14. * {Object} area {range: [[], [], ..], boudingRect}
  15. * function return:
  16. * {boolean} Whether in the given brush.
  17. */
  18. interface BrushSelectorOnBrushType {
  19. point(itemLayout: number[], selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean;
  20. rect(itemLayout: RectLike, selectors: BrushCommonSelectorsForSeries, area: BrushSelectableArea): boolean;
  21. }
  22. /**
  23. * This methods are corresponding to `BrushSelectorOnBrushType`,
  24. * but `area: BrushSelectableArea` is binded to each method.
  25. */
  26. export interface BrushCommonSelectorsForSeries {
  27. point(itemLayout: number[]): boolean;
  28. rect(itemLayout: RectLike): boolean;
  29. }
  30. export declare function makeBrushCommonSelectorForSeries(area: BrushSelectableArea): BrushCommonSelectorsForSeries;
  31. declare const selector: Record<BrushType, BrushSelectorOnBrushType>;
  32. export default selector;