Feat:主题配置支持设置关联线的样式,即实线或虚线

This commit is contained in:
街角小林 2024-08-12 13:36:14 +08:00
parent 182cdf5153
commit 3801dc3ec4
2 changed files with 11 additions and 5 deletions

View File

@ -213,7 +213,8 @@ class AssociativeLine {
associativeLineWidth,
associativeLineColor,
associativeLineActiveWidth,
associativeLineActiveColor
associativeLineActiveColor,
associativeLineDasharray
} = this.mindMap.themeConfig
// 箭头
this.markerPath
@ -232,7 +233,7 @@ class AssociativeLine {
.stroke({
width: associativeLineWidth,
color: associativeLineColor,
dasharray: [6, 4]
dasharray: associativeLineDasharray || [6, 4]
})
.fill({ color: 'none' })
path.plot(pathStr)
@ -331,8 +332,11 @@ class AssociativeLine {
// 创建连接线
createLine(fromNode) {
let { associativeLineWidth, associativeLineColor } =
this.mindMap.themeConfig
let {
associativeLineWidth,
associativeLineColor,
associativeLineDasharray
} = this.mindMap.themeConfig
if (this.isCreatingLine || !fromNode) return
this.front()
this.isCreatingLine = true
@ -342,7 +346,7 @@ class AssociativeLine {
.stroke({
width: associativeLineWidth,
color: associativeLineColor,
dasharray: [6, 4]
dasharray: associativeLineDasharray || [6, 4]
})
.fill({ color: 'none' })
// 箭头

View File

@ -42,6 +42,8 @@ export default {
associativeLineActiveWidth: 8,
// 关联线激活状态的颜色
associativeLineActiveColor: 'rgba(2, 167, 240, 1)',
// 关联线样式
associativeLineDasharray: [6, 4],
// 关联线文字颜色
associativeLineTextColor: 'rgb(51, 51, 51)',
// 关联线文字大小