-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
add identifiers to graph elements #124
Conversation
@sebastiandedeyne sorry, have missed the approval. And because the graph gets more and more complex should we add this package to the official spatie docs instead of a readme only? |
Hello, I currently have a similar need where I would need multiple instance of the same type in a graph. we should be able to have different instance of a type on a graph. Do you now when this PR will be merged or how I can achieve that in the meantime ? |
@desaintflorent until now I never needed the same type multiple times on top-level!? 🤔 EDIT: okay, it's approved, I only wait for feedback. |
@Gummibeer My need is to have two ItemList on the top level. Minor sounds enough I guess. Thank you for taking care of this 👍 I will keep you posted if It solve my problem without any issue. |
Looking forward to this. Any news on the release? I will also jump in check to see if this helps my case as well. The example of |
News on my end @Gummibeer: Works very well. I was able to generate a list of VideoObjects and add them to the graph. As stated earlier, my use case needs the ability to create a collection object and add that to it as well - but I was able to construct that object myself for now (that is a different ticket to add Collection as a type) |
@logan-jobzmall happy to hear, I will release it today then.
So the matching issue is #25 and PR #80 . |
fixes #73
In addition to the multiple instances itself this comes with two more major changes.
Graph
does not extend theBaseType
anymore - this is because they got too different and doesn't overlap enough anymore.hide()
andshow()
logic on theGraph
got much more complex with the goal to let it do what the user (or I) would expect it to do if multiple calls with different parameters are chained.->hide(Org::class, null)->hide(Org::class, 'spatie')
won't only hide spatie but simply ignore the second call because the first one already ignores all orgs.->hide(Org::class, null)->show(Org::class, 'spatie')
is the most complex one - it will keep all existing orgs hidden except the specific spatie one.At all the
hide()
andshow()
methods should be called after adding all instances to make this work like expected.Would result in two shown organizations (
spatie
&example2
) because the last one is added after the hide all configuration is overridden by the specific hide/show configuration.But without all this we would receive even more unexpected results. Right now there is no weighting - so simply the last call will set the state. So you should be careful in which order you hide/show your graph elements.