constants.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. var _a;
  2. export var RANGE_VALUE = 'range';
  3. export var RANGE_TYPE = 'type';
  4. export var PERCENT = 'percent';
  5. export var DEFAULT_COLOR = '#f0f0f0';
  6. /** 仪表盘由 指针和表盘 组成 */
  7. export var INDICATEOR_VIEW_ID = 'indicator-view';
  8. export var RANGE_VIEW_ID = 'range-view';
  9. /**
  10. * 仪表盘默认配置项
  11. */
  12. export var DEFAULT_OPTIONS = {
  13. percent: 0,
  14. range: {
  15. ticks: [],
  16. },
  17. innerRadius: 0.9,
  18. radius: 0.95,
  19. startAngle: (-7 / 6) * Math.PI,
  20. endAngle: (1 / 6) * Math.PI,
  21. syncViewPadding: true,
  22. axis: {
  23. line: null,
  24. label: {
  25. offset: -24,
  26. style: {
  27. textAlign: 'center',
  28. textBaseline: 'middle',
  29. },
  30. },
  31. subTickLine: {
  32. length: -8,
  33. },
  34. tickLine: {
  35. length: -12,
  36. },
  37. grid: null,
  38. },
  39. indicator: {
  40. pointer: {
  41. style: {
  42. lineWidth: 5,
  43. lineCap: 'round',
  44. },
  45. },
  46. pin: {
  47. style: {
  48. r: 9.75,
  49. lineWidth: 4.5,
  50. fill: '#fff',
  51. },
  52. },
  53. },
  54. statistic: {
  55. title: false,
  56. },
  57. meta: (_a = {},
  58. // 两个 view 的 scale 同步到 v 上
  59. _a[RANGE_VALUE] = {
  60. sync: 'v',
  61. },
  62. _a[PERCENT] = {
  63. sync: 'v',
  64. tickCount: 5,
  65. tickInterval: 0.2,
  66. },
  67. _a),
  68. animation: false,
  69. };
  70. //# sourceMappingURL=constants.js.map