File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 3333 < div class ="btn-zoom-container " style ="position: relative; ">
3434 < div class ="btn-group btn-group-zoom " role ="group " >
3535 < button type =button class ="btn btn-secondary b-tooltip btn-zoom btn-zoom-in "
36- title ="Zoom In "> +</ button >
36+ title ="Zoom In " id =" zoom-in-btn " > +</ button >
3737 < button type =button class ="btn btn-secondary b-tooltip btn-zoom btn-zoom-out "
38- title ="Zoom Out "> -</ button >
38+ title ="Zoom Out " id =" zoom-out-btn " > -</ button >
3939 < button type =button class ="btn btn-secondary b-tooltip btn-zoom btn-zoom-fit "
40- title ="Fit to View "> [ ]</ button >
40+ title ="Fit to View " id =" fit-to-view-btn " > [ ]</ button >
4141 </ div >
4242 </ div >
4343 </ nav >
Original file line number Diff line number Diff line change 222222 [main-content]
223223 [modal]]
224224 (. js/document (getElementById " main-content-container" )))
225+
226+ (defn zoom [f]
227+ (.zoom @cytoscape-instance
228+ #js{:level (f (.zoom @cytoscape-instance))
229+ :position (.position
230+ (.getElementById
231+ @cytoscape-instance
232+ " mainWorkspace" ))}))
233+
234+ (defn zoom-in [] (zoom inc))
235+
236+ (defn zoom-out [] (zoom dec))
237+
238+ (defn fit-to-view [] (.fit @cytoscape-instance))
239+
240+ (defn load-event []
241+ (.addEventListener
242+ (.getElementById js/document " zoom-in-btn" ) " click" zoom-in)
243+ (.addEventListener
244+ (.getElementById js/document " zoom-out-btn" ) " click" zoom-out)
245+ (.addEventListener
246+ (.getElementById js/document " fit-to-view-btn" ) " click" fit-to-view))
247+
248+ (.addEventListener js/window " load" load-event false )
249+
225250(defn on-js-reload []
226251 ; ; optionally touch your app-state to force rerendering depending on
227252 ; ; your application
Original file line number Diff line number Diff line change @@ -136,7 +136,6 @@ node.prove-source {
136136 replace-head-syms
137137 print-str))
138138
139- ; ; Added 03/04/20
140139(defn latex->encoded-svg
141140 " Convert string of plain-text represented LaTeX into an svg file."
142141 [^String latex]
You can’t perform that action at this time.
0 commit comments