Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private renderCommit(commit: Commit) {
const { x, y } = this.getWithCommitOffset(commit);
const shouldRenderTooltip =
this.state.currentCommitOver === commit &&
(this.gitgraph.isHorizontal ||
(this.gitgraph.mode === Mode.Compact &&
commit.style.hasTooltipInCompactMode));
if (shouldRenderTooltip) {
this.$tooltip = (
);
}
return (
function appendTooltipToGraph(commit: Commit): void {
if (!svg.firstChild) return;
if (gitgraph.isVertical && gitgraph.mode !== Mode.Compact) return;
if (gitgraph.isVertical && !commit.style.hasTooltipInCompactMode) return;
const tooltip = commit.renderTooltip
? commit.renderTooltip(commit)
: createTooltip(commit);
$tooltip = createG({
translate: getWithCommitOffset(commit),
children: [tooltip],
});
svg.firstChild.appendChild($tooltip);
}