Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
Code Block | ||
---|---|---|
| ||
onos.ui.addView('viewId', { preloadinit: preloadinit, reset: reset, load: load, unload: unload, resize: resize, theme: theme }); |
...
The second argument to the function is an inline object block with the given keys, whose values are references to view life-cycle callback functions:
preloadinit | This function is called only once, the first time the view is loaded. It is called after the view's <div> has been added to the DOM. |
reset | This function is called just before the view is shown. It can be used to clear stale data from the view. |
load | This function is called when the view is loaded. |
unload | This function is called when the view is unloaded. The view may use this to drop references to cached data, or stop background tasks. |
resize | This function is called when the view has been resized. |
theme | This function is called when the user has toggled the theme. |
...
In the first release, the Topology View is the only view available; it is loaded at GUI startup. The following paragraphs summarize each of the view's callbacks:
...
Init
The preload init callback is used to initialize the view's SVG layer (including pan and zoom controls) and theĀ Force Layout used to visualize the topology.
...