-
Notifications
You must be signed in to change notification settings - Fork 87
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
beforeDraw
hook
#97
Comments
Tell me if I'm interpreting your request correctly:
Is that right? |
Almost - I think This way you could use the data to, for example, update your scale's domains. |
Sam, that is the intent of the "transform" method. It takes in the data as I use it traditionally to update scale domains, create layouts etc. -- Irene On Mon, Apr 28, 2014 at 11:02 AM, Sam Selikoff [email protected]:
|
So there was a situation I ran into that prevented me from being able to use transform for this, and I think it was the cascade. Does a layer's or attached chart's I think I wanted a layer/attached chart's domain to override the parent's. When I have more time I'll go back and try to get what the exact use case was. |
That would be incredibly helpful Sam! Let us know when there's an example -- Irene On Mon, Apr 28, 2014 at 11:38 AM, Sam Selikoff [email protected]:
|
@iros you can actually see the convo here: #78 (comment) The problem was because But perhaps I need to rethink the hierarchy a la Mike's suggestion. Still, having a method that is reliably invoked last on a subchart could be useful. |
Another solution would be to build support for constructors into d3.chart (see #76). If it were clear how to access any given chart constructor, then we could remove both Removing the "cascading" behavior would be a pretty significant breaking change, and I don't suggest it lightly. But it may be that the -cascade methods are too clever for their own good, so I want to at least put that on the table. @samselikoff In the mean time, you should be able to solve your problem with the refactoring I suggested in that issue. |
It'd be nice to have a
beforeDraw
hook, a place to do chart-wide work not related to any particular layer (e.g. updating a scale's domain), but completely removed from the transform cascade.Thoughts?
(I took a look at the library myself and was playing around with implementing, but figured I'd message here first.)
The text was updated successfully, but these errors were encountered: