Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass styling #639

Closed
harveyslash opened this issue Mar 14, 2018 · 3 comments
Closed

How to pass styling #639

harveyslash opened this issue Mar 14, 2018 · 3 comments

Comments

@harveyslash
Copy link

I am using mermaid api like this :

 mermaid.mermaidAPI.initialize({
                                theme: 'forest',
                                startOnLoad:true,
                                sequence: {
                                        diagramMarginX:5,
                                        diagramMarginY:1,
                                },
                        });

then i call render :
mermaid.mermaidAPI.render('__graph'+i,graphDefinition,cb)

The theme correctly changes from default to green , but the styles passed in sequence dont seem to have any effect.

I would like to make the actor boxes in sequence diagram smaller in comparison to the text.

@tylerlong
Copy link
Collaborator

I would like to make the actor boxes in sequence diagram smaller in comparison to the text.

mermaid.initialize({
      sequence: {
        width: 100,
        height: 50
      }
});

Actually those are not controlled by CSS. It's controlled by D3.

@harveyslash
Copy link
Author

harveyslash commented Mar 15, 2018

mermaid.mermaidAPI.initialize({
                                theme: 'forest',                                                                                                        startOnLoad:true,
                                sequence: { 
                                           width:50,
                                },
                        });

Had no effect on the diagram.
I am using this on a static page , with this version:
https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js

@tylerlong
Copy link
Collaborator

tylerlong commented Mar 16, 2018

Please test the latest version.

For version 7.x you probably need to replace sequence: with sequenceDiagram:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants