@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>
45 lines (44 loc) • 1.36 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { BasicTooltip, Chip } from "@dfnivo/tooltip";
var tooltipStyles = {
container: {
display: "flex",
alignItems: "center"
},
sourceChip: {
marginRight: 7
},
targetChip: {
marginLeft: 7,
marginRight: 7
}
};
export var SankeyLinkTooltip = function(param) {
var link = param.link;
return /*#__PURE__*/ _jsx(BasicTooltip, {
id: /*#__PURE__*/ _jsxs("span", {
style: tooltipStyles.container,
children: [
/*#__PURE__*/ _jsx(Chip, {
color: link.source.color || "",
style: tooltipStyles.sourceChip
}),
/*#__PURE__*/ _jsx("strong", {
children: link.source.label
}),
" > ",
/*#__PURE__*/ _jsx("strong", {
children: link.target.label
}),
/*#__PURE__*/ _jsx(Chip, {
color: link.target.color || "",
style: tooltipStyles.targetChip
}),
/*#__PURE__*/ _jsx("strong", {
children: link.formattedValue
})
]
})
});
};
//# sourceMappingURL=SankeyLinkTooltip.js.map