Add loop label tooltip to graph with help cursor

This commit is contained in:
Thibaud Colas 2016-07-31 17:47:26 +03:00
parent 26779038aa
commit 71489c5f67
2 changed files with 12 additions and 1 deletions

View File

@ -53,12 +53,19 @@ export default {
// be matched. // be matched.
loopLabel() { loopLabel() {
var labelStr = this.repeat.label, var labelStr = this.repeat.label,
label, labelBox, box; tooltipStr = this.repeat.tooltip,
label, tooltip, labelBox, box;
if (labelStr) { if (labelStr) {
label = this.container.text(0, 0, [labelStr]) label = this.container.text(0, 0, [labelStr])
.addClass('repeat-label'); .addClass('repeat-label');
if (tooltipStr) {
tooltip = Snap().el('title')
.append(this.container.text(0, 0, tooltipStr));
label.append(tooltip);
}
box = this.getBBox(); box = this.getBBox();
labelBox = label.getBBox(); labelBox = label.getBBox();
label.transform(Snap.matrix().translate( label.transform(Snap.matrix().translate(

View File

@ -50,6 +50,10 @@ circle {
font-size: 10px; font-size: 10px;
} }
.repeat-label {
cursor: help;
}
.subexp .subexp-label tspan, .subexp .subexp-label tspan,
.charset .charset-label tspan { .charset .charset-label tspan {
dominant-baseline: text-after-edge; dominant-baseline: text-after-edge;