shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.25k stars 1.23k forks source link

Rendering complex Mermaid.js flowchart diagrams causes text inside nodes to be cut #2542

Open PHAredes opened 9 months ago

PHAredes commented 9 months ago

I tried to use this diagram here:

graph LR

  subgraph lv0[lv0]
  direction LR
    RW[Rosary Warden]
    WoS[Weight of Sin]
  end

  lv0 -->|lv1| Re[Retribution]

  Re --->|lv2| RP[Relentless Power]
  RP -->|lv3| SS[Sacred Steel]

  lv0 -->|lv1| BP[Blood Pact]
  BP --->|lv2| De[Determination]
  BP --->|lv2| CoA[Covenant of Atonement]
  BP -->|lv1| G[Reaper Rosary]
  G -->|lv1| MS[Mystic Striker]
  G -->|lv2| BS[Blessed Steel]

  lv0 -->|lv1| CW[Crimson Warmonger]
  BS -->|lv3| RprP[Reaper Prayer]
  CW -->|lv2| CC[Crimson Cleaver]
  CC -->|lv2| K[Weight of Justice]
  CC --->|lv3| N[Crimson Glaive]
graph LR

  subgraph lv0[lv0]
  direction LR
    RW[Rosary Warden]
    WoS[Weight of Sin]
  end

  lv0 -->|lv1| Re[Retribution]

  Re --->|lv2| RP[Relentless Power]
  RP -->|lv3| SS[Sacred Steel]

  lv0 -->|lv1| BP[Blood Pact]
  BP --->|lv2| De[Determination]
  BP --->|lv2| CoA[Covenant of Atonement]
  BP -->|lv1| G[Reaper Rosary]
  G -->|lv1| MS[Mystic Striker]
  G -->|lv2| BS[Blessed Steel]

  lv0 -->|lv1| CW[Crimson Warmonger]
  BS -->|lv3| RprP[Reaper Prayer]
  CW -->|lv2| CC[Crimson Cleaver]
  CC -->|lv2| K[Weight of Justice]
  CC --->|lv3| N[Crimson Glaive]

Although it renders as intended on mermaid.live and Github I wasn't able to make nodes to acommodate its text on Nextra. I tried to change font size (both for each node and as a class), used frontmatter config, remake nodes positioning, etc.

Nextra Nextra

mermaid.live mermaid.live

PHAredes commented 9 months ago

Also, abbreviating is not a quick fix

Captura de tela 2023-11-17 030034

dimaMachina commented 9 months ago

can't reproduce, also it's an upstream issue

https://github.com/shuding/nextra/assets/7361780/b0212744-d524-47ed-af6d-9b4c354eab8b

PHAredes commented 9 months ago

Which was yours resolution? I got this at 1366x768

dimaMachina commented 9 months ago

my resolution is 3456 x 2234 I tried to set your resolution in developer tools, but got same result

image
PHAredes commented 9 months ago

Well, I'll assume it has to do with my local environment

dimaMachina commented 9 months ago

Otherwise please share a link to your web page

dimaMachina commented 8 months ago

closing due to lack of sharing link of deployed page

anuragxxd commented 1 month ago

Hey @dimaMachina, We are facing the exact same issue here. Please have a look.

Here is the code for the same https://github.com/elixir-cloud-aai/cloud-components/blob/xd/docs/apps/documentation/pages/docs/customization.mdx?plain=1#L23

& the deployment: https://elixir-cloud-components-gwvkhi2z9-elixir-cloud-aai.vercel.app/docs/customization

Screenshot 2024-07-20 at 5 00 23 PM