Hola, estoy tratando de usar https://github.com/iVis-at-Bilkent/cytoscape.js-context-menus para crear menús contextuales en mis nodos, pero estoy atascado. Me gustaría mostrar los atributos de los nodos. A continuación se muestra mi código. ¿Podría obtener ayuda por favor?
<CytoscapeComponent elements={props.elements} style={ { height: sizeHeight + 'px', cursor: my_cursor } } cy={cy => { cy.on('add', 'node', _evt => { cy.layout(layout).run() cy.fit() setCy(cy) }) cy.on('mouseover', 'node', (evt) => { changeCursor('pointer') //makePopper(evt.target) }); cy.on('mouseout', 'node', (evt) => { changeCursor('default') var options = { // Customize event to bring up the context menu // Possible options https://js.cytoscape.org/#events/user-input-device-events evtType: 'tap', // List of initial menu items // A menu item must have either onClickFunction or submenu or both menuItems: [ { content: 'test', selector: 'node', onClickFunction: function (evt) { console.log(evt.target.data('123'))// The function to be executed on click //console.log('remove element'); }, show: false }, { id: 'test', content: 'test1', selector: 'node', coreAsWell: false, show: true, onClickFunction: function (evt) { console.log('test')// The function to be executed on click //console.log('remove element'); }, } cy.contextMenus(options); }