Skip to content

Commit

Permalink
linkTools, elementTools: add HoverConnect tool (#1763)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumilingus authored Aug 8, 2022
1 parent f884fc8 commit 5ac4a06
Show file tree
Hide file tree
Showing 14 changed files with 638 additions and 34 deletions.
23 changes: 23 additions & 0 deletions demo/sequence/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
<title>Sequence Diagram</title>

<link rel="stylesheet" type="text/css" href="../../build/joint.css" />
<style>
.available-cell.joint-type-sd-message [joint-selector="wrapper"] {
stroke-width: 26;
}
.available-cell.joint-type-sd-lifeline [joint-selector="wrapper"] {
stroke-width: 100;
}
.available-cell [joint-selector="line"] {
stroke: #08BC8A;
stroke-width: 5;
stroke-dasharray: none;
}

.available-cell.highlighted-connecting [joint-selector="wrapper"] {
stroke: #08BC8A;
stroke-opacity: 0.2;
stroke-linecap: butt;
}

.joint-tool[data-tool-name="hover-connect"] circle {
fill: #4666E5;
}
</style>
</head>
<body>

Expand Down
30 changes: 30 additions & 0 deletions demo/sequence/src/joint.shapes.sd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,24 @@
stroke: '#DDDDDD',
strokeWidth: 1,
fill: '#F9FBFA'
},
label: {
refY: null,
refX: null,
y: 'calc(h+2)',
x: 'calc(w/2)',
textAnchor: 'middle',
textVerticalAnchor: 'top',
fontSize: 12,
fontFamily: 'sans-serif',
textWrap: {
width: -10
}
}
}
}, {
placeholder: 'What\'s the group\'s name?',

fitRoles: function() {
this.fitEmbeds({ padding: 10 });
}
Expand All @@ -37,6 +52,8 @@
}
}
}, {
placeholder: 'What\'s the role?',

setName: function(name) {
this.attr(['label', 'text'], name);
}
Expand Down Expand Up @@ -71,6 +88,9 @@
stroke: '#222222',
strokeWidth: 2
},
wrapper: {
connection: true
},
icon: {
atConnectionRatioIgnoreGradient: 0.5
}
Expand All @@ -83,6 +103,14 @@
'fill': 'none',
'pointer-events': 'none'
}
}, {
tagName: 'path',
selector: 'wrapper',
attributes: {
'fill': 'none',
'stroke': 'transparent',
'stroke-width': 20
}
}, {
tagName: 'g',
selector: 'icon',
Expand Down Expand Up @@ -127,6 +155,8 @@
},
}
}, {
placeholder: 'What\'s the message?',

defaultLabel: {
markup: [{
tagName: 'rect',
Expand Down
Loading

0 comments on commit 5ac4a06

Please sign in to comment.