Many nodes not responding to hover functions in Cytoscape.js

662 views
Skip to first unread message

J. Smith

unread,
Oct 16, 2014, 12:36:41 PM10/16/14
to cytoscap...@googlegroups.com

I am using a cose layout to display a list of nodes. Everything displays properly. However, part of the nodes (especially the one in the lower half) tend not to respond to any hover commands or functions. Although clicks work just fine! For instance, they should be logging the node ID in the console on both click and hover. The click works just fine. However, upon hovering, the top half of nodes does, but the lower half of nodes (and those around sides) do not.

I have tried:
  • removing the on click function
  • using cy.nodes().on('click'....


jQuery(document).ready(function($) { // on dom ready
    $('#etl_cyto').cytoscape({
        maxZoom: 1e1,
        minZoom: 0.5,
        zoomingEnabled: true,
        userZoomingEnabled: true,
        panningEnabled: true,
        userPanningEnabled: true,
        autoungrabifyNodes: true,
        autoungrabifyEdges: true,
        autoungrabify: true,
        hideEdgesOnViewport: true,
        hideLabelsOnViewport: true,
        textureOnViewport: true,
        autounselectify: false,
        motionBlur: false,
        pixelRatio: 0.666,
        boxSelectionEnabled: false,
        layout: {
            name: 'cose',
            animate: false,
            debug: false,
            numIter: 1,
            fit: true,
            padding: 30,
            refresh: 1,
            nodeRepulsion: 4000
        },
        ready: function() {
            var cy = $('#etl_cyto').cytoscape('get');
            etl_cyto_new(etl_visual_js.path, cy);
        }
    });

    function etl_cyto_functions(cy) {
        var etl_cyto_div = $('#etl_cyto');
        cy.on('tapdragover', 'node', function(e) {
            var tapTarget = e.cyTarget;
            var tapTargetId = tapTarget.id();
            console.log(tapTargetId);
        });
        cy.on('vclick', 'node', function(e) {
            var theNewTarget = e.cyTarget;
            var theNewTargetId = theNewTarget.id();
            console.log(theNewTargetId);
        });
    }

    function etl_cyto_new(url, cy) {
        $.getJSON(url, function(result) {
            if (result) {
                cy.load(
                    result, function() {
                }, function() {
                    $('#etl_loading_div').hide();
                    etl_cyto_functions(cy);
                });
            }
        });
    } 

});
 

Max Franz

unread,
Oct 20, 2014, 11:58:08 AM10/20/14
to cytoscap...@googlegroups.com
I have confirmed both `mouseover` and `tapdragover` working on v2.3.3.  Please provide a full running ZIP example or a jsbin that reproduces your issue.  Thanks -Max
--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages