Abe Stanway
Abe Stanway

Reputation: 95

Interpolation on Cubism graphs

Cubism was designed, by mbostock's own words, for maximum information density - which means it generally wants to display one datapoint per pixel. While this is useful in many cases, it doesn't help when your data itself is not that dense. In these cases, you get ugly, staccato-style graphs like so:

enter image description here

Is there a way to interpolate my data/graph within Cubism to show a nice, smoothed graph?

EDIT:

After adding keepLastValue to the metric, I get this:

enter image description here

Here is the same data as shown in Graphite: enter image description here

I would like to smooth the Cubism view to look more like Graphite (with the added awesomeness of the horizon overplotting)

Upvotes: 5

Views: 827

Answers (1)

polm23
polm23

Reputation: 15623

Cubism doesn't do this automatically, but d3 has an interpolator you can use to fill in the in-between values. Here is an example from Mike Bostock using a custom line interpolator; you're probably fine with the default one.

Upvotes: 2

Related Questions