Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

§Variables

namespaces

Map of namespace prefixes to corresponding fully qualified namespace strings

selection

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.

§Functions

create

Given the specified element name, returns a single-element selection containing a detached element of the given name in the current document.

creator

Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

local

Obtain a new local variable

matcher

Given the specified selector, returns a function which returns true if "this" element matches the specified selector.

namespace

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.

pointer

Returns a two-element array of numbers [x, y] representing the coordinates of the specified event relative to the specified target. event can be a MouseEvent, a PointerEvent, a Touch, or a custom event holding a UIEvent as event.sourceEvent.

pointers

Returns an array [[x0, y0], [x1, y1]…] of coordinates of the specified event’s pointer locations relative to the specified target. For touch events, the returned array of positions corresponds to the event.touches array; for other events, returns a single-element array.

select

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.

selectAll

Create an empty selection.

selector

Given the specified selector, returns a function which returns the first descendant of "this" element that matches the specified selector.

selectorAll

Given the specified selector, returns a function which returns all descendants of "this" element that match the specified selector.

style

Returns the value of the style property with the specified name for the specified node. If the node has an inline style with the specified name, its value is returned; otherwise, the computed property value is returned. See also selection.style.

window

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.

§Interfaces

ArrayLike

A helper interface which covers arguments like NodeListOf or HTMLCollectionOf argument types

ClientPointEvent

A User interface event (e.g. mouse event, touch or MSGestureEvent) with captured clientX and clientY properties.

CustomEventParameters

Interface for optional parameters map, when dispatching custom events on a selection

EnterElement

An interface describing the element type of the Enter Selection group elements created when invoking selection.enter().

Local
NamespaceLocalObject

Interface for object literal containing local name with related fully qualified namespace

NamespaceMap

Interface for maps of namespace prefixes to corresponding fully qualified namespace strings

Selection

A D3 Selection of elements.

TransitionLike

TransitionLike is a helper interface to represent a quasi-Transition, without specifying the full Transition interface in this file. For example, wherever d3-zoom allows a Transition to be passed in as an argument, it internally immediately invokes its selection() method to retrieve the underlying Selection object before proceeding. d3-brush uses a subset of Transition methods internally. The use of this interface instead of the full imported Transition interface is [referred] to achieve two things: (1) the d3-transition module may not be required by a projects use case, (2) it avoids possible complications from 'module augmentation' from d3-transition to Selection.

§Type Aliases

BaseType

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.

ContainerElement

Container element type usable for mouse/touch functions

KeyType

KeyType serves as alias for valid types that d3 supports as key for data binding

SelectionFn

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.

ValueFn

Callback type for selections and transitions