hikerpig / pintora

An extensible text-to-diagrams library that works in both browser and node.js
https://pintorajs.vercel.app
MIT License
1.08k stars 22 forks source link

`noteBackground` in `sequenceDiagram` is not adjustable #272

Closed JKRhb closed 3 months ago

JKRhb commented 3 months ago

Hi there :)

When using the themeConfig in a sequenceDiagram, it seems as if the noteBackground color is not adjustable. Instead, it is always rendered yellow. You can find a minimal example for reproducing the issue below.

Source code

sequenceDiagram
  @config({
     "themeConfig": {
       "themeVariables": {
         "noteBackground": "#ff0000"
       }
     }
  })
  A->>B: Hi, this is a minimal example.

  @note over A,B: My background is not red :(

Rendered sequence diagram

image
hikerpig commented 3 months ago

Ah this is because @config can only set diagram local config but not global theme config for now. You will have to call pintora.setConfig JS API to alter global theme. But I will look into it, it's reasonable that one should be able to alter diagram local theme through @config directive.

hikerpig commented 3 months ago

Fixed in v0.7.4