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

Class diagram: annotations support #973

Merged
merged 9 commits into from
Oct 8, 2019
Merged

Class diagram: annotations support #973

merged 9 commits into from
Oct 8, 2019

Conversation

klemmchr
Copy link
Member

@klemmchr klemmchr commented Oct 4, 2019

Resolves #963

I added support for class annotations and did some minor changes needed for this feature.
I centered the class title because it would look quite odd it the annotation and the class title would be left aligned. Also I made the class title bold to make it distinguishable from the annotations. I decided for this syntax:

class Class01
<<interface>> Class01

class Class10 {
  <<service>>
}

image

@coveralls
Copy link

coveralls commented Oct 4, 2019

Pull Request Test Coverage Report for Build 1052

  • 13 of 28 (46.43%) changed or added relevant lines in 3 files are covered.
  • 99 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 53.544%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/diagrams/class/classRenderer.js 0 15 0.0%
Files with Coverage Reduction New Missed Lines %
src/diagrams/class/classRenderer.js 2 6.98%
src/diagrams/class/parser/classDiagram.jison 97 56.95%
Totals Coverage Status
Change from base Build 1037: -0.02%
Covered Lines: 2652
Relevant Lines: 4908

💛 - Coveralls

@klemmchr
Copy link
Member Author

klemmchr commented Oct 4, 2019

The image in the readme needs to be regenerated. Is there a tool for this or is it done by hand?

@klemmchr klemmchr marked this pull request as ready for review October 4, 2019 23:04
@knsv knsv requested a review from ashishjain0512 October 5, 2019 09:49
@knsv
Copy link
Collaborator

knsv commented Oct 5, 2019

@Chris579 great job! I am asking Ashish to do amore detailed review this before merging.

@knsv
Copy link
Collaborator

knsv commented Oct 5, 2019

We will merge this to develop and the feature will be included in the version 9. In version 9 class diagrams will be moved from experimental to officially supported with proper docs etc.

@klemmchr
Copy link
Member Author

klemmchr commented Oct 5, 2019

Is there already a vague ETA for Version 9?

* @public
*/
export const addAnnotation = function(className, annotation) {
classes[className].annotations.push(annotation);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unhappy about that. This will throw an exception if an annotation is defined before the class itself. It seems like there is no error handling about this at all, even for the members. How to treat that?

@ashishjain0512 ashishjain0512 merged commit 4ce523f into mermaid-js:master Oct 8, 2019
@ashishjain0512
Copy link
Collaborator

Merging Pull request to master.

@mermaid-js mermaid-js locked as resolved and limited conversation to collaborators Oct 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Class diagram: Add support for annotations
4 participants