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

Directive support for many diagrams, config bugfix #1582

Merged
merged 19 commits into from
Jul 28, 2020

Conversation

cmmoran
Copy link
Collaborator

@cmmoran cmmoran commented Jul 27, 2020

📑 Summary

Directive support for most diagrams
Slight pie refactor
Added pie unit tests
Fixed a config issue where multiple diagrams on the same page (using the same mermaid context) would inadvertently share the same configuration if the first config utilized the init directive to set configuration variables.

📏 Design Decisions

The jison parsing statements for directive support are fairly drop-in and require very little change on the parser. These changes have been added and the modifications to the parserDb support file have been made for the following diagrams:

  • pie
  • gantt
  • user-journey
  • flowchart (graph)
  • class
  • er
  • state

The remaining one(s) to update are:

  • info (is this a starter example?)
  • git (experimental)

cmmoran and others added 15 commits July 23, 2020 05:58
Fixed an issue in journey svgDraw.drawText expected an attribute (textMargin) but did not receive one and raised an error: <tspan> attribute x: Expected length, "NaN".
Added parseDirective to journeyDb
…urityLevel='loose' must be set by the siteConfig. The default securityLevel as of now is 'strict'. This causes html to be url encoded.
Added the parser as the first argument to parseDirective to support custom directive handling (for now delegated within mermaidAPI but should probably discriminate based on type for delegation)
Diagrams now properly reset to siteConfig when there are multiple diagrams on a single page
Fixed a regression bug I introduced in theme.spec.js
Added directive support to pie
(Refactored pie parsing to be a bit more clear)
Added more unit tests to pie
…s-in-actor-names-in-sequence-diagrams' into develop
@cmmoran cmmoran changed the title Directive support for journey (+<tspan> NaN bugfix) Directive support for many diagrams, config bugfix Jul 27, 2020
Fixed an issue with markerUnits: (default is 'strokeWidth' not 0
@cmmoran cmmoran requested a review from knsv July 28, 2020 00:26
GraphObjects.md: [ and ] should be escaped in text (they're links otherwise)
flow.jison: fixed a parsing issue when the direction is omitted (defaults to 'TB')
stateRenderer-v2: was silently failing due to a try/catch in the parse function. (intentional?) removed to show errorHandler
mermaidAPI: removed unnecessary call to updateRendererConfigs since reinitialize does this
Fixed a class diagram parsing issue
@knsv knsv merged commit b23988c into mermaid-js:develop Jul 28, 2020
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

Successfully merging this pull request may close these issues.

3 participants