mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
fixed gitgraphconfig problem
This commit is contained in:
parent
299e559aa5
commit
53798beb96
@ -10,10 +10,9 @@ import type {
|
|||||||
GitGraphDBRenderProvider,
|
GitGraphDBRenderProvider,
|
||||||
DiagramOrientation,
|
DiagramOrientation,
|
||||||
} from './gitGraphTypes.js';
|
} from './gitGraphTypes.js';
|
||||||
import type { GitGraphDiagramConfig } from '../../config.type.js';
|
|
||||||
|
|
||||||
const DEFAULT_CONFIG = getConfig();
|
const DEFAULT_CONFIG = getConfig();
|
||||||
const DEFAULT_GITGRAPH_CONFIG: Required<GitGraphDiagramConfig> = DEFAULT_CONFIG.gitGraph;
|
const DEFAULT_GITGRAPH_CONFIG = DEFAULT_CONFIG?.gitGraph;
|
||||||
|
|
||||||
let allCommitsDict = new Map();
|
let allCommitsDict = new Map();
|
||||||
|
|
||||||
@ -1324,7 +1323,7 @@ if (import.meta.vitest) {
|
|||||||
branchPos.set('main', { pos: 0, index: 0 });
|
branchPos.set('main', { pos: 0, index: 0 });
|
||||||
branchPos.set('develop', { pos: 107.49609375, index: 1 });
|
branchPos.set('develop', { pos: 107.49609375, index: 1 });
|
||||||
branchPos.set('feature', { pos: 225.70703125, index: 2 });
|
branchPos.set('feature', { pos: 225.70703125, index: 2 });
|
||||||
DEFAULT_GITGRAPH_CONFIG.parallelCommits = true;
|
DEFAULT_GITGRAPH_CONFIG!.parallelCommits = true;
|
||||||
commits.forEach((commit, key) => {
|
commits.forEach((commit, key) => {
|
||||||
if (commit.parents.length > 0) {
|
if (commit.parents.length > 0) {
|
||||||
curPos = calculateCommitPosition(commit);
|
curPos = calculateCommitPosition(commit);
|
||||||
@ -1352,7 +1351,7 @@ if (import.meta.vitest) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
DEFAULT_GITGRAPH_CONFIG.parallelCommits = false;
|
DEFAULT_GITGRAPH_CONFIG!.parallelCommits = false;
|
||||||
it('add', () => {
|
it('add', () => {
|
||||||
commitPos.set('parent1', { x: 1, y: 1 });
|
commitPos.set('parent1', { x: 1, y: 1 });
|
||||||
commitPos.set('parent2', { x: 2, y: 2 });
|
commitPos.set('parent2', { x: 2, y: 2 });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user