jointjs

How to make jointjs paper responsive?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I just discover javascript library JointJs and I implemented a graph with paper and rects. But I can't make it responsive when I reduce the browser size my graph doesn't display correctly. How can I make my paper responsive with jointjs ? 回答1: You can initially set the paper to be the same dimensions as it's containing element, but that's only calculated initially when the paper is created. If you want to paper to change size as you resize your browser, you'll need to react to resize events. Firstly, you'll need to set overflow to

How can I use JointJS with an application built with Angular CLI?

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have installed jointjs via npm and also installed typings and code compiles/builds fine. Code import { Component } from '@angular/core' ; import * as joint from '../../node_modules/jointjs/dist/joint.min' ; export class AppComponent { title = 'app works!' ; constructor ( ) { // console.log(joint)// private jint: joint, } ngOnInit () { var graph = new joint . dia . Graph ; } } Error shows up on the browser: Failed to compile . / home / vinay / angularapps / jjs / src / app / app . component . ts ( 17 , 31 ): Property 'Graph' does

Joint.js Drag and Drop Element between two papers

烈酒焚心 提交于 2019-12-03 00:40:47
I am implementing drag and drop between two papers .But I am stuck with the syncing of offset of dragged element with cursor position as I have two papers in my html body.I have very minute experience with css which may be causing problem of positioning of elements. Use Case:- User clicks on element from paper 2 and starts dragging and go to paper 1. On Pointer up a clone of that element is added to paper 1 on the position of cursor in paper 1. My strategy to handle this is :- When the user clicks mousedown 1.Dynamically create a div 2.Create a third paper, say call it "flypaper" in the new

NameSpace Issue in JointJS version 3

老子叫甜甜 提交于 2019-12-02 10:06:49
I am trying to convert a legacy app from JointJS v2.2.1 to v3.0.2. I’m hitting an error others have found: Uncaught Error: dia.ElementView: markup required. (joint.min.js:8) A helpful person said: “Please note you need to be careful with the cellViewNamespace for the dia.Paper and cellNamespace option for the dia.Graph in this setup. Running this snippet is a quick check you've set up the namespaces correctly: const cells = JSON.stringify(graph.toJSON()); graph.clear(); graph.fromJSON(JSON.parse(cells)); ” Can anyone offer additional help? I don’t know enough about JointJS to resolve this

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

百般思念 提交于 2019-12-02 07:37:08
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 viewBox="0 0 1024 768" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org

Hiding elements in a diagram

做~自己de王妃 提交于 2019-12-02 02:17:20
I have a read-only diagram to visualize some data. My end users would like to "filter" the data such that only a subset of the data may be shown at one time. I realize that I can redraw the whole diagram each time I apply a filter omitting the elements that are not to be shown but I am wondering if there is a way that I can simply "hide" some existing elements dynamically and then subsequently re-show them. To try and make crystal clear, if this were a web page instead of a diagram, I would draw the analogy of applying the CSS of display: none to elements of my choosing. You can actually do

How can I keep jointjs cells from overflowing the paper?

拜拜、爱过 提交于 2019-11-30 17:50:54
I'm using jointjs to make diagrams which will be user-editable. The user may drag them around and relocate each cell. However, when a cell is dragged to the edge, it overflows and becomes cut off. I want to prevent this from happening, instead the cell to stop before it gets to the edge of the paper and not be allowed to cross the edge, thus always staying completely within the paper. The behavior can be seen in jointjs' very own demos here: http://www.jointjs.com/tutorial/ports Try dragging the cell to the edge and you'll see that it eventually becomes hidden as it crosses the edge of the

Text area in svg shapes

狂风中的少年 提交于 2019-11-30 15:30:41
Created a text area in svg using joint js. However, I am not able to enter any text in the text area. How to make the text area editable? Code: var graph = new joint.dia.Graph; var paper = new joint.dia.Paper({ el: $('#myholder'), width: 1500, height: 700, model: graph }); // Create a custom element. // ------------------------ joint.shapes.html = {}; joint.shapes.html.Element = joint.shapes.basic.Generic.extend(_.extend({}, joint.shapes.basic.PortsModelInterface, { markup: '<g class="rotatable"><g class="scalable"><rect/></g><g class="inPorts"/><g class="outPorts"/></g>', portMarkup: '<g

Can I inject JointJS as an AngularJS module like any other library?

这一生的挚爱 提交于 2019-11-30 14:12:47
问题 I have an app with angular and I need to use this library http://www.jointjs.com/, So I downloaded the joint.min.js and joint.min.css and placed their routes in the index.html but I don't know what to put in the app.js to inject it and I keep getting injection error from angular. Is it possible that this is not the way to do it? I googled a lot but didn't find any approach. I will appreciate any help, thanks in advance! 回答1: If you want to render a Jointjs diagram in your angular application,

Joint.js add custom ports with path class. for custom elements

故事扮演 提交于 2019-11-30 12:54:30
What I am trying to do is make a element with custom class for ports and path so that I can add an element with custom path and my own markup for ports.This way when I create an element I will pass dynamic path for its shape just like elements of path class behave and as I have also extended from PortsModelInterface I will also have my own markup for ports. This whole effort is to make svg scalable for zomming. Previously I was using html custom element with my custom ports which was working fine but html of custom elements wasn't scaling on zooming var graph = new joint.dia. var paper = new