Force service API.
initForce(svg, forceG, uplink, dim, opts)
svg
: D3 selection of svg element for force layout renderingforceG
: D3 selection of force layout SVG group elementuplink
: API uplink to main topo.js moduleshowNoDevs(b)
- show or hide no connected devices messageprojection()
- return ref to map projection objectzoomLayer()
- return ref to zoom layer elementzoomer()
- return ref to zoomer objectopacifyMap(b)
- show or hide map layertopoStartDone()
- callback invoked after topo data has been received from serverdim
: initial dimensions of SVG ... [w, h]
opts
: options objectnewDim()
dim
: new dimensions ... [w, h]
destroyForce()
updateDeviceColors()
toggleHosts(x)
x
: boolean (optional)x
is not defined, toggles host visibilityx
is defined, sets or clears host visibilitytogglePorts()
x
: boolean (optional)x
is not defined, toggles port labels visibilityx
is defined, sets or clears port labels visibilitytoggleOffline()
x
: boolean (optional)x
is not defined, toggles offline devices visibilityx
is defined, sets or clears offline devices visibilitycycleDeviceLabels()
unpin()
showMastership(masterId)
masterId
: ONOS instance identifier (e.g. IP address)masterId
is defined, will render the display to highlight those devices mastered by the given cluster membermasterId
is not defined, restores the displayshowBadLinks()
setNodeScale()
scale
: the scale to useresetAllLocations()
addDevice(data)
data
: add-device event payloadupdateDevice(data)
data
: update-device event payloadremoveDevice(data)
data
: remove-device event payloadaddHost(data)
data
: add-host event payloadupdateHost(data)
data
: update-host event payloadmoveHost(data)
data
: move-host event payloadremoveHost(data)
data
: remove-host event payloadaddLink(data)
data
: add-link event payloadupdateLink(data)
data
: update-link event payloadremoveLink(data)
data
: remove-link event payloadtopoStartDone()