-
Notifications
You must be signed in to change notification settings - Fork 24
Updated a number of components to add useful features #40
Conversation
Hi @MHeisoku, these improvements look great! I don't normally like to merge a lot of unrelated changes in a single PR or commit, but since you are a first-time contributor, and this is great stuff, I am willing to take this as-is. Would you be willing to summarize the individual changes for the changelog, and to help my review? Thanks! |
Yes can do. I can summarise each change in bullet point form if you'd like? |
Yes, that would be perfect, thanks! It doesn’t need to be detailed - take a look at Changelog.md for guidance. |
Is this sufficient? Let me know if it hasn't hit the mark. I have more changes made to choro, bubble and marker to add features but will leave them to separate pull requests for each. Let me know what I can do for next steps for this PR. 0.5.2
|
That's perfect, thanks very much. I'm just recovering from illness, will review soon! |
These features look super helpful. Thanks also for providing an example of each feature in one of the demo charts - that's the best way to test things in this library, in lieu of proper tests, and it's helpful to users. When you talk about using Please try to make changes backward-compatible, so that people can upgrade without too much effort. I tested backward compatibility of the bubble chart colors by commenting out the color-related lines // .colors(colorbrewer.Reds[7])
// .colorDomain([
// d3.min(facilitiesGroup.all(), dc.pluck('value')),
// d3.mean(facilitiesGroup.all(), dc.pluck('value'))
// ])
// .colorAccessor(function(d,i) {
// return d.value;
// }) and got a messy chart: It doesn't have to work the same way as before, with grey unselected bubbles, but
It looks like
I tested In future PRs, please don't check in generated artifacts such as Great work! I'm glad to see this library getting some major upgrades. I look forward to seeing your "dynamic choropleth and legend regeneration code" once we have reviewed and merged this. |
Thanks for reviewing and for the comments Gordon - helps me to know what to look out for next time. Can I amend this PR and resubmit for review or do I need to close and submit a new PR? Sorry for such basic questions. |
Just push more commits to the same branch and they will show up here. A PR is basically a live diff between two forks/branches. Another tip for next time: when doing multiple PRs, you will find that you want to dedicate a branch for each PR, instead of using master. |
Hi @MHeisoku, are you still interested in contributing? These are great improvements and I'd really like to see them merged! |
…rom gordonwoodhull (includes updates to clustering example to show how to fitOnRender and fitOnRedraw and reuse an already initialised Leaflet map object).
Apologies Gordon. Have been busy wrapping up a job and moving onto another recently and haven't had the time until recently to commit changes. See latest changes which hopefully address your feedback. I have also demonstrated how to use the .map() setter function in leafletBase. I found the .map setter function useful to preserve Leaflet's responsive behaviour and allow a lot of Leaflet specific code and plugins to initialise a map before dc layers are added. From now on I will stick to isolating PRs to either a particular chart type, or new/enhanced functionality that is common across chart types. I've also figured out how to use grunt (pretty cool and makes changing and testing really easy) and will make sure in future I only push files in src so you can generate dc.leaflet.js as part of the build process. |
…et (input variable left off function call)
Hi Gordon. Just want to check to see whether you need me to make any further changes? |
Thanks @MHeisoku! Sorry for the slow review - I was caught up in a few other projects this week. I tested backward compatibility by temporarily checking out the old index.html. There is a small aesthetic difference in the bubble chart but everything works properly now. IMO it looks better without the bold outlines, so I think this change is fine, just wanted to document it for posterity. I removed the comments you made for testing, as I find it confusing to have "what-ifs" in the code. Also it's not a good practice to set a scale inside an accessor, although it does work. I guess you did this for brevity. I also added your Released as 0.5.2! |
This is my first time making a pull request and I should note that I haven't minified the js and haven't regenerated js.map files.
The features I have added are in the readme and the examples have been updated to demonstrate some of the key ones. Being able to use your own pre-existing Leaflet map object is one of the most powerful and ensures that DC.js is able to seamlessly plugin to existing maps.
Happy to discuss and revise things further - keen to see this library mature as it is really beneficial for interactive maps. I have some dynamic choropleth and legend regeneration code I'd like to refactor in a future version - replacing an existing with new layer and also replacing the legend is critical to some intuitive discovery use cases.