var element = document.getElementById(“xxx”);
element.style.left = newPos.x;
element.style.top = newPos.y;
// here do something to update the attached connections
You need to call jsPlumb.revalidate(id or element)
on the element you moved…
If you go to http://gootechnologies.github.io/shader-graph/editor/ you can add a new element cliking the vec4 option at the bottom of the page so that a new vec4 element is added at the top of the page. Then dragging the new element a bit to the right and connecting the rgba output in vec4 to rgba in the fragColor element you get this:
document.getElementById("jsPlumb_2_2").style.top = "100px";
jsPlumb.revalidate("rgba2");
Yes that makes sense, because your app is using an instance of jsPlumb, not the static instance:
If you try the same thing using instance
instead of jsPlumb
you should be good. But not with rgba2
as the ID. You need to use the element, or the ID of the element:
var element = document.getElementById(“xxx”);
element.style.left = newPos.x;
element.style.top = newPos.y;
instance.revalidate(element);
On Jun 26, 2016, at 7:32 AM, Simon Porritt <si...@jsplumbtoolkit.com> wrote:
Yes that makes sense, because your app is using an instance of jsPlumb, not the static instance:
<image.png>
If you try the same thing using
instance
instead ofjsPlumb
you should be good. But not withrgba2
as the ID. You need to use the element, or the ID of the element:var element = document.getElementById(“xxx”); element.style.left = newPos.x; element.style.top = newPos.y; instance.revalidate(element);
--
You received this message because you are subscribed to a topic in the Google Groups "jsPlumb" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jsplumb/AiYcJ6n_4pQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jsplumb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.