Container element type usable for mouse/touch functions
Selects the root element, document.documentElement. This function can also be used to test for selections (instanceof d3.selection) or to extend the selection prototype.
Callback type for selections and transitions
The current event, if any. This is set during the invocation of an event listener, and is reset after the listener terminates. Use this to access standard event fields such as event.timeStamp and methods such as event.preventDefault. While you can use the native event.pageX and event.pageY, it is often more convenient to transform the event position to the local coordinate system of the container that received the event using d3.mouse, d3.touch or d3.touches.
If you use Babel, Webpack, or another ES6-to-ES5 bundler, be aware that the value of d3.event changes during an event! An import of d3.event must be a live binding, so you may need to configure the bundler to import from D3’s ES6 modules rather than from the generated UMD bundle; not all bundlers observe jsnext:main. Also beware of conflicts with the window.event global.
Map of namespace prefixes to corresponding fully qualified namespace strings
Selects the root element, document.documentElement. This function can also be used to test for selections (instanceof d3.selection) or to extend the selection prototype.
Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.
The generic refers to the type of the new element to be returned by the creator function.
Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, such as for SVG elements.
Invokes the specified listener, using the specified "that" as "this" context and passing the specified arguments, if any. During the invocation, d3.event is set to the specified event; after the listener returns (or throws an error), d3.event is restored to its previous value. In addition, sets event.sourceEvent to the prior value of d3.event, allowing custom events to retain a reference to the originating native event. Returns the value returned by the listener.
The first generic "Context" refers to the "this" context type in which the listener will be invoked. The second generic "Result" specifies the return type of the listener.
The event to which d3.event will be set during the listener invocation.
The event listener function to be invoked. This function will be invoked with the "this" context, provided by the "that" argument of customEvent(...). It will be passed all optional arguments passed to customEvent(...). The function returns a value corresponding to the type of the second generic type.
The "this"" context which will be used for the invocation of listener.
A list of optional arguments, which will be passed to listener.
Obtain a new local variable
The generic refers to the type of the variable to store locally.
Given the specified selector, returns a function which returns true if "this" element matches the specified selector.
A CSS selector string.
Get (x, y)-coordinates of the current event relative to the specified container element. The container may be an HTML or SVG container element, such as a G element or an SVG element. The coordinates are returned as a two-element array of numbers [x, y].
Container element relative to which coordinates are calculated.
Obtain an object with properties of fully qualified namespace string and name of local by parsing a shorthand string "prefix:local". If the prefix does not exist in the "namespaces" object provided by d3-selection, then the local name is returned as a simple string.
A string composed of the namespace prefix and local name separated by colon, e.g. "svg:text".
Select the first element that matches the specified selector string. If no elements match the selector, returns an empty selection. If multiple elements match the selector, only the first matching element (in document order) will be selected.
The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type.
CSS selector string
Select the specified node element.
The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, on the selected element. This is useful when re-selecting an element with a previously set, know datum type.
An element to be selected
Create an empty selection.
Create an empty selection.
Create an empty selection.
Select all elements that match the specified selector string. The elements will be selected in document order (top-to-bottom). If no elements in the document match the selector, returns an empty selection.
The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type.
CSS selector string
Select the specified array of nodes.
The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type.
An Array of nodes
Select the specified nodes. This signature allows the selection of nodes contained in a NodeList, HTMLCollection or similar data structure.
The first generic "GElement" refers to the type of element to be selected. The second generic "OldDatum" refers to the type of the datum, of a selected element. This is useful when re-selecting elements with a previously set, know datum type.
An Array-like collection of nodes
Given the specified selector, returns a function which returns the first descendant of "this" element that matches the specified selector.
The generic refers to the type of the returned descendant element.
A CSS selector string.
Given the specified selector, returns a function which returns all descendants of "this" element that match the specified selector.
The generic refers to the type of the returned descendant element.
A CSS selector string.
Returns the x and y coordinates of the touch with the specified identifier associated with the current event relative to the specified container. The container may be an HTML or SVG container element, such as a G element or an SVG element. The coordinates are returned as a two-element array of numbers [x, y] or null if there is no touch with the specified identifier in touches, returns null; this can be useful for ignoring touchmove events where the only some touches have moved.
If touches is not specified, it defaults to the current event’s changedTouches property.
Container element relative to which coordinates are calculated.
Touch Identifier associated with the current event.
Return the x and y coordinates of the touch with the specified identifier associated with the current event relative to the specified container. The container may be an HTML or SVG container element, such as a G element or an SVG element. The coordinates are returned as a two-element array of numbers [x, y] or null if there is no touch with the specified identifier in touches, returns null; this can be useful for ignoring touchmove events where the only some touches have moved.
If touches is not specified, it defaults to the current event’s changedTouches property.
Container element relative to which coordinates are calculated.
TouchList to be used when identifying the touch.
Touch Identifier associated with the current event.
Return the x and y coordinates of the touches associated with the current event relative to the specified container. The container may be an HTML or SVG container element, such as a G element or an SVG element. The coordinates are returned as an array of two-element arrays of numbers [[x1, y1], [x2, y2], …].
If touches is not specified, it defaults to the current event’s touches property.
Container element relative to which coordinates are calculated.
TouchList to be used.
Returns the owner window for the specified node. If node is a node, returns the owner document’s default view; if node is a document, returns its default view; otherwise returns the node.
A DOM element
Generated using TypeDoc
BaseType serves as an alias for the 'minimal' data type which can be selected without 'd3-selection' trying to use properties internally which would otherwise not be supported.