Rotation of cells using Mxgraph using IE 10 compatibility mode

607 views Asked by At

I have a swimlane/container cell on my mxgraph (version 2.1.0.9). When the cell is rotated by 270 degrees, the cell label does not rotate with the cell when using IE 10 in compatibility mode. The label rotates correctly in every other browser tested, this is the only one it fails with.

The issue can be seen by going to www.draw.io using IE 10, opening the developer tools and setting the browser mode to IE10 compat view (the page refreshes), drop a container onto the graph (first shape in library section), grab the rotation handle and rotate it.

The result is the label of the swimlane isn't rotated with the cell. The style of the cell after rotation is:

swimlane;whiteSpace=wrap;rotation=-90

I tried adding this code to the HelloWorld example (http://jgraph.github.io/mxgraph/javascript/examples/helloworld.html):

var v3 = graph.insertVertex(parent, 'swimlane;whiteSpace=wrap;rotation=-90', 'Container', 200, 150, 180, 130);

And in IE 10 compat view the problem was the same. Can the label be made to rotate with the cell correctly in this case?

1

There are 1 answers

1
Frodo Baggins On

mxGraph isn't supported in IE 10 compat mode with IE 7 standards document mode. The VML implementation in IE 10 just isn't production quality.

What's probably happening is IE is detecting an Intranet site and forcing compat mode. The best way around this is to add "X-UA-Compatible: IE=edge" to the response header when delivering it to the server.

Unfortunately, the DOCTYPE is ignored is Intranet mode, so you can't force it out of compat mode purely on the client side. See this thread for further details.