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

Draw ordering for points #20

Closed
davidmanzanares opened this issue Feb 1, 2018 · 7 comments
Closed

Draw ordering for points #20

davidmanzanares opened this issue Feb 1, 2018 · 7 comments
Assignees

Comments

@davidmanzanares
Copy link

We should be able to order the features (for drawing) on the client.

Doing it on JS is not a viable option if we want to order by a dynamic property: i.e. it is too slow to reorder per frame.

I would try to do a PoC with a psudo ordering mechanism implemented with WebGL. My idea is to divide the features into buckets and draw each tile one time per bucket and GPU filtering out the features that don't belong to the bucket.

@davidmanzanares davidmanzanares self-assigned this Feb 1, 2018
@davidmanzanares
Copy link
Author

Partially done with #70

The current implementation allows ordering the features based on the width property (this only works for points).

Example:

Default behavior (order is Maps API order, basically: no order): https://cartodb.github.io/renderer-prototype/example/mapbox.html#eyJhIjoidHhfMDEyNV9jb3B5X2NvcHkiLCJiIjoiIiwiYyI6ImRtYW56YW5hcmVzLWRlZDEzIiwiZCI6ImNhcnRvLXN0YWdpbmcuY29tIiwiZSI6IndpZHRoOiBzcXJ0KCRhbW91bnQvNTAwMCkqMjAqKHpvb20oKS80MDAwKzAuMDEpKjEuNVxuY29sb3I6IHJhbXAoJGNhdGVnb3J5LCBQcmlzbSlcbnN0cm9rZUNvbG9yOiAgICAgICByZ2JhKDAsMCwwLDAuNylcbnN0cm9rZVdpZHRoOiAgICAgIDIqem9vbSgpLzUwMDAwXG4iLCJmIjp7ImxuZyI6Mi4xNywibGF0Ijo0MS4zOH0sImciOjEzfQ==

Small points below: https://cartodb.github.io/renderer-prototype/example/mapbox.html#eyJhIjoidHhfMDEyNV9jb3B5X2NvcHkiLCJiIjoiIiwiYyI6ImRtYW56YW5hcmVzLWRlZDEzIiwiZCI6ImNhcnRvLXN0YWdpbmcuY29tIiwiZSI6IndpZHRoOiBzcXJ0KCRhbW91bnQvNTAwMCkqMjAqKHpvb20oKS80MDAwKzAuMDEpKjEuNVxuY29sb3I6IHJhbXAoJGNhdGVnb3J5LCBQcmlzbSlcbnN0cm9rZUNvbG9yOiAgICAgICByZ2JhKDAsMCwwLDAuNylcbnN0cm9rZVdpZHRoOiAgICAgIDIqem9vbSgpLzUwMDAwXG5vcmRlcjogZGVzYyh3aWR0aCgpKSIsImYiOnsibG5nIjoyLjE3LCJsYXQiOjQxLjM4fSwiZyI6MTN9

Small points on top: https://cartodb.github.io/renderer-prototype/example/mapbox.html#eyJhIjoidHhfMDEyNV9jb3B5X2NvcHkiLCJiIjoiIiwiYyI6ImRtYW56YW5hcmVzLWRlZDEzIiwiZCI6ImNhcnRvLXN0YWdpbmcuY29tIiwiZSI6IndpZHRoOiBzcXJ0KCRhbW91bnQvNTAwMCkqMjAqKHpvb20oKS80MDAwKzAuMDEpKjEuNVxuY29sb3I6IHJhbXAoJGNhdGVnb3J5LCBQcmlzbSlcbnN0cm9rZUNvbG9yOiAgICAgICByZ2JhKDAsMCwwLDAuNylcbnN0cm9rZVdpZHRoOiAgICAgIDIqem9vbSgpLzUwMDAwXG5vcmRlcjogYXNjKHdpZHRoKCkpIiwiZiI6eyJsbmciOjIuMTcsImxhdCI6NDEuMzh9LCJnIjoxM30=

@makella Can you take a look? Do you consider this good enough to put a low-priority label or something like that in this issue?

@makella makella added the type: doc Related to any type of docs: internal, external, examples label Feb 15, 2018
@makella
Copy link
Contributor

makella commented Feb 15, 2018

@davidmanzanares great!
And yes, to me, this seems good enough for a first release BUT definitely hope we prioritize ordering by the count of features too (in the future!) and expand to lines as well.

Just to clarify, is there any way to order based on width + an attribute?
I'm pretty sure not, but just wanted to ask :)

@rochoa rochoa added topic: expressions and removed type: doc Related to any type of docs: internal, external, examples labels Feb 19, 2018
@rochoa rochoa added this to the Alpha milestone Feb 19, 2018
@davidmanzanares
Copy link
Author

@makella

Just to clarify, is there any way to order based on width + an attribute?

No, not yet

@rochoa Can we move this to next?

@rochoa rochoa modified the milestones: Alpha, Next Feb 23, 2018
@rochoa
Copy link
Contributor

rochoa commented Feb 23, 2018

Done.

@rochoa rochoa changed the title Draw ordering Draw ordering for points Jul 13, 2018
@rochoa rochoa modified the milestones: Next, Public Jul 13, 2018
@davidmanzanares
Copy link
Author

If no one disagrees, I think we should expose the existing functionality in the documentation

@makella
Copy link
Contributor

makella commented Aug 8, 2018

No objections from me. I do think that it was slowing some maps down and in those cases, people can order by in their data

@makella
Copy link
Contributor

makella commented Aug 16, 2018

@davidmanzanares here is the issue i was seeing yesterday
#844

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

No branches or pull requests

3 participants