From fb2bf9bd43300ca7336146f44f8c9bf005c284bd Mon Sep 17 00:00:00 2001 From: Thomas Plumpton Date: Sat, 7 Feb 2026 16:10:15 +0000 Subject: [PATCH 1/5] fix(graph): fixed canvas 2d graph alignment when showHeaders is false (#117) --- README.md | 3 +++ package-lock.json | 2 +- packages/library/README.md | 4 ++++ packages/library/package.json | 2 +- .../library/src/__snapshots__/GitLogPaged.spec.tsx.snap | 6 +++--- packages/library/src/modules/Graph/constants.ts | 7 +++++++ .../library/src/modules/Graph/core/GraphCore.module.scss | 1 - .../src/modules/Graph/strategies/Canvas/Canvas2DGraph.tsx | 6 +++++- .../src/modules/Graph/strategies/Grid/HTMLGridGraph.tsx | 4 +++- .../Grid/__snapshots__/HTMLGridGraph.spec.tsx.snap | 2 +- 10 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 packages/library/src/modules/Graph/constants.ts diff --git a/README.md b/README.md index 074b1825..4803e65a 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,9 @@ This strategy can be used by rendering the `` subcompone ### Canvas 2D +> [!WARNING] +> This Canvas2D variant of the graph is in-complete and may have rendering bugs. It's also not as feature-rich as the HTML variant due to canvas API limitations and unfinished work. + This implementation uses a standard HTML `canvas` element with a `2d` rendering context. This strategy can be used by rendering the `` subcomponent under the ``. diff --git a/package-lock.json b/package-lock.json index 44c131d5..4b7cd0f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11766,7 +11766,7 @@ }, "packages/library": { "name": "@tomplum/react-git-log", - "version": "3.5.0", + "version": "3.5.1", "license": "Apache-2.0", "dependencies": { "@uidotdev/usehooks": "^2.4.1", diff --git a/packages/library/README.md b/packages/library/README.md index e095b1c3..af95ad4a 100644 --- a/packages/library/README.md +++ b/packages/library/README.md @@ -337,6 +337,10 @@ The following properties are injected into the functions `props` argument: ### GraphCanvas2D +> [!WARNING] +> This Canvas2D variant of the graph is in-complete and may have rendering bugs. It's also not as feature-rich as the HTML variant due to canvas API limitations and unfinished work. + + | Property | Type | Description | |-------------------|---------------------------------------|----------------------------------------------------------------------------------------------------------------| | `nodeTheme` | [`NodeTheme`](#nodetheme) | Theme applied to commit node elements in the graph. | diff --git a/packages/library/package.json b/packages/library/package.json index d6b65ef2..93bbe5a5 100644 --- a/packages/library/package.json +++ b/packages/library/package.json @@ -3,7 +3,7 @@ "author": "Thomas Plumpton", "repository": "https://github.com/TomPlum/react-git-log", "description": "A flexible, themable, React component for visualising Git commit history, branch and tag metadata.", - "version": "3.5.0", + "version": "3.5.1", "license": "Apache-2.0", "type": "module", "main": "dist/react-git-log.js", diff --git a/packages/library/src/__snapshots__/GitLogPaged.spec.tsx.snap b/packages/library/src/__snapshots__/GitLogPaged.spec.tsx.snap index dda1710b..600267b5 100644 --- a/packages/library/src/__snapshots__/GitLogPaged.spec.tsx.snap +++ b/packages/library/src/__snapshots__/GitLogPaged.spec.tsx.snap @@ -1763,7 +1763,7 @@ exports[`GitLogPaged > should render correctly and match the snapshot the pagina >