Comments (4)
reference of my stratify comment: d3/d3-hierarchy#33
from d3-collection.
Furthur investigation indicates that that adding .sum() to my heirarchy also strips node properties. Why not a properties node? Consider how labels are created in the example linked above.
node.append("div")
.attr("class", "node-label")
.text(function(d) { return d.parent.parent.data.key + " to " + d.parent.data.key + "\n" + d.data.key; });
So in order to use something within a leaf, you'd either need to make sure its a key along the way, or do lookup from the OG data. Property portability might be more flexible.
from d3-collection.
Curious to know if this suggestion is reasonable.
from d3-collection.
Apologies for the delayed reply. This doesn’t seem to be an issue with d3.nest. nest.rollup doesn’t strip properties; if you specify a rollup function, you can do whatever you like with the passed-in array of values, and the returned value is what becomes the resulting entry.value.
Perhaps you meant to suggest a change to d3.hierarchy instead? That also doesn’t strip properties, but it does (intentionally) wrap the input data. You can access the original input as node.data.
from d3-collection.
Related Issues (19)
- Fix prototype.constructor.
- d3.map could take an optional value accessor function? HOT 1
- ES6 Collections. HOT 2
- d3.group convenience function? HOT 3
- Support natural sorting of keys. HOT 5
- sortValues after rollup HOT 2
- Feature request HOT 1
- value/values on rollup function HOT 2
- d3.nest reformats a Date object to a string HOT 1
- Nest: individual key sorting HOT 1
- es6 import syntax example? HOT 4
- Feature Request - same level nesting by multiple key HOT 1
- Custom key, values field names for the nest() HOT 5
- Why does d3.nest.map prepend a prefix? HOT 4
- nest.rollup should create {key, value} for leaf entries. HOT 9
- Add nest.count or nest.visit? HOT 1
- Mutable nests? HOT 1
- Support string as accessor? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-collection.