dc.graph
Version:
Graph visualizations integrated with crossfilter and dc.js
747 lines (586 loc) • 103 kB
Markdown
<a name="dc_graph"></a>
## dc\_graph : <code>object</code>
The entire dc.graph.js library is scoped under the **dc_graph** name space. It does not introduce
anything else into the global name space.
Like in dc.js and most libraries built on d3, most `dc_graph` functions are designed to allow function chaining, meaning they return the current diagram
instance whenever it is appropriate. The getter forms of functions do not participate in function
chaining because they return values that are not the diagram.
**Kind**: global namespace
**Version**: 0.9.7
**Example**
```js
// Example chaining
diagram.width(600)
.height(400)
.nodeDimension(nodeDim)
.nodeGroup(nodeGroup);
```
* [dc_graph](#dc_graph) : <code>object</code>
* [.diagram](#dc_graph.diagram)
* [new diagram(parent, [chartGroup])](#new_dc_graph.diagram_new)
* [.height([height])](#dc_graph.diagram+height) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.width([width])](#dc_graph.diagram+width) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.root([root])](#dc_graph.diagram+root) ⇒ <code>node</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.mouseZoomable([mouseZoomable])](#dc_graph.diagram+mouseZoomable) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.altKeyZoom([altKeyZoom])](#dc_graph.diagram+altKeyZoom) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.fitStrategy([fitStrategy])](#dc_graph.diagram+fitStrategy) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.autoZoom([autoZoom])](#dc_graph.diagram+autoZoom) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeDimension([nodeDimension])](#dc_graph.diagram+nodeDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeGroup([nodeGroup])](#dc_graph.diagram+nodeGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeDimension([edgeDimension])](#dc_graph.diagram+edgeDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeGroup([edgeGroup])](#dc_graph.diagram+edgeGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeKey([nodeKey])](#dc_graph.diagram+nodeKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeKey([edgeKey])](#dc_graph.diagram+edgeKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeSource([edgeSource])](#dc_graph.diagram+edgeSource) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeTarget([edgeTarget])](#dc_graph.diagram+edgeTarget) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterDimension([clusterDimension])](#dc_graph.diagram+clusterDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterGroup([clusterGroup])](#dc_graph.diagram+clusterGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterKey([clusterKey])](#dc_graph.diagram+clusterKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterParent([clusterParent])](#dc_graph.diagram+clusterParent) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterPadding([clusterPadding])](#dc_graph.diagram+clusterPadding) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeParentCluster([nodeParentCluster])](#dc_graph.diagram+nodeParentCluster) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeRadius([nodeRadius])](#dc_graph.diagram+nodeRadius) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeStrokeWidth([nodeStrokeWidth])](#dc_graph.diagram+nodeStrokeWidth) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeStroke([nodeStroke])](#dc_graph.diagram+nodeStroke) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFillScale([nodeFillScale])](#dc_graph.diagram+nodeFillScale) ⇒ <code>function</code> \| <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFill([nodeFill])](#dc_graph.diagram+nodeFill) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeOpacity([nodeOpacity])](#dc_graph.diagram+nodeOpacity) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodePadding([nodePadding])](#dc_graph.diagram+nodePadding) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabelPadding([nodeLabelPadding])](#dc_graph.diagram+nodeLabelPadding) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLineHeight([nodeLineHeight])](#dc_graph.diagram+nodeLineHeight) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabel([nodeLabel])](#dc_graph.diagram+nodeLabel) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabelFill([nodeLabelFill])](#dc_graph.diagram+nodeLabelFill) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFitLabel([nodeFitLabel])](#dc_graph.diagram+nodeFitLabel) ⇒ <code>function</code> \| <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeShape([nodeShape])](#dc_graph.diagram+nodeShape) ⇒ <code>function</code> \| <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeTitle([nodeTitle])](#dc_graph.diagram+nodeTitle) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeOrdering([nodeOrdering])](#dc_graph.diagram+nodeOrdering) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFixed([nodeFixed])](#dc_graph.diagram+nodeFixed) ⇒ <code>function</code> \| <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeStroke([edgeStroke])](#dc_graph.diagram+edgeStroke) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeStrokeWidth([edgeStrokeWidth])](#dc_graph.diagram+edgeStrokeWidth) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeOpacity([edgeOpacity])](#dc_graph.diagram+edgeOpacity) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeLabel([edgeLabel])](#dc_graph.diagram+edgeLabel) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowhead([edgeArrowhead])](#dc_graph.diagram+edgeArrowhead) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowtail([edgeArrowtail])](#dc_graph.diagram+edgeArrowtail) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowSize([edgeArrowSize])](#dc_graph.diagram+edgeArrowSize) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeIsLayout([edgeIsLayout])](#dc_graph.diagram+edgeIsLayout) ⇒ <code>function</code> \| <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.lengthStrategy([lengthStrategy])](#dc_graph.diagram+lengthStrategy) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeLength([edgeLength])](#dc_graph.diagram+edgeLength) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.flowLayout([flowLayout])](#dc_graph.diagram+flowLayout)
* [.rankdir([rankdir])](#dc_graph.diagram+rankdir)
* [.baseLength([baseLength])](#dc_graph.diagram+baseLength) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.transitionDuration([transitionDuration])](#dc_graph.diagram+transitionDuration) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.stageTransitions([stageTransitions])](#dc_graph.diagram+stageTransitions) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.deleteDelay([deleteDelay])](#dc_graph.diagram+deleteDelay) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.groupConnected([groupConnected])](#dc_graph.diagram+groupConnected) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.timeLimit([timeLimit])](#dc_graph.diagram+timeLimit) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.constrain([constrain])](#dc_graph.diagram+constrain) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.parallelEdgeOffset([parallelEdgeOffset])](#dc_graph.diagram+parallelEdgeOffset) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeOrdering([edgeOrdering])](#dc_graph.diagram+edgeOrdering) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.initLayoutOnRedraw([initLayoutOnRedraw])](#dc_graph.diagram+initLayoutOnRedraw) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.layoutUnchanged([layoutUnchanged])](#dc_graph.diagram+layoutUnchanged) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.relayout()](#dc_graph.diagram+relayout) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.initialLayout([initialLayout])](#dc_graph.diagram+initialLayout) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.induceNodes([induceNodes])](#dc_graph.diagram+induceNodes) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.showLayoutSteps([showLayoutSteps])](#dc_graph.diagram+showLayoutSteps) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.legend([legend])](#dc_graph.diagram+legend) ⇒ <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.child([id], [object])](#dc_graph.diagram+child) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.layoutAlgorithm([algo])](#dc_graph.diagram+layoutAlgorithm) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.layoutEngine([engine])](#dc_graph.diagram+layoutEngine)
* [.handleDisconnected([handleDisconnected])](#dc_graph.diagram+handleDisconnected) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.redraw()](#dc_graph.diagram+redraw) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.render()](#dc_graph.diagram+render) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.on([event], [f])](#dc_graph.diagram+on) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.getStats()](#dc_graph.diagram+getStats) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.x([scale])](#dc_graph.diagram+x) ⇒ <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.y([scale])](#dc_graph.diagram+y) ⇒ <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.redrawGroup()](#dc_graph.diagram+redrawGroup) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.renderGroup()](#dc_graph.diagram+renderGroup) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.anchor([parent], [chartGroup])](#dc_graph.diagram+anchor) ⇒ <code>String</code> \| <code>node</code> \| <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.anchorName()](#dc_graph.diagram+anchorName) ⇒ <code>String</code>
* [.select([selector])](#dc_graph.diagram+select) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.selectAll([selector])](#dc_graph.diagram+selectAll) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.svg([selection])](#dc_graph.diagram+svg) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.g([selection])](#dc_graph.diagram+g) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.resetSvg()](#dc_graph.diagram+resetSvg) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.graphviz_attrs](#dc_graph.graphviz_attrs)
* [new graphviz_attrs()](#new_dc_graph.graphviz_attrs_new)
* [.rankdir([rankdir])](#dc_graph.graphviz_attrs+rankdir)
* [.nodesep([nodesep])](#dc_graph.graphviz_attrs+nodesep)
* [.ranksep([ranksep])](#dc_graph.graphviz_attrs+ranksep)
* [.cola_layout](#dc_graph.cola_layout)
* [new cola_layout([id])](#new_dc_graph.cola_layout_new)
* [.handleDisconnected([handleDisconnected])](#dc_graph.cola_layout+handleDisconnected) ⇒ <code>Boolean</code> \| [<code>cola\_layout</code>](#dc_graph.cola_layout)
* [.lengthStrategy([lengthStrategy])](#dc_graph.cola_layout+lengthStrategy) ⇒ <code>function</code> \| <code>String</code> \| [<code>cola\_layout</code>](#dc_graph.cola_layout)
* [.baseLength([baseLength])](#dc_graph.cola_layout+baseLength) ⇒ <code>Number</code> \| [<code>cola\_layout</code>](#dc_graph.cola_layout)
* [.flowLayout([flowLayout])](#dc_graph.cola_layout+flowLayout)
* [.dagre_layout](#dc_graph.dagre_layout)
* [new dagre_layout([id])](#new_dc_graph.dagre_layout_new)
* [.tree_layout](#dc_graph.tree_layout)
* [new tree_layout([id])](#new_dc_graph.tree_layout_new)
* [.graphviz_layout](#dc_graph.graphviz_layout)
* [new graphviz_layout([id])](#new_dc_graph.graphviz_layout_new)
* [.d3_force_layout](#dc_graph.d3_force_layout)
* [new d3_force_layout([id])](#new_dc_graph.d3_force_layout_new)
* [.d3v4_force_layout](#dc_graph.d3v4_force_layout)
* [new d3v4_force_layout([id])](#new_dc_graph.d3v4_force_layout_new)
* [.flexbox_layout](#dc_graph.flexbox_layout)
* [new flexbox_layout([id])](#new_dc_graph.flexbox_layout_new)
* [.addressToKey([addressToKey])](#dc_graph.flexbox_layout+addressToKey) ⇒ <code>function</code> \| [<code>flexbox\_layout</code>](#dc_graph.flexbox_layout)
* [.keyToAddress([keyToAddress])](#dc_graph.flexbox_layout+keyToAddress) ⇒ <code>function</code> \| [<code>flexbox\_layout</code>](#dc_graph.flexbox_layout)
* [.layered_layout](#dc_graph.layered_layout)
* [new layered_layout([id])](#new_dc_graph.layered_layout_new)
* [.constraint_pattern](#dc_graph.constraint_pattern)
* [new constraint_pattern(diagram, pattern)](#new_dc_graph.constraint_pattern_new)
* [.tip](#dc_graph.tip)
* [new tip()](#new_dc_graph.tip_new)
* [.direction](#dc_graph.tip+direction) ⇒ <code>String</code> \| [<code>tip</code>](#dc_graph.tip)
* [.content](#dc_graph.tip+content) ⇒ <code>function</code>
* [.table](#dc_graph.tip+table) ⇒ <code>function</code>
* [.brush](#dc_graph.brush)
* [new brush()](#new_dc_graph.brush_new)
* [.on(event, [f])](#dc_graph.brush+on) ⇒ [<code>brush</code>](#dc_graph.brush) \| <code>function</code>
* [.activate()](#dc_graph.brush+activate) ⇒ [<code>brush</code>](#dc_graph.brush)
* [.deactivate()](#dc_graph.brush+deactivate) ⇒ [<code>brush</code>](#dc_graph.brush)
* [.isActive()](#dc_graph.brush+isActive) ⇒ <code>Boolean</code>
* [.flat_group](#dc_graph.flat_group) : <code>object</code>
* [.make(source, id_accessor)](#dc_graph.flat_group.make) ⇒ <code>Object</code>
* ~~[.another(ndx, id_accessor)](#dc_graph.flat_group.another) ⇒ <code>Object</code>~~
<a name="dc_graph.diagram"></a>
### dc_graph.diagram
**Kind**: static class of [<code>dc\_graph</code>](#dc_graph)
* [.diagram](#dc_graph.diagram)
* [new diagram(parent, [chartGroup])](#new_dc_graph.diagram_new)
* [.height([height])](#dc_graph.diagram+height) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.width([width])](#dc_graph.diagram+width) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.root([root])](#dc_graph.diagram+root) ⇒ <code>node</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.mouseZoomable([mouseZoomable])](#dc_graph.diagram+mouseZoomable) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.altKeyZoom([altKeyZoom])](#dc_graph.diagram+altKeyZoom) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.fitStrategy([fitStrategy])](#dc_graph.diagram+fitStrategy) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.autoZoom([autoZoom])](#dc_graph.diagram+autoZoom) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeDimension([nodeDimension])](#dc_graph.diagram+nodeDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeGroup([nodeGroup])](#dc_graph.diagram+nodeGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeDimension([edgeDimension])](#dc_graph.diagram+edgeDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeGroup([edgeGroup])](#dc_graph.diagram+edgeGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeKey([nodeKey])](#dc_graph.diagram+nodeKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeKey([edgeKey])](#dc_graph.diagram+edgeKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeSource([edgeSource])](#dc_graph.diagram+edgeSource) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeTarget([edgeTarget])](#dc_graph.diagram+edgeTarget) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterDimension([clusterDimension])](#dc_graph.diagram+clusterDimension) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterGroup([clusterGroup])](#dc_graph.diagram+clusterGroup) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterKey([clusterKey])](#dc_graph.diagram+clusterKey) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterParent([clusterParent])](#dc_graph.diagram+clusterParent) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.clusterPadding([clusterPadding])](#dc_graph.diagram+clusterPadding) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeParentCluster([nodeParentCluster])](#dc_graph.diagram+nodeParentCluster) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeRadius([nodeRadius])](#dc_graph.diagram+nodeRadius) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeStrokeWidth([nodeStrokeWidth])](#dc_graph.diagram+nodeStrokeWidth) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeStroke([nodeStroke])](#dc_graph.diagram+nodeStroke) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFillScale([nodeFillScale])](#dc_graph.diagram+nodeFillScale) ⇒ <code>function</code> \| <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFill([nodeFill])](#dc_graph.diagram+nodeFill) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeOpacity([nodeOpacity])](#dc_graph.diagram+nodeOpacity) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodePadding([nodePadding])](#dc_graph.diagram+nodePadding) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabelPadding([nodeLabelPadding])](#dc_graph.diagram+nodeLabelPadding) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLineHeight([nodeLineHeight])](#dc_graph.diagram+nodeLineHeight) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabel([nodeLabel])](#dc_graph.diagram+nodeLabel) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeLabelFill([nodeLabelFill])](#dc_graph.diagram+nodeLabelFill) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFitLabel([nodeFitLabel])](#dc_graph.diagram+nodeFitLabel) ⇒ <code>function</code> \| <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeShape([nodeShape])](#dc_graph.diagram+nodeShape) ⇒ <code>function</code> \| <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeTitle([nodeTitle])](#dc_graph.diagram+nodeTitle) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeOrdering([nodeOrdering])](#dc_graph.diagram+nodeOrdering) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.nodeFixed([nodeFixed])](#dc_graph.diagram+nodeFixed) ⇒ <code>function</code> \| <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeStroke([edgeStroke])](#dc_graph.diagram+edgeStroke) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeStrokeWidth([edgeStrokeWidth])](#dc_graph.diagram+edgeStrokeWidth) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeOpacity([edgeOpacity])](#dc_graph.diagram+edgeOpacity) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeLabel([edgeLabel])](#dc_graph.diagram+edgeLabel) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowhead([edgeArrowhead])](#dc_graph.diagram+edgeArrowhead) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowtail([edgeArrowtail])](#dc_graph.diagram+edgeArrowtail) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeArrowSize([edgeArrowSize])](#dc_graph.diagram+edgeArrowSize) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeIsLayout([edgeIsLayout])](#dc_graph.diagram+edgeIsLayout) ⇒ <code>function</code> \| <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.lengthStrategy([lengthStrategy])](#dc_graph.diagram+lengthStrategy) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeLength([edgeLength])](#dc_graph.diagram+edgeLength) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.flowLayout([flowLayout])](#dc_graph.diagram+flowLayout)
* [.rankdir([rankdir])](#dc_graph.diagram+rankdir)
* [.baseLength([baseLength])](#dc_graph.diagram+baseLength) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.transitionDuration([transitionDuration])](#dc_graph.diagram+transitionDuration) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.stageTransitions([stageTransitions])](#dc_graph.diagram+stageTransitions) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.deleteDelay([deleteDelay])](#dc_graph.diagram+deleteDelay) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.groupConnected([groupConnected])](#dc_graph.diagram+groupConnected) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.timeLimit([timeLimit])](#dc_graph.diagram+timeLimit) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.constrain([constrain])](#dc_graph.diagram+constrain) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.parallelEdgeOffset([parallelEdgeOffset])](#dc_graph.diagram+parallelEdgeOffset) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.edgeOrdering([edgeOrdering])](#dc_graph.diagram+edgeOrdering) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.initLayoutOnRedraw([initLayoutOnRedraw])](#dc_graph.diagram+initLayoutOnRedraw) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.layoutUnchanged([layoutUnchanged])](#dc_graph.diagram+layoutUnchanged) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.relayout()](#dc_graph.diagram+relayout) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.initialLayout([initialLayout])](#dc_graph.diagram+initialLayout) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.induceNodes([induceNodes])](#dc_graph.diagram+induceNodes) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.showLayoutSteps([showLayoutSteps])](#dc_graph.diagram+showLayoutSteps) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.legend([legend])](#dc_graph.diagram+legend) ⇒ <code>Object</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.child([id], [object])](#dc_graph.diagram+child) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.layoutAlgorithm([algo])](#dc_graph.diagram+layoutAlgorithm) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.layoutEngine([engine])](#dc_graph.diagram+layoutEngine)
* [.handleDisconnected([handleDisconnected])](#dc_graph.diagram+handleDisconnected) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.redraw()](#dc_graph.diagram+redraw) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.render()](#dc_graph.diagram+render) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.on([event], [f])](#dc_graph.diagram+on) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.getStats()](#dc_graph.diagram+getStats) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.x([scale])](#dc_graph.diagram+x) ⇒ <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.y([scale])](#dc_graph.diagram+y) ⇒ <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.redrawGroup()](#dc_graph.diagram+redrawGroup) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.renderGroup()](#dc_graph.diagram+renderGroup) ⇒ [<code>diagram</code>](#dc_graph.diagram)
* [.anchor([parent], [chartGroup])](#dc_graph.diagram+anchor) ⇒ <code>String</code> \| <code>node</code> \| <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.anchorName()](#dc_graph.diagram+anchorName) ⇒ <code>String</code>
* [.select([selector])](#dc_graph.diagram+select) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.selectAll([selector])](#dc_graph.diagram+selectAll) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.svg([selection])](#dc_graph.diagram+svg) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.g([selection])](#dc_graph.diagram+g) ⇒ <code>d3.selection</code> \| [<code>diagram</code>](#dc_graph.diagram)
* [.resetSvg()](#dc_graph.diagram+resetSvg) ⇒ [<code>diagram</code>](#dc_graph.diagram)
<a name="new_dc_graph.diagram_new"></a>
#### new diagram(parent, [chartGroup])
`dc_graph.diagram` is a dc.js-compatible network visualization component. It registers in
the dc.js chart registry and its nodes and edges are generated from crossfilter groups. It
logically derives from the dc.js
[baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin),
but it does not physically derive from it since so much is different about network
visualization versus conventional charts.
| Param | Type | Description |
| --- | --- | --- |
| parent | <code>String</code> \| <code>node</code> | Any valid [d3 single selector](https://github.com/mbostock/d3/wiki/Selections#selecting-elements) specifying a dom block element such as a div; or a dom element. |
| [chartGroup] | <code>String</code> | The name of the dc.js chart group this diagram instance should be placed in. Filter interaction with a diagram will only trigger events and redraws within the diagram's group. |
<a name="dc_graph.diagram+height"></a>
#### diagram.height([height]) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the height attribute of the diagram. If a value is given, then the diagram is
returned for method chaining. If no value is given, then the current value of the height
attribute will be returned.
The width and height are applied to the SVG element generated by the diagram on render, or
when `resizeSvg` is called.
If the value is falsy or a function, the height will be calculated the first time it is
needed, using the provided function or default height calculator, and then cached. The
default calculator uses the client rect of the element specified when constructing the chart,
with a minimum of `minHeight`. A custom calculator will be passed the element.
If the value is `'auto'`, the height will be calculated every time the diagram is drawn, and
it will not be set on the `<svg>` element. Instead, the element will be pinned to the same
rectangle as its containing div using CSS.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [height] | <code>Number</code> | <code>200</code> |
<a name="dc_graph.diagram+width"></a>
#### diagram.width([width]) ⇒ <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the width attribute of the diagram. If a value is given, then the diagram is
returned for method chaining. If no value is given, then the current value of the width
attribute will be returned.
The width and height are applied to the SVG element generated by the diagram on render, or
when `resizeSvg` is called.
If the value is falsy or a function, the width will be calculated the first time it is
needed, using the provided function or default width calculator, and then cached. The default
calculator uses the client rect of the element specified when constructing the chart, with a
minimum of `minWidth`. A custom calculator will be passed the element.
If the value is `'auto'`, the width will be calculated every time the diagram is drawn, and
it will not be set on the `<svg>` element. Instead, the element will be pinned to the same
rectangle as its containing div using CSS.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [width] | <code>Number</code> | <code>200</code> |
<a name="dc_graph.diagram+root"></a>
#### diagram.root([root]) ⇒ <code>node</code> \| [<code>diagram</code>](#dc_graph.diagram)
Get or set the root element, which is usually the parent div. Normally the root is set
when the diagram is constructed; setting it later may have unexpected consequences.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [root] | <code>node</code> | <code></code> |
<a name="dc_graph.diagram+mouseZoomable"></a>
#### diagram.mouseZoomable([mouseZoomable]) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
Get or set whether mouse wheel rotation or touchpad gestures will zoom the diagram, and
whether dragging on the background pans the diagram.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [mouseZoomable] | <code>Boolean</code> | <code>true</code> |
<a name="dc_graph.diagram+altKeyZoom"></a>
#### diagram.altKeyZoom([altKeyZoom]) ⇒ <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
Whether zooming should only be enabled when the alt key is pressed.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [altKeyZoom] | <code>Boolean</code> | <code>true</code> |
<a name="dc_graph.diagram+fitStrategy"></a>
#### diagram.fitStrategy([fitStrategy]) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the fitting strategy for the canvas, which affects how the translate
and scale get calculated when `autoZoom` is triggered.
* `'default'` - simulates the preserveAspectRatio behavior of `xMidYMid meet`, but
with margins - the content is stretched or squished in the more constrained
direction, and centered in the other direction
* `'vertical'` - fits the canvas vertically (with vertical margins) and centers
it horizontally. If the canvas is taller than the viewport, it will meet
vertically and there will be blank areas to the left and right. If the canvas
is wider than the viewport, it will be sliced.
* `'horizontal'` - fits the canvas horizontally (with horizontal margins) and
centers it vertically. If the canvas is wider than the viewport, it will meet
horizontally and there will be blank areas above and below. If the canvas is
taller than the viewport, it will be sliced.
Other options
* `null` - no attempt is made to fit the content in the viewport
* `'zoom'` - does not scale the content, but attempts to bring as much content
into view as possible, using using the same algorithm as `restrictPan`
* `'align_{tlbrc}[2]'` - does not scale; aligns up to two sides or centers them
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [fitStrategy] | <code>String</code> | <code>'default'</code> |
<a name="dc_graph.diagram+autoZoom"></a>
#### diagram.autoZoom([autoZoom]) ⇒ <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Auto-zoom behavior.
* `'always'` - zoom every time layout happens
* `'once'` - zoom the next time layout happens
* `null` - manual, call `zoomToFit` to fit
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [autoZoom] | <code>String</code> | <code></code> |
<a name="dc_graph.diagram+nodeDimension"></a>
#### diagram.nodeDimension([nodeDimension]) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter dimension which represents the nodes (vertices) in the
diagram. Typically there will be a crossfilter instance for the nodes, and another for
the edges.
*Dimensions are included on the diagram for similarity to dc.js, however the diagram
itself does not use them - but [filter_selection](dc_graph.filter_selection) will.*
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [nodeDimension] | <code>crossfilter.dimension</code> |
<a name="dc_graph.diagram+nodeGroup"></a>
#### diagram.nodeGroup([nodeGroup]) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter group which is the data source for the nodes in the
diagram. The diagram will use the group's `.all()` method to get an array of `{key,
value}` pairs, where the key is a unique identifier, and the value is usually an object
containing the node's attributes. All accessors work with these key/value pairs.
If the group is changed or returns different values, the next call to `.redraw()` will
reflect the changes incrementally.
It is possible to pass another object with the same `.all()` interface instead of a
crossfilter group.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [nodeGroup] | <code>crossfilter.group</code> |
<a name="dc_graph.diagram+edgeDimension"></a>
#### diagram.edgeDimension([edgeDimension]) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter dimension which represents the edges in the
diagram. Typically there will be a crossfilter instance for the nodes, and another for
the edges.
*Dimensions are included on the diagram for similarity to dc.js, however the diagram
itself does not use them - but [filter_selection](dc_graph.filter_selection) will.*
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [edgeDimension] | <code>crossfilter.dimension</code> |
<a name="dc_graph.diagram+edgeGroup"></a>
#### diagram.edgeGroup([edgeGroup]) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter group which is the data source for the edges in the
diagram. See `.nodeGroup` above for the way data is loaded from a crossfilter group.
The values in the key/value pairs returned by `diagram.edgeGroup().all()` need to
support, at a minimum, the [nodeSource](dc_graph.diagram#nodeSource) and
[nodeTarget](dc_graph.diagram#nodeTarget), which should return the same
keys as the [nodeKey](#dc_graph.diagram+nodeKey)
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [edgeGroup] | <code>crossfilter.group</code> |
<a name="dc_graph.diagram+nodeKey"></a>
#### diagram.nodeKey([nodeKey]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the unique key for each node. By
default, this accesses the `key` field of the object passed to it. The keys should match
the keys returned by the [edgeSource](#dc_graph.diagram+edgeSource) and
[edgeTarget](#dc_graph.diagram+edgeTarget).
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeKey] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+edgeKey"></a>
#### diagram.edgeKey([edgeKey]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the unique key for each edge. By
default, this accesses the `key` field of the object passed to it.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [edgeKey] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+edgeSource"></a>
#### diagram.edgeSource([edgeSource]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the source (origin/tail) key of
the edge objects. The key must equal the key returned by the `.nodeKey` for one of the
nodes; if it does not, or if the node is currently filtered out, the edge will not be
displayed. By default, looks for `.value.sourcename`.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [edgeSource] | <code>function</code> | <code>function(kv) { return kv.value.sourcename; }</code> |
<a name="dc_graph.diagram+edgeTarget"></a>
#### diagram.edgeTarget([edgeTarget]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the target (destination/head) key
of the edge objects. The key must equal the key returned by the
[nodeKey](#dc_graph.diagram+nodeKey) for one of the nodes; if it does not, or if the node
is currently filtered out, the edge will not be displayed. By default, looks for
`.value.targetname`.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [edgeTarget] | <code>function</code> | <code>function(kv) { return kv.value.targetname; }</code> |
<a name="dc_graph.diagram+clusterDimension"></a>
#### diagram.clusterDimension([clusterDimension]) ⇒ <code>crossfilter.dimension</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter dimension which represents the edges in the
diagram. Typically there will be a crossfilter instance for the nodes, and another for
the edges.
*As with node and edge dimensions, the diagram will itself not filter on cluster dimensions;
this is included for symmetry, and for modes which may want to filter clusters.*
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [clusterDimension] | <code>crossfilter.dimension</code> |
<a name="dc_graph.diagram+clusterGroup"></a>
#### diagram.clusterGroup([clusterGroup]) ⇒ <code>crossfilter.group</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the crossfilter group which is the data source for clusters in the
diagram.
The key/value pairs returned by `diagram.clusterGroup().all()` need to support, at a minimum,
the [clusterKey](#dc_graph.diagram+clusterKey) and [clusterParent](#dc_graph.diagram+clusterParent)
accessors, which should return keys in this group.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [clusterGroup] | <code>crossfilter.group</code> |
<a name="dc_graph.diagram+clusterKey"></a>
#### diagram.clusterKey([clusterKey]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the unique key for each cluster. By
default, this accesses the `key` field of the object passed to it.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [clusterKey] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+clusterParent"></a>
#### diagram.clusterParent([clusterParent]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the key of the parent of a cluster,
which is another cluster.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [clusterParent] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+clusterPadding"></a>
#### diagram.clusterPadding([clusterPadding]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the padding, in pixels, around a cluster.
**To be implemented.** If a single value is returned, it will be used on all sides; if two
values are returned they will be interpreted as the vertical and horizontal padding.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [clusterPadding] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+nodeParentCluster"></a>
#### diagram.nodeParentCluster([nodeParentCluster]) ⇒ <code>function</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the parent cluster of a node, or
`null` if the node is not in a cluster.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeParentCluster] | <code>function</code> | <code>function(kv) { return kv.key }</code> |
<a name="dc_graph.diagram+nodeRadius"></a>
#### diagram.nodeRadius([nodeRadius]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the radius, in pixels, for each
node. This determines the height of nodes,and if `nodeFitLabel` is false, the width too.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeRadius] | <code>function</code> \| <code>Number</code> | <code>25</code> |
<a name="dc_graph.diagram+nodeStrokeWidth"></a>
#### diagram.nodeStrokeWidth([nodeStrokeWidth]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the stroke width, in pixels, for
drawing the outline of each node. According to the SVG specification, the outline will
be drawn half on top of the fill, and half outside. Default: 1
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeStrokeWidth] | <code>function</code> \| <code>Number</code> | <code>1</code> |
<a name="dc_graph.diagram+nodeStroke"></a>
#### diagram.nodeStroke([nodeStroke]) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the stroke color for the outline
of each node.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeStroke] | <code>function</code> \| <code>String</code> | <code>'black'</code> |
<a name="dc_graph.diagram+nodeFillScale"></a>
#### diagram.nodeFillScale([nodeFillScale]) ⇒ <code>function</code> \| <code>d3.scale</code> \| [<code>diagram</code>](#dc_graph.diagram)
If set, the value returned from `nodeFill` will be processed through this
[d3.scale](https://github.com/mbostock/d3/wiki/Scales)
to return the fill color. If falsy, uses the identity function (no scale).
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [nodeFillScale] | <code>function</code> \| <code>d3.scale</code> |
<a name="dc_graph.diagram+nodeFill"></a>
#### diagram.nodeFill([nodeFill]) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the fill color for the body of each
node.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeFill] | <code>function</code> \| <code>String</code> | <code>'white'</code> |
<a name="dc_graph.diagram+nodeOpacity"></a>
#### diagram.nodeOpacity([nodeOpacity]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the opacity of each node.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeOpacity] | <code>function</code> \| <code>Number</code> | <code>1</code> |
<a name="dc_graph.diagram+nodePadding"></a>
#### diagram.nodePadding([nodePadding]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the padding or minimum distance, in pixels, for a node. (Will be distributed
to both sides of the node.)
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodePadding] | <code>function</code> \| <code>Number</code> | <code>6</code> |
<a name="dc_graph.diagram+nodeLabelPadding"></a>
#### diagram.nodeLabelPadding([nodeLabelPadding]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the padding, in pixels, for a node's label. If an object, should contain fields
`x` and `y`. If a number, will be applied to both x and y.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeLabelPadding] | <code>function</code> \| <code>Number</code> \| <code>Object</code> | <code>0</code> |
<a name="dc_graph.diagram+nodeLineHeight"></a>
#### diagram.nodeLineHeight([nodeLineHeight]) ⇒ <code>function</code> \| <code>Number</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the line height for nodes with multiple lines of text, in ems.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeLineHeight] | <code>function</code> \| <code>Number</code> | <code>1</code> |
<a name="dc_graph.diagram+nodeLabel"></a>
#### diagram.nodeLabel([nodeLabel]) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the label text to display in each
node. By default, looks for a field `label` or `name` inside the `value` field.
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type |
| --- | --- |
| [nodeLabel] | <code>function</code> \| <code>String</code> |
**Example**
```js
// Default behavior
diagram.nodeLabel(function(kv) {
return kv.value.label || kv.value.name;
});
```
<a name="dc_graph.diagram+nodeLabelFill"></a>
#### diagram.nodeLabelFill([nodeLabelFill]) ⇒ <code>function</code> \| <code>String</code> \| [<code>diagram</code>](#dc_graph.diagram)
Set or get the function which will be used to retrieve the label fill color. Default: null
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeLabelFill] | <code>function</code> \| <code>String</code> | <code></code> |
<a name="dc_graph.diagram+nodeFitLabel"></a>
#### diagram.nodeFitLabel([nodeFitLabel]) ⇒ <code>function</code> \| <code>Boolean</code> \| [<code>diagram</code>](#dc_graph.diagram)
Whether to fit the node shape around the label
**Kind**: instance method of [<code>diagram</code>](#dc_graph.diagram)
| Param | Type | Default |
| --- | --- | --- |
| [nodeFitLabel] | <code>function</code> \| <code>Boolean</code> | <code>true</code> |
<a name="dc_graph.diagram+nodeShape"></a>
#### diagram.nodeShape([nodeShape]) ⇒ <code>function</code> \| <code>Object</code> \| [<code>diagram</code>](#dc