Skip to content

d3.timer.replace and d3.timer.reschedule #1790

Closed

Description

@mbostock

Transitions currently use the internal d3_timer_active variable to reschedule the active timer and replace its callback function. It’d be nice if we made these methods public so that you can easily stub out the d3.timer API or use similar functionality when implementing complex custom animations.

Activity

  1. added this to the 3.5 milestone on Mar 19, 2014
  2. modified the milestones: 3.x, 3.5 on May 30, 2014
  3. cool-Blue commented on Apr 30, 2015

    @cool-Blue

    Have you also considered d3.timer maintaining a timers by name array? Or timers by id maybe. It would be good if d3.timer returned an id and maintained a list, this would round out the proposed api nicely. It would also allow better management of the timer in the force layout for example. Currently, if you .stop() a force layout and restart it before force.tick() is called, you end up with two timers, both hitting the same call-back and the animation runs at double speed.

  4. modified the milestones: 3.x, 4.0 on Oct 22, 2015
  5. mbostock commented on Oct 22, 2015

    @mbostock
    MemberAuthor

    In 4.0, I’m planning on having d3.timer return a handle so that you can modify and cancel timers outside of the callback; see d3/d3-timer#5.

  6. mbostock commented on Mar 1, 2016

    @mbostock
    MemberAuthor

    Closing as fixed in d3-timer for 4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions