visjs / vis-network

:dizzy: Display dynamic, automatically organised, customizable network views.
https://visjs.github.io/vis-network/
Apache License 2.0
3.09k stars 374 forks source link

EdgeHandler error since v.6.4.3 #255

Open ccaillet opened 5 years ago

ccaillet commented 5 years ago

Hi I use vis-network as a Hierarchical layout, using script: https://visjs.github.io/vis-network/standalone/umd/vis-network.min.js like this:

const data = {
    nodes: new vis.DataSet([]),
    edges: new vis.DataSet([])
}

const options = {

    layout: {
        hierarchical: {
            sortMethod: "directed",
            shakeTowards: "roots"
        }
    },
    locale: 'fr',
    locales: vis_fr,
    height: '600px',
    edges: {
        arrows: 'to',
        smooth: true,
        length: 250
    },
    nodes: {
        shape: shapes.task,
        widthConstraint: 100
    },
    manipulation: {
        enabled: manageTasks,
        addNode: function(node, callback) {
            location.href = base_url + 'task/add'
        }
    // ...
    }
}

It worked fine with version v6.4.0. Since version 6.4.3, I've got the following error:

TypeError: i is null
EdgesHandler.js:145:32
    value EdgesHandler.js:145
    emit index.js:145
    <anonyme> self-hosted:1023
    value LayoutEngine.js:382
    emit index.js:145
    <anonyme> self-hosted:1019
    value EdgesHandler.js:301
    value EdgesHandler.js:490
    value EdgesHandler.js:440
    bindEventListeners Network.js:305
    emit index.js:145
    <anonyme> self-hosted:1019
    value Clustering.js:618
    value Clustering.js:176
    cluster Network.js:495
    clusterUnreachableTasks network.js:336
    <anonyme> network.js:223
    jQuery 4
        u
        fireWith
        k
        n

In this projet I use a click on a node to do something. And with this error, it look like that the click event is not anymore registred.

Thomaash commented 5 years ago

Hi @ccaillet,

when I deleted all the stuff from your example you didn't provide (vis_fr, shapes.task, manageTasks, base_url) everything works just fine. I don't get any error at all.