mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 11:14:12 +01:00
Added setLink and setClickEvent to gantt
This commit is contained in:
@@ -126,6 +126,7 @@ export const draw = function (text, id) {
|
||||
.enter()
|
||||
|
||||
rectangles.append('rect')
|
||||
.attr('id', function (d) { return d.id })
|
||||
.attr('rx', 3)
|
||||
.attr('ry', 3)
|
||||
.attr('x', function (d) {
|
||||
@@ -171,7 +172,12 @@ export const draw = function (text, id) {
|
||||
return res + ' task' + secNum
|
||||
})
|
||||
|
||||
rectangles.append('text')
|
||||
rectangles.append('a').attr('href', function (d) {
|
||||
/* All rectangles are clickable. If d.link is not specified, '' is returned */
|
||||
return d.link
|
||||
})
|
||||
.attr('id', function (d) { return d.id + '-text' })
|
||||
.append('text')
|
||||
.text(function (d) {
|
||||
return d.task
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user