ScatterSeries.js 4.0 KB

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