react-graph-tree
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -182,3 +182,3 @@ import React, { Component } from 'react'; | ||
value: function componentDidMount() { | ||
document.getElementById('svgHolder').innerHTML = ''; | ||
document.getElementById(this.props.id).innerHTML = ''; | ||
@@ -212,3 +212,3 @@ // ************** BASE VARIABLES ************** | ||
var tree = d3.layout.tree().size([height, width]); | ||
var item = document.getElementById('svgHolder'); | ||
var item = document.getElementById(this.props.id); | ||
var svg = d3.select(item).insert('svg').attr('width', width + margin.right + margin.left).attr('height', height + margin.top + margin.bottom).insert('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); | ||
@@ -444,3 +444,3 @@ | ||
var style = direction === 'rtl' ? { transform: 'rotate(180deg)' } : {}; | ||
return React.createElement('div', { id: 'svgHolder', style: style }); | ||
return React.createElement('div', { id: this.props.id, style: style }); | ||
} | ||
@@ -453,6 +453,8 @@ }]); | ||
data: PropTypes.object.isRequired, | ||
direction: PropTypes.string | ||
direction: PropTypes.string, | ||
id: PropTypes.string.isRequired | ||
}; | ||
Tree.defaultProps = { | ||
direction: 'ltr' | ||
direction: 'ltr', | ||
id: 'svgHolder' | ||
}; | ||
@@ -459,0 +461,0 @@ |
@@ -187,3 +187,3 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
document.getElementById('svgHolder').innerHTML = ''; | ||
document.getElementById(this.props.id).innerHTML = ''; | ||
@@ -217,3 +217,3 @@ // ************** BASE VARIABLES ************** | ||
var tree = d3.layout.tree().size([height, width]); | ||
var item = document.getElementById('svgHolder'); | ||
var item = document.getElementById(this.props.id); | ||
var svg = d3.select(item).insert('svg').attr('width', width + margin.right + margin.left).attr('height', height + margin.top + margin.bottom).insert('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); | ||
@@ -449,3 +449,3 @@ | ||
var style = direction === 'rtl' ? { transform: 'rotate(180deg)' } : {}; | ||
return React__default.createElement('div', { id: 'svgHolder', style: style }); | ||
return React__default.createElement('div', { id: this.props.id, style: style }); | ||
} | ||
@@ -458,6 +458,8 @@ }]); | ||
data: PropTypes.object.isRequired, | ||
direction: PropTypes.string | ||
direction: PropTypes.string, | ||
id: PropTypes.string.isRequired | ||
}; | ||
Tree.defaultProps = { | ||
direction: 'ltr' | ||
direction: 'ltr', | ||
id: 'svgHolder' | ||
}; | ||
@@ -464,0 +466,0 @@ |
{ | ||
"name": "react-graph-tree", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "yershalom", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100649
797