ToolboxModel.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 * as zrUtil from 'zrender/lib/core/util.js';
  42. import * as featureManager from './featureManager.js';
  43. import ComponentModel from '../../model/Component.js';
  44. var ToolboxModel =
  45. /** @class */
  46. function (_super) {
  47. __extends(ToolboxModel, _super);
  48. function ToolboxModel() {
  49. var _this = _super !== null && _super.apply(this, arguments) || this;
  50. _this.type = ToolboxModel.type;
  51. return _this;
  52. }
  53. ToolboxModel.prototype.optionUpdated = function () {
  54. _super.prototype.optionUpdated.apply(this, arguments);
  55. var ecModel = this.ecModel;
  56. zrUtil.each(this.option.feature, function (featureOpt, featureName) {
  57. var Feature = featureManager.getFeature(featureName);
  58. if (Feature) {
  59. if (Feature.getDefaultOption) {
  60. Feature.defaultOption = Feature.getDefaultOption(ecModel);
  61. }
  62. zrUtil.merge(featureOpt, Feature.defaultOption);
  63. }
  64. });
  65. };
  66. ToolboxModel.type = 'toolbox';
  67. ToolboxModel.layoutMode = {
  68. type: 'box',
  69. ignoreSize: true
  70. };
  71. ToolboxModel.defaultOption = {
  72. show: true,
  73. z: 6,
  74. // zlevel: 0,
  75. orient: 'horizontal',
  76. left: 'right',
  77. top: 'top',
  78. // right
  79. // bottom
  80. backgroundColor: 'transparent',
  81. borderColor: '#ccc',
  82. borderRadius: 0,
  83. borderWidth: 0,
  84. padding: 5,
  85. itemSize: 15,
  86. itemGap: 8,
  87. showTitle: true,
  88. iconStyle: {
  89. borderColor: '#666',
  90. color: 'none'
  91. },
  92. emphasis: {
  93. iconStyle: {
  94. borderColor: '#3E98C5'
  95. }
  96. },
  97. // textStyle: {},
  98. // feature
  99. tooltip: {
  100. show: false,
  101. position: 'bottom'
  102. }
  103. };
  104. return ToolboxModel;
  105. }(ComponentModel);
  106. export default ToolboxModel;