Questions tagged [draw2d-js]

Draw2D is a JavaScript/HTML5 library for canvas development. Based on JQuery and RaphaelJS, it is platform independent, cross-browser and device.

Draw2D is a JavaScript/HTML5 library for canvas development. Based on JQuery and RaphaelJS, it is platform independent, cross-browser and device. Available at http://www.draw2d.org

54 questions
4
votes
1 answer

draw2d on drag start event

I want to call my custom callback function every time, when user starts dragging figures. I tried to do it like so: figure.onDragStart = function (x, y, shiftKey, ctrlKey) { myfunc(); }; But the problem is, every time when my function is…
Jacobian
  • 7,972
  • 22
  • 92
  • 184
4
votes
1 answer

draw2d.js : connected event

How to get know what two figures was conneted in draw2d js libdrary ( http://www.draw2d.org/draw2d/ )? I cant find corresponding event/callback method..
Andrey Baryshnikov
  • 751
  • 1
  • 12
  • 21
3
votes
2 answers

Save and Restore rectangles with connections in Draw2D.js touch via JSON

How do I create rectangles with 4 ports (each side) in a correct way, so I can save and restore them via JSON? I tried this one, but only the rectangles are been saved. The connections and labels got lost. JSFiddle:…
user3142695
  • 11,619
  • 29
  • 119
  • 238
2
votes
0 answers

The Draw2D touch project still running

I am looking for HTML5/2D/Javascript library to use in a project, where I need to manipulate shapes and connectos. The Draw2D seems to be quite good, but after seen the last change log was in 2016 I got a little worried about the future of the…
DPalharini
  • 181
  • 1
  • 10
2
votes
1 answer

draw2d touch (js) rotate ports and bounding box with figure

It seems that draw2d rotates only the inner content of a figure when I rotate it. For example using this function; function rotate (angle, figure){ if(!isNaN(parseFloat(angle)) && isFinite(angle)){ …
user2485309
  • 127
  • 1
  • 6
2
votes
2 answers

Canvas within a scrollable browser window (grab position)

I have an issue when drawing in a canvas within a browser window that has a vertical scrollbar. The figures is at the correct position, and is possible to grab it around the canvas and make the connections, but this is only possible with the…
2
votes
0 answers

How to draw a draw2d polyline

Ho do I draw a polyline with draw2d (javascript not eclipse)? (unfortunately there is no example on draw2d.org) So far I tried: var polyline = new draw2d.shape.basic.PolyLine(); polyline.addPoint(30, 0); polyline.addPoint(30,…
Thorsten Niehues
  • 11,698
  • 18
  • 69
  • 94
1
vote
1 answer

Adding Highcharts chart to draw2d canvas

I was wondering if there is a mean to add a graph made with Highcharts into a draw2d canvas. I tried to use the class made to import external SVG SVGFigure, but it seems like the SVG is too complex to be used with this class according to this and my…
1
vote
1 answer

Drag & Drop menu with Draw2D.js

How would I create a Drag & Drop menu with Draw2D.js? I am making an application using React and can't find how to do it in the docs. There is something similar in this example, but I don't understand how to I would make my own. In the example, the…
frizd
  • 71
  • 1
  • 5
1
vote
1 answer

Importing draw2d in react causes jquery reference error

As soon as I add import draw2d from "draw2d" to my imports I get ReferenceError: jQuery is not defined. I tried installing and adding jquery but still get same error... import React, {Component} from "react"; import jQuery from "jquery"; import…
TedTrippin
  • 3,325
  • 4
  • 23
  • 41
1
vote
0 answers

Drag & Drop child node in Draw2d Custom Layout/Figure

I have a Draw2d(js) custom figure (Table) which contains nested custom figures (Column). I want to grag and drop column from one table to another. I just want from you guys some guidelines how to enable grag & drop, I'll handle other logic. I've…
Zohaib Ijaz
  • 17,180
  • 5
  • 28
  • 50
1
vote
0 answers

Draw2D.js : How to get JSON from 'HorizontalLayout' with child labels and how to restore 'HorizontalLayout' with label from JSON

I am newb to Draw2D.js, I have created 'HorizontalLayout' with three child label. and trying to get JSON for 'HorizontalLayout' with three child label. My code as following: HTML:
Mehul Mali
  • 2,354
  • 4
  • 11
  • 23
1
vote
3 answers

Installation of draw2D touch on Angular2

how can I install the draw2d touch library on Angular 2 ? I do not find any news about it. Thank you
uroti
  • 37
  • 1
  • 7
1
vote
2 answers

How to scroll my canvas while creating a connection in draw2d-js?

I have two figures, one in the visible area of my canvas and one outside (on the right). It is not possible to make a connection because I can't reach the other figure. Is it possible to autoscroll, to the right while creating a connection so I can…
Dreqnoid
  • 11
  • 3
1
vote
2 answers

canvas setDimension() breaks drag functionality of figure

I am using draw2dtouch 6.1.66 version (latest version). Initially width and height of canvas was 1000px and 800px respectively. On button click, I am changing the canvas width and height to 2170px and 902px respectively. Now I cannot drag rectangle…
satish ganai
  • 97
  • 1
  • 9
1
2 3 4