Hello everyone, I’m trying to add a popup with some text above the graph node on node click.
node variable there is basically entity with x,y,z coordinates. But these coordinates are static and do not changing depending on graph rotation or zoom
const showTooltip = (node) => {
const el = document.createElement('div')
el.className = 'graph-tooltip'
el.innerHTML = `<div class="graph-tooltip__content">${node.textDescription || ''}</div>`
const objectCSS = new CSS2DObject(el)
objectCSS.position.set(node.x, node.y + 20, node.z)
objectCSS.name = 'tooltip';
Graph.scene().add(objectCSS);
}
the problem is when I’m rotating or zooming graph popup position is broken
(rotating)
(zooming)