Skip to content

Preview maxZoom setting only respected after chart update #47

@wpickett-trimble

Description

@wpickett-trimble

The mermaid.vscode.maxZoom configuration setting is only respected after an update has been made to a chart being previewed. Regardless of the user configuration for this setting, the initial preview of a Mermaid chart is limited to 500% zoom (i.e. maxZoom = 5).

Expected behavior

When opening a Mermaid Chart preview, the user's maxZoom configuration setting is respected.

Actual behavior

The chart is limited to a maximum 500% zoom level until an update to the underlying chart code is made.

Reproduction steps

  • Set the mermaid.vscode.maxZoom setting to 10 in the user's settings.json for VS Code

  • Create a test.mmd file in the workspace, with the following content:

    flowchart LR
    
    foo --> bar
    
  • Open the Mermaid preview by right-clicking within a test.mmd editor and selecting MermaidChart: Preview Diagram, or selecting MermaidChart: Preview Diagram from the VS Code command palette.

  • In the newly-opened preview panel that opens, zoom in as far as possible. Note that it is limited to 500% zoom.

  • While the preview panel is still open, update test.mmd with the following content:

    flowchart LR
    
    foo --> bar
    bar --> baz
    
  • In the preview panel, attempt to zoom in further. Note that you can now zoom to 1000% (corresponding to maxZoom = 10).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions