Live data from Hacker News

Plottable.js – Flexible, interactive charts for the web

plottablejs.org

21–30 of 90 posts

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

#21
post #16
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.

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.

Looking further into the examples, it looks like they offer time scale zooming, which is sufficient for what I'm looking for.

Thanks!

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

#22
Comparing their Finance demo [1] to the HighStocks equivalent [2]. It comes in at nearly twice the lines of code for significantly less functionality. Obviously there's a difference in approach here - HighStocks comes with lots of sensible default options where as Plottable.js seems to require more explicit configuration. And Highcharts is a commercial product whereas Plottable is free.

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 [1] http://plottablejs.org/examples/finance/ [2] http://www.highcharts.com/stock/demo/compare

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

#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 performance issue is that SVG's are slower than canvas, and that is mostly a problem when you have tens of thousand data points.

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

#24

It has been over a decade since I did any legitimate work in JavaScript. If I wanted to use this to make some pretty data displays, do I really need to install an ecosystem (npm, node, grunt, bower, more?) instead of just pointing a script tag to something.js?

I would look at Flot, it's just 1 file (plugins are additional files) and very simple to use. http://www.flotcharts.org/

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

#25

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.

We use Plot.ly (https://plot.ly/javascript/), which is also built on top of D3.js

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.

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

#26

It has been over a decade since I did any legitimate work in JavaScript. If I wanted to use this to make some pretty data displays, do I really need to install an ecosystem (npm, node, grunt, bower, more?) instead of just pointing a script tag to something.js?

The Readme[0] has links to a hosted version on a CDN, as well as a direct download

[0]: https://github.com/palantir/plottable#quick-start

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

#27
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...

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 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.

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

#28
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…

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.

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

#29

It has been over a decade since I did any legitimate work in JavaScript. If I wanted to use this to make some pretty data displays, do I really need to install an ecosystem (npm, node, grunt, bower, more?) instead of just pointing a script tag to something.js?

I would look at Flot, it's just 1 file (plugins are additional files) and very simple to use. http://www.flotcharts.org/

I wouldn't. While it still works (and I use it in a project of mine), the last commit is two years old and there are more and more open issues. It's a dead project.

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

#30
post #16
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.

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 client. For values below that, Javascript is more than capable.

Post reply on HN