Changes in D3 4.0

Changes in D3 4.0 D3 4.0 is modular. Instead of one library, D3 is now many small libraries that are designed to work together. You can pick and choose which parts to use as you see fit. Each library is maintained in its own repository, allowing decentralized ownership and independent release cycles. The default bundle combines about thirty of these microlibraries. <script src="https://d3js.org/d3.v4.js"></script> As before, you can load optional plugins on top of the default bundle

center.y()

center.y([y]) If y is specified, sets the y-coordinate of the centering position to the specified number and returns this force. If y is not specified, returns the current y-coordinate, which defaults to zero.

cardinal.tension()

cardinal.tension(tension) Returns a cardinal curve with the specified tension in the range [0, 1]. The tension determines the length of the tangents: a tension of one yields all zero tangents, equivalent to curveLinear; a tension of zero produces a uniform Catmull–Rom spline. For example: var line = d3.line().curve(d3.curveCardinal.tension(0.5));

cell

cell Each cell in the diagram is an object with the following properties: site - the site of the cell’s associated input point. halfedges - an array of indexes into diagram.edges representing the cell’s polygon.

catmullRom.alpha()

catmullRom.alpha(alpha) Returns a cubic Catmull–Rom curve with the specified alpha in the range [0, 1]. If alpha is zero, produces a uniform spline, equivalent to curveCardinal with a tension of zero; if alpha is one, produces a chordal spline; if alpha is 0.5, produces a centripetal spline. Centripetal splines are recommended to avoid self-intersections and overshoot. For example: var line = d3.line().curve(d3.curveCatmullRom.alpha(0.5));

center.x()

center.x([x]) If x is specified, sets the x-coordinate of the centering position to the specified number and returns this force. If x is not specified, returns the current x-coordinate, which defaults to zero.

bundle.beta()

bundle.beta(beta) Returns a bundle curve with the specified beta in the range [0, 1], representing the bundle strength. If beta equals zero, a straight line between the first and last point is produced; if beta equals one, a standard basis spline is produced. For example: var line = d3.line().curve(d3.curveBundle.beta(0.5));

brush.filter()

brush.filter([filter]) If filter is specified, sets the filter to the specified function and returns the brush. If filter is not specified, returns the current filter, which defaults to: function filter() { return !event.button; } If the filter returns falsey, the initiating event is ignored and no brush gesture is started. Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons, since those buttons are typically intended

brush.on()

brush.on(typenames, [listener]) If listener is specified, sets the event listener for the specified typenames and returns the brush. If an event listener was already registered for the same type and name, the existing listener is removed before the new listener is added. If listener is null, removes the current event listeners for the specified typenames, if any. If listener is not specified, returns the first currently-assigned listener matching the specified typenames, if any. When a speci

brush.handleSize()

brush.handleSize([size]) If size is specified, sets the size of the brush handles to the specified number and returns the brush. If size is not specified, returns the current handle size, which defaults to six. This method must be called before applying the brush to a selection; changing the handle size does not affect brushes that were previously rendered.