ONOS-6391: writing API readme's
- D3 api doc

Change-Id: I70ac164509e4d2ecb1f39d1e89e3a6a2bd6df282
diff --git a/web/gui/src/main/webapp/_doc/view/topo/README.d3.md b/web/gui/src/main/webapp/_doc/view/topo/README.d3.md
index dfda0ed..22bcf2a 100644
--- a/web/gui/src/main/webapp/_doc/view/topo/README.d3.md
+++ b/web/gui/src/main/webapp/_doc/view/topo/README.d3.md
@@ -7,43 +7,104 @@
 ### Function Descriptions
 
 `initD3(api, zoomer)`
+* `api`: reverse linkage to topoForce module
+  * `node()`: reference to D3 node selection
+  * `link()`: reference to D3 link selection
+  * `linkLabel()`: reference to D3 link label selection
+  * `instVisible()`: returns true if instance panel is visible
+  * `posNode(node, forUpdate)`: position node (see topoModel.js) 
+  * `showHosts()`: returns true if hosts are to be displayed
+  * `restyleLinkElement(ldata, immediate)`: link styling 
+  * `updateLinkLabelModel()`: update link labels
+  * `linkConfig()`: ref to link configuration data
+  * `deviceScale()`: scale value for devices (based on current zoom)
+  * `linkWidthScale()`: scale value for links (based on current zoom)
+* `zoomer`: zoomer object
+* Initializes this module with a function API to other modules
 
 `destroyD3()`
+* (currently a no-op)
 
 `incDevLabIndex()`
+* Increments the device label index (mod 3) and returns the
+  text to show in the "flash" message
 
 `setDevLabIndex(mode)`
+* `mode`: label mode index (0, 1, 2)
+* Sets the device label index to the given mode
+* Stores this choice in user preferences
 
 `hostLabel(d)`
+* `d`: host model data
+* Returns the label to display for the specified host, given
+  the current host label mode
 
 `deviceLabel(d)`
+* `d`: device model data
+* Returns the label to display for the specified device, given
+  the current device label mode
 
 `trimLabel(label)`
+* `label`: label to trim
+* Returns the specified label trimmed of whitespace
 
 `updateDeviceLabel(d)`
+* `d`: device model data
+* Updates the rendering of the specified device; specifically
+  the label and (if defined) the badge
 
 `updateHostLabel(d)`
+* `d`: host model data
+* Updates the rendering of the label for the specified host 
 
 `updateDeviceColors(d)`
+* `d`: device model data (optional)
+* Updates the color of the specified device 
+  (showing instance mastership)
+* If no parameter is given, updates the colors of _all_ devices
 
 `deviceExisting(d)`
+* `d`: device model data
+* Updates rendering of an existing (not new) device
 
 `hostExisting(d)`
+* `d`: host model data
+* Updates rendering of an existing (not new) host
 
 `deviceEnter(d)`
+* `d`: device model data
+* Sets up and renders a new device
 
 `hostEnter(d)`
+* `d`: host model data
+* Sets up and renders a new host
 
 `hostExit(d)`
+* `d`: host model data
+* Animates removal of (and removes) specified host
 
 `deviceExit(d)`
+* `d`: device model data
+* Animates removal of (and removes) specified device
 
 `linkEntering(d)`
+* `d`: link model data
+* Sets up and renders a new link
 
 `applyLinklabels()`
+* Re-renders labels currently defined on link models
 
 `transformLabel(p, id)`
+* `p`: position data
+* `id`: link id
+* Returns translation string for label positioning
 
 `applyPortLabels(data, portLabelG)`
+* `data`: port label data
+* `portLabelG`: port label SVG grouping element
+* Creates and renders port labels on links
 
 `applyNumLinkLabels(data, lblsG)`
+* `data`: link label data
+* `lblsG`: link label SVG grouping element
+* Renders a "crosshatch link" with count for multiple links
diff --git a/web/gui/src/main/webapp/app/view/topo/topoForce.js b/web/gui/src/main/webapp/app/view/topo/topoForce.js
index c33a232..9b9a29c 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoForce.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoForce.js
@@ -1017,7 +1017,7 @@
             updateLinkLabelModel: updateLinkLabelModel,
             linkConfig: function () { return linkConfig; },
             deviceScale: deviceScale,
-            linkWidthScale: linkWidthScale,
+            linkWidthScale: linkWidthScale
         };
     }