diff --git a/types/d3-selection/index.d.ts b/types/d3-selection/index.d.ts index ef164164cf..08daf8b0c5 100644 --- a/types/d3-selection/index.d.ts +++ b/types/d3-selection/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3-selection module 1.0 +// Type definitions for D3JS d3-selection module 1.1 // Project: https://github.com/d3/d3-selection/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -194,7 +194,7 @@ export interface Selection(selector: ValueFn): Selection; @@ -241,7 +241,7 @@ export interface Selection(selector: ValueFn>): Selection; @@ -276,7 +276,7 @@ export interface Selection): this; @@ -304,7 +304,7 @@ export interface Selection): this; @@ -340,7 +340,7 @@ export interface Selection, priority?: null | 'important'): this; @@ -367,7 +367,7 @@ export interface Selection): this; /** @@ -423,7 +423,7 @@ export interface Selection): this; @@ -449,16 +449,17 @@ export interface Selection): this; /** - * 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.) + * Appends a new element of this type (tag name) as the last child of each selected element, + * or before the next following sibling in the update selection if this is an enter selection. + * The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; + * however, note that selection.order may still be required if updating elements change order + * (i.e., if the order of new data is inconsistent with old data). * * This method returns a new selection containing the appended elements. * Each new element inherits the data of the current elements, if any. @@ -472,10 +473,11 @@ export interface Selection(type: string): Selection; /** - * 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.) + * Appends a new element of the type provided by the element creator functionas the last child of each selected element, + * or before the next following sibling in the update selection if this is an enter selection. + * The latter behavior for enter selections allows you to insert elements into the DOM in an order consistent with the new bound data; + * however, note that selection.order may still be required if updating elements change order + * (i.e., if the order of new data is inconsistent with old data). * * This method returns a new selection containing the appended elements. * Each new element inherits the data of the current elements, if any. @@ -483,14 +485,15 @@ export interface Selection(type: ValueFn): Selection; /** - * Inserts a new element of the specified type (tag name) before the element matching the specified "before" - * selector string for each selected element. + * Inserts a new element of the specified type (tag name) before the first element matching the specified + * before selector for each selected element. For example, a before selector :first-child will prepend nodes before the first child. + * If before is not specified, it defaults to null. (To append elements in an order consistent with bound data, use selection.append.) * * This method returns a new selection containing the appended elements. * Each new element inherits the data of the current elements, if any. @@ -503,12 +506,12 @@ export interface Selection( @@ -572,7 +575,7 @@ export interface Selection): Selection; @@ -584,7 +587,7 @@ export interface Selection(selector: ValueFn): Selection; @@ -639,7 +642,7 @@ export interface Selection(value: ValueFn): Selection; @@ -659,7 +662,7 @@ export interface Selection): this; @@ -810,11 +813,11 @@ export interface Selection): this;