Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
nghyd
Commits
23a029ec
Commit
23a029ec
authored
4 years ago
by
mathias.chouet
Browse files
Options
Downloads
Patches
Plain Diff
Modules Diagram: fix blank diagram issue with PreBarrage
parent
e686923a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!93
Resolve "Ajout du module Prébarrage"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/modules-diagram/modules-diagram.component.ts
+36
-30
36 additions, 30 deletions
...p/components/modules-diagram/modules-diagram.component.ts
with
36 additions
and
30 deletions
src/app/components/modules-diagram/modules-diagram.component.ts
+
36
−
30
View file @
23a029ec
...
...
@@ -111,41 +111,47 @@ export class ModulesDiagramComponent implements AfterContentInit, AfterViewCheck
}
public
ngAfterViewInit
():
void
{
// add click listener on every calculator node in the graph, that
// corresponds to an open module
this
.
nativeElement
.
querySelectorAll
(
"
g.node
"
).
forEach
(
item
=>
{
if
(
item
.
id
&&
this
.
formIsOpen
(
item
.
id
))
{
item
.
style
.
cursor
=
"
pointer
"
;
item
.
addEventListener
(
"
click
"
,
()
=>
{
this
.
openCalc
(
item
.
id
);
});
}
});
setTimeout
(()
=>
{
// clodo trick
// add click listener on every calculator node in the graph, that
// corresponds to an open module
this
.
nativeElement
.
querySelectorAll
(
"
g.node
"
).
forEach
(
item
=>
{
if
(
item
.
id
&&
this
.
formIsOpen
(
item
.
id
))
{
item
.
style
.
cursor
=
"
pointer
"
;
item
.
addEventListener
(
"
click
"
,
()
=>
{
this
.
openCalc
(
item
.
id
);
});
}
});
},
20
);
// @WARNING keep timeout > the one in ngAfterContentInit() below
}
public
ngAfterContentInit
():
void
{
this
.
error
=
false
;
mermaid
.
initialize
({
// theme: "forest"
flowchart
:
{
curve
:
"
basis
"
}
});
this
.
nativeElement
=
this
.
diagram
.
nativeElement
;
if
(
this
.
hasModules
)
{
// generate graph description
const
graphDefinition
=
this
.
graphDefinition
();
// draw
try
{
mermaid
.
render
(
"
graphDiv
"
,
graphDefinition
,
(
svgCode
,
bindFunctions
)
=>
{
this
.
nativeElement
.
innerHTML
=
svgCode
;
});
}
catch
(
e
)
{
console
.
error
(
e
);
this
.
error
=
true
;
// clodo trick or displaying modules diagram coming from a
// PreBarrage module results in a blank diagram
setTimeout
(()
=>
{
mermaid
.
initialize
({
// theme: "forest"
flowchart
:
{
curve
:
"
basis
"
}
});
this
.
nativeElement
=
this
.
diagram
.
nativeElement
;
if
(
this
.
hasModules
)
{
// generate graph description
const
graphDefinition
=
this
.
graphDefinition
();
// draw
try
{
mermaid
.
render
(
"
graphDiv
"
,
graphDefinition
,
(
svgCode
,
bindFunctions
)
=>
{
this
.
nativeElement
.
innerHTML
=
svgCode
;
});
}
catch
(
e
)
{
console
.
error
(
e
);
this
.
error
=
true
;
}
}
}
}
,
10
);
}
public
resetZoom
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment