Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gryphon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Show more breadcrumbs
Monterey Phoenix
User Interfaces
Gryphon
Commits
09562e88
Commit
09562e88
authored
7 months ago
by
Allen, Bruce (CIV)
Browse files
Options
Downloads
Patches
Plain Diff
account for when the trace-generator skips rows in events
parent
ca7c55d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tg_to_gry.py
+10
-13
10 additions, 13 deletions
python/tg_to_gry.py
with
10 additions
and
13 deletions
python/tg_to_gry.py
+
10
−
13
View file @
09562e88
...
@@ -144,27 +144,24 @@ def _add_view_object(view_object, gry_graph):
...
@@ -144,27 +144,24 @@ def _add_view_object(view_object, gry_graph):
view_object
[
"
AD
"
]))
view_object
[
"
AD
"
]))
def
_trace_v_spacing
(
tg_nodes
):
def
_trace_v_spacing
(
tg_nodes
):
# start off
maximums
with default node height
# start off with default node height
maximum
s
=
defaultdict
(
lambda
:
settings
[
"
trace_node_height
"
])
row_height
s
=
defaultdict
(
lambda
:
settings
[
"
trace_node_height
"
])
w
=
settings
[
"
trace_node_width
"
]
w
=
settings
[
"
trace_node_width
"
]
default_v_spacing
=
settings
[
"
trace_node_v_spacing
"
]
default_v_spacing
=
settings
[
"
trace_node_v_spacing
"
]
# get the max height for each row
# get the max height for each row
for
tg_node
in
tg_nodes
:
# event in event list
for
tg_node
in
tg_nodes
:
# event in event list
maximum
s
[
tg_node
[
4
]]
=
max
(
maximum
s
[
tg_node
[
4
]],
row_height
s
[
tg_node
[
4
]]
=
max
(
row_height
s
[
tg_node
[
4
]],
margined_text_height
(
strip_underscore
(
tg_node
[
0
]),
w
))
margined_text_height
(
strip_underscore
(
tg_node
[
0
]),
w
))
# calculate the adjusted spacing at each row
# calculate the adjusted spacing at each row
keys
=
sorted
(
maximum
s
.
keys
())
keys
=
sorted
(
row_height
s
.
keys
())
count
=
len
(
maximums
)
count
=
keys
[
-
1
]
+
1
# trace-generator can skip rows
adjusted_v_spacing
=
[
0
]
*
count
adjusted_v_spacing
=
[
0
]
*
count
# create the array and set the first to 0
for
i
in
range
(
1
,
count
):
for
i
in
range
(
1
,
count
):
adjusted_v_spacing
[
i
]
=
adjusted_v_spacing
[
i
-
1
]
\
adjusted_v_spacing
[
i
]
=
adjusted_v_spacing
[
i
-
1
]
\
+
maximums
[
i
-
1
]
/
2
\
+
row_heights
[
i
-
1
]
/
2
\
+
maximums
[
i
]
/
2
+
default_v_spacing
+
row_heights
[
i
]
/
2
+
default_v_spacing
return
adjusted_v_spacing
return
adjusted_v_spacing
def
_trace_edge
(
tg_edge
,
relation
,
label
,
nodes
,
placer
):
def
_trace_edge
(
tg_edge
,
relation
,
label
,
nodes
,
placer
):
gry_edge
=
dict
()
gry_edge
=
dict
()
if
relation
==
"
IN
"
or
relation
==
"
FOLLOWS
"
:
if
relation
==
"
IN
"
or
relation
==
"
FOLLOWS
"
:
...
@@ -185,7 +182,7 @@ def _trace_edge(tg_edge, relation, label, nodes, placer):
...
@@ -185,7 +182,7 @@ def _trace_edge(tg_edge, relation, label, nodes, placer):
gry_from_node
=
nodes
[
from_id
]
gry_from_node
=
nodes
[
from_id
]
gry_to_node
=
nodes
[
to_id
]
gry_to_node
=
nodes
[
to_id
]
ep1_x
,
ep1_y
,
ep2_x
,
ep2_y
=
placer
.
place_cubic_bezier_points
(
ep1_x
,
ep1_y
,
ep2_x
,
ep2_y
=
placer
.
place_cubic_bezier_points
(
from_id
,
gry_from_node
[
"
x
"
],
gry_from_node
[
"
y
"
],
from_id
,
gry_from_node
[
"
x
"
],
gry_from_node
[
"
y
"
],
to_id
,
gry_to_node
[
"
x
"
],
gry_to_node
[
"
y
"
])
to_id
,
gry_to_node
[
"
x
"
],
gry_to_node
[
"
y
"
])
gry_edge
[
"
ep1_x
"
]
=
ep1_x
gry_edge
[
"
ep1_x
"
]
=
ep1_x
gry_edge
[
"
ep1_y
"
]
=
ep1_y
gry_edge
[
"
ep1_y
"
]
=
ep1_y
...
...
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