Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rocolib
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
roco
rocolib
Merge requests
!20
2D cut pattern visualization
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
2D cut pattern visualization
mehtank/rocolib:display2d
into
v0.3
Overview
0
Commits
9
Pipelines
1
Changes
7
Merged
mehtank
requested to merge
mehtank/rocolib:display2d
into
v0.3
3 years ago
Overview
0
Commits
9
Pipelines
1
Changes
7
Expand
Mostly handle
#10
0
0
Merge request reports
Compare
v0.3
v0.3 (base)
and
latest version
latest version
312a7485
9 commits,
3 years ago
7 files
+
196
−
139
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
rocolib/api/components/Component.py
+
16
−
12
Options
@@ -14,7 +14,7 @@ from rocolib.utils.utils import prefix as prefixString
from
rocolib.utils.utils
import
tryImport
from
rocolib.utils.io
import
load_yaml
from
rocolib.utils.nx2go
import
GraphVisualization
as
gv
from
dash
import
Dash
,
html
from
dash
import
html
,
dcc
log
=
logging
.
getLogger
(
__name__
)
@@ -531,19 +531,23 @@ class Component(Parameterized):
def
visualize
(
self
,
outputs
=
True
,
**
ka
):
widgets
=
self
.
makeOutput
(
outputs
,
widgets
=
True
,
**
ka
)
app
=
Dash
(
__name__
)
elts
=
[
html
.
H2
(
'
RoCo component visualizer
'
),
html
.
H1
(
f
"
Component:
{
self
.
getName
()
}
"
),
]
elts
=
[
html
.
H1
(
f
"
RoCo component visualizer:
{
self
.
getName
()
}
"
)
]
tabs
=
[]
for
c
,
w
in
widgets
.
items
():
elts
.
append
(
html
.
H3
(
f
"
Composable:
{
c
}
"
))
widgets
=
[]
for
k
,
v
in
w
.
items
():
elts
.
append
(
html
.
H4
(
f
"
Widget:
{
k
}
"
))
elts
.
append
(
html
.
P
(
v
[
'
desc
'
]))
elts
.
append
(
v
[
'
widget
'
])
app
.
layout
=
html
.
Div
(
elts
)
app
.
run_server
(
debug
=
True
)
widgets
.
append
(
html
.
Div
([
html
.
H3
(
v
[
'
desc
'
]),
html
.
P
(
f
"
Widget:
{
k
}
"
),
v
[
'
widget
'
],
],
style
=
{
'
padding
'
:
10
,
'
flex
'
:
1
}))
tabs
.
append
(
dcc
.
Tab
(
label
=
f
"
Composable:
{
c
}
"
,
children
=
html
.
Div
(
widgets
,
style
=
{
'
display
'
:
'
flex
'
,
'
flex-direction
'
:
'
row
'
})
))
elts
.
append
(
html
.
Div
(
dcc
.
Tabs
(
tabs
)))
return
html
.
Div
(
elts
)
def
makeOutput
(
self
,
outputs
=
(),
filedir
=
None
,
widgets
=
False
,
**
ka
):
if
filedir
: