react-evs-d3-tree
Advanced tools
Comparing version 3.6.4 to 3.6.5
@@ -476,3 +476,3 @@ "use strict"; | ||
var _a = this.generateTree(), nodes = _a.nodes, links = _a.links; | ||
var _b = this.props, renderCustomNodeElement = _b.renderCustomNodeElement, orientation = _b.orientation, pathFunc = _b.pathFunc, transitionDuration = _b.transitionDuration, nodeSize = _b.nodeSize, depthFactor = _b.depthFactor, initialDepth = _b.initialDepth, separation = _b.separation, enableLegacyTransitions = _b.enableLegacyTransitions, svgClassName = _b.svgClassName, pathClassFunc = _b.pathClassFunc; | ||
var _b = this.props, renderCustomNodeElement = _b.renderCustomNodeElement, orientation = _b.orientation, pathFunc = _b.pathFunc, transitionDuration = _b.transitionDuration, nodeSize = _b.nodeSize, depthFactor = _b.depthFactor, initialDepth = _b.initialDepth, separation = _b.separation, enableLegacyTransitions = _b.enableLegacyTransitions, svgClassName = _b.svgClassName, pathClassFunc = _b.pathClassFunc, pathShadowClassFunc = _b.pathShadowClassFunc, doubleLink = _b.doubleLink; | ||
var _c = this.state.d3, translate = _c.translate, scale = _c.scale; | ||
@@ -485,2 +485,7 @@ var subscriptions = __assign(__assign(__assign({}, nodeSize), separation), { depthFactor: depthFactor, initialDepth: initialDepth }); | ||
links.map(function (linkData, i) { | ||
if (doubleLink) { | ||
return (react_1.default.createElement(react_1.default.Fragment, null, | ||
react_1.default.createElement(index_js_2.default, { key: 'link-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathClassFunc, linkData: linkData, onClick: _this.handleOnLinkClickCb, onMouseOver: _this.handleOnLinkMouseOverCb, onMouseOut: _this.handleOnLinkMouseOutCb, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration }), | ||
react_1.default.createElement(index_js_2.default, { key: 'link-shadow-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathShadowClassFunc, linkData: linkData, onClick: function () { }, onMouseOver: function () { }, onMouseOut: function () { }, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration }))); | ||
} | ||
return (react_1.default.createElement(index_js_2.default, { key: 'link-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathClassFunc, linkData: linkData, onClick: _this.handleOnLinkClickCb, onMouseOver: _this.handleOnLinkMouseOverCb, onMouseOut: _this.handleOnLinkMouseOutCb, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration })); | ||
@@ -505,2 +510,3 @@ }), | ||
pathClassFunc: undefined, | ||
pathShadowClassFunc: undefined, | ||
transitionDuration: 500, | ||
@@ -527,2 +533,3 @@ depthFactor: undefined, | ||
dataKey: undefined, | ||
doubleLink: false, | ||
}; | ||
@@ -529,0 +536,0 @@ return Tree; |
@@ -433,3 +433,3 @@ import React from 'react'; | ||
const { nodes, links } = this.generateTree(); | ||
const { renderCustomNodeElement, orientation, pathFunc, transitionDuration, nodeSize, depthFactor, initialDepth, separation, enableLegacyTransitions, svgClassName, pathClassFunc, } = this.props; | ||
const { renderCustomNodeElement, orientation, pathFunc, transitionDuration, nodeSize, depthFactor, initialDepth, separation, enableLegacyTransitions, svgClassName, pathClassFunc, pathShadowClassFunc, doubleLink, } = this.props; | ||
const { translate, scale } = this.state.d3; | ||
@@ -443,2 +443,7 @@ const subscriptions = Object.assign(Object.assign(Object.assign({}, nodeSize), separation), { depthFactor, | ||
links.map((linkData, i) => { | ||
if (doubleLink) { | ||
return (React.createElement(React.Fragment, null, | ||
React.createElement(Link, { key: 'link-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathClassFunc, linkData: linkData, onClick: this.handleOnLinkClickCb, onMouseOver: this.handleOnLinkMouseOverCb, onMouseOut: this.handleOnLinkMouseOutCb, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration }), | ||
React.createElement(Link, { key: 'link-shadow-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathShadowClassFunc, linkData: linkData, onClick: () => { }, onMouseOver: () => { }, onMouseOut: () => { }, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration }))); | ||
} | ||
return (React.createElement(Link, { key: 'link-' + i, orientation: orientation, pathFunc: pathFunc, pathClassFunc: pathClassFunc, linkData: linkData, onClick: this.handleOnLinkClickCb, onMouseOver: this.handleOnLinkMouseOverCb, onMouseOut: this.handleOnLinkMouseOutCb, enableLegacyTransitions: enableLegacyTransitions, transitionDuration: transitionDuration })); | ||
@@ -464,2 +469,3 @@ }), | ||
pathClassFunc: undefined, | ||
pathShadowClassFunc: undefined, | ||
transitionDuration: 500, | ||
@@ -486,3 +492,4 @@ depthFactor: undefined, | ||
dataKey: undefined, | ||
doubleLink: false, | ||
}; | ||
export default Tree; |
@@ -137,2 +137,3 @@ import { HierarchyPointNode } from 'd3-hierarchy'; | ||
pathClassFunc?: PathClassFunction; | ||
pathShadowClassFunc?: PathClassFunction; | ||
/** | ||
@@ -276,2 +277,3 @@ * Determines the spacing between parent & child nodes. | ||
dataKey?: string; | ||
doubleLink?: boolean; | ||
} |
{ | ||
"name": "react-evs-d3-tree", | ||
"version": "3.6.4", | ||
"version": "3.6.5", | ||
"description": "React component to create interactive D3 tree hierarchies", | ||
@@ -5,0 +5,0 @@ "author": "Ben Kremer", |
123549
2350