Refresh JointJS Paper

1,414 views
Skip to first unread message

Amit Kumar Mondal

unread,
Sep 23, 2016, 3:20:04 AM9/23/16
to JointJS
Hello all,

I am trying to find a way to refresh the paper elements explicitly: It would be really helpful if anyone can help me.

Thanks in advance.

Vladimír Talaš

unread,
Oct 3, 2016, 10:26:43 AM10/3/16
to joi...@googlegroups.com
Hi, 

What do you mean by refresh? what should be refreshed? could you please provide an use-case or a code snippet? 

Regards, 


--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Vladimir Talas
Client IO

Amit Kumar Mondal

unread,
Oct 3, 2016, 2:51:21 PM10/3/16
to JointJS
I have a backend container which is used to create custom elements and these elements are represented in the JointJS. So, if I create an element in the runtime, I am searching for functionality to have the elements reflected in the UI automatically. I believe it needs a time based refresh on the paper. My JS is actually communication with my backend runtime and if I refresh the page manually the elements appear. I am thinking if I can have a functionality so that the paper gets refreshed automatically. I just need to refresh the paper and I believe all the elements created in runtime would appear.


On Monday, 3 October 2016 16:26:43 UTC+2, Vladimír Talaš wrote:
Hi, 

What do you mean by refresh? what should be refreshed? could you please provide an use-case or a code snippet? 

Regards, 

On Fri, Sep 23, 2016 at 9:20 AM, Amit Kumar Mondal <ad...@amitinside.com> wrote:
Hello all,

I am trying to find a way to refresh the paper elements explicitly: It would be really helpful if anyone can help me.

Thanks in advance.

--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vladimír Talaš

unread,
Oct 4, 2016, 8:14:09 AM10/4/16
to joi...@googlegroups.com
It seems you should rather focus on the graph (http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#dia.Graph). Graph is a model for the paper, paper holds reference and listen to changes made on the graph. Changes are automatically reflected to the view. 

For example if you open this demo http://resources.jointjs.com/demos/rappid/apps/KitchenSink/index.html and run this in console app.graph.getCells()[0].attr('text/text', "Fire incident changed") it should change the text of the "Fire Incident" element on the top.

Regards, 
 

To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Message has been deleted

Praveen Biradar

unread,
Apr 25, 2019, 2:51:13 AM4/25/19
to JointJS
Its not working .

PFA image for reference
To unsubscribe from this group and stop receiving emails from it, send an email to joi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Capture.PNG

Roman Bruckner

unread,
Apr 26, 2019, 4:58:59 PM4/26/19
to joi...@googlegroups.com
Hi Praveen,

there is a selector `label` that is referring to the SVGText element as well. This takes precedence as this is defined in the shapes markup as a `selector` property. The `text` selector is a general CSS selector matching all text elements.


Try to use `element.attr('label/text', 'Your Text');`

Best,
Roman
Reply all
Reply to author
Forward
0 new messages