From 2cea0f2ed5ba5bb35934f6f9094379070a8a6ac6 Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Thu, 16 Mar 2017 14:37:19 -0400 Subject: [PATCH] fix link; markdown docs --- Changelog.md | 2 +- web/docs/api-latest.md | 879 +++++++++++++++++++++++++---------------- 2 files changed, 550 insertions(+), 331 deletions(-) diff --git a/Changelog.md b/Changelog.md index 7b13e5de..de9322e8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,7 +4,7 @@ deprecated on the diagram object * `cola`, `dagre`, `tree` `_layout` are the current layout engines, and it should be possible to plug in others without modifying dc.graph.js -* [graphviz_attrs](http://dc-js.github.io/dc.graph.js/docs/html/graphviz_attrs.html) is the "base +* [graphviz_attrs](http://dc-js.github.io/dc.graph.js/docs/html/dc_graph.graphviz_attrs.html) is the "base class" for layout engines that want to support the [common attributes of graphviz](http://www.graphviz.org/doc/info/attrs.html). currently these are just `rankdir` and `ranksep`. diff --git a/web/docs/api-latest.md b/web/docs/api-latest.md index d531b9f4..17380b05 100644 --- a/web/docs/api-latest.md +++ b/web/docs/api-latest.md @@ -9,7 +9,7 @@ instance whenever it is appropriate. The getter forms of functions do not parti chaining because they return values that are not the chart. **Kind**: global namespace -**Version**: 0.3.16 +**Version**: 0.4.0 **Example** ```js // Example chaining @@ -22,77 +22,94 @@ chart.width(600) * [dc_graph](#dc_graph) : object * [.diagram](#dc_graph.diagram) * [new diagram(parent, [chartGroup])](#new_dc_graph.diagram_new) - * [.width](#dc_graph.diagram+width) ⇒ Number | [diagram](#dc_graph.diagram) - * [.height](#dc_graph.diagram+height) ⇒ Number | [diagram](#dc_graph.diagram) - * [.root](#dc_graph.diagram+root) ⇒ node | [diagram](#dc_graph.diagram) - * [.mouseZoomable](#dc_graph.diagram+mouseZoomable) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.fitStrategy](#dc_graph.diagram+fitStrategy) ⇒ String | [diagram](#dc_graph.diagram) - * [.autoZoom](#dc_graph.diagram+autoZoom) ⇒ String | [diagram](#dc_graph.diagram) - * [.nodeDimension](#dc_graph.diagram+nodeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) - * [.nodeGroup](#dc_graph.diagram+nodeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) - * [.edgeDimension](#dc_graph.diagram+edgeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) - * [.edgeGroup](#dc_graph.diagram+edgeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) - * [.nodeKey](#dc_graph.diagram+nodeKey) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeKey](#dc_graph.diagram+edgeKey) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeSource](#dc_graph.diagram+edgeSource) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeTarget](#dc_graph.diagram+edgeTarget) ⇒ function | [diagram](#dc_graph.diagram) - * [.nodeRadius](#dc_graph.diagram+nodeRadius) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeStrokeWidth](#dc_graph.diagram+nodeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeStroke](#dc_graph.diagram+nodeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeFillScale](#dc_graph.diagram+nodeFillScale) ⇒ function | d3.scale | [diagram](#dc_graph.diagram) - * [.nodeFill](#dc_graph.diagram+nodeFill) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeOpacity](#dc_graph.diagram+nodeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodePadding](#dc_graph.diagram+nodePadding) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeLabel](#dc_graph.diagram+nodeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeLabelFill](#dc_graph.diagram+nodeLabelFill) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeFitLabel](#dc_graph.diagram+nodeFitLabel) ⇒ function | Boolean | [diagram](#dc_graph.diagram) - * [.nodeShape](#dc_graph.diagram+nodeShape) ⇒ function | Object | [diagram](#dc_graph.diagram) - * [.nodeTitle](#dc_graph.diagram+nodeTitle) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeOrdering](#dc_graph.diagram+nodeOrdering) ⇒ function | [diagram](#dc_graph.diagram) - * [.nodeFixed](#dc_graph.diagram+nodeFixed) ⇒ function | Object | [diagram](#dc_graph.diagram) - * [.edgeStroke](#dc_graph.diagram+edgeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeStrokeWidth](#dc_graph.diagram+edgeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeOpacity](#dc_graph.diagram+edgeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeLabel](#dc_graph.diagram+edgeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowhead](#dc_graph.diagram+edgeArrowhead) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowtail](#dc_graph.diagram+edgeArrowtail) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowSize](#dc_graph.diagram+edgeArrowSize) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeIsLayout](#dc_graph.diagram+edgeIsLayout) ⇒ function | Boolean | [diagram](#dc_graph.diagram) - * [.lengthStrategy](#dc_graph.diagram+lengthStrategy) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeLength](#dc_graph.diagram+edgeLength) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.flowLayout](#dc_graph.diagram+flowLayout) - * [.rankdir](#dc_graph.diagram+rankdir) - * [.baseLength](#dc_graph.diagram+baseLength) ⇒ Number | [diagram](#dc_graph.diagram) - * [.transitionDuration](#dc_graph.diagram+transitionDuration) ⇒ Number | [diagram](#dc_graph.diagram) - * [.stageTransitions](#dc_graph.diagram+stageTransitions) ⇒ String | [diagram](#dc_graph.diagram) - * [.deleteDelay](#dc_graph.diagram+deleteDelay) ⇒ Number | [diagram](#dc_graph.diagram) - * [.groupConnected](#dc_graph.diagram+groupConnected) ⇒ String | [diagram](#dc_graph.diagram) - * [.timeLimit](#dc_graph.diagram+timeLimit) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.constrain](#dc_graph.diagram+constrain) ⇒ function | [diagram](#dc_graph.diagram) - * [.parallelEdgeOffset](#dc_graph.diagram+parallelEdgeOffset) ⇒ Number | [diagram](#dc_graph.diagram) - * [.edgeOrdering](#dc_graph.diagram+edgeOrdering) ⇒ function | [diagram](#dc_graph.diagram) - * [.initLayoutOnRedraw](#dc_graph.diagram+initLayoutOnRedraw) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.layoutUnchanged](#dc_graph.diagram+layoutUnchanged) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.relayout](#dc_graph.diagram+relayout) ⇒ [diagram](#dc_graph.diagram) - * [.initialLayout](#dc_graph.diagram+initialLayout) ⇒ function | [diagram](#dc_graph.diagram) - * [.induceNodes](#dc_graph.diagram+induceNodes) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.showLayoutSteps](#dc_graph.diagram+showLayoutSteps) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.legend](#dc_graph.diagram+legend) ⇒ Object | [diagram](#dc_graph.diagram) - * [.child](#dc_graph.diagram+child) ⇒ [diagram](#dc_graph.diagram) - * [.layoutAlgorithm](#dc_graph.diagram+layoutAlgorithm) ⇒ [diagram](#dc_graph.diagram) - * [.handleDisconnected](#dc_graph.diagram+handleDisconnected) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.render](#dc_graph.diagram+render) ⇒ [diagram](#dc_graph.diagram) - * [.on](#dc_graph.diagram+on) ⇒ [diagram](#dc_graph.diagram) - * [.getStats](#dc_graph.diagram+getStats) ⇒ [diagram](#dc_graph.diagram) - * [.select](#dc_graph.diagram+select) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.selectAll](#dc_graph.diagram+selectAll) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.svg](#dc_graph.diagram+svg) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.resetSvg](#dc_graph.diagram+resetSvg) ⇒ [diagram](#dc_graph.diagram) - * [.redrawGroup](#dc_graph.diagram+redrawGroup) ⇒ [diagram](#dc_graph.diagram) - * [.renderGroup](#dc_graph.diagram+renderGroup) ⇒ [diagram](#dc_graph.diagram) - * [.defineArrow](#dc_graph.diagram+defineArrow) ⇒ [diagram](#dc_graph.diagram) + * [.width([width])](#dc_graph.diagram+width) ⇒ Number | [diagram](#dc_graph.diagram) + * [.height([height])](#dc_graph.diagram+height) ⇒ Number | [diagram](#dc_graph.diagram) + * [.root([root])](#dc_graph.diagram+root) ⇒ node | [diagram](#dc_graph.diagram) + * [.mouseZoomable([mouseZoomable])](#dc_graph.diagram+mouseZoomable) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.fitStrategy([fitStrategy])](#dc_graph.diagram+fitStrategy) ⇒ String | [diagram](#dc_graph.diagram) + * [.autoZoom([autoZoom])](#dc_graph.diagram+autoZoom) ⇒ String | [diagram](#dc_graph.diagram) + * [.nodeDimension([nodeDimension])](#dc_graph.diagram+nodeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) + * [.nodeGroup([nodeGroup])](#dc_graph.diagram+nodeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) + * [.edgeDimension([edgeDimension])](#dc_graph.diagram+edgeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) + * [.edgeGroup([edgeGroup])](#dc_graph.diagram+edgeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) + * [.nodeKey([nodeKey])](#dc_graph.diagram+nodeKey) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeKey([edgeKey])](#dc_graph.diagram+edgeKey) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeSource([edgeSource])](#dc_graph.diagram+edgeSource) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeTarget([edgeTarget])](#dc_graph.diagram+edgeTarget) ⇒ function | [diagram](#dc_graph.diagram) + * [.nodeRadius([nodeRadius])](#dc_graph.diagram+nodeRadius) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeStrokeWidth([nodeStrokeWidth])](#dc_graph.diagram+nodeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeStroke([nodeStroke])](#dc_graph.diagram+nodeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeFillScale([nodeFillScale])](#dc_graph.diagram+nodeFillScale) ⇒ function | d3.scale | [diagram](#dc_graph.diagram) + * [.nodeFill([nodeFill])](#dc_graph.diagram+nodeFill) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeOpacity([nodeOpacity])](#dc_graph.diagram+nodeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodePadding([nodePadding])](#dc_graph.diagram+nodePadding) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeLabel([nodeLabel])](#dc_graph.diagram+nodeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeLabelFill([nodeLabelFill])](#dc_graph.diagram+nodeLabelFill) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeFitLabel([nodeFitLabel])](#dc_graph.diagram+nodeFitLabel) ⇒ function | Boolean | [diagram](#dc_graph.diagram) + * [.nodeShape([nodeShape])](#dc_graph.diagram+nodeShape) ⇒ function | Object | [diagram](#dc_graph.diagram) + * [.nodeTitle([nodeTitle])](#dc_graph.diagram+nodeTitle) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeOrdering([nodeOrdering])](#dc_graph.diagram+nodeOrdering) ⇒ function | [diagram](#dc_graph.diagram) + * [.nodeFixed([nodeFixed])](#dc_graph.diagram+nodeFixed) ⇒ function | Object | [diagram](#dc_graph.diagram) + * [.edgeStroke([edgeStroke])](#dc_graph.diagram+edgeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeStrokeWidth([edgeStrokeWidth])](#dc_graph.diagram+edgeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeOpacity([edgeOpacity])](#dc_graph.diagram+edgeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeLabel([edgeLabel])](#dc_graph.diagram+edgeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowhead([edgeArrowhead])](#dc_graph.diagram+edgeArrowhead) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowtail([edgeArrowtail])](#dc_graph.diagram+edgeArrowtail) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowSize([edgeArrowSize])](#dc_graph.diagram+edgeArrowSize) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeIsLayout([edgeIsLayout])](#dc_graph.diagram+edgeIsLayout) ⇒ function | Boolean | [diagram](#dc_graph.diagram) + * [.lengthStrategy([lengthStrategy])](#dc_graph.diagram+lengthStrategy) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeLength([edgeLength])](#dc_graph.diagram+edgeLength) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.flowLayout([flowLayout])](#dc_graph.diagram+flowLayout) + * [.rankdir([rankdir])](#dc_graph.diagram+rankdir) + * [.baseLength([baseLength])](#dc_graph.diagram+baseLength) ⇒ Number | [diagram](#dc_graph.diagram) + * [.transitionDuration([transitionDuration])](#dc_graph.diagram+transitionDuration) ⇒ Number | [diagram](#dc_graph.diagram) + * [.stageTransitions([stageTransitions])](#dc_graph.diagram+stageTransitions) ⇒ String | [diagram](#dc_graph.diagram) + * [.deleteDelay([deleteDelay])](#dc_graph.diagram+deleteDelay) ⇒ Number | [diagram](#dc_graph.diagram) + * [.groupConnected([stageTransitions])](#dc_graph.diagram+groupConnected) ⇒ String | [diagram](#dc_graph.diagram) + * [.timeLimit([timeLimit])](#dc_graph.diagram+timeLimit) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.constrain([constrain])](#dc_graph.diagram+constrain) ⇒ function | [diagram](#dc_graph.diagram) + * [.parallelEdgeOffset([parallelEdgeOffset])](#dc_graph.diagram+parallelEdgeOffset) ⇒ Number | [diagram](#dc_graph.diagram) + * [.edgeOrdering([edgeOrdering])](#dc_graph.diagram+edgeOrdering) ⇒ function | [diagram](#dc_graph.diagram) + * [.initLayoutOnRedraw([initLayoutOnRedraw])](#dc_graph.diagram+initLayoutOnRedraw) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.layoutUnchanged([layoutUnchanged])](#dc_graph.diagram+layoutUnchanged) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.relayout()](#dc_graph.diagram+relayout) ⇒ [diagram](#dc_graph.diagram) + * [.initialLayout([initialLayout])](#dc_graph.diagram+initialLayout) ⇒ function | [diagram](#dc_graph.diagram) + * [.induceNodes([induceNodes])](#dc_graph.diagram+induceNodes) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.showLayoutSteps([showLayoutSteps])](#dc_graph.diagram+showLayoutSteps) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.legend([legend])](#dc_graph.diagram+legend) ⇒ Object | [diagram](#dc_graph.diagram) + * [.child([id], [object])](#dc_graph.diagram+child) ⇒ [diagram](#dc_graph.diagram) + * [.layoutAlgorithm([algo])](#dc_graph.diagram+layoutAlgorithm) ⇒ [diagram](#dc_graph.diagram) + * [.layoutEngine([engine])](#dc_graph.diagram+layoutEngine) + * [.handleDisconnected([handleDisconnected])](#dc_graph.diagram+handleDisconnected) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.render()](#dc_graph.diagram+render) ⇒ [diagram](#dc_graph.diagram) + * [.on([event], [f])](#dc_graph.diagram+on) ⇒ [diagram](#dc_graph.diagram) + * [.getStats()](#dc_graph.diagram+getStats) ⇒ [diagram](#dc_graph.diagram) + * [.select([selector])](#dc_graph.diagram+select) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.selectAll([selector])](#dc_graph.diagram+selectAll) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.svg([selection])](#dc_graph.diagram+svg) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.resetSvg()](#dc_graph.diagram+resetSvg) ⇒ [diagram](#dc_graph.diagram) + * [.redrawGroup()](#dc_graph.diagram+redrawGroup) ⇒ [diagram](#dc_graph.diagram) + * [.renderGroup()](#dc_graph.diagram+renderGroup) ⇒ [diagram](#dc_graph.diagram) + * [.defineArrow(name, width, height, refX, refY, drawf)](#dc_graph.diagram+defineArrow) ⇒ [diagram](#dc_graph.diagram) * [.anchor([parent], [chartGroup])](#dc_graph.diagram+anchor) ⇒ String | node | d3.selection | [diagram](#dc_graph.diagram) * [.anchorName()](#dc_graph.diagram+anchorName) ⇒ String + * [.graphviz_attrs](#dc_graph.graphviz_attrs) + * [new graphviz_attrs()](#new_dc_graph.graphviz_attrs_new) + * _instance_ + * [.rankdir([rankdir])](#dc_graph.graphviz_attrs+rankdir) + * _static_ + * [.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) ⇒ Boolean | [cola_layout](#dc_graph.cola_layout) + * [.lengthStrategy([lengthStrategy])](#dc_graph.cola_layout+lengthStrategy) ⇒ function | String | [cola_layout](#dc_graph.cola_layout) + * [.baseLength([baseLength])](#dc_graph.cola_layout+baseLength) ⇒ Number | [cola_layout](#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) * [.constraint_pattern](#dc_graph.constraint_pattern) * [new constraint_pattern(diagram, pattern)](#new_dc_graph.constraint_pattern_new) * [.tip](#dc_graph.tip) @@ -112,75 +129,76 @@ chart.width(600) * [.diagram](#dc_graph.diagram) * [new diagram(parent, [chartGroup])](#new_dc_graph.diagram_new) - * [.width](#dc_graph.diagram+width) ⇒ Number | [diagram](#dc_graph.diagram) - * [.height](#dc_graph.diagram+height) ⇒ Number | [diagram](#dc_graph.diagram) - * [.root](#dc_graph.diagram+root) ⇒ node | [diagram](#dc_graph.diagram) - * [.mouseZoomable](#dc_graph.diagram+mouseZoomable) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.fitStrategy](#dc_graph.diagram+fitStrategy) ⇒ String | [diagram](#dc_graph.diagram) - * [.autoZoom](#dc_graph.diagram+autoZoom) ⇒ String | [diagram](#dc_graph.diagram) - * [.nodeDimension](#dc_graph.diagram+nodeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) - * [.nodeGroup](#dc_graph.diagram+nodeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) - * [.edgeDimension](#dc_graph.diagram+edgeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) - * [.edgeGroup](#dc_graph.diagram+edgeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) - * [.nodeKey](#dc_graph.diagram+nodeKey) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeKey](#dc_graph.diagram+edgeKey) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeSource](#dc_graph.diagram+edgeSource) ⇒ function | [diagram](#dc_graph.diagram) - * [.edgeTarget](#dc_graph.diagram+edgeTarget) ⇒ function | [diagram](#dc_graph.diagram) - * [.nodeRadius](#dc_graph.diagram+nodeRadius) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeStrokeWidth](#dc_graph.diagram+nodeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeStroke](#dc_graph.diagram+nodeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeFillScale](#dc_graph.diagram+nodeFillScale) ⇒ function | d3.scale | [diagram](#dc_graph.diagram) - * [.nodeFill](#dc_graph.diagram+nodeFill) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeOpacity](#dc_graph.diagram+nodeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodePadding](#dc_graph.diagram+nodePadding) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.nodeLabel](#dc_graph.diagram+nodeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeLabelFill](#dc_graph.diagram+nodeLabelFill) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeFitLabel](#dc_graph.diagram+nodeFitLabel) ⇒ function | Boolean | [diagram](#dc_graph.diagram) - * [.nodeShape](#dc_graph.diagram+nodeShape) ⇒ function | Object | [diagram](#dc_graph.diagram) - * [.nodeTitle](#dc_graph.diagram+nodeTitle) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.nodeOrdering](#dc_graph.diagram+nodeOrdering) ⇒ function | [diagram](#dc_graph.diagram) - * [.nodeFixed](#dc_graph.diagram+nodeFixed) ⇒ function | Object | [diagram](#dc_graph.diagram) - * [.edgeStroke](#dc_graph.diagram+edgeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeStrokeWidth](#dc_graph.diagram+edgeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeOpacity](#dc_graph.diagram+edgeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeLabel](#dc_graph.diagram+edgeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowhead](#dc_graph.diagram+edgeArrowhead) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowtail](#dc_graph.diagram+edgeArrowtail) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeArrowSize](#dc_graph.diagram+edgeArrowSize) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.edgeIsLayout](#dc_graph.diagram+edgeIsLayout) ⇒ function | Boolean | [diagram](#dc_graph.diagram) - * [.lengthStrategy](#dc_graph.diagram+lengthStrategy) ⇒ function | String | [diagram](#dc_graph.diagram) - * [.edgeLength](#dc_graph.diagram+edgeLength) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.flowLayout](#dc_graph.diagram+flowLayout) - * [.rankdir](#dc_graph.diagram+rankdir) - * [.baseLength](#dc_graph.diagram+baseLength) ⇒ Number | [diagram](#dc_graph.diagram) - * [.transitionDuration](#dc_graph.diagram+transitionDuration) ⇒ Number | [diagram](#dc_graph.diagram) - * [.stageTransitions](#dc_graph.diagram+stageTransitions) ⇒ String | [diagram](#dc_graph.diagram) - * [.deleteDelay](#dc_graph.diagram+deleteDelay) ⇒ Number | [diagram](#dc_graph.diagram) - * [.groupConnected](#dc_graph.diagram+groupConnected) ⇒ String | [diagram](#dc_graph.diagram) - * [.timeLimit](#dc_graph.diagram+timeLimit) ⇒ function | Number | [diagram](#dc_graph.diagram) - * [.constrain](#dc_graph.diagram+constrain) ⇒ function | [diagram](#dc_graph.diagram) - * [.parallelEdgeOffset](#dc_graph.diagram+parallelEdgeOffset) ⇒ Number | [diagram](#dc_graph.diagram) - * [.edgeOrdering](#dc_graph.diagram+edgeOrdering) ⇒ function | [diagram](#dc_graph.diagram) - * [.initLayoutOnRedraw](#dc_graph.diagram+initLayoutOnRedraw) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.layoutUnchanged](#dc_graph.diagram+layoutUnchanged) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.relayout](#dc_graph.diagram+relayout) ⇒ [diagram](#dc_graph.diagram) - * [.initialLayout](#dc_graph.diagram+initialLayout) ⇒ function | [diagram](#dc_graph.diagram) - * [.induceNodes](#dc_graph.diagram+induceNodes) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.showLayoutSteps](#dc_graph.diagram+showLayoutSteps) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.legend](#dc_graph.diagram+legend) ⇒ Object | [diagram](#dc_graph.diagram) - * [.child](#dc_graph.diagram+child) ⇒ [diagram](#dc_graph.diagram) - * [.layoutAlgorithm](#dc_graph.diagram+layoutAlgorithm) ⇒ [diagram](#dc_graph.diagram) - * [.handleDisconnected](#dc_graph.diagram+handleDisconnected) ⇒ Boolean | [diagram](#dc_graph.diagram) - * [.render](#dc_graph.diagram+render) ⇒ [diagram](#dc_graph.diagram) - * [.on](#dc_graph.diagram+on) ⇒ [diagram](#dc_graph.diagram) - * [.getStats](#dc_graph.diagram+getStats) ⇒ [diagram](#dc_graph.diagram) - * [.select](#dc_graph.diagram+select) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.selectAll](#dc_graph.diagram+selectAll) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.svg](#dc_graph.diagram+svg) ⇒ d3.selection | [diagram](#dc_graph.diagram) - * [.resetSvg](#dc_graph.diagram+resetSvg) ⇒ [diagram](#dc_graph.diagram) - * [.redrawGroup](#dc_graph.diagram+redrawGroup) ⇒ [diagram](#dc_graph.diagram) - * [.renderGroup](#dc_graph.diagram+renderGroup) ⇒ [diagram](#dc_graph.diagram) - * [.defineArrow](#dc_graph.diagram+defineArrow) ⇒ [diagram](#dc_graph.diagram) + * [.width([width])](#dc_graph.diagram+width) ⇒ Number | [diagram](#dc_graph.diagram) + * [.height([height])](#dc_graph.diagram+height) ⇒ Number | [diagram](#dc_graph.diagram) + * [.root([root])](#dc_graph.diagram+root) ⇒ node | [diagram](#dc_graph.diagram) + * [.mouseZoomable([mouseZoomable])](#dc_graph.diagram+mouseZoomable) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.fitStrategy([fitStrategy])](#dc_graph.diagram+fitStrategy) ⇒ String | [diagram](#dc_graph.diagram) + * [.autoZoom([autoZoom])](#dc_graph.diagram+autoZoom) ⇒ String | [diagram](#dc_graph.diagram) + * [.nodeDimension([nodeDimension])](#dc_graph.diagram+nodeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) + * [.nodeGroup([nodeGroup])](#dc_graph.diagram+nodeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) + * [.edgeDimension([edgeDimension])](#dc_graph.diagram+edgeDimension) ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) + * [.edgeGroup([edgeGroup])](#dc_graph.diagram+edgeGroup) ⇒ crossfilter.group | [diagram](#dc_graph.diagram) + * [.nodeKey([nodeKey])](#dc_graph.diagram+nodeKey) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeKey([edgeKey])](#dc_graph.diagram+edgeKey) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeSource([edgeSource])](#dc_graph.diagram+edgeSource) ⇒ function | [diagram](#dc_graph.diagram) + * [.edgeTarget([edgeTarget])](#dc_graph.diagram+edgeTarget) ⇒ function | [diagram](#dc_graph.diagram) + * [.nodeRadius([nodeRadius])](#dc_graph.diagram+nodeRadius) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeStrokeWidth([nodeStrokeWidth])](#dc_graph.diagram+nodeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeStroke([nodeStroke])](#dc_graph.diagram+nodeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeFillScale([nodeFillScale])](#dc_graph.diagram+nodeFillScale) ⇒ function | d3.scale | [diagram](#dc_graph.diagram) + * [.nodeFill([nodeFill])](#dc_graph.diagram+nodeFill) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeOpacity([nodeOpacity])](#dc_graph.diagram+nodeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodePadding([nodePadding])](#dc_graph.diagram+nodePadding) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.nodeLabel([nodeLabel])](#dc_graph.diagram+nodeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeLabelFill([nodeLabelFill])](#dc_graph.diagram+nodeLabelFill) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeFitLabel([nodeFitLabel])](#dc_graph.diagram+nodeFitLabel) ⇒ function | Boolean | [diagram](#dc_graph.diagram) + * [.nodeShape([nodeShape])](#dc_graph.diagram+nodeShape) ⇒ function | Object | [diagram](#dc_graph.diagram) + * [.nodeTitle([nodeTitle])](#dc_graph.diagram+nodeTitle) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.nodeOrdering([nodeOrdering])](#dc_graph.diagram+nodeOrdering) ⇒ function | [diagram](#dc_graph.diagram) + * [.nodeFixed([nodeFixed])](#dc_graph.diagram+nodeFixed) ⇒ function | Object | [diagram](#dc_graph.diagram) + * [.edgeStroke([edgeStroke])](#dc_graph.diagram+edgeStroke) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeStrokeWidth([edgeStrokeWidth])](#dc_graph.diagram+edgeStrokeWidth) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeOpacity([edgeOpacity])](#dc_graph.diagram+edgeOpacity) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeLabel([edgeLabel])](#dc_graph.diagram+edgeLabel) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowhead([edgeArrowhead])](#dc_graph.diagram+edgeArrowhead) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowtail([edgeArrowtail])](#dc_graph.diagram+edgeArrowtail) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeArrowSize([edgeArrowSize])](#dc_graph.diagram+edgeArrowSize) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.edgeIsLayout([edgeIsLayout])](#dc_graph.diagram+edgeIsLayout) ⇒ function | Boolean | [diagram](#dc_graph.diagram) + * [.lengthStrategy([lengthStrategy])](#dc_graph.diagram+lengthStrategy) ⇒ function | String | [diagram](#dc_graph.diagram) + * [.edgeLength([edgeLength])](#dc_graph.diagram+edgeLength) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.flowLayout([flowLayout])](#dc_graph.diagram+flowLayout) + * [.rankdir([rankdir])](#dc_graph.diagram+rankdir) + * [.baseLength([baseLength])](#dc_graph.diagram+baseLength) ⇒ Number | [diagram](#dc_graph.diagram) + * [.transitionDuration([transitionDuration])](#dc_graph.diagram+transitionDuration) ⇒ Number | [diagram](#dc_graph.diagram) + * [.stageTransitions([stageTransitions])](#dc_graph.diagram+stageTransitions) ⇒ String | [diagram](#dc_graph.diagram) + * [.deleteDelay([deleteDelay])](#dc_graph.diagram+deleteDelay) ⇒ Number | [diagram](#dc_graph.diagram) + * [.groupConnected([stageTransitions])](#dc_graph.diagram+groupConnected) ⇒ String | [diagram](#dc_graph.diagram) + * [.timeLimit([timeLimit])](#dc_graph.diagram+timeLimit) ⇒ function | Number | [diagram](#dc_graph.diagram) + * [.constrain([constrain])](#dc_graph.diagram+constrain) ⇒ function | [diagram](#dc_graph.diagram) + * [.parallelEdgeOffset([parallelEdgeOffset])](#dc_graph.diagram+parallelEdgeOffset) ⇒ Number | [diagram](#dc_graph.diagram) + * [.edgeOrdering([edgeOrdering])](#dc_graph.diagram+edgeOrdering) ⇒ function | [diagram](#dc_graph.diagram) + * [.initLayoutOnRedraw([initLayoutOnRedraw])](#dc_graph.diagram+initLayoutOnRedraw) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.layoutUnchanged([layoutUnchanged])](#dc_graph.diagram+layoutUnchanged) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.relayout()](#dc_graph.diagram+relayout) ⇒ [diagram](#dc_graph.diagram) + * [.initialLayout([initialLayout])](#dc_graph.diagram+initialLayout) ⇒ function | [diagram](#dc_graph.diagram) + * [.induceNodes([induceNodes])](#dc_graph.diagram+induceNodes) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.showLayoutSteps([showLayoutSteps])](#dc_graph.diagram+showLayoutSteps) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.legend([legend])](#dc_graph.diagram+legend) ⇒ Object | [diagram](#dc_graph.diagram) + * [.child([id], [object])](#dc_graph.diagram+child) ⇒ [diagram](#dc_graph.diagram) + * [.layoutAlgorithm([algo])](#dc_graph.diagram+layoutAlgorithm) ⇒ [diagram](#dc_graph.diagram) + * [.layoutEngine([engine])](#dc_graph.diagram+layoutEngine) + * [.handleDisconnected([handleDisconnected])](#dc_graph.diagram+handleDisconnected) ⇒ Boolean | [diagram](#dc_graph.diagram) + * [.render()](#dc_graph.diagram+render) ⇒ [diagram](#dc_graph.diagram) + * [.on([event], [f])](#dc_graph.diagram+on) ⇒ [diagram](#dc_graph.diagram) + * [.getStats()](#dc_graph.diagram+getStats) ⇒ [diagram](#dc_graph.diagram) + * [.select([selector])](#dc_graph.diagram+select) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.selectAll([selector])](#dc_graph.diagram+selectAll) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.svg([selection])](#dc_graph.diagram+svg) ⇒ d3.selection | [diagram](#dc_graph.diagram) + * [.resetSvg()](#dc_graph.diagram+resetSvg) ⇒ [diagram](#dc_graph.diagram) + * [.redrawGroup()](#dc_graph.diagram+redrawGroup) ⇒ [diagram](#dc_graph.diagram) + * [.renderGroup()](#dc_graph.diagram+renderGroup) ⇒ [diagram](#dc_graph.diagram) + * [.defineArrow(name, width, height, refX, refY, drawf)](#dc_graph.diagram+defineArrow) ⇒ [diagram](#dc_graph.diagram) * [.anchor([parent], [chartGroup])](#dc_graph.diagram+anchor) ⇒ String | node | d3.selection | [diagram](#dc_graph.diagram) * [.anchorName()](#dc_graph.diagram+anchorName) ⇒ String @@ -202,10 +220,10 @@ visualization versus conventional charts. -#### diagram.width ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.width([width]) ⇒ Number | [diagram](#dc_graph.diagram) Set or get the width attribute of the diagram. See `.height` below. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -213,13 +231,13 @@ Set or get the width attribute of the diagram. See `.height` below. -#### diagram.height ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.height([height]) ⇒ Number | [diagram](#dc_graph.diagram) Set or get the height attribute of the diagram. The width and height are applied to the SVG element generated by the diagram when rendered. 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. Default: 200 -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -227,23 +245,23 @@ the height attribute will be returned. Default: 200 -#### diagram.root ⇒ node | [diagram](#dc_graph.diagram) +#### diagram.root([root]) ⇒ node | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [root] | node | +| Param | Type | Default | +| --- | --- | --- | +| [root] | node | | -#### diagram.mouseZoomable ⇒ Boolean | [diagram](#dc_graph.diagram) +#### diagram.mouseZoomable([mouseZoomable]) ⇒ Boolean | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -251,7 +269,7 @@ whether dragging on the background pans the diagram. -#### diagram.fitStrategy ⇒ String | [diagram](#dc_graph.diagram) +#### diagram.fitStrategy([fitStrategy]) ⇒ String | [diagram](#dc_graph.diagram) Set or get the fitting strategy for the canvas, which affects how the [viewBox](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox) and [preserveAspectRatio](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio) @@ -274,7 +292,7 @@ Other options * function - will be called with (viewport width, viewport height, canvas width, canvas height) and result will be used to set `preserveAspectRatio`. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -282,13 +300,13 @@ height) and result will be used to set `preserveAspectRatio`. -#### diagram.autoZoom ⇒ String | [diagram](#dc_graph.diagram) +#### diagram.autoZoom([autoZoom]) ⇒ String | [diagram](#dc_graph.diagram) Auto-zoom behavior. * `'always'` - zoom every time layout happens * `'once'` - zoom the first time layout happens * `null` - manual, call `zoomToFit` to fit -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -296,7 +314,7 @@ Auto-zoom behavior. -#### diagram.nodeDimension ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) +#### diagram.nodeDimension([nodeDimension]) ⇒ crossfilter.dimension | [diagram](#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. @@ -304,7 +322,7 @@ the edges. used for filtering other charts on the same crossfilter instance based on the nodes selected.* -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -312,7 +330,7 @@ selected.* -#### diagram.nodeGroup ⇒ crossfilter.group | [diagram](#dc_graph.diagram) +#### diagram.nodeGroup([nodeGroup]) ⇒ crossfilter.group | [diagram](#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 @@ -322,7 +340,7 @@ reflect the changes incrementally. It is possible to pass another object with the same `.all()` interface instead of a crossfilter group. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -330,7 +348,7 @@ crossfilter group. -#### diagram.edgeDimension ⇒ crossfilter.dimension | [diagram](#dc_graph.diagram) +#### diagram.edgeDimension([edgeDimension]) ⇒ crossfilter.dimension | [diagram](#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. @@ -338,7 +356,7 @@ the edges. used for filtering other charts on the same crossfilter instance based on the edges selected.* -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -346,14 +364,15 @@ selected.* -#### diagram.edgeGroup ⇒ crossfilter.group | [diagram](#dc_graph.diagram) +#### diagram.edgeGroup([edgeGroup]) ⇒ crossfilter.group | [diagram](#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` and `nodeTarget`, which should return the same -keys as the `nodeKey` +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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -361,64 +380,66 @@ keys as the `nodeKey` -#### diagram.nodeKey ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.nodeKey([nodeKey]) ⇒ function | [diagram](#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` and `.edgeTarget`. +the keys returned by the [edgeSource](#dc_graph.diagram+edgeSource) and +[edgeTarget](#dc_graph.diagram+edgeTarget). -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [nodeKey] | function | +| Param | Type | Default | +| --- | --- | --- | +| [nodeKey] | function | function(kv) { return kv.key } | -#### diagram.edgeKey ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.edgeKey([edgeKey]) ⇒ function | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [edgeKey] | function | +| Param | Type | Default | +| --- | --- | --- | +| [edgeKey] | function | function(kv) { return kv.key } | -#### diagram.edgeSource ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.edgeSource([edgeSource]) ⇒ function | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [edgeSource] | function | +| Param | Type | Default | +| --- | --- | --- | +| [edgeSource] | function | function(kv) { return kv.value.sourcename; } | -#### diagram.edgeTarget ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.edgeTarget([edgeTarget]) ⇒ function | [diagram](#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` 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`. +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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [edgeTarget] | function | +| Param | Type | Default | +| --- | --- | --- | +| [edgeTarget] | function | function(kv) { return kv.value.targetname; } | -#### diagram.nodeRadius ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.nodeRadius([nodeRadius]) ⇒ function | Number | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -426,12 +447,12 @@ node. This determines the height of nodes,and if `nodeFitLabel` is false, the wi -#### diagram.nodeStrokeWidth ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.nodeStrokeWidth([nodeStrokeWidth]) ⇒ function | Number | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -439,11 +460,11 @@ be drawn half on top of the fill, and half outside. Default: 1 -#### diagram.nodeStroke ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.nodeStroke([nodeStroke]) ⇒ function | String | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -451,12 +472,12 @@ of each node. -#### diagram.nodeFillScale ⇒ function | d3.scale | [diagram](#dc_graph.diagram) +#### diagram.nodeFillScale([nodeFillScale]) ⇒ function | d3.scale | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -464,11 +485,11 @@ to return the fill color. If falsy, uses the identity function (no scale). -#### diagram.nodeFill ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.nodeFill([nodeFill]) ⇒ function | String | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -476,10 +497,10 @@ node. -#### diagram.nodeOpacity ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.nodeOpacity([nodeOpacity]) ⇒ function | Number | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the opacity of each node. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -487,11 +508,11 @@ Set or get the function which will be used to retrieve the opacity of each node. -#### diagram.nodePadding ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.nodePadding([nodePadding]) ⇒ function | Number | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -499,11 +520,11 @@ to both sides of the node.) -#### diagram.nodeLabel ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.nodeLabel([nodeLabel]) ⇒ function | String | [diagram](#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 property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -518,10 +539,10 @@ diagram.nodeLabel(function(kv) { ``` -#### diagram.nodeLabelFill ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.nodeLabelFill([nodeLabelFill]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the label fill color. Default: null -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -529,10 +550,10 @@ Set or get the function which will be used to retrieve the label fill color. Def -#### diagram.nodeFitLabel ⇒ function | Boolean | [diagram](#dc_graph.diagram) +#### diagram.nodeFitLabel([nodeFitLabel]) ⇒ function | Boolean | [diagram](#dc_graph.diagram) Whether to fit the node shape around the label -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -540,7 +561,7 @@ Whether to fit the node shape around the label -#### diagram.nodeShape ⇒ function | Object | [diagram](#dc_graph.diagram) +#### diagram.nodeShape([nodeShape]) ⇒ function | Object | [diagram](#dc_graph.diagram) The shape to use for drawing each node, specified as an object with at least the field `shape`. The names of shapes are mostly taken [from graphviz](http://www.graphviz.org/doc/info/shapes.html); currently ellipse, egg, @@ -550,7 +571,7 @@ invtriangle, invtrapezium, square, polygon are supported. If `shape = polygon`: * `sides`: number of sides for a polygon -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -565,11 +586,11 @@ diagram.nodeShape(function(kv) { ``` -#### diagram.nodeTitle ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.nodeTitle([nodeTitle]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the node title, usually rendered as a tooltip. By default, uses the key of the node. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -584,37 +605,37 @@ chart.nodeTitle(function(kv) { ``` -#### diagram.nodeOrdering ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.nodeOrdering([nodeOrdering]) ⇒ function | [diagram](#dc_graph.diagram) By default, nodes are added to the layout in the order that `.nodeGroup().all()` returns them. If specified, `.nodeOrdering` provides an accessor that returns a key to sort the nodes on. *It would be better not to rely on ordering to affect layout, but it may affect the layout in some cases.* -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [nodeOrdering] | function | +| Param | Type | Default | +| --- | --- | --- | +| [nodeOrdering] | function | | -#### diagram.nodeFixed ⇒ function | Object | [diagram](#dc_graph.diagram) +#### diagram.nodeFixed([nodeFixed]) ⇒ function | Object | [diagram](#dc_graph.diagram) Specify an accessor that returns an {x,y} coordinate for a node that should be [fixed in place](https://github.com/tgdwyer/WebCola/wiki/Fixed-Node-Positions), and returns falsy for other nodes. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [nodeFixed] | function | Object | +| Param | Type | Default | +| --- | --- | --- | +| [nodeFixed] | function | Object | | -#### diagram.edgeStroke ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.edgeStroke([edgeStroke]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the stroke color for the edges. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -622,10 +643,10 @@ Set or get the function which will be used to retrieve the stroke color for the -#### diagram.edgeStrokeWidth ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.edgeStrokeWidth([edgeStrokeWidth]) ⇒ function | Number | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the stroke width for the edges. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -633,11 +654,11 @@ Set or get the function which will be used to retrieve the stroke width for the -#### diagram.edgeOpacity ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.edgeOpacity([edgeOpacity]) ⇒ function | Number | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the edge opacity, a number from 0 to 1. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -645,11 +666,11 @@ to 1. -#### diagram.edgeLabel ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.edgeLabel([edgeLabel]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the edge label text. The label is displayed when an edge is hovered over. By default, uses the `edgeKey`. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -664,12 +685,12 @@ chart.edgeLabel(function(d) { ``` -#### diagram.edgeArrowhead ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.edgeArrowhead([edgeArrowhead]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the name of the arrowhead to use for the target/ head/destination of the edge. Arrow symbols can be specified with `.defineArrow()`. Return null to display no arrowhead. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -677,12 +698,12 @@ for the target/ head/destination of the edge. Arrow symbols can be specified wit -#### diagram.edgeArrowtail ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.edgeArrowtail([edgeArrowtail]) ⇒ function | String | [diagram](#dc_graph.diagram) Set or get the function which will be used to retrieve the name of the arrow tail to use for the tail/source of the edge. Arrow symbols can be specified with `.defineArrow()`. Return null to display no arrowtail. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -690,10 +711,10 @@ for the tail/source of the edge. Arrow symbols can be specified with -#### diagram.edgeArrowSize ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.edgeArrowSize([edgeArrowSize]) ⇒ function | Number | [diagram](#dc_graph.diagram) Multiplier for arrow size. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -701,12 +722,12 @@ Multiplier for arrow size. -#### diagram.edgeIsLayout ⇒ function | Boolean | [diagram](#dc_graph.diagram) +#### diagram.edgeIsLayout([edgeIsLayout]) ⇒ function | Boolean | [diagram](#dc_graph.diagram) To draw an edge but not have it affect the layout, specify a function which returns false for that edge. By default, will return false if the `notLayout` field of the edge value is truthy, true otherwise. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -721,7 +742,7 @@ chart.edgeIsLayout(function(kv) { ``` -#### diagram.lengthStrategy ⇒ function | String | [diagram](#dc_graph.diagram) +#### diagram.lengthStrategy([lengthStrategy]) ⇒ function | String | [diagram](#dc_graph.diagram) Currently, three strategies are supported for specifying the lengths of edges: * 'individual' - uses the `edgeLength` for each edge. If it returns falsy, uses the `baseLength` @@ -731,7 +752,9 @@ the edge. See for more details. 'none' - no edge lengths will be specified -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: Use [cola_layout.lengthStrategy](#dc_graph.cola_layout+lengthStrategy) instead. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -739,12 +762,12 @@ for more details. -#### diagram.edgeLength ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.edgeLength([edgeLength]) ⇒ function | Number | [diagram](#dc_graph.diagram) When the `.lengthStrategy` is 'individual', this accessor will be used to read the length of each edge. By default, reads the `distance` field of the edge. If the distance is falsy, uses the `baseLength`. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -759,11 +782,13 @@ chart.edgeLength(function(kv) { ``` -#### diagram.flowLayout +#### diagram.flowLayout([flowLayout]) This should be equivalent to rankdir and ranksep in the dagre/graphviz nomenclature, but for now it is separate. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: use [cola_layout.flowLayout](#dc_graph.cola_layout+flowLayout) instead. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -778,11 +803,13 @@ chart.flowLayout({axis: 'x', minSeparation: 200}) ``` -#### diagram.rankdir +#### diagram.rankdir([rankdir]) Direction to draw ranks. Currently for dagre and expand_collapse, but I think cola could be generated from graphviz-style since it is more general. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: use [dagre_layout.rankdir](dc_graph.dagre_layout#rankdir) instead. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -790,12 +817,14 @@ generated from graphviz-style since it is more general. -#### diagram.baseLength ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.baseLength([baseLength]) ⇒ Number | [diagram](#dc_graph.diagram) Gets or sets the default edge length (in pixels) when the `.lengthStrategy` is 'individual', and the base value to be multiplied for 'symmetric' and 'jaccard' edge lengths. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: use [cola_layout.baseLength](#dc_graph.cola_layout+baseLength) instead. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -803,19 +832,19 @@ lengths. -#### diagram.transitionDuration ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.transitionDuration([transitionDuration]) ⇒ Number | [diagram](#dc_graph.diagram) Gets or sets the transition duration, the length of time each change to the diagram will be animated. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [transitionDuration] | Number | +| Param | Type | Default | +| --- | --- | --- | +| [transitionDuration] | Number | 500 | -#### diagram.stageTransitions ⇒ String | [diagram](#dc_graph.diagram) +#### diagram.stageTransitions([stageTransitions]) ⇒ String | [diagram](#dc_graph.diagram) How transitions should be split into separate animations to emphasize the delete, modify, and insert operations: * `none`: modify and insert operations animate at the same time @@ -824,43 +853,43 @@ the delete, modify, and insert operations: Deletions always happen before/during layout computation. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [stageTransitions] | String | +| Param | Type | Default | +| --- | --- | --- | +| [stageTransitions] | String | 'none' | -#### diagram.deleteDelay ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.deleteDelay([deleteDelay]) ⇒ Number | [diagram](#dc_graph.diagram) The delete transition happens simultaneously with layout, which can take longer than the transition duration. Delaying it can bring it closer to the other staged transitions. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [deleteDelay] | Number | +| Param | Type | Default | +| --- | --- | --- | +| [deleteDelay] | Number | 0 | -#### diagram.groupConnected ⇒ String | [diagram](#dc_graph.diagram) +#### diagram.groupConnected([stageTransitions]) ⇒ String | [diagram](#dc_graph.diagram) Whether to put connected components each in their own group, to stabilize layout. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [stageTransitions] | String | +| Param | Type | Default | +| --- | --- | --- | +| [stageTransitions] | String | false | -#### diagram.timeLimit ⇒ function | Number | [diagram](#dc_graph.diagram) +#### diagram.timeLimit([timeLimit]) ⇒ function | Number | [diagram](#dc_graph.diagram) Gets or sets the maximum time spent doing layout for a render or redraw. Set to 0 for no limit. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -868,7 +897,7 @@ limit. -#### diagram.constrain ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.constrain([constrain]) ⇒ function | [diagram](#dc_graph.diagram) Gets or sets a function which will be called with the current nodes and edges on each redraw in order to derive new layout constraints. The constraints are built from scratch on each redraw. @@ -893,7 +922,7 @@ Because it is tedious to write code to generate constraints for a graph, **dc.gr also includes a [constraint generator](#dc_graph+constraint_pattern) to produce this constrain function, specifying the constraints themselves in a graph. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -901,11 +930,11 @@ this constrain function, specifying the constraints themselves in a graph. -#### diagram.parallelEdgeOffset ⇒ Number | [diagram](#dc_graph.diagram) +#### diagram.parallelEdgeOffset([parallelEdgeOffset]) ⇒ Number | [diagram](#dc_graph.diagram) If there are multiple edges between the same two nodes, start them this many pixels away from the original so they don't overlap. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -913,7 +942,7 @@ from the original so they don't overlap. -#### diagram.edgeOrdering ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.edgeOrdering([edgeOrdering]) ⇒ function | [diagram](#dc_graph.diagram) By default, edges are added to the layout in the order that `.edgeGroup().all()` returns them. If specified, `.edgeOrdering` provides an accessor that returns a key to sort the edges on. @@ -921,15 +950,15 @@ edges on. layout in some cases. (Probably less than node ordering, but it does affect which parallel edge is which.)* -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [edgeOrdering] | function | +| Param | Type | Default | +| --- | --- | --- | +| [edgeOrdering] | function | | -#### diagram.initLayoutOnRedraw ⇒ Boolean | [diagram](#dc_graph.diagram) +#### diagram.initLayoutOnRedraw([initLayoutOnRedraw]) ⇒ Boolean | [diagram](#dc_graph.diagram) Currently there are some bugs when the same instance of cola.js is used multiple times. (In particular, overlaps between nodes may not be eliminated [if cola is not reinitialized](https://github.com/tgdwyer/WebCola/issues/118) @@ -937,7 +966,7 @@ This flag can be set true to construct a new cola layout object on each redraw. layout seems to be more stable if this is set false, so hopefully this will be fixed soon. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -945,10 +974,10 @@ soon. -#### diagram.layoutUnchanged ⇒ Boolean | [diagram](#dc_graph.diagram) +#### diagram.layoutUnchanged([layoutUnchanged]) ⇒ Boolean | [diagram](#dc_graph.diagram) Whether to perform layout when the data is unchanged from the last redraw. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -956,18 +985,25 @@ Whether to perform layout when the data is unchanged from the last redraw. -#### diagram.relayout ⇒ [diagram](#dc_graph.diagram) +#### diagram.relayout() ⇒ [diagram](#dc_graph.diagram) When `layoutUnchanged` is false, this will force layout to happen again. This may be needed when changing a parameter but not changing the topology of the graph. (Yes, probably should not be necessary.) -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.initialLayout ⇒ function | [diagram](#dc_graph.diagram) +#### diagram.initialLayout([initialLayout]) ⇒ function | [diagram](#dc_graph.diagram) Function to call to generate an initial layout. Takes (diagram, nodes, edges) -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: The only layout that was using this was `tree_positions` and it never +worked as an initialization step for cola, as was originally intended. Now that +`tree_layout` is a layout algorithm, this should go away. + +In the future, there will be support for chaining layout algorithms. But that will be a +matter of composing them into a super-algorithm, not a special step like this was. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -975,12 +1011,12 @@ Function to call to generate an initial layout. Takes (diagram, nodes, edges) -#### diagram.induceNodes ⇒ Boolean | [diagram](#dc_graph.diagram) +#### diagram.induceNodes([induceNodes]) ⇒ Boolean | [diagram](#dc_graph.diagram) By default, all nodes are included, and edges are only included if both end-nodes are visible. If `.induceNodes` is set, then only nodes which have at least one edge will be shown. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -988,12 +1024,12 @@ shown. -#### diagram.showLayoutSteps ⇒ Boolean | [diagram](#dc_graph.diagram) +#### diagram.showLayoutSteps([showLayoutSteps]) ⇒ Boolean | [diagram](#dc_graph.diagram) If this flag is true, the positions of nodes and will be updated while layout is iterating. If false, the positions will only be updated once layout has stabilized. Note: this may not be compatible with transitionDuration. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -1001,24 +1037,24 @@ stabilized. Note: this may not be compatible with transitionDuration. -#### diagram.legend ⇒ Object | [diagram](#dc_graph.diagram) +#### diagram.legend([legend]) ⇒ Object | [diagram](#dc_graph.diagram) Assigns a legend object which will be displayed within the same SVG element and according to the visual encoding of this diagram. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -| Param | Type | -| --- | --- | -| [legend] | Object | +| Param | Type | Default | +| --- | --- | --- | +| [legend] | Object | | -#### diagram.child ⇒ [diagram](#dc_graph.diagram) +#### diagram.child([id], [object]) ⇒ [diagram](#dc_graph.diagram) Specifies another kind of child layer or interface. For example, this can be used to display tooltips on nodes using `dc_graph.tip`. The child needs to support a `parent` method, the diagram to modify. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Description | | --- | --- | --- | @@ -1038,29 +1074,51 @@ diagram.child('tip', tip); ``` -#### diagram.layoutAlgorithm ⇒ [diagram](#dc_graph.diagram) -Currently, you can specify 'cola' (the default) or 'dagre' as the Layout Algorithm and it -will replace the back-end. In the future, there will be subclasses like colaDiagram and -dagreDiagram with appropriate interfaces for each, but it is not yet clear which features are -common between them. +#### diagram.layoutAlgorithm([algo]) ⇒ [diagram](#dc_graph.diagram) +Specify 'cola' (the default) or 'dagre' as the Layout Algorithm and it will replace the +back-end. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: use [diagram.layoutEngine](#dc_graph.diagram+layoutEngine) with the engine +object instead -| Param | Type | Description | -| --- | --- | --- | -| [algo] | String | the name of the layout algorithm to use | +**Kind**: instance method of [diagram](#dc_graph.diagram) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [algo] | String | 'cola' | the name of the layout algorithm to use | **Example** ```js // use dagre for layout diagram.layoutAlgorithm('dagre'); ``` + + +#### diagram.layoutEngine([engine]) +The layout engine determines how to draw things! + +**Kind**: instance method of [diagram](#dc_graph.diagram) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [engine] | Object | | the layout engine to use | + +**Example** +```js +// use cola with no webworker +diagram.layoutEngine(dc_graph.cola_layout()); +// use dagre with a webworker +diagram.layoutEngine(dc_graph.webworker_layout(dc_graph.dagre_layout())); +``` -#### diagram.handleDisconnected ⇒ Boolean | [diagram](#dc_graph.diagram) -Instructs cola.js to fit the connected components. Default: true +#### diagram.handleDisconnected([handleDisconnected]) ⇒ Boolean | [diagram](#dc_graph.diagram) +Instructs cola.js to fit the connected components. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Deprecated**: Use +[cola_layout.handleDisconnected](#dc_graph.cola_layout+handleDisconnected) instead. + +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Default | | --- | --- | --- | @@ -1068,16 +1126,16 @@ Instructs cola.js to fit the connected components. Default: true -#### diagram.render ⇒ [diagram](#dc_graph.diagram) +#### diagram.render() ⇒ [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Erases any existing SVG elements and draws the diagram from scratch. `.render()` must be called the first time, and `.redraw()` can be called after that. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.on ⇒ [diagram](#dc_graph.diagram) +#### diagram.on([event], [f]) ⇒ [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Attaches an event handler to the diagram. The currently supported events are @@ -1086,7 +1144,7 @@ method. Attaches an event handler to the diagram. The currently supported events and can be modified through the passed d3 selections. * `end()` - diagram layout has completed. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Description | | --- | --- | --- | @@ -1095,15 +1153,15 @@ and can be modified through the passed d3 selections. -#### diagram.getStats ⇒ [diagram](#dc_graph.diagram) +#### diagram.getStats() ⇒ [diagram](#dc_graph.diagram) Returns an object with current statistics on graph layout. * `nnodes` - number of nodes displayed * `nedges` - number of edges displayed -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.select ⇒ d3.selection | [diagram](#dc_graph.diagram) +#### diagram.select([selector]) ⇒ d3.selection | [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Execute a d3 single selection in the diagram's scope using the given selector @@ -1114,7 +1172,7 @@ d3.select('#diagram-id').select(selector) Since this function returns a d3 selection, it is not chainable. (However, d3 selection calls can be chained after it.) -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -1122,7 +1180,7 @@ calls can be chained after it.) -#### diagram.selectAll ⇒ d3.selection | [diagram](#dc_graph.diagram) +#### diagram.selectAll([selector]) ⇒ d3.selection | [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Selects all elements that match the d3 single selector in the diagram's scope, @@ -1133,7 +1191,7 @@ d3.select('#diagram-id').selectAll(selector) Since this function returns a d3 selection, it is not chainable. (However, d3 selection calls can be chained after it.) -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -1141,13 +1199,13 @@ calls can be chained after it.) -#### diagram.svg ⇒ d3.selection | [diagram](#dc_graph.diagram) +#### diagram.svg([selection]) ⇒ d3.selection | [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Returns the top svg element for this specific chart. You can also pass in a new svg element, but setting the svg element on a diagram may have unexpected consequences. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | | --- | --- | @@ -1155,32 +1213,32 @@ svg element, but setting the svg element on a diagram may have unexpected conseq -#### diagram.resetSvg ⇒ [diagram](#dc_graph.diagram) +#### diagram.resetSvg() ⇒ [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Remove the diagram's SVG elements from the dom and recreate the container SVG element. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.redrawGroup ⇒ [diagram](#dc_graph.diagram) +#### diagram.redrawGroup() ⇒ [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Causes all charts in the chart group to be redrawn. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.renderGroup ⇒ [diagram](#dc_graph.diagram) +#### diagram.renderGroup() ⇒ [diagram](#dc_graph.diagram) Standard dc.js [baseMixin](https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.baseMixin) method. Causes all charts in the chart group to be rendered. -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) -#### diagram.defineArrow ⇒ [diagram](#dc_graph.diagram) +#### diagram.defineArrow(name, width, height, refX, refY, drawf) ⇒ [diagram](#dc_graph.diagram) Creates an svg marker definition for drawing edge arrow tails or heads. The `viewBox` of the marker is `0 -5 10 10`, so the arrow should be drawn from (0, -5) to (10, 5); it will be moved and sized based on the other parameters, and rotated based on the @@ -1188,7 +1246,7 @@ orientation of the edge. (If further customization is required, it is possible to append other `svg:defs` to `chart.svg()` and use refer to them by `id`.) -**Kind**: instance property of [diagram](#dc_graph.diagram) +**Kind**: instance method of [diagram](#dc_graph.diagram) | Param | Type | Description | | --- | --- | --- | @@ -1230,6 +1288,167 @@ will orphan any previously created SVGElements. Returns the DOM id for the chart's anchored location. **Kind**: instance method of [diagram](#dc_graph.diagram) + + +### dc_graph.graphviz_attrs +**Kind**: static class of [dc_graph](#dc_graph) + +* [.graphviz_attrs](#dc_graph.graphviz_attrs) + * [new graphviz_attrs()](#new_dc_graph.graphviz_attrs_new) + * _instance_ + * [.rankdir([rankdir])](#dc_graph.graphviz_attrs+rankdir) + * _static_ + * [.ranksep([ranksep])](#dc_graph.graphviz_attrs.ranksep) + + + +#### new graphviz_attrs() +`dc_graph.graphviz_attrs defines a basic set of attributes which layout engines should +implement - although these are not // required, they make it easier for clients and +behaviors (like expand_collapse) to work with // multiple layout engines // these +attributes are [from graphviz](http://www.graphviz.org/doc/info/attrs.html) + + + +#### graphviz_attrs.rankdir([rankdir]) +Direction to draw ranks. + +**Kind**: instance method of [graphviz_attrs](#dc_graph.graphviz_attrs) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [rankdir] | String | 'TB' | 'TB', 'LR', 'BT', or 'RL' | + + + +#### graphviz_attrs.ranksep([ranksep]) +Spacing in between ranks. + +**Kind**: static method of [graphviz_attrs](#dc_graph.graphviz_attrs) +**Instnace**: + +| Param | Type | Default | +| --- | --- | --- | +| [ranksep] | String | 40 | + + + +### dc_graph.cola_layout +**Kind**: static class of [dc_graph](#dc_graph) + +* [.cola_layout](#dc_graph.cola_layout) + * [new cola_layout([id])](#new_dc_graph.cola_layout_new) + * [.handleDisconnected([handleDisconnected])](#dc_graph.cola_layout+handleDisconnected) ⇒ Boolean | [cola_layout](#dc_graph.cola_layout) + * [.lengthStrategy([lengthStrategy])](#dc_graph.cola_layout+lengthStrategy) ⇒ function | String | [cola_layout](#dc_graph.cola_layout) + * [.baseLength([baseLength])](#dc_graph.cola_layout+baseLength) ⇒ Number | [cola_layout](#dc_graph.cola_layout) + * [.flowLayout([flowLayout])](#dc_graph.cola_layout+flowLayout) + + + +#### new cola_layout([id]) +`dc_graph.cola_layout` is an adaptor for cola.js layouts in dc.graph.js + + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [id] | String | uuid() | Unique identifier | + + + +#### cola_layout.handleDisconnected([handleDisconnected]) ⇒ Boolean | [cola_layout](#dc_graph.cola_layout) +Instructs cola.js to fit the connected components. + +**Kind**: instance method of [cola_layout](#dc_graph.cola_layout) + +| Param | Type | Default | +| --- | --- | --- | +| [handleDisconnected] | Boolean | true | + + + +#### cola_layout.lengthStrategy([lengthStrategy]) ⇒ function | String | [cola_layout](#dc_graph.cola_layout) +Currently, three strategies are supported for specifying the lengths of edges: +* 'individual' - uses the `edgeLength` for each edge. If it returns falsy, uses the +`baseLength` +* 'symmetric', 'jaccard' - compute the edge length based on the graph structure around +the edge. See +[the cola.js wiki](https://github.com/tgdwyer/WebCola/wiki/link-lengths) +for more details. +'none' - no edge lengths will be specified + +**Kind**: instance method of [cola_layout](#dc_graph.cola_layout) + +| Param | Type | Default | +| --- | --- | --- | +| [lengthStrategy] | function | String | 'symmetric' | + + + +#### cola_layout.baseLength([baseLength]) ⇒ Number | [cola_layout](#dc_graph.cola_layout) +Gets or sets the default edge length (in pixels) when the `.lengthStrategy` is +'individual', and the base value to be multiplied for 'symmetric' and 'jaccard' edge +lengths. + +**Kind**: instance method of [cola_layout](#dc_graph.cola_layout) + +| Param | Type | Default | +| --- | --- | --- | +| [baseLength] | Number | 30 | + + + +#### cola_layout.flowLayout([flowLayout]) +If `flowLayout` is set, it determines the axis and separation for +[cola flow layout](http://marvl.infotech.monash.edu/webcola/doc/classes/cola.layout.html#flowlayout). +If it is not set, `flowLayout` will be calculated from the [rankdir](#dc_graph.graphviz_attrs+rankdir) +and [ranksep](dc_graph.graphviz_attrs#ranksep); if `rankdir` is also null (the +default for cola layout), then there will be no flow. + +**Kind**: instance method of [cola_layout](#dc_graph.cola_layout) + +| Param | Type | Default | +| --- | --- | --- | +| [flowLayout] | Object | | + +**Example** +```js +// No flow (default) +chart.flowLayout(null) +// flow in x with min separation 200 +chart.flowLayout({axis: 'x', minSeparation: 200}) +``` + + +### dc_graph.dagre_layout +**Kind**: static class of [dc_graph](#dc_graph) + + +#### new dagre_layout([id]) +`dc_graph.dagre_layout` is an adaptor for dagre.js layouts in dc.graph.js + +In addition to the below layout attributes, `dagre_layout` also implements the attributes from +[graphviz_attrs](#dc_graph.graphviz_attrs) + + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [id] | String | uuid() | Unique identifier | + + + +### dc_graph.tree_layout +**Kind**: static class of [dc_graph](#dc_graph) + + +#### new tree_layout([id]) +`dc_graph.tree_layout` is a very simple and not very bright tree layout. It can draw any DAG, but +tries to position the nodes as a tree. + + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [id] | String | uuid() | Unique identifier | + ### dc_graph.constraint_pattern