Plottable.js – Flexible, interactive charts for the web
plottablejs.org
plottablejs.org
With D3.js you have instead full flexibility and the only performance issue is that SVG's are slower than canvas, and that is mostly a problem when you have tens of thousand data points.
If there's a bug in a library then that doesn't invalidate the entire concept of 'simple charting libraries'. How many have you tried?
d3 is robust because it's great code that's widely used - not because of it's other design choices.
I disagree very much. On top of the facts you mentioned, the main reason why d3 works where others don't is because it doesn't abstract away as much from the end user. Leaky abstractions will always, always come back and bite you in the you-know-where.
Clearly this library is setting the world on fire. Meanwhile if you want slow pointy clicky chartjunk for your PHB you can probably use your company's Tableau license, and if you want to push the envelope you use d3.
I've been using d3 on and off since 2011. It started from a spare, elegant idea and progressed to the point that almost anything I might wish to implement has at least some pieces already written in some obscure blocks.org block.
I find that pretty damned impressive given that many of my interests were research projects abandoned in the 90s and only just now beginning to come back. (yes, there were smart people back then, too; they all seemed to have SGIs)
[citation needed]
I seriously doubt the veracity of that claim, and if that's the only justification you can come up with as to why anything is a leaky abstraction, then I refuse to believe you.
No dispute that Wilkinson's ideas deeply influenced all sane graphics frameworks thereafter. In fact SPSS' purchase of SYSTAT was (by far) the best thing they ever did, and that's why people still use that awful piece of garbage.
However, Hadley Wickham spent a lot of time thinking through which parts still made sense, and which didn't, in implementing ggplot2. That book is free online, as are Bostock's notes.
I heartily recommend all three, but if money is an issue you can get the latter two for a lot less than a copy of TGoG.
Funfact: Wilkinson started this by selling SYSTAT to SPSS, got bored, eventually went to Tableau (seems to have worked out nicely for them) and now is at h2o. As much as I despise SPSS from having taught classes that use it, I admire their business sense and wish I'd owned equity in them prior to IBM buying the company.
H2O might not be a bad investment either (I've been wrong plenty of times though).
Turns out Bostock explicitly avoided devising Yet Another Grammar of Graphics in favor of selection and transformation operators. Which, as it happens, is a very sparse but expressive grammar anyways (cf dplyr and other corners of the Hadleyverse). Nonetheless, I misrepresented his idea of maximizing expressivity by minimizing grammatical constraints.
The IEEE paper is even better than I remembered. It's just as good today as it was when he first submitted it.
However, being afraid that I'm not aware of some other, maybe more powerful, libraries out there, I'm asking here are there good alternatives?
Also, there were some rumors lately regarding the layoffs in Palantir, which makes me worry about the future of the project.
I personally love: http://metricsgraphicsjs.org/ and http://www.chartjs.org/
BTW I created the list, comments are appreciated
It has been around for a long while, has superb connectors to many different languages (we mostly interact with it from Python), and has been recently open-sourced. Free, but they also provide hosting for your charts for a very modest fee. Highly recommended.
See https://github.com/plotly/plotly.js/issues/16
Maybe there is a way of rolling your own, but there isn't any documentation...
We ended up using (Django-)NVD3 instead, which worked fine.
C3 builds on top of D3 (D3 is a requirement). The documentation is ok, but I like the way it builds the more simple charts I'm creating now.
HighCharts is full featured and heavier. Its amazing what it can do. It falls back to older browsers fairly easily. It wasn't free though.
There a good O'Reilly book on D3 by Scott Murray, the ebook version of which is free that's a great primer:
http://chimera.labs.oreilly.com/books/1230000000345/index.ht...
I think we'd probably both agree what if someone just wanted to build one (simple) interactive chart and then be done, D3 is probably not a good first choice.
https://cdnjs.com/libraries/plottable.js
The page above actually links to the following:
https://cdnjs.cloudflare.com/ajax/libs/plottable.js/2.2.0/pl...
https://cdnjs.cloudflare.com/ajax/libs/plottable.js/2.2.0/pl...
Check out any web dev project on github. Web developers are fucking insane.
public connectorsEnabled(enabled: boolean): this;
public connectorsEnabled(enabled?: boolean): any {
if (enabled == null) {
return this._connectorsEnabled;
}
this._connectorsEnabled = enabled;
return this;
}
https://github.com/palantir/plottable/blob/develop/src/plots...x.connectorsEnabled(boolean) on line 31 is a setter, return `this` for the benefit of method chaining.
That then leaves the actual definition which goes through to the JavaScript: it has an optional argument to satisfy both plausible signatures and starts on line 32.
In short, the first two are basically hints for TypeScript (if the signature is such-and-such, its return type is actually more restricted than `any`), while the third has the actual implementation.
For something similar consider how the type of callback in `addEventListener(type, callback)` depends on `type`: it’s always going to be a function taking an Event, but for e.g. type 'mousedown' it’s actually more than that, it’s a MouseEvent. So the TypeScript definitions in dom.d.ts or whatever it is (I haven’t had opportunity to actively use TypeScript for a while) has a whole lot of definitions: `addEventListener('mousedown', (event: MouseEvent) => void)`, `addEventListener('focus', (event: FocusEvent) => void)`, &c. (And because it’s just definitions, not the implementation, there is no actual implementation of `addEventListener(string, (event: Event) => void)`. This connectorsEnabled case does have the actual implementation.) In type system terms, think of it as a very restricted form of dependent typing.
edit - see also line 24, for the declaration of the usage without an argument: https://github.com/palantir/plottable/blob/develop/src/plots...
public connectorsEnabled(enabled: boolean): this;
public connectorsEnabled(): boolean;
public connectorsEnabled(enabled?: boolean): any {
if (enabled == null) {
return this._connectorsEnabled;
}
this._connectorsEnabled = enabled;
return this;
}
In that way, typescript will use the most specific overload to do type checking, so you'll get an actual boolean when doing connectorsEnabled(); instead of any.For me though Highcharts/Highstocks is still easily worth its license fees. In my experience >90% of charts I require are very simple to implement in Highcharts and the sensible defaults make your life easy. For the other <10% use D3/a custom solution.
[1] http://plottablejs.org/examples/finance/ [2] http://www.highcharts.com/stock/demo/compare
Ideally I want to plot common time series data with independent scales for each yaxis variable. This is for plotting thermocouple traces.
Here is a stack overflow post from me a while ago: https://stackoverflow.com/questions/35262796/plot-multiple-s...
I've been looking for something with support for this a long time - cheers very much appreciated.
For me, I can use plottable and then make the charts my own with raw D3.
Any recommendations for the easiest to drop-in pretty looking charting library that supports dynamic streamed data from a WebSocket.
For instance, let's say I want to show an dynamic CPU usage graph of one of my servers over time. I don't want a ton of dependencies, it should be lightweight, easy to integrate, and quick!
I'm not an HTML guru, so I don't want 100's of files that I have to build with bower/grunt jobs. Just a link to a script and a bit of JavaScript. That I can manage,
Suggestions really appreciated. If this is it, that's fine too.
That's a problem that, having worked mainly with Chartist, I have struggled with.
I think 10,000 datapoints is the limit in 2d visualization but even 1000-2000 datapoints is often acceptable limit. It's usually reasonable to reasonable to downsample and decimate data before presenting it. If user zooms into data, it should be handled in some other ways than keeping all data.
But if the library supports zooming, I highly appreciate it if I can just put my 10,000 to 100,000 datapoints into the library, specify a simple filter function (avg, sum, min, max) and let the library pick the points it wants to display at each zoom level.
Beyond ~100,000 datapoints any filtering is likely better done in the database than on the client. For values below that, Javascript is more than capable.
A 100,000 data point file would be about 500kb transfered to the client. This is still a tiny amount of data to play around with in JS. It is possible to build an array of image tiles, and zoom around like google maps. But keeping the image tiles in memory could be worse than just replotting if the plot function is fast and optimized enough.
Thanks!
If you need 10000> points and interactivity you could try my own: http://generalsarsby.github.io/mjs_plot/
Is this something that is expected to be handled by the end-user developer?
It's the nearest thing I've seen to an implementation of lattice/ggplot2-style graphing (from R) for Javascript.