@concord-consortium/rete-connection-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.9.0-cc.1 • Public • Published

Rete connection plugin

Rete.js plugin

Install

import ConnectionPlugin from 'rete-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

Readme

Keywords

none

Package Sidebar

Install

npm i @concord-consortium/rete-connection-plugin

Weekly Downloads

2

Version

0.9.0-cc.1

License

MIT

Unpacked Size

410 kB

Total Files

19

Last publish

Collaborators

  • eireland
  • bgoldowsky
  • lblagg
  • emcelroy
  • tealefristoe
  • kswenson
  • concordconsortium
  • scytacki
  • dougmartin
  • piotrjanik