Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
43ad9ac8
Commit
43ad9ac8
authored
10 months ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dome] styling DOT diagrams
parent
64f3e438
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ivette/src/dome/renderer/graph/diagram.tsx
+18
-4
18 additions, 4 deletions
ivette/src/dome/renderer/graph/diagram.tsx
with
18 additions
and
4 deletions
ivette/src/dome/renderer/graph/diagram.tsx
+
18
−
4
View file @
43ad9ac8
...
@@ -35,6 +35,8 @@ import './style.css';
...
@@ -35,6 +35,8 @@ import './style.css';
export
type
Direction
=
'
LR
'
|
'
TD
'
;
export
type
Direction
=
'
LR
'
|
'
TD
'
;
export
type
Font
=
'
serif
'
|
'
sans
'
|
'
mono
'
;
export
type
Color
=
export
type
Color
=
|
'
white
'
|
'
grey
'
|
'
dark
'
|
'
white
'
|
'
grey
'
|
'
dark
'
|
'
primary
'
|
'
selected
'
|
'
primary
'
|
'
selected
'
...
@@ -45,7 +47,7 @@ export type Shape =
...
@@ -45,7 +47,7 @@ export type Shape =
|
'
point
'
|
'
box
'
|
'
point
'
|
'
box
'
|
'
diamond
'
|
'
hexagon
'
|
'
diamond
'
|
'
hexagon
'
|
'
circle
'
|
'
ellipse
'
|
'
circle
'
|
'
ellipse
'
|
'
note
'
|
'
tab
'
|
'
folder
'
;
|
'
note
'
|
'
tab
'
|
'
folder
'
|
'
cds
'
;
export
type
Arrow
=
'
none
'
|
'
arrow
'
|
'
tee
'
|
'
box
'
|
'
dot
'
;
export
type
Arrow
=
'
none
'
|
'
arrow
'
|
'
tee
'
|
'
box
'
|
'
dot
'
;
...
@@ -64,6 +66,8 @@ export interface Node {
...
@@ -64,6 +66,8 @@ export interface Node {
label
?:
string
;
label
?:
string
;
/** Node tooltip */
/** Node tooltip */
title
?:
string
;
title
?:
string
;
/** Node font (label) */
font
?:
Font
;
/** Node color (filled background) */
/** Node color (filled background) */
color
?:
Color
;
color
?:
Color
;
/**
/**
...
@@ -94,6 +98,8 @@ export interface Edge {
...
@@ -94,6 +98,8 @@ export interface Edge {
head
?:
Arrow
;
head
?:
Arrow
;
/** Default is `none` */
/** Default is `none` */
tail
?:
Arrow
;
tail
?:
Arrow
;
/** Label font */
font
?:
Font
;
/** Label */
/** Label */
label
?:
string
;
label
?:
string
;
/** Tooltip */
/** Tooltip */
...
@@ -148,9 +154,15 @@ export interface DiagramProps {
...
@@ -148,9 +154,15 @@ export interface DiagramProps {
}
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* --- C
olor
Model --- */
/* --- C
SS
Model
--- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
const
FONTNAME
=
{
'
serif
'
:
'
Times
'
,
'
sans
'
:
'
sans-serif
'
,
'
mono
'
:
'
Courier
'
,
};
// node background colors
// node background colors
const
BGCOLOR
=
{
const
BGCOLOR
=
{
'
white
'
:
'
#fff
'
,
'
white
'
:
'
#fff
'
,
...
@@ -340,7 +352,8 @@ class Builder {
...
@@ -340,7 +352,8 @@ class Builder {
.
print
(
'
'
)
.
print
(
'
'
)
.
port
(
n
.
id
)
.
port
(
n
.
id
)
.
print
(
'
[
'
)
.
print
(
'
[
'
)
.
attr
(
'
id
'
,
n
.
id
);
.
attr
(
'
id
'
,
n
.
id
)
.
attr
(
'
fontname
'
,
n
.
font
?
FONTNAME
[
n
.
font
]
:
undefined
);
if
(
typeof
n
.
shape
===
'
object
'
)
{
if
(
typeof
n
.
shape
===
'
object
'
)
{
this
this
.
attr
(
'
shape
'
,
'
record
'
)
.
attr
(
'
shape
'
,
'
record
'
)
...
@@ -399,6 +412,7 @@ class Builder {
...
@@ -399,6 +412,7 @@ class Builder {
.
port
(
e
.
target
,
e
.
targetPort
)
.
port
(
e
.
target
,
e
.
targetPort
)
.
print
(
'
[
'
)
.
print
(
'
[
'
)
.
attr
(
'
label
'
,
e
.
label
)
.
attr
(
'
label
'
,
e
.
label
)
.
attr
(
'
fontname
'
,
e
.
font
?
FONTNAME
[
e
.
font
]
:
undefined
)
.
attr
(
'
headlabel
'
,
e
.
headLabel
)
.
attr
(
'
headlabel
'
,
e
.
headLabel
)
.
attr
(
'
taillabel
'
,
e
.
tailLabel
)
.
attr
(
'
taillabel
'
,
e
.
tailLabel
)
.
attr
(
'
labeltooltip
'
,
e
.
label
?
tooltip
:
undefined
)
.
attr
(
'
labeltooltip
'
,
e
.
label
?
tooltip
:
undefined
)
...
@@ -476,7 +490,7 @@ function GraphvizView(props: GraphvizProps): JSX.Element {
...
@@ -476,7 +490,7 @@ function GraphvizView(props: GraphvizProps): JSX.Element {
setError
(
undefined
);
setError
(
undefined
);
graphviz
(
href
,
{
graphviz
(
href
,
{
useWorker
:
false
,
useWorker
:
false
,
fit
:
tru
e
,
zoom
:
true
,
width
,
height
,
fit
:
fals
e
,
zoom
:
true
,
width
,
height
,
}).
onerror
(
setError
)
}).
onerror
(
setError
)
.
renderDot
(
model
).
on
(
'
end
'
,
function
()
{
.
renderDot
(
model
).
on
(
'
end
'
,
function
()
{
if
(
onSelection
)
{
if
(
onSelection
)
{
...
...
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