react-native-d3-tree-graph
react-native-d3-tree-graph copied to clipboard
TypeError: undefined is not an object (evaluating 'start[0].x')
Hi! I'm working on this example and getting this error below which is coming from siblingUtil.js TypeError: undefined is not an object (evaluating 'start[0].x') Please help me out.

@itsusmanmirza are you running example in this repo ?
No not in this repo I'm importing this in my own project, in Home Screen.tsx, and yes I'm using TypeScript as well.
are you already having react-native-svg version in your project before integrating this library ? @itsusmanmirza
Yes react-native-svg was already installed and I'm using this version.

@itsusmanmirza got it.. In you project you have to use the same version as this library is using..Please try and let me know if you face any issue
Alright I'll update you soon.
have tried, no luck, not working.
@itsusmanmirza can you please share the steps you followed .
@itsusmanmirza please share your package.json
Due to inactivity closing this for now.
There is problem in below code (which is given in readme). If we run below code it is shoving TypeError: undefined is not an object (evaluating 'start[0].x'). kindly run example it is working fine,
@codesinghanoop , kindly remove or update below code in readme file. Thank You @codesinghanoop nice work.
import AwesomeHierarchyGraph from 'react-native-d3-tree-graph'
var root = { name: "", id: 1, hidden: true, children: [ { name: "Q", id: 16, no_parent: true }] }
var siblings = [{ source: { id: 3, name: "C" }, target: { id: 11, name: "K" } }]
export default class example extends Component { render() { return ( <View style={styles.container}> <AwesomeHierarchyGraph root = {root} siblings = {siblings} /> </View> ); }
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, });
I have the same issue
@codesinghanoop facing this issue . Do you have any idea how to solve this?
@michaeljamieson10 & @bishalvaii , Run example , Please pick code from readme.md, i will update it later. Let me know if it doesn't works for you