CustomSeries.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.js';
  42. import { makeInner } from '../../util/model.js';
  43. import SeriesModel from '../../model/Series.js';
  44. // Also compat with ec4, where
  45. // `visual('color') visual('borderColor')` is supported.
  46. export var STYLE_VISUAL_TYPE = {
  47. color: 'fill',
  48. borderColor: 'stroke'
  49. };
  50. export var NON_STYLE_VISUAL_PROPS = {
  51. symbol: 1,
  52. symbolSize: 1,
  53. symbolKeepAspect: 1,
  54. legendIcon: 1,
  55. visualMeta: 1,
  56. liftZ: 1,
  57. decal: 1
  58. };
  59. ;
  60. export var customInnerStore = makeInner();
  61. var CustomSeriesModel = /** @class */function (_super) {
  62. __extends(CustomSeriesModel, _super);
  63. function CustomSeriesModel() {
  64. var _this = _super !== null && _super.apply(this, arguments) || this;
  65. _this.type = CustomSeriesModel.type;
  66. return _this;
  67. }
  68. CustomSeriesModel.prototype.optionUpdated = function () {
  69. this.currentZLevel = this.get('zlevel', true);
  70. this.currentZ = this.get('z', true);
  71. };
  72. CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {
  73. return createSeriesData(null, this);
  74. };
  75. CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {
  76. var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);
  77. el && (params.info = customInnerStore(el).info);
  78. return params;
  79. };
  80. CustomSeriesModel.type = 'series.custom';
  81. CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];
  82. CustomSeriesModel.defaultOption = {
  83. coordinateSystem: 'cartesian2d',
  84. // zlevel: 0,
  85. z: 2,
  86. legendHoverLink: true,
  87. // Custom series will not clip by default.
  88. // Some case will use custom series to draw label
  89. // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
  90. clip: false
  91. // Cartesian coordinate system
  92. // xAxisIndex: 0,
  93. // yAxisIndex: 0,
  94. // Polar coordinate system
  95. // polarIndex: 0,
  96. // Geo coordinate system
  97. // geoIndex: 0,
  98. };
  99. return CustomSeriesModel;
  100. }(SeriesModel);
  101. export default CustomSeriesModel;