DataDimensionInfo.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. var zrUtil = require("zrender/lib/core/util");
  20. /*
  21. * Licensed to the Apache Software Foundation (ASF) under one
  22. * or more contributor license agreements. See the NOTICE file
  23. * distributed with this work for additional information
  24. * regarding copyright ownership. The ASF licenses this file
  25. * to you under the Apache License, Version 2.0 (the
  26. * "License"); you may not use this file except in compliance
  27. * with the License. You may obtain a copy of the License at
  28. *
  29. * http://www.apache.org/licenses/LICENSE-2.0
  30. *
  31. * Unless required by applicable law or agreed to in writing,
  32. * software distributed under the License is distributed on an
  33. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  34. * KIND, either express or implied. See the License for the
  35. * specific language governing permissions and limitations
  36. * under the License.
  37. */
  38. /**
  39. * @class
  40. * @param {Object|DataDimensionInfo} [opt] All of the fields will be shallow copied.
  41. */
  42. function DataDimensionInfo(opt) {
  43. if (opt != null) {
  44. zrUtil.extend(this, opt);
  45. }
  46. /**
  47. * Dimension name.
  48. * Mandatory.
  49. * @type {string}
  50. */
  51. // this.name;
  52. /**
  53. * The origin name in dimsDef, see source helper.
  54. * If displayName given, the tooltip will displayed vertically.
  55. * Optional.
  56. * @type {string}
  57. */
  58. // this.displayName;
  59. /**
  60. * Which coordSys dimension this dimension mapped to.
  61. * A `coordDim` can be a "coordSysDim" that the coordSys required
  62. * (for example, an item in `coordSysDims` of `model/referHelper#CoordSysInfo`),
  63. * or an generated "extra coord name" if does not mapped to any "coordSysDim"
  64. * (That is determined by whether `isExtraCoord` is `true`).
  65. * Mandatory.
  66. * @type {string}
  67. */
  68. // this.coordDim;
  69. /**
  70. * The index of this dimension in `series.encode[coordDim]`.
  71. * Mandatory.
  72. * @type {number}
  73. */
  74. // this.coordDimIndex;
  75. /**
  76. * Dimension type. The enumerable values are the key of
  77. * `dataCtors` of `data/List`.
  78. * Optional.
  79. * @type {string}
  80. */
  81. // this.type;
  82. /**
  83. * This index of this dimension info in `data/List#_dimensionInfos`.
  84. * Mandatory after added to `data/List`.
  85. * @type {number}
  86. */
  87. // this.index;
  88. /**
  89. * The format of `otherDims` is:
  90. * ```js
  91. * {
  92. * tooltip: number optional,
  93. * label: number optional,
  94. * itemName: number optional,
  95. * seriesName: number optional,
  96. * }
  97. * ```
  98. *
  99. * A `series.encode` can specified these fields:
  100. * ```js
  101. * encode: {
  102. * // "3, 1, 5" is the index of data dimension.
  103. * tooltip: [3, 1, 5],
  104. * label: [0, 3],
  105. * ...
  106. * }
  107. * ```
  108. * `otherDims` is the parse result of the `series.encode` above, like:
  109. * ```js
  110. * // Suppose the index of this data dimension is `3`.
  111. * this.otherDims = {
  112. * // `3` is at the index `0` of the `encode.tooltip`
  113. * tooltip: 0,
  114. * // `3` is at the index `1` of the `encode.tooltip`
  115. * label: 1
  116. * };
  117. * ```
  118. *
  119. * This prop should never be `null`/`undefined` after initialized.
  120. * @type {Object}
  121. */
  122. this.otherDims = {};
  123. /**
  124. * Be `true` if this dimension is not mapped to any "coordSysDim" that the
  125. * "coordSys" required.
  126. * Mandatory.
  127. * @type {boolean}
  128. */
  129. // this.isExtraCoord;
  130. /**
  131. * @type {module:data/OrdinalMeta}
  132. */
  133. // this.ordinalMeta;
  134. /**
  135. * Whether to create inverted indices.
  136. * @type {boolean}
  137. */
  138. // this.createInvertedIndices;
  139. }
  140. ;
  141. var _default = DataDimensionInfo;
  142. module.exports = _default;