js-sequence-diagrams
js-sequence-diagrams copied to clipboard
support clicking
How can I support clicking every text tab?
I needed to support clicking on the "participant" (nodes) and managed to extract it by doing the following:
// Getting all the available "participants" - could alternatively adjust to select notes, signals etc.
var actors = document.getElementsByClassName('actor');
// Making the first participant have an onClick event, could alternatively for loop
actors[0].style.cursor = 'pointer';
actors[0].onclick = () => {
console.log(actors[0].textContent);
}
Hope this helps!