CustomSeries.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import { __extends } from "tslib";
  41. import createSeriesData from '../helper/createSeriesData';
  42. import { makeInner } from '../../util/model';
  43. import SeriesModel from '../../model/Series';
  44. export var TRANSFORM_PROPS = {
  45. x: 1,
  46. y: 1,
  47. scaleX: 1,
  48. scaleY: 1,
  49. originX: 1,
  50. originY: 1,
  51. rotation: 1
  52. }; // Also compat with ec4, where
  53. // `visual('color') visual('borderColor')` is supported.
  54. export var STYLE_VISUAL_TYPE = {
  55. color: 'fill',
  56. borderColor: 'stroke'
  57. };
  58. export var NON_STYLE_VISUAL_PROPS = {
  59. symbol: 1,
  60. symbolSize: 1,
  61. symbolKeepAspect: 1,
  62. legendIcon: 1,
  63. visualMeta: 1,
  64. liftZ: 1,
  65. decal: 1
  66. };
  67. ;
  68. ;
  69. export var customInnerStore = makeInner();
  70. var CustomSeriesModel =
  71. /** @class */
  72. function (_super) {
  73. __extends(CustomSeriesModel, _super);
  74. function CustomSeriesModel() {
  75. var _this = _super !== null && _super.apply(this, arguments) || this;
  76. _this.type = CustomSeriesModel.type;
  77. return _this;
  78. }
  79. CustomSeriesModel.prototype.optionUpdated = function () {
  80. this.currentZLevel = this.get('zlevel', true);
  81. this.currentZ = this.get('z', true);
  82. };
  83. CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {
  84. return createSeriesData(null, this);
  85. };
  86. CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {
  87. var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);
  88. el && (params.info = customInnerStore(el).info);
  89. return params;
  90. };
  91. CustomSeriesModel.type = 'series.custom';
  92. CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];
  93. CustomSeriesModel.defaultOption = {
  94. coordinateSystem: 'cartesian2d',
  95. zlevel: 0,
  96. z: 2,
  97. legendHoverLink: true,
  98. // Custom series will not clip by default.
  99. // Some case will use custom series to draw label
  100. // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
  101. clip: false // Cartesian coordinate system
  102. // xAxisIndex: 0,
  103. // yAxisIndex: 0,
  104. // Polar coordinate system
  105. // polarIndex: 0,
  106. // Geo coordinate system
  107. // geoIndex: 0,
  108. };
  109. return CustomSeriesModel;
  110. }(SeriesModel);
  111. export default CustomSeriesModel;