Comments (1)
@Parya-Jafari - was doing some checking in the index file. You are indeed correct that an empty array ([]) is neither null nor undefined as per the ternary operator test in index.tsx file. You are right it might be useful to change the expression to also check for empty array. If in your JSON object etc. you remove the child object entirely class name will change to node__leaf
getNodeClassName = (parent: HierarchyPointNode<TreeNodeDatum>, nodeDatum: TreeNodeDatum) => { const { rootNodeClassName, branchNodeClassName, leafNodeClassName } = this.props; const hasParent = parent !== null && parent !== undefined; if (hasParent) { return nodeDatum.children ? branchNodeClassName : leafNodeClassName; } else { return rootNodeClassName; } };
from react-d3-tree.
Related Issues (20)
- Is it possible to add Scroll bars to view the chart?
- draggable prop issue HOT 3
- [question] Default tree is not centered and nodes are cut off HOT 1
- Is there a way to open previous node on route back to page having react-d3-tree.im routing user to next page from react d3tree.
- Is there a search option available to open d3tree and show ?
- Cannot find a declaration file for module HOT 3
- How to use non-copyable objects as data?
- Getting error: selection2.interrupt is not a function at zoom.transform
- How to center a node HOT 1
- Safari: foreignobject render issue HOT 2
- Zoom and Drag not working on NextJS HOT 2
- How to center a node on from external event
- Tree not centering when using renderCustomNodeElement prop
- This is having older version of "@bkrem/react-transition-group": "^1.3.3", in package.json.
- How to restrict the drag area?
- Intersection bug HOT 1
- Codesandbox examples not available HOT 2
- Can I change the key of children in data list from 'children' to be any key I want something like have props called valueKey or something like that , thanks
- Unable to install this package where I have react-native running on v0.74
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 react-d3-tree.