1.0.5 • Published 3 years ago

visualne-connection-plugin v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

VisualNE connection plugin

visualne.js plugin

Install

import { ConnectionPlugin } from 'visualne-connection-plugin';

editor.use(ConnectionPlugin);

Events

editor.on('connectionpath', data => {
    const {
        points, // array of numbers, e.g. [x1, y1, x2, y2]
        connection, // Rete.Connection instance
        d // string, d attribute of <path>
    } = data;

    data.d = `M ${x1} ${y1} ${x2} ${y2}`; // you can override the path curve
});
editor.on('connectiondrop', io /* Input or Output */ => {
    // triggered when the user drops picked connection
});
editor.on('connectionpick', io /* Input or Output */ => {
    // triggered when the user tries to pick a connection
    // you can prevent it
    return false;
});

editor.trigger('resetconnection'); // reset pseudo connection
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.1-nn

3 years ago

1.0.0

3 years ago