ScatterSeries.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 SeriesModel from '../../model/Series.js';
  43. var ScatterSeriesModel = /** @class */function (_super) {
  44. __extends(ScatterSeriesModel, _super);
  45. function ScatterSeriesModel() {
  46. var _this = _super !== null && _super.apply(this, arguments) || this;
  47. _this.type = ScatterSeriesModel.type;
  48. _this.hasSymbolVisual = true;
  49. return _this;
  50. }
  51. ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {
  52. return createSeriesData(null, this, {
  53. useEncodeDefaulter: true
  54. });
  55. };
  56. ScatterSeriesModel.prototype.getProgressive = function () {
  57. var progressive = this.option.progressive;
  58. if (progressive == null) {
  59. // PENDING
  60. return this.option.large ? 5e3 : this.get('progressive');
  61. }
  62. return progressive;
  63. };
  64. ScatterSeriesModel.prototype.getProgressiveThreshold = function () {
  65. var progressiveThreshold = this.option.progressiveThreshold;
  66. if (progressiveThreshold == null) {
  67. // PENDING
  68. return this.option.large ? 1e4 : this.get('progressiveThreshold');
  69. }
  70. return progressiveThreshold;
  71. };
  72. ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {
  73. return selectors.point(data.getItemLayout(dataIndex));
  74. };
  75. ScatterSeriesModel.prototype.getZLevelKey = function () {
  76. // Each progressive series has individual key.
  77. return this.getData().count() > this.getProgressiveThreshold() ? this.id : '';
  78. };
  79. ScatterSeriesModel.type = 'series.scatter';
  80. ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];
  81. ScatterSeriesModel.defaultOption = {
  82. coordinateSystem: 'cartesian2d',
  83. // zlevel: 0,
  84. z: 2,
  85. legendHoverLink: true,
  86. symbolSize: 10,
  87. // symbolRotate: null, // 图形旋转控制
  88. large: false,
  89. // Available when large is true
  90. largeThreshold: 2000,
  91. // cursor: null,
  92. itemStyle: {
  93. opacity: 0.8
  94. // color: 各异
  95. },
  96. emphasis: {
  97. scale: true
  98. },
  99. // If clip the overflow graphics
  100. // Works on cartesian / polar series
  101. clip: true,
  102. select: {
  103. itemStyle: {
  104. borderColor: '#212121'
  105. }
  106. },
  107. universalTransition: {
  108. divideShape: 'clone'
  109. }
  110. // progressive: null
  111. };
  112. return ScatterSeriesModel;
  113. }(SeriesModel);
  114. export default ScatterSeriesModel;