jointjs

How to interactively create links in JointJS

ε祈祈猫儿з 提交于 2019-12-21 16:56:39
问题 I want to interactively add links to my JointJS based graph. My idea is to create a small temporary node on pointerdown with a link from the original node to this temporary node, drag it on top of another node and on pointerup create the real link removing the temporary link and node. Unfortunately I don't know how to convince the pointer to move the temporary element and not the node on which the pointerdown event happened. Any idea? Thanks! var tmp_obj; paper.on('cell:pointerdown', function

Make elements 'not selectable' in jointjs

我的梦境 提交于 2019-12-21 05:06:19
问题 I have used Jointjs diagramming library in one of my project. 1) I'm curious to know whether it provides any way to restrict users not to play with the elements of the diagram. What I mean is: a user would be able to see the diagram as an image rather than interacting with it like resizing, changing position, dragging links, etc. 2) My app is depending on it badly. Though I have solved the issue of auto layout, but is that possible with Jointjs, can we just tell the lib that we want these

Using predefined SVG file for creating a custom JointJS shape with ports

自作多情 提交于 2019-12-19 11:14:17
问题 I have a series of pre-created SVG symbols I want to use in JointJS. I've searched about using precreated SVGs and I found to be possible to create a complete custom elements using SVG by putting the SVG in the 'markup' property - (https://groups.google.com/forum/#!topic/jointjs/pQvN_0lXPVk). Below is the example of an SVG. Your help about how can I embed this definition in the markup property and add ports to it will be highly appreciated. Thanks <?xml version="1.0" standalone="no"?> <svg

How to highlight all element relative to a cell on diagram when using jointjs

[亡魂溺海] 提交于 2019-12-13 07:37:56
问题 I'm implementing a task relative to draw the diagram. It requires that when the user hovers on a cell of the diagram, it will highlight all preceding and subsequent of that cell and links. I found just how to highlight one element by clicking it. And not sure can I highlight links. Is it possible to do? 回答1: I have solved it in this way: this.listenTo(this.options.paper, 'cell:mouseover', function (cellView) { const links = this.options.paper.model.getConnectedLinks(cellView.model, {deep:

hello world does not work properly in html with jointjs?

冷暖自知 提交于 2019-12-13 06:24:42
问题 I am a beginner in html and the joint.js library. I have this code and once I saved it as html on my laptop, it is suppose to draw 2 connected rectangles but nothing appears in the browser. I downloaded many libraries and put them in the same folder that has the html page but nothing appear too. What am I suppose to do? Where can I put the libraries that I want to use in html code? The libraries that I downloaded are: backbone.js core.js geometry.js joint.all.css joint.all.js joint.all.min

newbie: hello world using jointjs

江枫思渺然 提交于 2019-12-12 18:15:45
问题 Hello Im trying to execute Hello world application using JointJS library as given in : http://www.jointjs.com/tutorial#hello-world I have downloaded joint.js and joint.css files I have copied the code given in HelloWorld tutorial in html file and accessed it from the firefox browser (26.0) But its not working as expected and shown in the tutorial. Expected: Two boxes with link should come. Actual: Nothing is coming on the browser. Ater debugging error is: "NS_ERROR_FAILURE:" in joint.js at:

In JointJs, how can I move a all elements together by dragging an embedded element?

余生长醉 提交于 2019-12-12 05:29:57
问题 I'm using JointJs to create a diagram. When I create an element with a number of embedded elements, I can easily drag them all by dragging the parent. However, when I drag the children, they move on their own. How can I move the parent and all children by dragging either the parent or one of the children elements? 回答1: it's a little bit tricky: https://jsfiddle.net/vtalas/xk73L947/ the magic is in this part: paper.on('cell:pointermove', function (cellView, evt) { if (cellView.model.isLink())

How to wrap lengthy text in JointJs Rectangle

安稳与你 提交于 2019-12-12 03:18:50
问题 Can anyone tell me how to wrap lengthy text inside rectangle in JointJS. Thanks in advance 回答1: You can use either "TextBlock" or if you trying to create a custom element you can write like this joint.shapes.devs.testModel = joint.shapes.basic.TextBlock.extend( { markup: ['<g class="rotatable"><g class="scalable"><rect class="body"/><rect class="leftthick"/></g>', joint.env.test('svgforeignobject') ? '<foreignObject class="fobj"><body xmlns="http://www.w3.org/1999/xhtml"><div class="content"/

How to style the attributes of a label when defining a joint.dia.Link?

偶尔善良 提交于 2019-12-11 16:48:33
问题 I looked into dia.Link.prototype.attr with a few examples and understand that Link attributes can be directly defined this way: joint.dia.Link.define('flow.Link', { router: { name: 'normal' }, connector: { name: 'normal' }, attrs: { '.tool-options': { 'data-tooltip-class-name': 'small', 'data-tooltip': 'Inspect me', 'data-tooltip-position': 'left' }, '.marker-source': { fill: 'none', stroke: 'none' }, '.connection-wrap': { fill: 'none' }, '.connection' : { stroke: '#0000ff', strokeWidth: 2,

Implement Rappid with angular 2

与世无争的帅哥 提交于 2019-12-11 13:38:37
问题 I am working on a angular 2 application wherein I have to implement rappid in one of component and had already purchased a licence of rappid with which I have got the licenced rappid.js file. Facing issues on how to integrate rappid with Angular 2. I have to make use of toolbar, halo, inspector, stencil and other ui components of rappid. And I guess if I go with npm jointjs module, these features will be not available over there because that will only expose the core JointJS library. Is there