-
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
Support for the d3 margin convention #81
Comments
I've implemented something similar, see here: https://gist.github.com/samselikoff/27152ff2d1d7c4af7ab8. I did find I needed the outer width/height on occasion, so I added those methods. Glancing over the file you posted I didn't see those, but I don't have time right now to dig in detail. I definitely think this would be useful to have in the base class. By core, do you mean it will be included in d3.chart? Are there plans for this? Great work! |
Ultimately this seems to be mostly relevant to d3.chart.base (see also Sam’s earlier iros/d3.chart.base#6), but probably the discussion has more visibility here. Regarding @peteb4ker's questions:
Yes, we do. We subclass
Certainly.
I think the method of appending an inner G container is fine, though I wouldn't retire the base element quite as much ( |
Finally got around to publishing our d3.chart margin component to github, available here: It takes leads from @samselikoff's and @knuton's examples above, inheriting from d3.chart.base. I've also posted 6 other d3.chart components, all documented (to various levels) at http://peteb4ker.github.io/d3.chart/doc/. Feedback / PRs are welcome. |
Hi all,
I've implemented a changeset for d3.chart.base library to support the d3 margin convention, changeset available here:
This changeset adds an additional method to d3.chart.base,
applyMarginConventions()
which creates a margined inner base container inside the existing base, then uses this inner container for width and height references.I've been able to use this for an internal project with a good level of success. I chatted with @iros briefly about this in January who pointed me to this list (Thanks!). With all this in mind, some questions:
Cheers,
Pete
The text was updated successfully, but these errors were encountered: