Mermaid class diagram fail to scale properly

Summary

Large mermaid class diagrams to not properly scale, resulting in significant clipping.

Steps to reproduce

Use the following mermaid diagram. Rendering appears below.

    classDiagram
    class Actor
    class child2
    class child3
    class child4
    class child5
    class child6
    class child7
    class child1
    class child8
    class cable
    class child9
    class child10
        child10 : <<byRef singelton>>
    class child11
    class child12
    class child13
    class child14
    class child15
    class child16
    class child17
    class child18
    class child19
    class child20
    Actor <|-- child5
    Actor <|-- child6
    child7 <|-- child1
    child7 <|-- child8
    child14 <|-- child15
    child15 <|-- child16
    child15 <|-- child17
    child16 <|-- child19
    child17 <|-- child18
    child11 <|-- child12
    child11 <|-- child13
    child11 --* child10
    child9 --o child14 : -InitializedInstruments[]
    child10 --o child14
    child12 --o child17
    child13 --o child16
    child4 --> child3
    child4 --> child5
    child4 --> child2
    child5 --o child9
    child6 --> child4
    child2 --> child1
    child2 --> child8
    child20 --o child13
    child20 --o child12
    child20 --o child9
    child20 --o cable
    child20 <|-- child4
    child20 <|-- child2
    child20 <|-- child7
    child20 <|-- child3
    Actor <|-- child20
    classDiagram
    class Actor
    class child2
    class child3
    class child4
    class child5
    class child6
    class child7
    class child1
    class child8
    class cable
    class child9
    class child10
        child10 : <<byRef singelton>>
    class child11
    class child12
    class child13
    class child14
    class child15
    class child16
    class child17
    class child18
    class child19
    class child20
    Actor <|-- child5
    Actor <|-- child6
    child7 <|-- child1
    child7 <|-- child8
    child14 <|-- child15
    child15 <|-- child16
    child15 <|-- child17
    child16 <|-- child19
    child17 <|-- child18
    child11 <|-- child12
    child11 <|-- child13
    child11 --* child10
    child9 --o child14 : -InitializedInstruments[]
    child10 --o child14
    child12 --o child17
    child13 --o child16
    child4 --> child3
    child4 --> child5
    child4 --> child2
    child5 --o child9
    child6 --> child4
    child2 --> child1
    child2 --> child8
    child20 --o child13
    child20 --o child12
    child20 --o child9
    child20 --o cable
    child20 <|-- child4
    child20 <|-- child2
    child20 <|-- child7
    child20 <|-- child3
    Actor <|-- child20

Example Project

see above

What is the current bug behavior?

Diagrams is not properly scaled and goes out of the center div

What is the expected correct behavior?

diagram should scale to width of center div

Relevant logs and/or screenshots

mermaid_scaling_bug

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)

System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 3.2.12 Git Version: 2.22.0 Sidekiq Version:5.2.7 Go Version: unknown

GitLab information Version: 12.5.0-ee Revision: 4878f9ac894 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.9 URL: https://<myhostname> HTTP Clone URL: http://<myIP>/some-group/some-project.git SSH Clone URL: git@<myhostname>:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 10.2.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 10.2.0 ? ... OK (10.2.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/1 ... yes 7/2 ... yes 2/4 ... yes 4/5 ... yes 4/6 ... yes 8/7 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 6 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)