cytoscape / cytoscape.js-qtip

A Cytoscape.js extension that wraps the QTip jQuery library
MIT License
41 stars 35 forks source link

Not show qtip on node on React Project #26

Closed luli-isa closed 7 years ago

luli-isa commented 7 years ago

Hi, I must show a popover when tne user mouseover on a node on my graph. I add this line code

cy.nodes().qtip({ content: 'hi', position: { my: 'top center', at: 'bottom center' } })

but the popover is show at the end of the generic html div in which there is the graph drawed and not on single node

maxkfranz commented 7 years ago

See https://github.com/cytoscape/cytoscape.js-qtip/issues/27#issuecomment-298685167

You probably have body { position: static; }

luli-isa commented 7 years ago

I try change the body from static to absolute position but It doesn't work :-(

maxkfranz commented 7 years ago

Maybe you're missing the qtip stylesheet?

gflowers2012 commented 7 years ago

Having an issue where the tooltip is showing outside of the container region for the cytoscape graph. qtip error

Code below:

`let cy1 = cytoscape({

  container: conf,
  elements: CytospaceGraphData.elements,
  layout: options,

  style: [
    {
      selector: 'node',
      style: {
        'content': 'data(label)'
      }
    },
    {
      selector: 'edge',
      style: {
        'mid-target-arrow-color': 'black',
        'mid-target-arrow-shape': 'triangle',
        'arrow-scale': '3'
      }
    }
  ]
});

cy1.on('click', 'node', function (e) {
  console.log(e);

  var x = e.position.x;
  var y = e.position.y;

  e.target.qtip({
    overwrite: false, // Make sure the tooltip won't be overridden once created
    content: 'Hello!',
    position: {
      my: 'top center',
      at: 'bottom center',
      target: [x + 3, y + 3],
      adjust: { x: 7, y: 7 }
    },
    hide: {
      event: 'click',
      fixed: true,
      event: false,
      inactive: 2000
    },
    style: {
      classes: 'qtip-bootstrap',
      width: 200,
      tip: {
        corner: true,
        width: 24,
        height: 24
      }
    }
  }, event); // Pass through our live event to qTip
});`