-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
document global renderlet #910
Comments
I don't know if this is generally helpful, even if it does fire at the "pretransition" step. dc.js offers very few global properties to be altered at these stages, so what does this gain that adding a listener to the chart does not? Also I'd like to point out, that a group can contain any type of chart. If a user is to alter the charts in some fashion during this call, it would require them to know what kind of chart it is (i.e. #904). I guess they could also check if a chart has a certain function/property, but that is less intuitive than assigning a "pretransition" to a chart directly and knowing the properties upfront. |
Yeah. I bet this is really just for detecting redraws / renders, if you're doing something else on the screen like updating some text or something. I'd like to deprecate it in favor of some chart group events. Wish we could find out how people are using it. Oh, we can! https://github.com/search?q=dc.renderlet&type=Code&utf8=✓ |
Interesting never tried that URL before. Seems to just return a bunch of clones checked into source control. |
Ah, you are right, sorry for the noise. I thought I saw some real results in there, but nothing in the first ten pages. (This the search function at the top of github, if you press backspace then it starts searching over all repos.) Google says |
The only use I'd see for it you've mentioned and would be provided for by chart (group) events so +1 for deprecating it in favor of cleaner, more semantically explicit events! :) |
For now, minimal documentation as I just posted on gitter: Usage: dc.renderlet(function() {
// do what you need here
}) Replaces any previous callback. I'll add this to the docs on my next sweep for 2.0. The interface won't change in 2.0.* but in 2.1 we should do better named event dispatches per chart group. |
I just noticed this thing existed, it is a single callback directly on
dc
which gets called directly after anyredrawAll
orrenderAll
.https://github.com/dc-js/dc.js/blob/develop/src/core.js#L283-L289
It fires immediately, like what we're calling "pretransition" #806, and unlike the other "renderlet" events. It takes the group name as its only parameter.
It does not use an event dispatcher. If I were to modernize it, I would suggest an event dispatcher per chart group, and (also/instead) taking the list of charts in the group. I don't know if people use it, though, since it has never been documented. It goes back almost to the beginning of the library.
The text was updated successfully, but these errors were encountered: