0be6b6392db73115c6437b39aaf2ec13d32f9fd76d77ed079f1a6bb08ee045f66a4b39b350e718b32ed4c2f9b4805c3531f3588658bcfe52ae91b810c4f849 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import OrdinalMeta from './OrdinalMeta.js';
  2. import { DataVisualDimensions, DimensionType } from '../util/types.js';
  3. declare class SeriesDimensionDefine {
  4. /**
  5. * Dimension type. The enumerable values are the key of
  6. * Optional.
  7. */
  8. type?: DimensionType;
  9. /**
  10. * Dimension name.
  11. * Mandatory.
  12. */
  13. name: string;
  14. /**
  15. * The origin name in dimsDef, see source helper.
  16. * If displayName given, the tooltip will displayed vertically.
  17. * Optional.
  18. */
  19. displayName?: string;
  20. tooltip?: boolean;
  21. /**
  22. * This dimension maps to the the dimension in dataStore by `storeDimIndex`.
  23. * Notice the facts:
  24. * 1. When there are too many dimensions in data store, seriesData only save the
  25. * used store dimensions.
  26. * 2. We use dimensionIndex but not name to reference store dimension
  27. * becuause the dataset dimension definition might has no name specified by users,
  28. * or names in sereis dimension definition might be different from dataset.
  29. */
  30. storeDimIndex?: number;
  31. /**
  32. * Which coordSys dimension this dimension mapped to.
  33. * A `coordDim` can be a "coordSysDim" that the coordSys required
  34. * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),
  35. * or an generated "extra coord name" if does not mapped to any "coordSysDim"
  36. * (That is determined by whether `isExtraCoord` is `true`).
  37. * Mandatory.
  38. */
  39. coordDim?: string;
  40. /**
  41. * The index of this dimension in `series.encode[coordDim]`.
  42. * Mandatory.
  43. */
  44. coordDimIndex?: number;
  45. /**
  46. * The format of `otherDims` is:
  47. * ```js
  48. * {
  49. * tooltip?: number
  50. * label?: number
  51. * itemName?: number
  52. * seriesName?: number
  53. * }
  54. * ```
  55. *
  56. * A `series.encode` can specified these fields:
  57. * ```js
  58. * encode: {
  59. * // "3, 1, 5" is the index of data dimension.
  60. * tooltip: [3, 1, 5],
  61. * label: [0, 3],
  62. * ...
  63. * }
  64. * ```
  65. * `otherDims` is the parse result of the `series.encode` above, like:
  66. * ```js
  67. * // Suppose the index of this data dimension is `3`.
  68. * this.otherDims = {
  69. * // `3` is at the index `0` of the `encode.tooltip`
  70. * tooltip: 0,
  71. * // `3` is at the index `1` of the `encode.label`
  72. * label: 1
  73. * };
  74. * ```
  75. *
  76. * This prop should never be `null`/`undefined` after initialized.
  77. */
  78. otherDims?: DataVisualDimensions;
  79. /**
  80. * Be `true` if this dimension is not mapped to any "coordSysDim" that the
  81. * "coordSys" required.
  82. * Mandatory.
  83. */
  84. isExtraCoord?: boolean;
  85. /**
  86. * If this dimension if for calculated value like stacking
  87. */
  88. isCalculationCoord?: boolean;
  89. defaultTooltip?: boolean;
  90. ordinalMeta?: OrdinalMeta;
  91. /**
  92. * Whether to create inverted indices.
  93. */
  94. createInvertedIndices?: boolean;
  95. /**
  96. * @param opt All of the fields will be shallow copied.
  97. */
  98. constructor(opt?: object | SeriesDimensionDefine);
  99. }
  100. export default SeriesDimensionDefine;