Releases: nicoespeon/gitgraph.js
Dashed-style commits
See #139.
Now you can define a line dash to your commits and branches:
var gitGraph = new GitGraph();
var master = gitGraph.branch({
name: "master",
color: "#F00",
lineDash: [5]
});
master.commit({
lineDash: [3, 2],
dotStrokeWidth: 5,
message: "This commit stroke is dashed"
});
The lineDash
option expects a list of segments
to pass to CanvasRenderingContext2D.setLineDash(). These segments are numbers that specifies distances to alternately draw a line and a gap.
Finally, you can specify a lineDash
value to the branch
and commit
options of your custom template.
Fix commit details position
Add TypeScript Definitions
GitGraph's TypeScript definitions are produced in a gitgraph.d.ts
file, along the build.
See #150.
Configurable tooltips container
You can specify a custom HTML element to contain tooltips displayed in compact mode:
var gitGraph = new GitGraph({
template: "metro",
tooltipContainer: document.querySelector("#tooltips"),
mode: "compact"
});
If you don't provide a tooltipContainer
, it will default to document.body
.
See #147.
Fix horizontal tags alignment
Display details in vertical-reverse mode
Fix few quirks in complex graphs drawing
Little fixes to around edge cases for graph drawing (see #120).
Tag command & Horizontal labels rotation
#134 -> Thanks to @cgddrd, labels properly rotate in horizontal mode. You can provide a labelRotation
configuration to your template too:
var graphConfig = new GitGraph.Template({
branch: {
color: "#000000",
mergeStyle: "straight",
labelRotation: 0 // -> can be configured
},
});
var gitGraph = new GitGraph({
template: graphConfig,
mode: "extended",
orientation: "horizontal"
});
#75 -> Now you can tag current HEAD with .tag( "my-tag" )
. You can still pass tag options to the method:
var gitGraph = new GitGraph({ template: "metro" });
gitGraph
.commit("Tag this commit")
.tag("my-tag");
// alternatively
gitGraph
.commit("Tag this commit")
.tag({
tag: "my-tag",
tagColor: "green",
tagFont: "normal 14pt Arial",
displayTagBox: false
});
#121 -> Fix rendering when parent branch has no commit.
Fix orphaned arrow head scenarios
Template blackarrow
used to generate orphaned arrow head in some scenario (see #117).
Those are fixed now.
Allow to configure commit default options at branch level
Now you can do things like:
var dev = master.branch({
name: "dev",
color: "cyan",
commitDefaultOptions: { color: "cyan" }
});
This will make your commits be cyan by default on dev
branch.
It works for others commit options too.