Simple Wrapper around JS PLUMB.
This provides a component that can be used to initialize jsplumb and create workflow diagrams
ember install ember-cli-jsplumb
import Route from '@ember/routing/route';
import { computed } from '@ember/object';
export default Route.extend({
definitionString: computed('controller.definition.{nodes,edges}', function(){
const definition = this.get('controller').get('definition');
return JSON.stringify(definition, null, 4);
}),
setupController() {
this.get('controller').set('definition', transform(definition));
this.get('controller').set('definitionString', this.get('definitionString'));
setInterval(() => {
this.notifyPropertyChange('definitionString');
this.get('controller').set('definitionString', this.get('definitionString'));
}, 500);
},
actions: {
onEditNode(node) {
window.alert(`Editing Node: ${node.id}`);
},
onRemoveNode(node) {
window.alert(`Removing Node: ${node.id}`);
},
onResizxeNode(node) {
// window.alert(`Resizing Node: ${node.id}`);
}
}
});
See the Contributing guide for details.
This project is licensed under the MIT License.