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

Support external rendering #51

Closed
korigod opened this issue Aug 21, 2018 · 3 comments
Closed

Support external rendering #51

korigod opened this issue Aug 21, 2018 · 3 comments

Comments

@korigod
Copy link

korigod commented Aug 21, 2018

Hi,

It's quite common now to use a JS framework such as React or Vue to render the elements instead of D3.js DOM manipulation. While it's possible with most of the packages, d3-axis doesn't support this kind of operation which is useful not only for consistency and reactivity but also for rendering of labels outside of svg to keep font rendering and size consistent with the remaining page elements even when chart is being scaled.

Is it possible to make d3-axis more friendly for select-less operation? E.g. provide methods to get ticks coordinates, line path etc. I would file a PR if I was sure how to do it right but I'm not, so could you either implement it or guide me on how this can be done?

@mbostock
Copy link
Member

With apologies, but I don’t see this as being possible (or… feasible). Your best bet is probably forking this library and re-implementing it with your framework of choice.

@korigod
Copy link
Author

korigod commented Aug 21, 2018

Thanks!

@mbostock
Copy link
Member

Also, there’s already scale.ticks, d3.ticks, d3.format etc. for doing all this stuff outside of d3-axis. The remaining logic in this module is essentially mapping that to SVG (and handling transitions).

mbostock added a commit that referenced this issue Jun 9, 2021
* Adopt type=module

follow changes in d3-format:
* type=module
* add exports
* remove zip
* license: ISC
* update dependencies

* browser instead of no-undef

* remove Sublime project

* add eslint.json

* fix #51; extract copyrights from license

* update dependencies

* update README

* update homepage

* push on prepublishOnly

* cleaner imports

* snapshot tests

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants