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.

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.

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.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

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.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.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":

link.distance()

link.distance([distance]) If distance is specified, sets the distance accessor to the specified number or function, re-evaluates the distance accessor for each link, and returns this force. If distance is not specified, returns the current distance accessor, which defaults to: function distance() { return 30; } The distance accessor is invoked for each link, being passed the link and its zero-based index. The resulting number is then stored internally, such that the distance of each link i