settingConfig.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import { commonConfig, displayOption } from 'data-room-ui/js/config'
  2. import Icon from 'data-room-ui/assets/images/bigScreenIcon/export'
  3. import cloneDeep from 'lodash/cloneDeep'
  4. export const settingConfig = {
  5. padding: [10, 10, 10, 10],
  6. legend: false,
  7. isGroup: true,
  8. data: [],
  9. color: '',
  10. theme: 'dark',
  11. displayOption: {
  12. ...displayOption,
  13. params: {
  14. enable: true
  15. },
  16. dimensionField: {
  17. // 指标
  18. label: '起始节点',
  19. enable: true,
  20. multiple: false // 是否多选
  21. },
  22. metricField: {
  23. label: '目标节点', // 维度/查询字段
  24. enable: true,
  25. multiple: false // 是否多选
  26. },
  27. seriesField: {
  28. // 系列
  29. label: '权重',
  30. enable: true,
  31. multiple: false // 是否多选
  32. }
  33. }
  34. }
  35. const customConfig = {
  36. type: 'sankey',
  37. root: {
  38. version: '2023071001',
  39. contribution: false,
  40. // 绕x轴旋转角度
  41. rotateX: 0,
  42. // 绕y轴旋转角度
  43. rotateY: 0,
  44. // 绕z轴旋转角度
  45. rotateZ: 0,
  46. // 透视距离
  47. perspective: 0,
  48. skewX: 0,
  49. skewY: 0
  50. },
  51. customize: {
  52. // 自定义样式
  53. top: 20,
  54. bottom: 20,
  55. left: 20,
  56. right: 50,
  57. normal: {
  58. labelPosition: 'right',
  59. labelColor: '#fff',
  60. labelFontSize: 12,
  61. labelFontWeight: 'bold',
  62. itemBorderColor: '#aaa',
  63. itemBorderWidth: 1,
  64. itemBorderType: 'solid',
  65. lineColor: 'gradient',
  66. lineCurveness: 0.5
  67. },
  68. emphasis: {
  69. labelPosition: 'right',
  70. labelColor: '#fff',
  71. labelFontSize: 12,
  72. labelFontWeight: 'bold',
  73. itemBorderColor: '#aaa',
  74. itemBorderWidth: 1,
  75. itemBorderType: 'solid',
  76. lineColor: 'gradient',
  77. lineCurveness: 0.5
  78. }
  79. }
  80. }
  81. export const dataConfig = {
  82. ...commonConfig(customConfig)
  83. }
  84. export const sankeyData = {
  85. name: '桑基图',
  86. title: '桑基图',
  87. icon: Icon.getNameList()[35],
  88. border: { type: '', titleHeight: 60, fontSize: 16, isTitle: true, padding: [0, 0, 0, 0] },
  89. className:
  90. 'com.gccloud.dataroom.core.module.chart.components.ScreenCandlestickChart',
  91. w: 450,
  92. h: 320,
  93. x: 0,
  94. y: 0,
  95. type: 'sankey',
  96. option: {
  97. ...cloneDeep(settingConfig)
  98. },
  99. setting: undefined, // 右侧面板自定义配置
  100. dataHandler: {}, // 数据自定义处理js脚本
  101. ...cloneDeep(dataConfig)
  102. }