mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-30 17:44:08 +01:00
Updating Gitgraph docs
This commit is contained in:
@@ -2,11 +2,15 @@ import { log } from '../../logger';
|
||||
import { random } from '../../utils';
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import * as configApi from '../../config';
|
||||
import { getConfig } from '../../config';
|
||||
import common from '../common/common';
|
||||
|
||||
let mainBranchName = getConfig().gitGraph.mainBranchName;
|
||||
let commits = {};
|
||||
let head = null;
|
||||
let branches = { main: head };
|
||||
let curBranch = 'main';
|
||||
let branches = {};
|
||||
branches[mainBranchName] = head;
|
||||
let curBranch = mainBranchName;
|
||||
let direction = 'LR';
|
||||
let seq = 0;
|
||||
|
||||
@@ -316,8 +320,10 @@ export const prettyPrint = function () {
|
||||
export const clear = function () {
|
||||
commits = {};
|
||||
head = null;
|
||||
branches = { main: head };
|
||||
curBranch = 'main';
|
||||
let mainBranch = getConfig().gitGraph.mainBranchName;
|
||||
branches = {};
|
||||
branches[mainBranch] = null;
|
||||
curBranch = mainBranch;
|
||||
seq = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -206,14 +206,14 @@ class Theme {
|
||||
this.git6 = darken(this.git6, 25);
|
||||
this.git7 = darken(this.git7, 25);
|
||||
}
|
||||
this.gitInv0 = invert(this.git0);
|
||||
this.gitInv1 = invert(this.git1);
|
||||
this.gitInv2 = invert(this.git2);
|
||||
this.gitInv3 = invert(this.git3);
|
||||
this.gitInv4 = invert(this.git4);
|
||||
this.gitInv5 = invert(this.git5);
|
||||
this.gitInv6 = invert(this.git6);
|
||||
this.gitInv7 = invert(this.git7);
|
||||
this.gitInv0 = this.gitInv0 || invert(this.git0);
|
||||
this.gitInv1 = this.gitInv1 || invert(this.git1);
|
||||
this.gitInv2 = this.gitInv2 || invert(this.git2);
|
||||
this.gitInv3 = this.gitInv3 || invert(this.git3);
|
||||
this.gitInv4 = this.gitInv4 || invert(this.git4);
|
||||
this.gitInv5 = this.gitInv5 || invert(this.git5);
|
||||
this.gitInv6 = this.gitInv6 || invert(this.git6);
|
||||
this.gitInv7 = this.gitInv7 || invert(this.git7);
|
||||
this.branchLabelColor =
|
||||
this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);
|
||||
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
||||
|
||||
@@ -197,14 +197,14 @@ class Theme {
|
||||
this.git5 = lighten(this.pie6 || adjust(this.primaryColor, { h: -90 }), 10);
|
||||
this.git6 = lighten(this.pie7 || adjust(this.primaryColor, { h: +60 }), 10);
|
||||
this.git7 = lighten(this.pie8 || adjust(this.primaryColor, { h: +120 }), 20);
|
||||
this.gitInv0 = invert(this.git0);
|
||||
this.gitInv1 = invert(this.git1);
|
||||
this.gitInv2 = invert(this.git2);
|
||||
this.gitInv3 = invert(this.git3);
|
||||
this.gitInv4 = invert(this.git4);
|
||||
this.gitInv5 = invert(this.git5);
|
||||
this.gitInv6 = invert(this.git6);
|
||||
this.gitInv7 = invert(this.git7);
|
||||
this.gitInv0 = this.gitInv0 || invert(this.git0);
|
||||
this.gitInv1 = this.gitInv1 || invert(this.git1);
|
||||
this.gitInv2 = this.gitInv2 || invert(this.git2);
|
||||
this.gitInv3 = this.gitInv3 || invert(this.git3);
|
||||
this.gitInv4 = this.gitInv4 || invert(this.git4);
|
||||
this.gitInv5 = this.gitInv5 || invert(this.git5);
|
||||
this.gitInv6 = this.gitInv6 || invert(this.git6);
|
||||
this.gitInv7 = this.gitInv7 || invert(this.git7);
|
||||
|
||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||
|
||||
@@ -228,22 +228,22 @@ class Theme {
|
||||
this.git6 = darken(this.git6, 25);
|
||||
this.git7 = darken(this.git7, 25);
|
||||
}
|
||||
this.gitInv0 = darken(invert(this.git0), 25);
|
||||
this.gitInv1 = invert(this.git1);
|
||||
this.gitInv2 = invert(this.git2);
|
||||
this.gitInv3 = invert(this.git3);
|
||||
this.gitInv4 = invert(this.git4);
|
||||
this.gitInv5 = invert(this.git5);
|
||||
this.gitInv6 = invert(this.git6);
|
||||
this.gitInv7 = invert(this.git7);
|
||||
this.gitBranchLabel0 = invert(this.labelTextColor);
|
||||
this.gitBranchLabel1 = this.labelTextColor;
|
||||
this.gitBranchLabel2 = this.labelTextColor;
|
||||
this.gitBranchLabel3 = invert(this.labelTextColor);
|
||||
this.gitBranchLabel4 = this.labelTextColor;
|
||||
this.gitBranchLabel5 = this.labelTextColor;
|
||||
this.gitBranchLabel6 = this.labelTextColor;
|
||||
this.gitBranchLabel7 = this.labelTextColor;
|
||||
this.gitInv0 = this.gitInv0 || darken(invert(this.git0), 25);
|
||||
this.gitInv1 = this.gitInv1 || invert(this.git1);
|
||||
this.gitInv2 = this.gitInv2 || invert(this.git2);
|
||||
this.gitInv3 = this.gitInv3 || invert(this.git3);
|
||||
this.gitInv4 = this.gitInv4 || invert(this.git4);
|
||||
this.gitInv5 = this.gitInv5 || invert(this.git5);
|
||||
this.gitInv6 = this.gitInv6 || invert(this.git6);
|
||||
this.gitInv7 = this.gitInv7 || invert(this.git7);
|
||||
this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);
|
||||
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
||||
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
||||
this.gitBranchLabel3 = this.gitBranchLabel3 || invert(this.labelTextColor);
|
||||
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
||||
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
||||
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
||||
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
||||
|
||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||
|
||||
@@ -198,14 +198,14 @@ class Theme {
|
||||
this.git6 = darken(this.git6, 25);
|
||||
this.git7 = darken(this.git7, 25);
|
||||
}
|
||||
this.gitInv0 = invert(this.git0);
|
||||
this.gitInv1 = invert(this.git1);
|
||||
this.gitInv2 = invert(this.git2);
|
||||
this.gitInv3 = invert(this.git3);
|
||||
this.gitInv4 = invert(this.git4);
|
||||
this.gitInv5 = invert(this.git5);
|
||||
this.gitInv6 = invert(this.git6);
|
||||
this.gitInv7 = invert(this.git7);
|
||||
this.gitInv0 = this.gitInv0 || invert(this.git0);
|
||||
this.gitInv1 = this.gitInv1 || invert(this.git1);
|
||||
this.gitInv2 = this.gitInv2 || invert(this.git2);
|
||||
this.gitInv3 = this.gitInv3 || invert(this.git3);
|
||||
this.gitInv4 = this.gitInv4 || invert(this.git4);
|
||||
this.gitInv5 = this.gitInv5 || invert(this.git5);
|
||||
this.gitInv6 = this.gitInv6 || invert(this.git6);
|
||||
this.gitInv7 = this.gitInv7 || invert(this.git7);
|
||||
|
||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||
|
||||
@@ -230,14 +230,14 @@ class Theme {
|
||||
this.git6 = this.pie7 || adjust(this.primaryColor, { h: +60 });
|
||||
this.git7 = this.pie8 || adjust(this.primaryColor, { h: +120 });
|
||||
|
||||
this.gitInv0 = invert(this.git0);
|
||||
this.gitInv1 = invert(this.git1);
|
||||
this.gitInv2 = invert(this.git2);
|
||||
this.gitInv3 = invert(this.git3);
|
||||
this.gitInv4 = invert(this.git4);
|
||||
this.gitInv5 = invert(this.git5);
|
||||
this.gitInv6 = invert(this.git6);
|
||||
this.gitInv7 = invert(this.git7);
|
||||
this.gitInv0 = this.gitInv0 || invert(this.git0);
|
||||
this.gitInv1 = this.gitInv1 || invert(this.git1);
|
||||
this.gitInv2 = this.gitInv2 || invert(this.git2);
|
||||
this.gitInv3 = this.gitInv3 || invert(this.git3);
|
||||
this.gitInv4 = this.gitInv4 || invert(this.git4);
|
||||
this.gitInv5 = this.gitInv5 || invert(this.git5);
|
||||
this.gitInv6 = this.gitInv6 || invert(this.git6);
|
||||
this.gitInv7 = this.gitInv7 || invert(this.git7);
|
||||
|
||||
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
||||
this.gitBranchLabel0 = this.branchLabelColor;
|
||||
|
||||
Reference in New Issue
Block a user