constant.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { deepMix } from '@antv/util';
  2. import { Path } from '../../shapes';
  3. import { classNames } from '../../util';
  4. export var AXIS_BASE_DEFAULT_ATTR = {
  5. data: [],
  6. animate: {
  7. enter: false,
  8. update: {
  9. duration: 100,
  10. easing: 'ease-in-out-sine',
  11. fill: 'both',
  12. },
  13. exit: {
  14. duration: 100,
  15. fill: 'both',
  16. },
  17. },
  18. showArrow: true,
  19. showGrid: true,
  20. showLabel: true,
  21. showLine: true,
  22. showTick: true,
  23. showTitle: true,
  24. showTrunc: false,
  25. dataThreshold: 100,
  26. lineLineWidth: 1,
  27. lineStroke: 'black',
  28. crossPadding: 10,
  29. titleFill: 'black',
  30. titleFontSize: 12,
  31. titlePosition: 'lb',
  32. titleSpacing: 0,
  33. titleTextAlign: 'center',
  34. titleTextBaseline: 'middle',
  35. lineArrow: function () {
  36. return new Path({
  37. style: {
  38. path: [['M', 10, 10], ['L', -10, 0], ['L', 10, -10], ['L', 0, 0], ['L', 10, 10], ['Z']],
  39. anchor: '0.5 0.5',
  40. fill: 'black',
  41. transformOrigin: 'center',
  42. },
  43. });
  44. },
  45. labelAlign: 'parallel',
  46. labelDirection: 'positive',
  47. labelFontSize: 12,
  48. labelSpacing: 0,
  49. gridConnect: 'line',
  50. gridControlAngles: [],
  51. gridDirection: 'positive',
  52. gridLength: 0,
  53. gridType: 'segment',
  54. lineArrowOffset: 15,
  55. lineArrowSize: 10,
  56. tickDirection: 'positive',
  57. tickLength: 5,
  58. tickLineWidth: 1,
  59. tickStroke: 'black',
  60. tickStrokeOpacity: 0.65,
  61. labelOverlap: [
  62. // { type: 'rotate', optionalAngles: [0, 45, 90] },
  63. // { type: 'ellipsis', suffix: '...', minLength: 14, maxLength: 160 },
  64. // { type: 'hide' },
  65. ],
  66. };
  67. export var ARC_DEFAULT_OPTIONS = deepMix({}, AXIS_BASE_DEFAULT_ATTR, {
  68. style: {
  69. type: 'arc',
  70. },
  71. });
  72. export var HELIX_DEFAULT_OPTIONS = deepMix({}, AXIS_BASE_DEFAULT_ATTR, {
  73. style: {},
  74. });
  75. export var CLASS_NAMES = classNames({
  76. mainGroup: 'main-group',
  77. gridGroup: 'grid-group',
  78. grid: 'grid',
  79. lineGroup: 'line-group',
  80. line: 'line',
  81. tickGroup: 'tick-group',
  82. tick: 'tick',
  83. tickItem: 'tick-item',
  84. labelGroup: 'label-group',
  85. label: 'label',
  86. labelItem: 'label-item',
  87. titleGroup: 'title-group',
  88. title: 'title',
  89. lineFirst: 'line-first',
  90. lineSecond: 'line-second',
  91. }, 'axis');
  92. //# sourceMappingURL=constant.js.map