(g, opts, gd)
| 855 | } |
| 856 | |
| 857 | function makeEditable(g, opts, gd) { |
| 858 | var isVertical = opts.orientation === 'v'; |
| 859 | var fullLayout = gd._fullLayout; |
| 860 | var gs = fullLayout._size; |
| 861 | var t0, xf, yf; |
| 862 | |
| 863 | dragElement.init({ |
| 864 | element: g.node(), |
| 865 | gd: gd, |
| 866 | prepFn: function() { |
| 867 | t0 = g.attr('transform'); |
| 868 | setCursor(g); |
| 869 | }, |
| 870 | moveFn: function(dx, dy) { |
| 871 | g.attr('transform', t0 + strTranslate(dx, dy)); |
| 872 | |
| 873 | xf = dragElement.align( |
| 874 | (isVertical ? opts._uFrac : opts._vFrac) + (dx / gs.w), |
| 875 | isVertical ? opts._thickFrac : opts._lenFrac, |
| 876 | 0, 1, opts.xanchor); |
| 877 | yf = dragElement.align( |
| 878 | (isVertical ? opts._vFrac : (1 - opts._uFrac)) - (dy / gs.h), |
| 879 | isVertical ? opts._lenFrac : opts._thickFrac, |
| 880 | 0, 1, opts.yanchor); |
| 881 | |
| 882 | var csr = dragElement.getCursor(xf, yf, opts.xanchor, opts.yanchor); |
| 883 | setCursor(g, csr); |
| 884 | }, |
| 885 | doneFn: function() { |
| 886 | setCursor(g); |
| 887 | |
| 888 | if(xf !== undefined && yf !== undefined) { |
| 889 | var update = {}; |
| 890 | update[opts._propPrefix + 'x'] = xf; |
| 891 | update[opts._propPrefix + 'y'] = yf; |
| 892 | if(opts._traceIndex !== undefined) { |
| 893 | Registry.call('_guiRestyle', gd, update, opts._traceIndex); |
| 894 | } else { |
| 895 | Registry.call('_guiRelayout', gd, update); |
| 896 | } |
| 897 | } |
| 898 | } |
| 899 | }); |
| 900 | } |
| 901 | |
| 902 | function calcLevels(gd, opts, zrange) { |
| 903 | var levelsIn = opts._levels; |
no outgoing calls
no test coverage detected
searching dependent graphs…