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
eb40076e
Commit
eb40076e
authored
11 months ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] renamed sandboxed diagrams
parent
5b328364
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/dome/renderer/graph/diagram.tsx
+7
-3
7 additions, 3 deletions
ivette/src/dome/renderer/graph/diagram.tsx
ivette/src/sandbox/dotdiagram.tsx
+0
-0
0 additions, 0 deletions
ivette/src/sandbox/dotdiagram.tsx
with
7 additions
and
3 deletions
ivette/src/dome/renderer/graph/diagram.tsx
+
7
−
3
View file @
eb40076e
...
@@ -137,7 +137,7 @@ const byNode = (a: Node, b: Node): number => byStr(a.id, b.id);
...
@@ -137,7 +137,7 @@ const byNode = (a: Node, b: Node): number => byStr(a.id, b.id);
const
byEdge
=
(
a
:
Edge
,
b
:
Edge
):
number
=>
byStr
(
edgeKey
(
a
),
edgeKey
(
b
));
const
byEdge
=
(
a
:
Edge
,
b
:
Edge
):
number
=>
byStr
(
edgeKey
(
a
),
edgeKey
(
b
));
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* --- d3-Graphviz
Component
--- */
/* --- d3-Graphviz
view
--- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
let
divId
=
0
;
let
divId
=
0
;
...
@@ -146,6 +146,7 @@ const newDivId = (): string => `dome_d3gv_${++divId}`;
...
@@ -146,6 +146,7 @@ const newDivId = (): string => `dome_d3gv_${++divId}`;
interface
GraphvizProps
extends
DiagramProps
{
size
:
Size
}
interface
GraphvizProps
extends
DiagramProps
{
size
:
Size
}
function
GraphvizView
(
props
:
GraphvizProps
):
JSX
.
Element
{
function
GraphvizView
(
props
:
GraphvizProps
):
JSX
.
Element
{
// --- Model Generation
// --- Model Generation
const
{
direction
=
'
LR
'
,
nodes
,
edges
}
=
props
;
const
{
direction
=
'
LR
'
,
nodes
,
edges
}
=
props
;
const
model
=
React
.
useMemo
(()
=>
{
const
model
=
React
.
useMemo
(()
=>
{
...
@@ -155,19 +156,22 @@ function GraphvizView(props: GraphvizProps): JSX.Element {
...
@@ -155,19 +156,22 @@ function GraphvizView(props: GraphvizProps): JSX.Element {
edges
.
concat
().
sort
(
byEdge
).
forEach
(
e
=>
dot
.
edge
(
e
));
edges
.
concat
().
sort
(
byEdge
).
forEach
(
e
=>
dot
.
edge
(
e
));
return
dot
.
flush
();
return
dot
.
flush
();
},
[
direction
,
nodes
,
edges
]);
},
[
direction
,
nodes
,
edges
]);
// --- Model Update Callback
// --- Model Update Callback
const
{
onModelChanged
}
=
props
;
const
{
onModelChanged
}
=
props
;
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
onModelChanged
)
onModelChanged
(
model
);
if
(
onModelChanged
)
onModelChanged
(
model
);
},
[
model
,
onModelChanged
]);
},
[
model
,
onModelChanged
]);
// --- Rendering
// --- Rendering & Remote
const
id
=
React
.
useMemo
(
newDivId
,
[]);
const
id
=
React
.
useMemo
(
newDivId
,
[]);
const
{
width
,
height
}
=
props
.
size
;
const
{
width
,
height
}
=
props
.
size
;
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
d3
.
graphviz
(
`#
${
id
}
`
,
{
d3
.
graphviz
(
`#
${
id
}
`
,
{
fit
:
false
,
zoom
:
fals
e
,
width
,
height
,
fit
:
false
,
zoom
:
tru
e
,
width
,
height
,
}).
renderDot
(
model
);
}).
renderDot
(
model
);
},
[
id
,
model
,
width
,
height
]);
},
[
id
,
model
,
width
,
height
]);
return
(
return
(
<
Catch
label
=
'Graphviz Error'
>
<
Catch
label
=
'Graphviz Error'
>
<
div
id
=
{
id
}
className
=
{
props
.
className
}
/>
<
div
id
=
{
id
}
className
=
{
props
.
className
}
/>
...
...
This diff is collapsed.
Click to expand it.
ivette/src/sandbox/diagram.tsx
→
ivette/src/sandbox/
dot
diagram.tsx
+
0
−
0
View file @
eb40076e
File moved
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