dsv2json

dsv2json [options…] [file] Converts the specified DSV input file to JSON. If file is not specified, defaults to reading from stdin. For example, to convert to CSV to JSON: csv2json < example.csv > example.json Or to convert CSV to a newline-delimited JSON stream: csv2json -n < example.csv > example.ndjson

dsv.parseRows()

dsv.parseRows(string[, row]) Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows. Unlike dsv.parse, this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length. For example, consider the following CSV file, which notably lac

dsv.formatRows()

dsv.formatRows(rows) Formats the specified array of array of string rows as delimiter-separated values, returning a string. This operation is the reverse of dsv.parseRows. Each row will be separated by a newline (\n), and each column within each row will be separated by the delimiter (such as a comma, ,). Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes. To convert an array of objects to an array of arrays while explicitly specifyi

dsv.parse()

dsv.parse(string[, row]) Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows. Unlike dsv.parseRows, this method requires that the first line of the DSV content contains a delimiter-separated list of column names; these column names become the attributes on the returned objects. For example, consider the following CSV file: Year,Make,Model,Length 1997,Ford,E350,2.34 2000,

dsv.format()

dsv.format(rows[, columns]) Formats the specified array of object rows as delimiter-separated values, returning a string. This operation is the inverse of dsv.parse. Each row will be separated by a newline (\n), and each column within each row will be separated by the delimiter (such as a comma, ,). Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes. If columns is not specified, the list of column names that forms the header row is d

drag.subject()

drag.subject([subject]) If subject is specified, sets the subject accessor to the specified object or function and returns the drag behavior. If subject is not specified, returns the current subject accessor, which defaults to: function subject(d) { return d == null ? {x: event.x, y: event.y} : d; } The subject of a drag gesture represents the thing being dragged. It is computed when an initiating input event is received, such as a mousedown or touchstart, immediately before the drag gestu

drag.filter()

D3 API Reference D3 4.0 is a collection of modules that are designed to work together; you can use the modules independently, or you can use them together as part of the default build. The source and documentation for each module is available in its repository. Follow the links below to learn more. For changes between 3.x and 4.0, see CHANGES; see also the 3.x reference. Arrays (Statistics, Search, Transformations, Histograms) Axes Brushes Chords Collections (Objects, Maps, Sets, Nests) Color

drag.on()

drag.on(typenames, [listener]) If listener is specified, sets the event listener for the specified typenames and returns the drag behavior. 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

dispatch.copy()

dispatch.copy() Returns a copy of this dispatch object. Changes to this dispatch do not affect the returned copy and vice versa.

drag()

drag(selection) Applies this drag behavior to the specified selection. This function is typically not invoked directly, and is instead invoked via selection.call. For example, to instantiate a drag behavior and apply it to a selection: d3.selectAll(".node").call(d3.drag().on("start", started)); Internally, the drag behavior uses selection.on to bind the necessary event listeners for dragging. The listeners use the name .drag, so you can subsequently unbind the drag behavior as follows: selec