Comments (8)
Thanks for the information. This looks like a bug, so it will be looked into soon.
from cytoscape.js-qtip.
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.
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.
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.
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.
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.
@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.
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)
- Share qtip instance per collection when possible
- qTip is rendered for all parent elements when a child node is clicked. HOT 2
- Improve adjusting when overflowing viewport
- Child node qtips don't get displayed properly HOT 5
- Add support for qTip version 3 HOT 4
- Qtip unpositioned for `mousover` HOT 3
- qtip.$domEle.qtip is not a function HOT 4
- qtip api method reposition not working
- Show qtip on hover or right click HOT 1
- show cytoscape.js-qtip on right click HOT 1
- Not show qtip on node on React Project HOT 4
- Edge tooltip position not correct HOT 12
- qtip.$domEle.qtip( opts ) is not a function, again. HOT 19
- Is it possible to new line in qtip content text? HOT 1
- Edge tooltip position is not working as expected HOT 4
- Click on node label doesn't open qTip HOT 1
- Showing multiple qtips on different nodes is broken HOT 1
- Allow jQuery 3.x (there is an XSS vulnerability in previous versions) HOT 4
- How can data wrap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-qtip.