diff --git a/d3-selection/index.d.ts b/d3-selection/index.d.ts index df9efa9bcc..49cd141dfa 100644 --- a/d3-selection/index.d.ts +++ b/d3-selection/index.d.ts @@ -461,8 +461,9 @@ interface Selection): this; /** - * Appends a new element of the specified type (tag name) as the next following sibling in the update selection. - * (This allows you to insert elements into the DOM in an order consistent with bound data; + * Appends a new element of the specified type (tag name) as the last child of each selected element, or the next + * following sibling in the update selection if this is an enter selection. + * (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; * however, the slower selection.order may still be required if updating elements change order.) * * This method returns a new selection containing the appended elements. @@ -475,27 +476,11 @@ interface Selection(this: Selection, - type: string): Selection; - + append(type: string): Selection; /** - * Appends a new element of the specified type (tag name) as the last child of each selected element. - * - * This method returns a new selection containing the appended elements. - * Each new element inherits the data of the current elements, if any. - * - * The generic refers to the type of the child element to be appended. - * - * @param type A string representing the tag name. The specified name may have a namespace prefix, such as svg:text - * to specify a text attribute in the SVG namespace. If no namespace is specified, the namespace will be inherited - * from the parent element; or, if the name is one of the known prefixes, the corresponding namespace will be used - * (for example, svg implies svg:svg) - */ - append(type: string): Selection; - - /** - * Appends a new element of the type provided by the element creator function as the next following sibling in the update selection. - * (This allows you to insert elements into the DOM in an order consistent with bound data; + * Appends a new element of the type provided by the element creator function as the last child of each selected element, + * or the next following sibling in the update selection if this is an enter selection. + * (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; * however, the slower selection.order may still be required if updating elements change order.) * * This method returns a new selection containing the appended elements. @@ -507,22 +492,7 @@ interface Selection(this: Selection, - type: ValueFn): Selection; - - /** - * Appends a new element of the type provided by the element creator function as the last child of each selected element. - * - * This method returns a new selection containing the appended elements. - * Each new element inherits the data of the current elements, if any. - * - * The generic refers to the type of the child element to be appended. - * - * @param type A creator function which is evaluated for each selected element, in order, being passed the current datum (d), - * the current index (i), and the current group (nodes), with this as the current DOM element. This function should return - * an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) - */ - append(type: ValueFn): Selection; + append(type: ValueFn): Selection; /** * Inserts a new element of the specified type (tag name) before the element matching the specified "before" @@ -550,7 +520,7 @@ interface Selection( type: string | ValueFn, before?: string | ValueFn - ): Selection; + ): Selection; /** * Removes the selected elements from the document. diff --git a/d3-zoom/d3-zoom-tests.ts b/d3-zoom/d3-zoom-tests.ts index 1926ad757f..f4a1c0944e 100644 --- a/d3-zoom/d3-zoom-tests.ts +++ b/d3-zoom/d3-zoom-tests.ts @@ -229,7 +229,7 @@ canvas.call(canvasZoom); // SVG Example -------------------------------------------------------------- // attach the zoom behavior to an overlay svg rectangle -const svgOverlay: Selection = svg.append('rect') +const svgOverlay: Selection = svg.append('rect') .attr('width', d => d.width) .attr('height', d => d.height) .style('fill', 'none')