Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom bin ranges #37

Open
1 task
shusson opened this issue Jun 28, 2017 · 6 comments
Open
1 task

Custom bin ranges #37

shusson opened this issue Jun 28, 2017 · 6 comments

Comments

@shusson
Copy link

shusson commented Jun 28, 2017

🆕 feature request

  • User story:
    Support custom bin ranges e.g ranges that follow a log scale. This would help us visualise data that is not evenly distributed.
@Drecula
Copy link
Contributor

Drecula commented Jun 28, 2017

Hi Shane,

Thank you for the excellent suggestion... I am chatting with our product team about it and will get back to you soon.

In the meantime, our first refactor of the crossfilter code just landed. It's been mostly organized into classes and refactored to ES6. I hope you find it a little more approachable!

@mrblueblue
Copy link
Contributor

@shusson Just wanted to clarify somethings:

If I'm understanding correctly, your request is for a type of bin transformation that has a "step" that changes logarithmically?

Right now the "step" is fixed, it being the max of the extent minus the min of the extent divided by the number of bins specified.

With a logarithmic step, I'm assuming that the step filled by each "bin" would grow logarithmically (or by whatever formula the user specifies)?

As a temporary workaround have you tried to visualize the data ubinned with a logarithmic scale?

Let me know if I've represented your request correctly!

@shusson
Copy link
Author

shusson commented Jun 30, 2017

@Drecula thanks, the refactor looks great.

@mrblueblue see this blog for an example of what I mean from an SQL perspective.

@edmapd
Copy link

edmapd commented Jun 30, 2017

Hi Shane,
We currently have a pull request in testing for "Custom Dimensions" which will let you form bins using your own SQL. This should be able to hit your use case. It will be in our next release, if not the following.

Regards,
Ed

@nytai
Copy link
Contributor

nytai commented Jun 30, 2017

@shusson You should be able to input the binning portion of the query directly as a dimension, and then turn binning off to achieve the desired results.

Following the blog post you posted above you'd input something like this

round(power(10,ceil(log10({column_name}+0.0001))))

as your dimension string.

(for reference to supported sql functions see here)

This is a workaround and would, unfortunately, require the entire dimension be destroyed in order to make changes.
It would be much nicer for crossfilter to support this as part of the binning api, which would allow for it to be toggled on/off, and make changes (power, log base, column etc) without having to destroy the dimension.

@shusson
Copy link
Author

shusson commented Jul 3, 2017

thanks @nytai I like the workaround and it should work for us for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants