Skip to content

Exported Image Does Not Retain Editor Theme/Styling #6788

@PradeepDurairaj-int

Description

@PradeepDurairaj-int

Description

When creating a Git graph using the Mermaid Live Editor, the visual theme and styling displayed within the editor are not preserved in the exported image. The exported image appears with a different, seemingly default, theme, resulting in a discrepancy between the intended visualization and the output.
For example, in the Mermaid Live editor, I used "config: theme: redux." This displays the Redux theme (without colors) in the Editor Live Output View. But When Exported, it Exports as Default Theme ( with colors).

FYI: I've attached the Split Screenshot of the Difference of the Image on the Live Editor vs the same Image After Exported as PNG.

Image

Steps to reproduce

  1. Go to the Mermaid Live Editor (https://mermaid.live/).
  2. Input a Mermaid Git graph code with the theme Redux.
  3. Observe the graph rendered in the editor, noting its specific theme (e.g., monochrome, specific line styles, and node appearances as seen).
  4. Export the graph as an image (e.g., PNG).
  5. Open the exported image and see the Difference between the color and theme between Live Editor Image and Exported one.

Screenshots

Image Image

Code Sample

---
config:
  theme: redux
---
gitGraph
  commit id: "Initial Commit" type: HIGHLIGHT
  checkout main
  branch bugfix
  checkout bugfix
  commit id: "Commit on bugfix" tag: "OD: 4 Sep 2020" tag: "CD: 16 Oct 2020"
  checkout main
  branch develop1
  checkout develop1
  commit id: "Commit on develop1"
  checkout main
  branch develop2
  checkout develop2
  commit id: "Commit on develop2" tag: "OD: 25 Jul 2018" tag: "CD: 4 Sep 2020"
  commit id: "Frozen: develop2" tag: "freeze" type: REVERSE
  checkout main
  merge bugfix id: "Merge bugfix"
  checkout develop1
  merge main id:"merge from main"
  checkout main
  merge develop1 id: "Merge develop1"
commit id: "New Branches"   type: HIGHLIGHT
  checkout main
  branch develop3
  checkout develop3
  commit id: "Commit on develop3" type: NORMAL
  checkout main
  branch bugfix1
  checkout bugfix1
  commit id: "Commit on bugfix1" tag: "OD: 4 Sep 2020, CD: EH/QD/CTO App + 1 day" type: NORMAL
  checkout main
  branch bugfix2
  checkout bugfix2
  commit id: "Commit on bugfix2" type: NORMAL

Setup

Suggested Solutions

SVG Exporting is OK, But Again Converting it into JPG or PNG is Double Task for Me, So Please Check it Into it.
Also Make sure this works on the Mermaid CLI ( NPM : mermaid_Modules) too Please.
This would help me a lot in making gitgraph easier and Efficient.

Additional Context

Mermaid is Much Better and Easier. Thank You for Making this Possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions