constant.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // 一些字段常量定义,需要在文档初告知用户
  2. export var ID_FIELD = 'id';
  3. export var PATH_FIELD = 'path';
  4. /**
  5. * 韦恩图 默认配置项
  6. */
  7. export var DEFAULT_OPTIONS = {
  8. appendPadding: [10, 0, 20, 0],
  9. blendMode: 'multiply',
  10. tooltip: {
  11. showTitle: false,
  12. showMarkers: false,
  13. fields: ['id', 'size'],
  14. formatter: function (datum) {
  15. return { name: datum.id, value: datum.size };
  16. },
  17. },
  18. legend: { position: 'top-left' },
  19. label: {
  20. style: {
  21. textAlign: 'center',
  22. fill: '#fff',
  23. },
  24. },
  25. // 默认不开启 图例筛选交互
  26. interactions: [{ type: 'legend-filter', enable: false }],
  27. state: {
  28. active: {
  29. style: {
  30. stroke: '#000',
  31. },
  32. },
  33. selected: {
  34. style: {
  35. stroke: '#000',
  36. lineWidth: 2,
  37. },
  38. },
  39. inactive: {
  40. style: {
  41. fillOpacity: 0.3,
  42. strokeOpacity: 0.3,
  43. },
  44. },
  45. },
  46. // 韦恩图的默认内置注册的交互
  47. defaultInteractions: ['tooltip', 'venn-legend-active'],
  48. };
  49. //# sourceMappingURL=constant.js.map