tomwanzek / d3-v4-definitelytyped

[DEPRECATED] This repo was intended as a staging area for typescript definitions supporting the latest major release of D3js (i.e. version 4.1.x) by Mike Bostock. It has been migrated to DefinitelyTyped.
MIT License
53 stars 14 forks source link

Creating transition on Selection from other Transition #110

Closed tomwanzek closed 8 years ago

tomwanzek commented 8 years ago

The type constraint on the interface augmentation Selection.transition(...) for generating a transition from an existing transition should probably be relaxed.

I.e. more like:

export interface Selection<GElement extends BaseType, Datum, PElement extends BaseType, PDatum> {
   ...
        transition(transition: Transition<BaseType, any, any, any>): Transition<GElement, Datum, PElement, PDatum>;
    }

Note that, the returned Transition is still a transition on the elements of the Selection from which it was created.

As an example, where this strategy is in use, see Brush & Zoom II