CustomSeries.js 3.6 KB

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