JointJS in a React app .. missing styles?

139 views
Skip to first unread message

Neil Kolban

unread,
Oct 17, 2021, 9:11:22 PM10/17/21
to JointJS
I have been tinkering with trying to get a JointJS diagram in my React app and find that a diagram that looks ok in raw HTML/JS looks different/wrong when encapsulated in a React story.  If I look at the following/attached screen shot.  We see that the links look wrong.   Could this be as a result of not having included the stylesheet?  I am using the "jointjs" npm distribution.

And one final clue .... as I was hunting around, I came across this StackOverflow Q&A ... https://stackoverflow.com/questions/49043429/how-to-use-jointjs-with-reactjs

Take a look at it and also note that their diagram of them also having it "working" appears to illustrate the same puzzle I am having.

Screenshot 2021-10-17 8.05.55 PM.png

Roman Bruckner

unread,
Oct 18, 2021, 6:51:09 AM10/18/21
to joi...@googlegroups.com
Hi Neil,

it is definitely the result of missing CSS. Please check out the following Rappid tutorial - https://resources.jointjs.com/tutorial/react-ts - on how to include the stylesheet.
The same approach applies for JointJS (Rappid is a superset of  JointJS).

Best regards,
Roman



--

---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jointjs/3571595e-fa87-4352-a031-7a2835f28e7an%40googlegroups.com.


--

Neil Kolban

unread,
Oct 18, 2021, 9:01:20 AM10/18/21
to JointJS
Thank you Roman.  After trying to figure out how to import "jointjs" CSS into React ... once done, the result was perfect (as you said it would be).  Thank you again.

Screenshot 2021-10-18 7.59.13 AM.png
Reply all
Reply to author
Forward
0 new messages