Comments (4)
Here’s flare.csv. The nice thing about this approach is that it’s trivial to use with a tabular datastore (such as a SQL database), and the serialized form is typically smaller than JSON: 5,532 bytes for CSV, 8,638 bytes for minimal JSON, and 11,634 for readable JSON.
from d3-hierarchy.
There’s some empirical evidence that suggests it would be helpful to support this form of input data.
It might be possible to support both forms. Perhaps if you set a parent accessor, it expects tabular input, and if you set a children accessor, it expects hierarchical input?
This issue also feels related to d3/d3#1145 d3/d3#1929 in that it may be easier to create wrapper objects for data—as opposed to setting properties on the input data—if we accept tabular input data.
Also tabular input feels nice because the layout’s output is always tabular, so as to work well with D3’s selections.
Also note that the force layout also takes tabular input, in the form of two tables: nodes and links.
from d3-hierarchy.
Related thought:
The force layout takes links as input with source and target properties that default to numeric indexes into the nodes array. It would be nice for those properties to be customized via accessor along with a key accessor to define a unique name for each node. (Possibly, the properties names should be named linkSource, linkTarget and nodeKey if we want to be explicit.) The source and target accessors could return either a key (a string if a key accessor is specified, or a numeric index if not) or a reference to the node. Then you wouldn’t have to manually wire up the graph, as in bl.ocks.org/533daf20348023dfdd76.
Similarly, hierarchy layouts could default so that the parent property is a numeric index into the nodes array. If you specify a key accessor, then the parent property could instead be a string whose value is the corresponding node’s key. You could also specify a parent accessor, which can return either a key or a reference to the parent node.
from d3-hierarchy.
Fixed in #14.
from d3-hierarchy.
Related Issues (20)
- Treemap leaf nodes with rect height = 0 HOT 1
- How can I handle the ts error "Type 'number | undefined' is not assignable to type 'number'." ? HOT 1
- IE11 issue - Const must be initialized in each.js HOT 1
- the json result convert to d3-hierarchy can not generate the correct format without children HOT 1
- tree layout: Support transparent intermediary nodes to keep the tree tidy HOT 3
- Undesirable padding behaviour with disparately sized children HOT 3
- node.sum/count for non-numeric data
- New nodesAtDepth(depth) function HOT 3
- d3 partition: ability to choose different "value" size variable
- document d3.Node
- Seemingly non-weird ball collection throws an error in d3.packEnclose() HOT 1
- Suggestion: pack() layouts with deterministic outputs HOT 5
- Inner and outer padding for partition layout
- How can you add new attributes to d3.heirarchy() object? HOT 1
- why non-negative for node.sum
- Using @ant-design/plots and this error is popping up
- d3.stratify().path() doesn't bind data HOT 1
- Stratify nodes that are both a leaf (with value) and a parent
- d3__WEBPACK_IMPORTED_MODULE_0__.hierarchy is not a function HOT 3
- d3__WEBPACK_IMPORTED_MODULE_0__.hierarchy is not a function HOT 4
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-hierarchy.