Add two or more items in the same line (add a custom HTML element or vue component))
See original GitHub issueHi, i was looking for a best node graph editor, and i found this repository, but i am having a hard time to find the information, i couldn’t understand the documentation, i think if i had more examples will be perfect.
My questions are… Is it possible to add a custom HTML element (or vue component) between the inputs? Like a title and dividers? and… my other question, is it possible insert more than one item in the same line, like a Checkbox list, i think this two options is very usefull for a better design in somes cases.
i made this example in browser…
export class MoveNode extends Node {
twoColumn = true;
width = 245;
axisList = ["X", "Y", "Z"];
constructor() {
super();
this.type = "MoveNode";
this.name = "Movimento";
this.addInputInterface("Entrada", "", 0, { type: "object" });
this.addOption(
"Hardware",
"SelectOption",
"Selecione uma Placa",
undefined,
{
items: ["Arduino Nano", "Octopus V1.1"]
}
);
this.axisList.forEach(axis => { this.addOption(axis, "CheckboxOption") });
this.events.update.addListener(this, event => {
console.log(this.interfaces.entries());
console.log(this.options.entries());
const item = this.axisList.find(axis => axis == event.name)
if (event.name === item) {
if (this.getOptionValue(item)) {
this.addInputInterface(item + " ", "NumberOption", 0);
} else {
this.removeInterface(item + " ");
}
}
});
this.addInputInterface("Velocidade", "NumberOption", 10000);
this.addOutputInterface("Saida", { type: "object" });
}
calculate() {
this.getInterface("Saida").value = this.getOptionValue("Hardware");
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Vue and Web Components
We consider Vue and Web Components to be primarily complementary technologies. Vue has excellent support for both consuming and creating custom elements.
Read more >Draw a connecting line between two elements - Stack Overflow
Working example link (usage: click on add scene to create a draggable, click on add choice to draw a leader line between two...
Read more >Suggestion: inline input/output #25 - newcat/baklavajs - GitHub
MSoup mentioned this issue on Dec 21, 2021. Add two or more items in the same line (add a custom HTML element or...
Read more >Styling Vue components with CSS - Learn web development
In the next article we'll return to adding some more ... Vue components are written as a combination of JavaScript objects that manage...
Read more >Building Custom Multi-Option Form Components with Vue.js
To make it possible to select multiple values we have to add a multiple property to the <select> tag of our component. So...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Documentation is indeed not my strong suit 😉 but PRs improving it are always welcome. I don’t think I’ll put the effort into improving the Baklava V1 documentation too much, since Baklava V2 is almost done. But I’ll certainly try to make the documentation for Baklava V2 more “guide”-like.
Guys, I understood! I have built an “Option” component, I will try to document this right for other people in the future as it is so simple to do!
You just need to create a Option element
in my case is ImgOption.vue
then register this component in the same location as the others. for example i use:
App.vue
now, we can use this option when creating nodes. When adding this option the third argument passed will be received inside the “ImgOption.vue” in the “prop” value.
Move.js
This code is just a didactic example, I hope it can help someone and thank you very much I think the problem has been solved, to see more advanced things I recommend seeing the @LukasLoeffler project exemple link project