Show More
@@ -165,12 +165,11 | |||
|
165 | 165 | msg.style.cursor = 's-resize'; |
|
166 | 166 | msg.onclick = function() { |
|
167 | 167 | this.parentNode.parentNode.style.height = 'auto'; |
|
168 | repaint_graph(); | |
|
169 | 168 | } |
|
170 | 169 | } |
|
171 | 170 | } |
|
172 | 171 | |
|
173 |
function set_canvas( |
|
|
172 | function set_canvas(heads) { | |
|
174 | 173 | var c = document.getElementById('graph_nodes'); |
|
175 | 174 | var t = document.getElementById('graph_content'); |
|
176 | 175 | canvas = document.getElementById('graph_canvas'); |
@@ -180,25 +179,22 | |||
|
180 | 179 | c.style.height=max_w+'px'; |
|
181 | 180 | canvas.setAttribute('width',max_w); |
|
182 | 181 | }; |
|
183 | function calc_max_w(jsdata) { | |
|
184 |
|
|
|
185 | var max_heads = 0; | |
|
186 | for( var i=0;i<jsdata.length;i++){ | |
|
187 | var m = Math.max.apply(Math, jsdata[i][1]); | |
|
188 | if (m>max_heads){ | |
|
189 |
|
|
|
190 | } | |
|
191 |
|
|
|
192 | return Math.max(100,max_heads*25); | |
|
182 | var heads = 1; | |
|
183 | var max_heads = 0; | |
|
184 | var jsdata = ${c.jsdata|n}; | |
|
185 | ||
|
186 | for( var i=0;i<jsdata.length;i++){ | |
|
187 | var m = Math.max.apply(Math, jsdata[i][1]); | |
|
188 | if (m>max_heads){ | |
|
189 | max_heads = m; | |
|
190 | } | |
|
193 | 191 | } |
|
194 | function repaint_graph() { | |
|
195 | var jsdata = ${c.jsdata|n}; | |
|
196 | var max_w = calc_max_w(jsdata); | |
|
197 | set_canvas(max_w); | |
|
198 | var r = new BranchRenderer(); | |
|
199 | r.render(jsdata,max_w); | |
|
200 | } | |
|
201 | repaint_graph (); | |
|
192 | var max_w = Math.max(100,max_heads*25); | |
|
193 | set_canvas(max_w); | |
|
194 | ||
|
195 | var r = new BranchRenderer(); | |
|
196 | r.render(jsdata,max_w); | |
|
197 | ||
|
202 | 198 | }); |
|
203 | 199 | </script> |
|
204 | 200 | %else: |
General Comments 0
You need to be logged in to leave comments.
Login now