Live data from Hacker News

Plottable.js – Flexible, interactive charts for the web

plottablejs.org

61–70 of 90 posts

Re: Plottable.js – Flexible, interactive charts for the web

#61

This is definitely the best charting library I've worked with so far, mostly because of its flexibility. 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.

This was on HN before: http://www.jsgraphs.com/ (comparison of all popular charting libraries)

Re: Plottable.js – Flexible, interactive charts for the web

#62
post #59
post #7

Can someone enlighten me on why they're doing two declarations, one empty returning `this` and the other, implemented, returning `any`? 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...

The odd thing is that they are not using three: 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 con…

There are all three. Just look up a bit.

Re: Plottable.js – Flexible, interactive charts for the web

#63
post #38

Earlier quoted context omitted.

x.connectorsEnabled() on line 24 is a getter, returning the boolean. 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 suc…

It feels complicated due to not using separate getter and setter functions. By splitting it into two functions the annotations could be reduced as well. I wonder what the reason for not taking that approach was.

It’s common in JavaScript to have method overloading for getters and setters like this. jQuery is probably the best-known example; .css('property') is a getter and .css('property', value) a setter.

Re: Plottable.js – Flexible, interactive charts for the web

#64
When it comes to plotting stuff with JS HighCharts is the ugly thing that gets the job done. I think at this point I tried at least 10 different libs and always ended up wasting lot of time because some basic feature was missing (eg. tooltips, zoom, some sort of chart, log scale, decent theme support, ...)

Re: Plottable.js – Flexible, interactive charts for the web

#65
post #23

I really dislike these simple charting libraries, because I always have some kind of issue that just wastes my time in the end. For example with plottable, there is a hover event function that is extremely expensive that will trigger for every pixel movement with your mouse. With just a few hundred datapoints every chart we rendered ran horribly slow. With D3.js you have instead full flexibility and the only performa…

Seriously... I was just reading the examples and thinking to myself "why would I use this over vanilla D3"? The syntax isn't more concise and offers less control, and introduces a whole new api to learn. To me this is like writing a DOM manipulation framework on top of jQuery...

I had a similar thought. With examples that still need so much code I'd rather just learn D3 and get much more re-usable knowledge

Re: Plottable.js – Flexible, interactive charts for the web

#66
post #59

Earlier quoted context omitted.

The odd thing is that they are not using three: 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 con…

There are all three. Just look up a bit.

Thanks, it does make more sense now.

Re: Plottable.js – Flexible, interactive charts for the web

#67
post #13

How well does this handle large datasets (thousands of datapoints)? That's a problem that, having worked mainly with Chartist, I have struggled with.

It uses SVG on D3. So I don't think so.

If you need 10000> points and interactivity you could try my own: http://generalsarsby.github.io/mjs_plot/

Re: Plottable.js – Flexible, interactive charts for the web

#68
post #16

Earlier quoted context omitted.

What is the maximum number of datapoints that plotting library should be excepted to handle at the same time? 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.

Displaying up to 1000 datapoints at once seems like a reasonable limit. 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…

If you are plotting using a canvas - not building a SVG or on the dom - then even 50000 points is fine, no need to filter even on mobile devices.

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.

Re: Plottable.js – Flexible, interactive charts for the web

#69
post #28

Earlier quoted context omitted.

Surely if it's a bug that affects everyone then file an issue? 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.

d3 is robust because it's practically a language, whereas all of these charting libraries that wrap it are essentially "d3 frameworks".

True, it was heavily inspired by the book 'The Grammar of Graphics', which is a truly worthwhile read.

Re: Plottable.js – Flexible, interactive charts for the web

#70
post #56
post #45

Earlier quoted context omitted.

Unless this has changed, you need the $9,950/year plan to serve it "behind your own firewall". I.e. otherwise plots on done on their systems by uploading data.

That used to be the case until the end of last year, but it has been open-sourced and you can render a plot entirely on the client side, without a roundtrip to Plot.ly's servers (no rate limits anymore, custom integrations to your existing stuff, etc.), for free. https://plot.ly/javascript/open-source-announcement/

We looked into it after they open sourced it; AFAIK, it is still designed to connect to their streaming servers with an API key (or run locally in an ipython notebook or similar "offline"). If you want to make your own private dashboards for your own system you still need https://plot.ly/product/enterprise/#plotly-on-premise

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.

Post reply on HN