BarSeries.js 3.9 KB

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