Skip to content

Commit

Permalink
Add button tooltips & compound link #3303
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Dec 13, 2024
1 parent 62f5ad2 commit 813ae56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions documentation/demos/fcose-gene/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,17 @@ Promise.all([
layoutOpts: {
randomize: true,
animate: true
}
},
tooltip: 'Randomise'
},

{
label: h('span', { 'class': 'fa fa-play' }, []),
layoutOpts: {
randomize: false,
animate: true
}
},
tooltip: 'Step'
}
];

Expand Down Expand Up @@ -150,7 +152,7 @@ Promise.all([
}

function makeButton( opts ){
var $button = h('button', { 'class': 'btn btn-default' }, [ opts.label ]);
var $button = h('button', { 'class': 'btn btn-default', title: opts.tooltip }, [ opts.label ]);

$btnParam.appendChild( $button );

Expand All @@ -160,6 +162,12 @@ Promise.all([
layout = makeLayout( opts.layoutOpts );
layout.run();
});

return tippy( $button, {
content: opts.tooltip,
arrow: true,
placement: 'right'
} );
}

var makeTippy = function(node, html){
Expand Down
3 changes: 3 additions & 0 deletions documentation/demos/fcose-gene/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
Visualisation by <a href="http://js.cytoscape.org">Cytoscape.js</a><br/>
Layout by <a href="https://github.com/iVis-at-Bilkent/cytoscape.js-fcose">FCOSE</a>
</p>
<p>
Note that FCOSE supports both non-compound and compound graphs. For a compound graph, see <a href="https://ivis-at-bilkent.github.io/cytoscape.js-fcose/demo/demo-compound.html">another FCOSE demo</a>.
</p>
</div>

</div>
Expand Down

0 comments on commit 813ae56

Please sign in to comment.