-
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
d3v4 cleanup #1398
Comments
👍 I agree to all of these, I will work on these when I am through with the brush and zoom :) After having worked for about 2 months now, I understand that it will make everyone's life easier if getter/setters did not do anything other than updating the underlying variable. Newer code I have started following that. When we are in more control with the upgrade, If you find it useful, we can make a pass to cleanup the entire code base in this regard. |
I mostly agree, but By all means, wherever we can remove extra code from getter/setters without changing the behavior, we should do that. Often that code will drift into prepare/initialize. I don't know if this is always possible. |
Here's part 2. Also filed a few issues. Going to get some weekend rest now. :) coordinate grid mixin(continued)
|
Agree to part 2 list as well. |
Okay, here's the final part 3/3 of my review. I've also made some minor edits and additions above. Truly a heroic effort you made here. I've learned so much reading your changes. Thank You! number display
pie chart
|
Thanks for your detailed review :) I will come back to changes needed for Meanwhile I will cover other remarks. |
A list for me to track (tick indicates completed or PR raised):
|
…rearranged the code to make it more explicit about what it does.
As of now skipping any changes in row-chart. At this stage, I think, we should keep the change-set small in comparison to v2.1. Once we are through with v3 release, we can discuss what all we can take up. |
…sh rounding check again for brush being empty. Fixes part of #1398
…API documentation changes. Fixes part of #1398.
I think this is the only remaining change before 3.0 goes beta! |
Just pushed tho PRs, we should be able to close this issue now 😃 |
Fixed in 3.0 beta 1 |
I've tried to use it in @observablehq with d3v5, and it sort of works, but some styling is off. But other than that, it looks good. Congratulations! And what an achievement! |
Thanks @Fil! Yes, we'll have to iterate on it. I'm new to ES6 modules so I'm not surprised that we need to configure the module better. It's still just straight old UMD. As for styling, I see two problems. One, the cell heights are too short, at least on my iPad. That is perhaps a CSS problem. Two, you need to set Yes, it was a huge amount of work, mostly by @kum-deepak. I'm really impressed that he figured this all out, and happy dc.js will live on for another few years! |
Hi @kum-deepak!
As promised, I'm doing a thorough line-by line review of #1363 d3v4 support.
Rather than comment inline on a PR that has already been merged, I decided to start a new issue.
I think I have gotten through about 1/3 of the changes, and I'm learning a lot along the way!
Here are my comments so far. I'm going to go for a Saturday walk now. :)
global changes
"selection"
The argument name
selection
is confusing forfadeDeselectedArea
/brushIsEmpty
/extendBrush
/scatterPlot.brushIsEmpty
scatterPlot._brushing
because it sounds like it should be a d3 selection. Personally I would use the termfilter
orextent
here.I guess this arose because of
event.selection
from Brush Events so maybebrushSelection
would be a good compromise. Kind of confusing that they reused such a common term.composite chart
rightYAxis
documentation: "depending on whether you are going to use the axis on left or right" doesn't make sense, as it should always bed3.axisRight
. I guess this was copied fromcoordinateGridMixin.yAxis
but it's different.coordinate grid mixin
xUnitCount
This function now distinguishes
dc.units.ordinal
but it doesn't need to because calling the function would have exactly the same effect. I'd rather not add the special case unless it's necessary for some reason? The design ofxUnits
functions is perhaps a bit strange but it is generic.If this really needs to be then it should at least use
chart.isOrdinal()
.prepareXAxis
I agree that we need to use
d3.scaleBand
instead ofd3.scaleOrdinal
-- it's so much cleaner! -- but it will confuse users if their input.x()
scale is changed. We should issue a warning every time we make the replacement so users can update their code accordingly.prepareYAxis
I respectfully disagree with the comment - it's really nice how the axes are automatically initialized and I think we should be able to extend that to the right axis.
This code will never get hit because
_yAxis
is initialized and the user would never set it to undefined or null.Could we start with
_yAxis
null and initialize it like we're doing here, when.yAxis()
is called as a getter?I think this would safely initialize it to axisLeft or axisRight automatically, and it would be nice not to default it wrong. The only way it might go wrong is if the user called
.yAxis()
before calling.useRightAxis(true)
but I doubt anyone would do that.Also, I know it was already there in the original, but I find
really confusing.
.scale()
is an ordinary setter which modifies the axis.The text was updated successfully, but these errors were encountered: