UNPKG

@dfnivo/sankey

Version:

<a href="https://nivo.rocks"><img alt="nivo" src="https://raw.githubusercontent.com/plouc/nivo/master/nivo.png" width="216" height="68"/></a>

42 lines (41 loc) 1.87 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "SankeyNodes", { enumerable: true, get: function() { return SankeyNodes; } }); var _jsxRuntime = require("react/jsx-runtime"); var _sankeyNodesItem = require("./SankeyNodesItem"); var SankeyNodes = function(param) { var nodes = param.nodes, nodeOpacity = param.nodeOpacity, nodeHoverOpacity = param.nodeHoverOpacity, nodeHoverOthersOpacity = param.nodeHoverOthersOpacity, borderWidth = param.borderWidth, getBorderColor = param.getBorderColor, borderRadius = param.borderRadius, setCurrentNode = param.setCurrentNode, currentNode = param.currentNode, currentLink = param.currentLink, isCurrentNode = param.isCurrentNode, isInteractive = param.isInteractive, onClick = param.onClick, tooltip = param.tooltip; var getOpacity = function(node) { if (!currentNode && !currentLink) return nodeOpacity; if (isCurrentNode(node)) return nodeHoverOpacity; return nodeHoverOthersOpacity; }; return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { children: nodes.map(function(node) { return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_sankeyNodesItem.SankeyNodesItem, { node: node, x: node.x, y: node.y, width: node.width, height: node.height, color: node.color, opacity: getOpacity(node), borderWidth: borderWidth, borderColor: getBorderColor(node), borderRadius: borderRadius, setCurrent: setCurrentNode, isInteractive: isInteractive, onClick: onClick, tooltip: tooltip }, node.id); }) }); }; //# sourceMappingURL=SankeyNodes.js.map