SliderTimelineModel.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var zrUtil = require("zrender/lib/core/util");
  2. var TimelineModel = require("./TimelineModel");
  3. var modelUtil = require("../../util/model");
  4. var SliderTimelineModel = TimelineModel.extend({
  5. type: 'timeline.slider',
  6. /**
  7. * @protected
  8. */
  9. defaultOption: {
  10. backgroundColor: 'rgba(0,0,0,0)',
  11. // 时间轴背景颜色
  12. borderColor: '#ccc',
  13. // 时间轴边框颜色
  14. borderWidth: 0,
  15. // 时间轴边框线宽,单位px,默认为0(无边框)
  16. orient: 'horizontal',
  17. // 'vertical'
  18. inverse: false,
  19. tooltip: {
  20. // boolean or Object
  21. trigger: 'item' // data item may also have tootip attr.
  22. },
  23. symbol: 'emptyCircle',
  24. symbolSize: 10,
  25. lineStyle: {
  26. show: true,
  27. width: 2,
  28. color: '#304654'
  29. },
  30. label: {
  31. // 文本标签
  32. position: 'auto',
  33. // auto left right top bottom
  34. // When using number, label position is not
  35. // restricted by viewRect.
  36. // positive: right/bottom, negative: left/top
  37. normal: {
  38. show: true,
  39. interval: 'auto',
  40. rotate: 0,
  41. // formatter: null,
  42. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  43. color: '#304654'
  44. },
  45. emphasis: {
  46. show: true,
  47. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  48. color: '#c23531'
  49. }
  50. },
  51. itemStyle: {
  52. normal: {
  53. color: '#304654',
  54. borderWidth: 1
  55. },
  56. emphasis: {
  57. color: '#c23531'
  58. }
  59. },
  60. checkpointStyle: {
  61. symbol: 'circle',
  62. symbolSize: 13,
  63. color: '#c23531',
  64. borderWidth: 5,
  65. borderColor: 'rgba(194,53,49, 0.5)',
  66. animation: true,
  67. animationDuration: 300,
  68. animationEasing: 'quinticInOut'
  69. },
  70. controlStyle: {
  71. show: true,
  72. showPlayBtn: true,
  73. showPrevBtn: true,
  74. showNextBtn: true,
  75. itemSize: 22,
  76. itemGap: 12,
  77. position: 'left',
  78. // 'left' 'right' 'top' 'bottom'
  79. playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z',
  80. // jshint ignore:line
  81. stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',
  82. // jshint ignore:line
  83. nextIcon: 'path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z',
  84. // jshint ignore:line
  85. prevIcon: 'path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z',
  86. // jshint ignore:line
  87. normal: {
  88. color: '#304654',
  89. borderColor: '#304654',
  90. borderWidth: 1
  91. },
  92. emphasis: {
  93. color: '#c23531',
  94. borderColor: '#c23531',
  95. borderWidth: 2
  96. }
  97. },
  98. data: []
  99. }
  100. });
  101. zrUtil.mixin(SliderTimelineModel, modelUtil.dataFormatMixin);
  102. var _default = SliderTimelineModel;
  103. module.exports = _default;