Skip to content

Instantly share code, notes, and snippets.

@iainkirkpatrick
Created August 14, 2015 00:35
Show Gist options
  • Select an option

  • Save iainkirkpatrick/3da905d03ea2b2af794e to your computer and use it in GitHub Desktop.

Select an option

Save iainkirkpatrick/3da905d03ea2b2af794e to your computer and use it in GitHub Desktop.
d3.selectAll('.graph').each(function (d, i) {
var graphEl = this,
graphNo = i;
var attrs = d3.values(this.attributes).slice(0, this.attributes.length);
//not all attrs are those given by user, some are methods, but length does not include them
var graphAttrs = attrs.map(function(e) {
// console.log(e.nodeName);
return d3.map(e.nodeName, e.nodeaValue)
});
console.log(graphAttrs);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment