Hello,\nIs it possible to do a resize like this exemple below with MxGraph ?
\nIn this exemple I resize by a drag&drop of the point(right|top corner) of the shape.

\nShape not yet resized :
\nShape not yet resized


Shape resized :
\nShape resized\n

\nmaybe I should instead use a blend of connections ?
\nThank you very much for your help,


asked 02 Dec '11, 00:21

john's gravatar image

accept rate: 0%

So, I had to implement a polygon to the white background transparent. See here.
\nThe buttons are images linked by connections.
\nI added a listener to change the position of buttons and connections when I drag the background, like this:

var polygone_x, polygone_y = 20;\ngraph.addListener(mxEvent.CELLS_MOVED, function(sender, evt) {      \n   var cells = evt.properties['cells'];\n   if ( cells[0].style == "POLYGONE1_STYLE" ) {  \n      var polygone = cells[0];          \n      var move_x = polygone.geometry.x - polygone_x; \n      var move_y = polygone.geometry.y - polygone_y;            \n      graph.getModel().beginUpdate();\n      try {\n         graph.moveCells(array_of_shapes_and_edges, move_x, move_y);\n      } finally {\n    graph.getModel().endUpdate();\n      }\n      polygone_x = polygone.geometry.x;\n      polygone_y = polygone.geometry.y;\n   }\n});\n

answered 06 Dec '11, 23:04

john's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 02 Dec '11, 00:21

Seen: 2,167 times

Last updated: 06 Dec '11, 23:04