-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support custom object key accessor in layer transitions #2570
Comments
@ilyabo Thank you for the suggestion. We do plan to expand the transition feature, though I'm not sure it can be as flexible as the d3 Suppose we support enter/update/exit, but you cannot change the order of your objects. i.e. the transition from |
Thanks for your answer @Pessimistress! We draw arrows sorted by their weights. The sorting is essential so that the larger arrows are drawn on top of thousands of smaller ones. We have interactive filters (not in the above example) which modify data and affect the sorting. So the change may well be like I understand that you have to make tradeoffs and performance is very important, but I also don't think that our case is a very special one. I think that not having the possibility to correctly identify changes will be a major blocker in many cases in which data can change. I don't really know how it works under the hood (I believe you are using transform feedback for the animation, is that right?). But maybe you could optionally send the correct indices to the shaders along with the data to avoid re-sorting? |
In your use case, you are using order to simulate z-index. If you instead set a small We are indeed using transform feedback under the hood. To support reordered data, we will need to reconstruct the start buffer to match the new end buffer. I guess the perf loss is acceptable since you as the user knows what you are asking for. |
Thanks for the awesome work on this library, wanted to say that it'd be very beneficial to have the support for identifying "new data" outside of just the array indices! |
@Pessimistress Just wondering if this work is still in progress at all? I have animation requirements on a data set that constantly changes in both length and order based on incoming data from an api/ changing zoom levels and using keys to identify the objects and their new positions rather than indexes would solve my issue instantly! |
@Pessimistress can we at least have the option to deactivate transition completely in the case where it does not work, meaning when objects are added or removed? |
@Fabioni what options do you need other than setting |
Just that. We can build this on our side. (comparing the set of all ids of the current data and from before), but I think it would be useful to have this as part of the layer logic. |
@Pessimistress any updates on this? |
Target Use case
It's fantastic to have the support for very efficient layer transitions. Currently, there is a possibility to define entering transitions for the individual objects in a layer. However, to determine which elements are new, the array indices are used. From the docs:
This is a very strong limitation. In our situation changes to data happen often and the objects must be sorted in a certain way, so we cannot put the new ones to the end of the array. Also, storing all the possibilities in the array and setting the opacities for the "non-existing" ones to 0 would be completely impractical (we need to represent connections between pairs of locations).
Proposed feature
It should be possible to specify a custom key accessor function to identify objects and changes in the data passed to a layer analogously to the D3's key parameter in selection.data()
To Do List
The text was updated successfully, but these errors were encountered: