anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.77k stars 425 forks source link

Bug with links #252

Open garyanikin opened 5 years ago

garyanikin commented 5 years ago

I'm trying to dynamically render new links with this code:

const renderLoop = setInterval(() => {
    renderer.pause();

    setTimeout(() => {
        // Render new transactions
        for (let i = 0; i < batch; i++) {
            const transaction = getTransaction()
            addLink(transaction.sender, transaction.recipient);
            if (currentTransaction < TRANSACTIONS.length) {
                nextTransaction()
            } else {
                clearInterval(renderLoop)
                return;
            }
        }
        renderer.resume();
    }, 0)

}, 2000)

And after a couple renders there appear a "ghost" links not connected to any node and with static positioning (they not animated like other nodes)

Screenshot 2019-10-25 at 17 09 19

Please, help me to figure out why it can happens?