@@ -150,42 +150,7 @@ function showNodeDetails(node) {
150150}
151151
152152function highlightEdge ( edge ) {
153- const details_top = document . getElementById ( "details_top" ) ;
154- const details_bottom = document . getElementById ( "details_bottom" ) ;
155- details_bottom . innerHTML = "" ;
156- const headerElement = document . createElement ( "h2" ) ;
157- headerElement . innerHTML = edge . id ( ) ;
158-
159- const sourceLink = document . createElement ( "a" ) ;
160- sourceLink . href = "#" ;
161- sourceLink . addEventListener ( "click" , function ( e ) { edge . unselect ( ) ; edge . source ( ) . select ( ) ; } ) ;
162- sourceLink . innerHTML = edge . source ( ) . id ( ) ;
163-
164- const targetLink = document . createElement ( "a" ) ;
165- targetLink . href = "#" ;
166- targetLink . addEventListener ( "click" , function ( e ) { edge . unselect ( ) ; edge . target ( ) . select ( ) ; } ) ;
167- targetLink . innerHTML = edge . target ( ) . id ( ) ;
168-
169- details_top . innerHTML = "" ;
170-
171- const paragraph = document . createElement ( "p" ) ;
172- paragraph . appendChild ( sourceLink ) ;
173- const label = document . createElement ( "i" ) ;
174- label . innerHTML = " " + edge . data ( "label" ) + " " ;
175- paragraph . appendChild ( label ) ;
176- paragraph . appendChild ( targetLink ) ;
177- details_top . appendChild ( headerElement ) ;
178- details_top . appendChild ( paragraph ) ;
179- // Only show the edge and the connected nodes
180- cy . elements ( ) . forEach ( n => n . style ( "opacity" , 0.2 ) ) ;
181- edge . style ( "opacity" , 1 ) ;
182- edge . connectedNodes ( ) . forEach ( n => n . style ( "opacity" , 1 ) ) ;
183- // hide filter pane
184- const filterPane = new bootstrap . Offcanvas ( '#filter_pane' ) ;
185- // FIXME: not quite sure what is going on here, but sometimes the internal state is incorrect
186- if ( document . getElementById ( "filter_pane" ) . classList . contains ( "show" ) )
187- filterPane . _isShown = true ;
188- filterPane . hide ( ) ;
153+ console . log ( "Edge double tapped: no op" ) ;
189154}
190155
191156function highlightElement ( event ) {
@@ -237,6 +202,7 @@ function unhighlightNode(event, unselect) {
237202
238203 // return graph to initial state
239204 const return_graph_to_init = ( ) => {
205+ cy . edges ( ) . forEach ( n => { n . style ( "curve-style" , "unbundled-bezier" ) ; n . style ( "min-zoomed-font-size" , 36 ) } ) ;
240206 cy . animate (
241207 {
242208 pan : cy_pan ,
@@ -258,6 +224,7 @@ function unhighlightNode(event, unselect) {
258224 console . log ( "New pos: " + n . id ( ) + ": " + n . position ( ) . x + ", " + n . position ( ) . y ) ;
259225 }
260226 } ) . play ( ) ) ;
227+
261228 } ;
262229
263230 return_graph_to_init ( ) ;
@@ -332,7 +299,12 @@ function newEdge(name, relation) {
332299 id : name + " → " + relation [ "name" ] ,
333300 source : name ,
334301 target : relation [ "name" ] ,
335- label : relation [ "description" ]
302+ label : relation [ "description" ] ,
303+ style : {
304+ "event" : "no" ,
305+ "selectable" : false ,
306+ "grabbable" : false
307+ } ,
336308 }
337309 }
338310}
@@ -358,7 +330,10 @@ function create_cy_elements(data, style) {
358330 container : document . getElementById ( 'cy' ) ,
359331 elements : elements ,
360332 layout : { name : 'random' } ,
361- style : style
333+ style : style ,
334+ minZoom : 0.75 ,
335+ maxZoom : 4 ,
336+ wheelSensitivity : 0.2 ,
362337 } ) ;
363338 // store the meta_node, since we need to remove it when highlighting nodes
364339 meta_node = cy . $ ( "#simulators" ) ;
0 commit comments