3cb3f7fbdc7c5893e3bd24175fea46611606851e460d9984d61629481d8739f4d44b0473ed2028a9898b9f7452cbd44ab8df7a9fc61b3cc62526dfb9186c84 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import GlobalModel from '../../model/Global.js';
  2. import ExtensionAPI from '../../core/ExtensionAPI.js';
  3. import { Payload, CommonAxisPointerOption } from '../../util/types.js';
  4. import { AxisPointerOption } from './AxisPointerModel.js';
  5. declare type AxisValue = CommonAxisPointerOption['value'];
  6. interface DataIndex {
  7. seriesIndex: number;
  8. dataIndex: number;
  9. dataIndexInside: number;
  10. }
  11. export interface DataByAxis {
  12. value: string | number;
  13. axisIndex: number;
  14. axisDim: string;
  15. axisType: string;
  16. axisId: string;
  17. seriesDataIndices: DataIndex[];
  18. valueLabelOpt: {
  19. precision: AxisPointerOption['label']['precision'];
  20. formatter: AxisPointerOption['label']['formatter'];
  21. };
  22. }
  23. export interface DataByCoordSys {
  24. coordSysId: string;
  25. coordSysIndex: number;
  26. coordSysType: string;
  27. coordSysMainType: string;
  28. dataByAxis: DataByAxis[];
  29. }
  30. interface AxisTriggerPayload extends Payload {
  31. currTrigger?: 'click' | 'mousemove' | 'leave';
  32. /**
  33. * x and y, which are mandatory, specify a point to trigger axisPointer and tooltip.
  34. */
  35. x?: number;
  36. /**
  37. * x and y, which are mandatory, specify a point to trigger axisPointer and tooltip.
  38. */
  39. y?: number;
  40. /**
  41. * finder, optional, restrict target axes.
  42. */
  43. seriesIndex?: number;
  44. dataIndex: number;
  45. axesInfo?: {
  46. axisDim?: string;
  47. axisIndex?: number;
  48. value?: AxisValue;
  49. }[];
  50. dispatchAction: ExtensionAPI['dispatchAction'];
  51. }
  52. /**
  53. * Basic logic: check all axis, if they do not demand show/highlight,
  54. * then hide/downplay them.
  55. *
  56. * @return content of event obj for echarts.connect.
  57. */
  58. export default function axisTrigger(payload: AxisTriggerPayload, ecModel: GlobalModel, api: ExtensionAPI): AxisTriggerPayload;
  59. export {};