-
Notifications
You must be signed in to change notification settings - Fork 560
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
Decouple graph structure from views #125
Comments
Hey! This is definitely on our roadmap and we would be happy if you can work on a PR. Your idea is right - |
Thanks for getting back to me. |
Hello, @Rupert-RR , |
We can do that, but in which case we cannot have |
NodesMap still can be generic, something like: class NodesMap<T: AnyObject> {
getView() -> getContainer() |
But we can't add a generic property to a class without specifying the concrete type used by the property.
will not work, And if we don't provide a |
Good point, going to try quick workaround using protocol: protocol MacawContainer: AnyObject { class NodesMap { |
Seems like protocol is good solution, here is some updated logic: |
I considered using a protocol, but then you end up having to cast to the |
This issue can be closed since we have |
Hi guys!
Firstly, thank you for the library — it's definitely something that is needed!
My immediate needs are for parsing and rendering SVG images as static images.
I know that this is possible using a
MacawView
(orSVGView
), but this seems unnecessarily heavy for rendering images, if we are not actually using views (views are expensive).How would you feel about enabling rendering without the view dependencies?
NodeRenderer
should have itsAnimationCache
as optional (since it is only ever used optionally anyway), which would allow us to create renderers which do not depend on views;MacawView
into a protocol with default implementations, allowing us to makeMacawView
conform to the protocol so that we can use the same logic, while also being able to make a different, non-view class which can render without a view.Incidentally, I think we ought to be able to use some dependency injection in the view / animation methods to get rid of the
nodesMap
andparentsMap
singletons.Let me know what you think. I would be happy to try to create some PRs for it, if you think this is a direction you might like to take. Otherwise I would probably try creating my own library, with this as a good starting point.
The text was updated successfully, but these errors were encountered: