-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chainable .data() function #584
Comments
Details: the following charts use
|
@gordonwoodhull Are you including the dataTable in these plans? It would be awesome to use |
@ccheaton, that's a a good suggestion and I opened #651 to track it. I've gotten requests for an option to call It's different from this one, however. This issue is that the existing feature |
An alternate solution is to build some kind of data pipelining library that makes "fake groups" easier to write and deals with chaining in a more elegant fashion. |
Originally,
.data()
was intended for pre-processing or filtering data. It takes a group and returns data in the same format asgroup.all()
.However, this does not work if the chart uses
.data()
internally, because one will override the other.So the current best way to do this is to create a fake group which wraps the group and implements
.all()
by fetching the data from the group and then returning its modified version of the data. This works fine and groups can be wrapped multiple times, but it's a bit confusing for new users, and it also looks like an ugly hack until you get used to it.A simple solution would be to have an internal
.data()
and an external.data()
, but this isn't very elegant and doesn't support the possibility that multiple levels of the chart might want to preprocess the data.Better to figure out a way to chain them so that (I presume) the client processes the data first, then the base, then the children.
The text was updated successfully, but these errors were encountered: