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

Relationships in namespaces (class diagram) #4656

Closed
radu781 opened this issue Jul 21, 2023 · 2 comments
Closed

Relationships in namespaces (class diagram) #4656

radu781 opened this issue Jul 21, 2023 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@radu781
Copy link

radu781 commented Jul 21, 2023

Proposal

Mermaid.js should add support for defining relationships in namespaces in order to clarify the link between multiple classes. At the moment relationships are only allowed for classes outside of namespaces.

Example

namespace NS{
    class A {
        - field
    }
    class B {
        - field
    }
    A .. B
}

Actual:

Parse error on line 227:
...        -    }    A .. B}
---------------------^
Expecting 'STRUCT_STOP', 'CLASS', got 'ALPHA'

Screenshots

No response

@radu781 radu781 added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jul 21, 2023
@radu781
Copy link
Author

radu781 commented Jul 22, 2023

It looks like you can add relationships if you specify them before creating the namespace.

A .. B
namespace NS{
    class A {
        - field
    }
    class B {
        - field
    }
}

This (partially) duplicates #4519

@radu781 radu781 closed this as completed Jul 22, 2023
@duaneking
Copy link

This is a defect. If I'm defining a class I should be able to include its entire definition and its use of other objects inside that definition for code clarity and accessibility for things like screen readers where the context needs to be hyper local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants