Skip to content

Commit 5ac4a06

Browse files
authored
linkTools, elementTools: add HoverConnect tool (#1763)
1 parent f884fc8 commit 5ac4a06

File tree

14 files changed

+638
-34
lines changed

14 files changed

+638
-34
lines changed

demo/sequence/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@
66
<title>Sequence Diagram</title>
77

88
<link rel="stylesheet" type="text/css" href="../../build/joint.css" />
9+
<style>
10+
.available-cell.joint-type-sd-message [joint-selector="wrapper"] {
11+
stroke-width: 26;
12+
}
13+
.available-cell.joint-type-sd-lifeline [joint-selector="wrapper"] {
14+
stroke-width: 100;
15+
}
16+
.available-cell [joint-selector="line"] {
17+
stroke: #08BC8A;
18+
stroke-width: 5;
19+
stroke-dasharray: none;
20+
}
21+
22+
.available-cell.highlighted-connecting [joint-selector="wrapper"] {
23+
stroke: #08BC8A;
24+
stroke-opacity: 0.2;
25+
stroke-linecap: butt;
26+
}
27+
28+
.joint-tool[data-tool-name="hover-connect"] circle {
29+
fill: #4666E5;
30+
}
31+
</style>
932
</head>
1033
<body>
1134

demo/sequence/src/joint.shapes.sd.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,24 @@
1010
stroke: '#DDDDDD',
1111
strokeWidth: 1,
1212
fill: '#F9FBFA'
13+
},
14+
label: {
15+
refY: null,
16+
refX: null,
17+
y: 'calc(h+2)',
18+
x: 'calc(w/2)',
19+
textAnchor: 'middle',
20+
textVerticalAnchor: 'top',
21+
fontSize: 12,
22+
fontFamily: 'sans-serif',
23+
textWrap: {
24+
width: -10
25+
}
1326
}
1427
}
1528
}, {
29+
placeholder: 'What\'s the group\'s name?',
30+
1631
fitRoles: function() {
1732
this.fitEmbeds({ padding: 10 });
1833
}
@@ -37,6 +52,8 @@
3752
}
3853
}
3954
}, {
55+
placeholder: 'What\'s the role?',
56+
4057
setName: function(name) {
4158
this.attr(['label', 'text'], name);
4259
}
@@ -71,6 +88,9 @@
7188
stroke: '#222222',
7289
strokeWidth: 2
7390
},
91+
wrapper: {
92+
connection: true
93+
},
7494
icon: {
7595
atConnectionRatioIgnoreGradient: 0.5
7696
}
@@ -83,6 +103,14 @@
83103
'fill': 'none',
84104
'pointer-events': 'none'
85105
}
106+
}, {
107+
tagName: 'path',
108+
selector: 'wrapper',
109+
attributes: {
110+
'fill': 'none',
111+
'stroke': 'transparent',
112+
'stroke-width': 20
113+
}
86114
}, {
87115
tagName: 'g',
88116
selector: 'icon',
@@ -127,6 +155,8 @@
127155
},
128156
}
129157
}, {
158+
placeholder: 'What\'s the message?',
159+
130160
defaultLabel: {
131161
markup: [{
132162
tagName: 'rect',

0 commit comments

Comments
 (0)