Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProB 2 Jupyter Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
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
general
stups
ProB 2 Jupyter Kernel
Commits
609a9c66
Commit
609a9c66
authored
1 year ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Enable ID prefix for VisB to avoid ID conflicts between cells
parent
a644e33c
No related branches found
No related tags found
No related merge requests found
Pipeline
#117439
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
notebooks/tests/VisB_Test.ipynb
+33
-33
33 additions, 33 deletions
notebooks/tests/VisB_Test.ipynb
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+5
-1
5 additions, 1 deletion
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
with
38 additions
and
34 deletions
notebooks/tests/VisB_Test.ipynb
+
33
−
33
View file @
609a9c66
...
@@ -225,10 +225,10 @@
...
@@ -225,10 +225,10 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function visualise0(stepNr) {\n"
,
" function visualise0(stepNr) {\n"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 0
\"
);
\n
"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 0
\"
);
\n
"
,
" setAttr(
\"
button
\"
,
\"
fill
\"
,
\"
red
\"
);
\n
"
,
" setAttr(
\"
visb__1.
button
\"
,
\"
fill
\"
,
\"
red
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
visb__1.
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
visb__1.
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" setAttr(
\"
visb__1.
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" }
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" async function runAll(delay) {\n"
,
" visualise0(1);
\n
"
,
" visualise0(1);
\n
"
,
...
@@ -240,14 +240,14 @@
...
@@ -240,14 +240,14 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function registerHovers() {\n"
,
" function registerHovers() {\n"
,
" var obj;
\n
"
,
" var obj;
\n
"
,
" obj = document.getElementById(
\"
button
\"
);
\n
"
,
" obj = document.getElementById(
\"
visb__1.
button
\"
);
\n
"
,
" obj.onmouseover = function(ev){\n"
,
" obj.onmouseover = function(ev){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
visb__1.
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" setAttr(
\"
visb__1.
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" obj.onmouseout = function(){\n"
,
" obj.onmouseout = function(){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
visb__1.
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" setAttr(
\"
visb__1.
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" }
\n
"
,
" }
\n
"
,
" </script>
\n
"
,
" </script>
\n
"
,
...
@@ -266,8 +266,8 @@
...
@@ -266,8 +266,8 @@
" </marker>
\n
"
,
" </marker>
\n
"
,
" </defs>
\n
"
,
" </defs>
\n
"
,
"
\n
"
,
"
\n
"
,
" <circle id=
\"
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
red
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <circle id=
\"
visb__1.
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
red
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <line id=
\"
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
20.0
\"
></line>
\n
"
,
" <line id=
\"
visb__1.
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
20.0
\"
></line>
\n
"
,
"</svg>
\n
"
,
"</svg>
\n
"
,
" </div>
\n
"
,
" </div>
\n
"
,
" <script> visualise0(1); </script>
\n
"
,
" <script> visualise0(1); </script>
\n
"
,
...
@@ -464,10 +464,10 @@
...
@@ -464,10 +464,10 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function visualise1(stepNr) {\n"
,
" function visualise1(stepNr) {\n"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 1
\"
);
\n
"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 1
\"
);
\n
"
,
" setAttr(
\"
button
\"
,
\"
fill
\"
,
\"
green
\"
);
\n
"
,
" setAttr(
\"
visb__2.
button
\"
,
\"
fill
\"
,
\"
green
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
visb__2.
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
visb__2.
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
180.0
\"
);
\n
"
,
" setAttr(
\"
visb__2.
arrow
\"
,
\"
y2
\"
,
\"
180.0
\"
);
\n
"
,
" }
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" async function runAll(delay) {\n"
,
" visualise1(1);
\n
"
,
" visualise1(1);
\n
"
,
...
@@ -479,14 +479,14 @@
...
@@ -479,14 +479,14 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function registerHovers() {\n"
,
" function registerHovers() {\n"
,
" var obj;
\n
"
,
" var obj;
\n
"
,
" obj = document.getElementById(
\"
button
\"
);
\n
"
,
" obj = document.getElementById(
\"
visb__2.
button
\"
);
\n
"
,
" obj.onmouseover = function(ev){\n"
,
" obj.onmouseover = function(ev){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
visb__2.
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" setAttr(
\"
visb__2.
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" obj.onmouseout = function(){\n"
,
" obj.onmouseout = function(){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
visb__2.
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" setAttr(
\"
visb__2.
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" }
\n
"
,
" }
\n
"
,
" </script>
\n
"
,
" </script>
\n
"
,
...
@@ -505,8 +505,8 @@
...
@@ -505,8 +505,8 @@
" </marker>
\n
"
,
" </marker>
\n
"
,
" </defs>
\n
"
,
" </defs>
\n
"
,
"
\n
"
,
"
\n
"
,
" <circle id=
\"
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
green
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <circle id=
\"
visb__2.
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
green
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <line id=
\"
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
180.0
\"
></line>
\n
"
,
" <line id=
\"
visb__2.
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
180.0
\"
></line>
\n
"
,
"</svg>
\n
"
,
"</svg>
\n
"
,
" </div>
\n
"
,
" </div>
\n
"
,
" <script> visualise1(1); </script>
\n
"
,
" <script> visualise1(1); </script>
\n
"
,
...
@@ -703,10 +703,10 @@
...
@@ -703,10 +703,10 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function visualise0(stepNr) {\n"
,
" function visualise0(stepNr) {\n"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 0
\"
);
\n
"
,
" setAttr(
\"
visb_debug_messages
\"
,
\"
text
\"
,
\"
Step
\"
+stepNr+
\"
/1, State ID: 0
\"
);
\n
"
,
" setAttr(
\"
button
\"
,
\"
fill
\"
,
\"
red
\"
);
\n
"
,
" setAttr(
\"
visb__3.
button
\"
,
\"
fill
\"
,
\"
red
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
visb__3.
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
visb__3.
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" setAttr(
\"
visb__3.
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" }
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" async function runAll(delay) {\n"
,
" visualise0(1);
\n
"
,
" visualise0(1);
\n
"
,
...
@@ -718,14 +718,14 @@
...
@@ -718,14 +718,14 @@
" <script>
\n
"
,
" <script>
\n
"
,
" function registerHovers() {\n"
,
" function registerHovers() {\n"
,
" var obj;
\n
"
,
" var obj;
\n
"
,
" obj = document.getElementById(
\"
button
\"
);
\n
"
,
" obj = document.getElementById(
\"
visb__3.
button
\"
);
\n
"
,
" obj.onmouseover = function(ev){\n"
,
" obj.onmouseover = function(ev){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
visb__3.
button
\"
,
\"
stroke
\"
,
\"
gray
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" setAttr(
\"
visb__3.
button
\"
,
\"
stroke-width
\"
,
\"
5
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" obj.onmouseout = function(){\n"
,
" obj.onmouseout = function(){\n"
,
" setAttr(
\"
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
visb__3.
button
\"
,
\"
stroke
\"
,
\"
black
\"
)
\n
"
,
" setAttr(
\"
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" setAttr(
\"
visb__3.
button
\"
,
\"
stroke-width
\"
,
\"
2
\"
)
\n
"
,
" };
\n
"
,
" };
\n
"
,
" }
\n
"
,
" }
\n
"
,
" </script>
\n
"
,
" </script>
\n
"
,
...
@@ -744,8 +744,8 @@
...
@@ -744,8 +744,8 @@
" </marker>
\n
"
,
" </marker>
\n
"
,
" </defs>
\n
"
,
" </defs>
\n
"
,
"
\n
"
,
"
\n
"
,
" <circle id=
\"
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
red
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <circle id=
\"
visb__3.
button
\"
cx=
\"
100
\"
cy=
\"
100
\"
fill=
\"
red
\"
r=
\"
80
\"
stroke=
\"
black
\"
stroke-width=
\"
2
\"
></circle>
\n
"
,
" <line id=
\"
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
20.0
\"
></line>
\n
"
,
" <line id=
\"
visb__3.
arrow
\"
marker-end=
\"
url(#arrowhead)
\"
stroke=
\"
gray
\"
stroke-width=
\"
2.0
\"
visible=
\"
TRUE
\"
x1=
\"
100
\"
x2=
\"
100.0
\"
y1=
\"
100
\"
y2=
\"
20.0
\"
></line>
\n
"
,
"</svg>
\n
"
,
"</svg>
\n
"
,
" </div>
\n
"
,
" </div>
\n
"
,
" <script> visualise0(1); </script>
\n
"
,
" <script> visualise0(1); </script>
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+
5
−
1
View file @
609a9c66
...
@@ -165,7 +165,11 @@ public final class ShowCommand implements Command {
...
@@ -165,7 +165,11 @@ public final class ShowCommand implements Command {
return
null
;
return
null
;
}
}
GetVisBHtmlForStates
htmlCmd
=
new
GetVisBHtmlForStates
(
state
,
VisBExportOptions
.
DEFAULT
.
withShowHeader
(
false
).
withShowVersionInfo
(
false
));
VisBExportOptions
options
=
VisBExportOptions
.
DEFAULT
.
withShowHeader
(
false
)
.
withShowVersionInfo
(
false
)
.
withAutoIdPrefix
();
GetVisBHtmlForStates
htmlCmd
=
new
GetVisBHtmlForStates
(
state
,
options
);
state
.
getStateSpace
().
execute
(
htmlCmd
);
state
.
getStateSpace
().
execute
(
htmlCmd
);
final
DisplayData
result
=
new
DisplayData
(
"<VisB visualization>"
);
final
DisplayData
result
=
new
DisplayData
(
"<VisB visualization>"
);
...
...
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