BarSeries.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 BaseBarSeriesModel from './BaseBarSeries.js';
  42. import createSeriesData from '../helper/createSeriesData.js';
  43. import { inheritDefaultOption } from '../../util/component.js';
  44. import tokens from '../../visual/tokens.js';
  45. var BarSeriesModel = /** @class */function (_super) {
  46. __extends(BarSeriesModel, _super);
  47. function BarSeriesModel() {
  48. var _this = _super !== null && _super.apply(this, arguments) || this;
  49. _this.type = BarSeriesModel.type;
  50. return _this;
  51. }
  52. BarSeriesModel.prototype.getInitialData = function () {
  53. return createSeriesData(null, this, {
  54. useEncodeDefaulter: true,
  55. createInvertedIndices: !!this.get('realtimeSort', true) || null
  56. });
  57. };
  58. /**
  59. * @override
  60. */
  61. BarSeriesModel.prototype.getProgressive = function () {
  62. // Do not support progressive in normal mode.
  63. return this.get('large') ? this.get('progressive') : false;
  64. };
  65. /**
  66. * @override
  67. */
  68. BarSeriesModel.prototype.getProgressiveThreshold = function () {
  69. // Do not support progressive in normal mode.
  70. var progressiveThreshold = this.get('progressiveThreshold');
  71. var largeThreshold = this.get('largeThreshold');
  72. if (largeThreshold > progressiveThreshold) {
  73. progressiveThreshold = largeThreshold;
  74. }
  75. return progressiveThreshold;
  76. };
  77. BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {
  78. return selectors.rect(data.getItemLayout(dataIndex));
  79. };
  80. BarSeriesModel.type = 'series.bar';
  81. BarSeriesModel.dependencies = ['grid', 'polar'];
  82. BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {
  83. // If clipped
  84. // Only available on cartesian2d
  85. clip: true,
  86. roundCap: false,
  87. showBackground: false,
  88. backgroundStyle: {
  89. color: 'rgba(180, 180, 180, 0.2)',
  90. borderColor: null,
  91. borderWidth: 0,
  92. borderType: 'solid',
  93. borderRadius: 0,
  94. shadowBlur: 0,
  95. shadowColor: null,
  96. shadowOffsetX: 0,
  97. shadowOffsetY: 0,
  98. opacity: 1
  99. },
  100. select: {
  101. itemStyle: {
  102. borderColor: tokens.color.primary,
  103. borderWidth: 2
  104. }
  105. },
  106. realtimeSort: false
  107. });
  108. return BarSeriesModel;
  109. }(BaseBarSeriesModel);
  110. export default BarSeriesModel;