How to use the @gitgraph/core.arrowSvgPath 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
return commit.parents.map((parentHash) => {
      const parent = this.state.commits.find(({ hash }) => hash === parentHash);
      if (!parent) return null;

      // Starting point, relative to commit
      const origin = this.gitgraph.reverseArrow
        ? {
            x: commitRadius + (parent.x - commit.x),
            y: commitRadius + (parent.y - commit.y),
          }
        : { x: commitRadius, y: commitRadius };

      return (
        
      );
    });
  }
github nicoespeon / gitgraph.js / packages / gitgraph-js / src / gitgraph.ts View on Github external
return commit.parents.map((parentHash) => {
        const parent = commits.find(({ hash }) => hash === parentHash);
        if (!parent) return null;

        // Starting point, relative to commit
        const origin = gitgraph.reverseArrow
          ? {
              x: commitRadius + (parent.x - commit.x),
              y: commitRadius + (parent.y - commit.y),
            }
          : { x: commitRadius, y: commitRadius };

        const path = createPath({
          d: arrowSvgPath(gitgraph, parent, commit),
          fill: gitgraph.template.arrow.color || "",
        });

        return createG({ translate: origin, children: [path] });
      });
    }

@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