constant.js 1.4 KB

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