| 1 | define ({ |
| 2 | reverseMatrix: function(plot, dim, offsets, rtl){ |
| 3 | //summary: |
| 4 | // reverse the underlying matrix of the plots to perform the mirroring behavior. |
| 5 | //plot: |
| 6 | // the plot which has the matrix to be reversed. |
| 7 | //dim: |
| 8 | // the dimension (width,height) of the chart. |
| 9 | //offsets: |
| 10 | // the offsets of the chart |
| 11 | var shift = offsets.l - offsets.r; |
| 12 | var xx = rtl? -1 : 1; |
| 13 | var xy = 0; |
| 14 | var yx = 0; |
| 15 | var yy = 1; |
| 16 | var dx = rtl? dim.width + shift : 0; |
| 17 | var dy = 0; |
| 18 | if(plot.matrix){ |
| 19 | xx = xx * Math.abs(plot.matrix.xx); |
| 20 | yy = plot.matrix.yy; |
| 21 | xy = plot.matrix.xy; |
| 22 | yx = plot.matrix.yx; |
| 23 | dy = plot.matrix.xy; |
| 24 | } |
| 25 | plot.setTransform({xx: xx, xy: xy, yx: yx, yy: yy, dx: dx, dy: dy}); |
| 26 | } |
| 27 | }); |