Giter VIP home page Giter VIP logo

Comments (8)

maxkfranz avatar maxkfranz commented on June 2, 2024

Thanks for the information. This looks like a bug, so it will be looked into soon.

from cytoscape.js-qtip.

maxkfranz avatar maxkfranz commented on June 2, 2024

After looking at this:

(1) ele.qtip("destroy") is not documented anywhere. I don't know how you decided to call that, as it doesn't exist as an option.

(2) cy.elements('node').qtip('api').destroy(); This works just fine on the demo page.

from cytoscape.js-qtip.

Kkevsterrr avatar Kkevsterrr commented on June 2, 2024

I believe this works on the demo page because the qtips are always shown. When you set the qtips to only show on mouse hover, destroying the qtips was working for the ones I had hovered over, but did not work for the ones I had not yet hovered over.

Also, (1) was an option in an older version of the qtip API - just figured it was worth a try.

from cytoscape.js-qtip.

maxkfranz avatar maxkfranz commented on June 2, 2024

@Kkevsterrr

Are you doing

(A) ele.qtip({ show: { event: 'mouseover' } })

or

(B) ele.on('mouseover', function(){ ele.qtip(...) })

?

As far as I know, (A) is the proper way to do things according to the qtip docs -- and the api object should be non-null after that call.

If you use (B), you can't really avoid having to do a null check when you access the qtip api object.

from cytoscape.js-qtip.

maxkfranz avatar maxkfranz commented on June 2, 2024

If you're using (B) because you want to use delegate selectors for elements not yet added to the graph, you can translate that to (A):

cy.on('mouseover',  'node', function(){
  this.qtip(...); // options that show qtip now
});

becomes

cy.on('add',  'node', function(){
  this.qtip({ show: { event: 'mouseover' }, ... }); // options that show qtip later on mouseover
});

That way, you guarantee the api object is always available for an element.

from cytoscape.js-qtip.

Kkevsterrr avatar Kkevsterrr commented on June 2, 2024

My goal is to be able to dynamically update the tooltips of the graph. My current code for displaying the tooltips is this:

cy.elements('node').qtip({
    content: function() {return get_qtip(this.data("id"), this.data("ip"), data)},
    position: {
        my: 'top center',
        at: 'bottom center'
    },
    show: { event: 'mouseover'  },
    hide: { event: 'mouseout' },
    style: {
            classes: 'qtip-bootstrap',
            tip: {
                width: 16,
                height: 8
             }
     }
});

I could never get qtip updating to work, so my solution was going to be remove all of the qtips and re-add them at each update. Both updating them and removing them though seem to fail for the same reason. Hopefully this helps clarify, and thank you so much for your help!

from cytoscape.js-qtip.

Kkevsterrr avatar Kkevsterrr commented on June 2, 2024

@maxkfranz Any progress on this? The solutions you suggested unfortunately did not remedy my problem, and any help would be appreciated!

from cytoscape.js-qtip.

leonardoperlore avatar leonardoperlore commented on June 2, 2024

cy.$('#id').qtip({
content: function() {
var btn = $('X');
return btn;
},
position: {
my: 'top center',
at: 'bottom center'
},
style: {
classes: 'qtip-bootstrap',
tip: {
width: 16,
height: 8
}
}
});

from cytoscape.js-qtip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.