Drawflow
Drawflow copied to clipboard
Add support of link labels
Hello!
First of all, many thanks for all the effort spent on creating this awesome project!
I had to introduce the support of link labels and I felt like it would benefit the community to have this feature as well. Right now, each labels are created using HTML defined by the app, but we could think of a way to parametrize this part if you think the effort is worth it.
Here is how you could use it
const editor = new Drawflow(el)
// Define some labels in HTML
const label1 = '<span class="label label-info" id="lb-a">Label A</span>'
const label2 = '<span class="label label-warning" id="lb-b">Label B</span>'
const labels = [label1, label2]
// Labels will be automatically added if they exist
editor.addConnection(id_output, id_input, output_class, input_class, labels)
And here's what it looks like
Let me know if you see issues or if you'd like me to change something. Cheers!
Hello! @mokaddem
Thanks for PR.
If labels is one thing missing.
There are alternatives to add the labels:
- https://github.com/jerosoler/Drawflow/issues/18