Skip to content
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

Pluginize #30

Merged
merged 7 commits into from
Jul 13, 2017
Merged

Pluginize #30

merged 7 commits into from
Jul 13, 2017

Conversation

ale0xb
Copy link
Contributor

@ale0xb ale0xb commented May 13, 2017

This PR does several things:

  1. Adapts base code to d3 v4
  2. Modernises the examples in index.html
  3. Proposes a stub for npm's package.json

Theoretically with very few further actions people could use this code by running npm install d3-cartogram in their projects. Any doubts, let me know. Thanks!

@ale0xb ale0xb mentioned this pull request May 13, 2017
@shawnbot shawnbot self-requested a review May 18, 2017 22:38
@shawnbot
Copy link
Owner

Thank you so much for this, @ale0xb. I likely won't be able to review it for a couple of weeks, but as soon as I have a chance to, I will. Feel free to bump this with a comment if it languishes for too long. 😬

@ale0xb
Copy link
Contributor Author

ale0xb commented Jun 24, 2017

Bump! 👋

Copy link
Owner

@shawnbot shawnbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this, @ale0xb! I have just a couple of minor changes.

index.html Outdated
// map.call(zoom);
updateZoom();
layer.attr("transform",
"translate(" + -38 + "," + 32 + ")" +
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit-picky thing: can this also be an array stringification, a la [-38, 32]? This will make it easier to turn the translation into a single variable.

index.html Outdated
updateZoom();
layer.attr("transform",
"translate(" + -38 + "," + 32 + ")" +
"scale(" + [0.94, 0.94] + ")");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"scale(" + 0.94 + ")" would suffice here, and also make it easier to update the scale by turning it into a variable like the translation distance.

@shawnbot
Copy link
Owner

If you have the time, would you also mind trying to merge @adamflorin's changes in #28 into this PR? Thank you!!

@adamflorin
Copy link

@shawnbot Good memory! @ale0xb Let me know if you have any questions, there are just a half-dozen small changes or so…

@ale0xb
Copy link
Contributor Author

ale0xb commented Jun 28, 2017

Hello!
I just pushed a couple of minor changes addressing the issues you pointed out @shawnbot.

Regarding @adamflorin PR I think most of the functionality was already implemented. This library is using a rollup setup that produces umd builds (and thus makes the code compatible with node and the browser). I didn't have time to test it myself but theoretically it should work just as fine as the official d3 plugins do (ie: d3-scale). Trigger a build and look at the first lines of build/d3-cartogram.js, you'll see what I mean.

Anything else let me know, happy to help!

@ale0xb
Copy link
Contributor Author

ale0xb commented Jul 13, 2017

Hello again @shawnbot, just a quick heads up regarding this PR. Anything else missing?

@shawnbot shawnbot merged commit 4fff2c0 into shawnbot:master Jul 13, 2017
@shawnbot
Copy link
Owner

Beautiful, thank you @ale0xb! I'll publish a release to npm shortly with you listed as a contributor.

@shawnbot shawnbot mentioned this pull request Jul 13, 2017
@ale0xb
Copy link
Contributor Author

ale0xb commented Jul 14, 2017

Lovely @shawnbot, thank you very much!
Don't forget to list it in the D3 Plugins Wiki

@ale0xb ale0xb deleted the pluginize branch July 15, 2017 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants