local.set()

local.set(node, value) Sets the value of this local on the specified node to the value, and returns the specified value. This is often performed using selection.each: selection.each(function(d) { foo.set(this, d.value); }); If you are just setting a single variable, consider using selection.property: selection.property(foo, function(d) { return d.value; });

local.remove()

local.remove(node) Deletes this local’s value from the specified node and returns its previous value. Returns true if the node defined this local prior to removal, and false otherwise. If ancestors also define this local, those definitions are unaffected, and thus local.get will still return the inherited value.

locale.format()

locale.format(specifier) Returns a new format function for the given string specifier. The returned function takes a number as the only argument, and returns a string representing the formatted number. The general form of a specifier is: [​[fill]align][sign][symbol][0][width][,][.precision][type] The fill can be any character. The presence of a fill character is signaled by the align character following it, which must be one of the following: > - Forces the field to be right-aligned wit

local.toString()

local.toString() Returns the automatically-generated identifier for this local. This is the name of the property that is used to store the local’s value on elements, and thus you can also set or get the local’s value using element[local] or by using selection.property.

link.iterations()

link.iterations([iterations]) If iterations is specified, sets the number of iterations per application to the specified number and returns this force. If iterations is not specified, returns the current iteration count which defaults to 1. Increasing the number of iterations greatly increases the rigidity of the constraint and is useful for complex structures such as lattices, but also increases the runtime cost to evaluate the force.

link.strength()

link.strength([strength]) If strength is specified, sets the strength accessor to the specified number or function, re-evaluates the strength accessor for each link, and returns this force. If strength is not specified, returns the current strength accessor, which defaults to: function strength(link) { return 1 / Math.min(count(link.source), count(link.target)); } Where count(node) is a function that returns the number of links with the given node as a source or target. This default was ch

local.get()

local.get(node) Returns the value of this local on the specified node. If the node does not define this local, returns the value from the nearest ancestor that defines it. Returns undefined if no ancestor defines this local.

link.links()

link.links([links]) If links is specified, sets the array of links associated with this force, recomputes the distance and strength parameters for each link, and returns this force. If links is not specified, returns the current array of links, which defaults to the empty array. Each link is an object with the following properties: source - the link’s source node; see simulation.nodes target - the link’s target node; see simulation.nodes index - the zero-based index into links, assigned

link.id()

link.id([id]) If id is specified, sets the node id accessor to the specified function and returns this force. If id is not specified, returns the current node id accessor, which defaults to the numeric node.index: function id(d) { return d.index; } The default id accessor allows each link’s source and target to be specified as a zero-based index into the nodes array. For example: var nodes = [ {"id": "Alice"}, {"id": "Bob"}, {"id": "Carol"} ]; var links = [ {"source": 0, "target":

line.y()

line.y([y]) If y is specified, sets the y accessor to the specified function or number and returns this line generator. If y is not specified, returns the current y accessor, which defaults to: function y(d) { return d[1]; } When a line is generated, the y accessor will be invoked for each defined element in the input data array, being passed the element d, the index i, and the array data as three arguments. The default y accessor assumes that the input data are two-element arrays of numbe