This is a fork of Mike Bostock’s Line Transition.
This fork was originally intended to showcase a principle of using padding between the x and y axis. This is a concept I’ve seen covered over and over again when dealing with non-zero minimum value charts (see example).
I also found it interesting to update both the line and the x axis. It should be noted that this was not the intent of the line transition example, seeing that the line was treated as a queue, pushing and popping from the front and back of the data. It talked on how to prevent odd visual behavior of the path when those changes occur, nothing more or less.
That being said, the visual change to the axis was a hack (see x_axis_scale) to just better understand how useful a constant, fast linear change effects my comprehension of the data.
So far, my personal opinion is that when dealing with updating data similar to this, it is best to spend most of your non-data visual queues to aid in comprehending the changing axis. It seems hard to distinguish between a major point (e.g any multiple of 5) and the points to it’s immediate right and left, by extending the tick size of the x axis, you add more “chart junk” but help aid yourself (or your user) in comprehending the data.
I believe that this example is one of the charts that has near to bare minimum “chart junk” while still allowing the user to easily understand the data.
If you have thoughts, or have forked this gist to offer different changes, contact me on twitter: @milr0c.
TODO: Combine both transitions into one, to prevent odd pausing behavior of x-axis (might be my eyes playing tricks on me).