How to use the @gitgraph/core.Mode.Compact function in @gitgraph/core

To help you get started, we’ve selected a few @gitgraph/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nicoespeon / gitgraph.js / packages / gitgraph-react / src / Gitgraph.tsx View on Github external
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 (
github nicoespeon / gitgraph.js / packages / gitgraph-js / src / gitgraph.ts View on Github external
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);
  }

@gitgraph/core

Core of gitgraph, a JavaScript library to draw pretty git graphs

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis