TooltipModel.js 4.3 KB

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