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

this context: Node or singleton selection? #28

Closed
mbostock opened this issue Nov 8, 2010 · 1 comment
Closed

this context: Node or singleton selection? #28

mbostock opened this issue Nov 8, 2010 · 1 comment

Comments

@mbostock
Copy link
Member

mbostock commented Nov 8, 2010

Should the this context of property functions be a Node or a singleton selection, as in d3.select(this)? The singleton selection is convenient in some cases, but it does not provide the complete functionality of the W3C DOM API, and extracting the element is a bit awkward: this[0][0].

Also, there are cases where callbacks are associated with individual nodes (such as "mouseover") and other cases where there are multiple nodes (such as the .call method, and non-staggered transition "end"). Maybe it's only in the latter where we use a selection as the this context.

Also, we could shorten the syntax to d3(this) rather than d3.select(this) to make it easier to convert. And this.node() might be clearer than this[0][0].

@mbostock
Copy link
Member Author

mbostock commented Feb 8, 2011

Keeping it as a node, for now, so as to minimize overhead and keep it simple.

equintanilla pushed a commit to equintanilla/d3 that referenced this issue Sep 3, 2014
This also includes a backwards-incompatible change to module naming when
used with Node.js: instead of require("d3-cloud").cloud, you should now
use require("d3-cloud") directly.

Fixes d3#28.
This issue was closed.
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

1 participant