TooltipModel.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 ComponentModel from '../../model/Component.js';
  42. var TooltipModel = /** @class */function (_super) {
  43. __extends(TooltipModel, _super);
  44. function TooltipModel() {
  45. var _this = _super !== null && _super.apply(this, arguments) || this;
  46. _this.type = TooltipModel.type;
  47. return _this;
  48. }
  49. TooltipModel.type = 'tooltip';
  50. TooltipModel.dependencies = ['axisPointer'];
  51. TooltipModel.defaultOption = {
  52. // zlevel: 0,
  53. z: 60,
  54. show: true,
  55. // tooltip main content
  56. showContent: true,
  57. // 'trigger' only works on coordinate system.
  58. // 'item' | 'axis' | 'none'
  59. trigger: 'item',
  60. // 'click' | 'mousemove' | 'none'
  61. triggerOn: 'mousemove|click',
  62. alwaysShowContent: false,
  63. displayMode: 'single',
  64. renderMode: 'auto',
  65. // whether restraint content inside viewRect.
  66. // If renderMode: 'richText', default true.
  67. // If renderMode: 'html', defaut false (for backward compat).
  68. confine: null,
  69. showDelay: 0,
  70. hideDelay: 100,
  71. // Animation transition time, unit is second
  72. transitionDuration: 0.4,
  73. enterable: false,
  74. backgroundColor: '#fff',
  75. // box shadow
  76. shadowBlur: 10,
  77. shadowColor: 'rgba(0, 0, 0, .2)',
  78. shadowOffsetX: 1,
  79. shadowOffsetY: 2,
  80. // tooltip border radius, unit is px, default is 4
  81. borderRadius: 4,
  82. // tooltip border width, unit is px, default is 0 (no border)
  83. borderWidth: 1,
  84. // Tooltip inside padding, default is 5 for all direction
  85. // Array is allowed to set up, right, bottom, left, same with css
  86. // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
  87. padding: null,
  88. // Extra css text
  89. extraCssText: '',
  90. // axis indicator, trigger by axis
  91. axisPointer: {
  92. // default is line
  93. // legal values: 'line' | 'shadow' | 'cross'
  94. type: 'line',
  95. // Valid when type is line, appoint tooltip line locate on which line. Optional
  96. // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
  97. // default is 'auto', chose the axis which type is category.
  98. // for multiply y axis, cartesian coord chose x axis, polar chose angle axis
  99. axis: 'auto',
  100. animation: 'auto',
  101. animationDurationUpdate: 200,
  102. animationEasingUpdate: 'exponentialOut',
  103. crossStyle: {
  104. color: '#999',
  105. width: 1,
  106. type: 'dashed',
  107. // TODO formatter
  108. textStyle: {}
  109. }
  110. // lineStyle and shadowStyle should not be specified here,
  111. // otherwise it will always override those styles on option.axisPointer.
  112. },
  113. textStyle: {
  114. color: '#666',
  115. fontSize: 14
  116. }
  117. };
  118. return TooltipModel;
  119. }(ComponentModel);
  120. export default TooltipModel;