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

feat: add name attribute and class "actor-line" to line #5338

Merged
merged 8 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ The theming engine will only recognize hex colors and not color names. So, the v
| actorBkg | mainBkg | Actor Background Color |
| actorBorder | primaryBorderColor | Actor Border Color |
| actorTextColor | primaryTextColor | Actor Text Color |
| actorLineColor | grey | Actor Line Color |
| actorLineColor | actorBorder | Actor Line Color |
| signalColor | textColor | Signal Color |
| signalTextColor | textColor | Signal Text Color |
| labelBoxBkgColor | actorBkg | Label Box Background Color |
Expand Down
12 changes: 6 additions & 6 deletions packages/mermaid/src/diagrams/sequence/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ const drawActorTypeParticipant = async function (elem, actor, conf, isFooter) {
.attr('y1', centerY)
.attr('x2', center)
.attr('y2', 2000)
.attr('class', 'actor-line')
.attr('class', '200')
.attr('class', 'actor-line 200')
aloisklink marked this conversation as resolved.
Show resolved Hide resolved
.attr('stroke-width', '0.5px')
.attr('stroke', '#999');
.attr('stroke', '#999')
.attr('name', actor.name);

g = boxplusLineGroup.append('g');
actor.actorCnt = actorCnt;
Expand Down Expand Up @@ -425,10 +425,10 @@ const drawActorTypeActor = async function (elem, actor, conf, isFooter) {
.attr('y1', centerY)
.attr('x2', center)
.attr('y2', 2000)
.attr('class', 'actor-line')
.attr('class', '200')
.attr('class', 'actor-line 200')
.attr('stroke-width', '0.5px')
.attr('stroke', '#999');
.attr('stroke', '#999')
.attr('name', actor.name);

actor.actorCnt = actorCnt;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/docs/config/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ The theming engine will only recognize hex colors and not color names. So, the v
| actorBkg | mainBkg | Actor Background Color |
| actorBorder | primaryBorderColor | Actor Border Color |
| actorTextColor | primaryTextColor | Actor Text Color |
| actorLineColor | grey | Actor Line Color |
| actorLineColor | actorBorder | Actor Line Color |
| signalColor | textColor | Signal Color |
| signalTextColor | textColor | Signal Text Color |
| labelBoxBkgColor | actorBkg | Label Box Background Color |
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/themes/theme-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Theme {
this.actorBorder = this.actorBorder || this.primaryBorderColor;
this.actorBkg = this.actorBkg || this.mainBkg;
this.actorTextColor = this.actorTextColor || this.primaryTextColor;
this.actorLineColor = this.actorLineColor || 'grey';
this.actorLineColor = this.actorLineColor || this.actorBorder;
this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;
this.signalColor = this.signalColor || this.textColor;
this.signalTextColor = this.signalTextColor || this.textColor;
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/themes/theme-dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Theme {
this.actorBorder = this.border1;
this.actorBkg = this.mainBkg;
this.actorTextColor = this.mainContrastColor;
this.actorLineColor = this.mainContrastColor;
this.actorLineColor = this.actorBorder;
this.signalColor = this.mainContrastColor;
this.signalTextColor = this.mainContrastColor;
this.labelBoxBkgColor = this.actorBkg;
Expand Down
3 changes: 2 additions & 1 deletion packages/mermaid/src/themes/theme-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Theme {
this.actorBorder = 'calculated';
this.actorBkg = 'calculated';
this.actorTextColor = 'black';
this.actorLineColor = 'grey';
this.actorLineColor = 'calculated';
this.signalColor = 'calculated';
this.signalTextColor = 'calculated';
this.labelBoxBkgColor = 'calculated';
Expand Down Expand Up @@ -187,6 +187,7 @@ class Theme {
this.loopTextColor = this.actorTextColor;
this.noteBorderColor = this.border2;
this.noteTextColor = this.actorTextColor;
this.actorLineColor = this.actorBorder;

/* Gantt chart variables */

Expand Down
3 changes: 2 additions & 1 deletion packages/mermaid/src/themes/theme-forest.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Theme {
this.actorBorder = 'calculated';
this.actorBkg = 'calculated';
this.actorTextColor = 'black';
this.actorLineColor = 'grey';
this.actorLineColor = 'calculated';
this.signalColor = '#333';
this.signalTextColor = '#333';
this.labelBoxBkgColor = 'calculated';
Expand Down Expand Up @@ -101,6 +101,7 @@ class Theme {
this.loopTextColor = this.actorTextColor;
this.noteBorderColor = this.border2;
this.noteTextColor = this.actorTextColor;
this.actorLineColor = this.actorBorder;

/* Each color-set will have a background, a foreground and a border color */
this.cScale0 = this.cScale0 || this.primaryColor;
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/themes/theme-neutral.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Theme {
this.actorBorder = 'calculated';
this.actorBkg = 'calculated';
this.actorTextColor = 'calculated';
this.actorLineColor = 'calculated';
this.actorLineColor = this.actorBorder;
this.signalColor = 'calculated';
this.signalTextColor = 'calculated';
this.labelBoxBkgColor = 'calculated';
Expand Down Expand Up @@ -113,7 +113,7 @@ class Theme {
this.actorBorder = lighten(this.border1, 23);
this.actorBkg = this.mainBkg;
this.actorTextColor = this.text;
this.actorLineColor = this.lineColor;
this.actorLineColor = this.actorBorder;
this.signalColor = this.text;
this.signalTextColor = this.text;
this.labelBoxBkgColor = this.actorBkg;
Expand Down
Loading