Displaying qTip hover on outer nodes of Cytoscape.js graph?

与世无争的帅哥 提交于 2019-12-12 01:58:33

问题


When hovering over the outer nodes of graph in Cytoscape.js, the qTip dialog is not displayed.

Is there anyway to display the qTip bubbles upon hovering on an outer node? I can have the qtip popup on nodes in the upper half but not much along the sides of the graph. Especially towards the bottom half.

            cy.elements('node').qtip({

            id: function() {
                return this.data('id');
            },
            content: function() {
                return this.data('name') + '<br /><em>$' + this.data('weight') + '</em>';
            },
            position: {
                my: 'bottom right',
                viewport: $(etl_cyto_div),
                adjust: {
                    cyViewport: true,
                    method: 'flip none'
                }
            },
            show: {
                cyBgOnly: false
            },
            hide: {
                cyBgOnly: false,
                cyViewport: true,
                delay: 100
            },
            style: {
                classes: 'qtip-tipsy',
                tip: {
                    width: 16,
                    height: 8
                }
            }
        });        

回答1:


I suspect your options may be causing the issue. Because this extension is a relatively thin wrapper around qtip, you just use the qTip API and options.

  • Try leaving options.position.adjust.method default
  • Try a more permissive options.position.adjust.method; see qtip docs
  • adjust.cyViewport is expensive (especially on touch) and can be buggy depending on the version of qtip used.
  • Try all defaults and see if you can reproduce your issue with the events you want. If not, then the issue is due to the set options. If so, please file your example code in an issue


来源:https://stackoverflow.com/questions/26390633/displaying-qtip-hover-on-outer-nodes-of-cytoscape-js-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!