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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB 2 Jupyter Kernel
Commits
d8ee9d4e
Commit
d8ee9d4e
authored
Jul 14, 2023
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Disable VisB headers
parent
1294f9c6
No related branches found
No related tags found
No related merge requests found
Pipeline
#117272
passed
Jul 14, 2023
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
notebooks/tests/VisB_Test.ipynb
+3
-23
3 additions, 23 deletions
notebooks/tests/VisB_Test.ipynb
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+1
-1
1 addition, 1 deletion
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
with
4 additions
and
24 deletions
notebooks/tests/VisB_Test.ipynb
+
3
−
23
View file @
d8ee9d4e
...
...
@@ -229,7 +229,6 @@
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" highlightRow(stepNr);
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" visualise0(1);
\n
"
,
...
...
@@ -254,13 +253,10 @@
" </script>
\n
"
,
" </head>
\n
"
,
"<body>
\n
"
,
" <button type=
\"
button
\"
class=
\"
collapsible collapsible-style
\"
>SVG Visualisation</button>
\n
"
,
" <div text-align=
\"
left
\"
>
\n
"
,
"
\n
"
,
"
\n
"
,
"<svg xmlns=
\"
http://www.w3.org/2000/svg
\"\n
"
,
" width=
\"
240
\"
height=
\"
200
\"
viewBox=
\"
0 0 240 200
\"
>
\n
"
,
"Detected VISB_SVG_CONTENTS (requires_nothing)
\n
"
,
"
\n
"
,
" <defs>
\n
"
,
" <marker id=
\"
arrowhead
\"
markerWidth=
\"
10
\"
markerHeight=
\"
7
\"\n
"
,
...
...
@@ -472,7 +468,6 @@
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
180.0
\"
);
\n
"
,
" highlightRow(stepNr);
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" visualise1(1);
\n
"
,
...
...
@@ -497,13 +492,10 @@
" </script>
\n
"
,
" </head>
\n
"
,
"<body>
\n
"
,
" <button type=
\"
button
\"
class=
\"
collapsible collapsible-style
\"
>SVG Visualisation</button>
\n
"
,
" <div text-align=
\"
left
\"
>
\n
"
,
"
\n
"
,
"
\n
"
,
"<svg xmlns=
\"
http://www.w3.org/2000/svg
\"\n
"
,
" width=
\"
240
\"
height=
\"
200
\"
viewBox=
\"
0 0 240 200
\"
>
\n
"
,
"Detected VISB_SVG_CONTENTS (requires_nothing)
\n
"
,
"
\n
"
,
" <defs>
\n
"
,
" <marker id=
\"
arrowhead
\"
markerWidth=
\"
10
\"
markerHeight=
\"
7
\"\n
"
,
...
...
@@ -715,7 +707,6 @@
" setAttr(
\"
arrow
\"
,
\"
visible
\"
,
\"
TRUE
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
x2
\"
,
\"
100.0
\"
);
\n
"
,
" setAttr(
\"
arrow
\"
,
\"
y2
\"
,
\"
20.0
\"
);
\n
"
,
" highlightRow(stepNr);
\n
"
,
" }
\n
"
,
" async function runAll(delay) {\n"
,
" visualise0(1);
\n
"
,
...
...
@@ -740,13 +731,10 @@
" </script>
\n
"
,
" </head>
\n
"
,
"<body>
\n
"
,
" <button type=
\"
button
\"
class=
\"
collapsible collapsible-style
\"
>SVG Visualisation</button>
\n
"
,
" <div text-align=
\"
left
\"
>
\n
"
,
"
\n
"
,
"
\n
"
,
"<svg xmlns=
\"
http://www.w3.org/2000/svg
\"\n
"
,
" width=
\"
240
\"
height=
\"
200
\"
viewBox=
\"
0 0 240 200
\"
>
\n
"
,
"Detected VISB_SVG_CONTENTS (requires_nothing)
\n
"
,
"
\n
"
,
" <defs>
\n
"
,
" <marker id=
\"
arrowhead
\"
markerWidth=
\"
10
\"
markerHeight=
\"
7
\"\n
"
,
...
...
@@ -797,14 +785,6 @@
"source"
:
[
":show"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
null
,
"id"
:
"8e25955c"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[]
}
],
"metadata"
:
{
...
...
%% Cell type:markdown id:c91030ef tags:
# Test VisB Rendering
%% Cell type:code id:30b8bf50 tags:
```
prob
::load
MACHINE button_def
// An example that uses VisB DEFINITIONS instead of a JSON and SVG file
DEFINITIONS
VISB_JSON_FILE == ""; // "button.svg";
VISB_SVG_BOX == rec(height:200, width:240);
VISB_SVG_CONTENTS == '''
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" />
</marker>
</marker>
</defs>
''';
VISB_SVG_OBJECTS == rec(`id`:"button", svg_class:"circle",
cx:"100",cy:"100", r:"80",
stroke:"black", `stroke-width`:"2");
VISB_SVG_UPDATES == rec(`id`:"button",
fill: IF button=TRUE THEN "green" ELSE "red" END);
VISB_SVG_HOVERS == rec(`id`:"button",
stroke:"gray", `stroke-width`:"5");
VISB_SVG_OBJECTS_ARROW == rec( svg_class:"line",
`id`: "arrow",
stroke:"gray",
`stroke-width`:2.0,
x1:100, y1:100,
`marker-end`: "url(#arrowhead)");
VISB_SVG_UPDATES2 == rec(`id`:"arrow",
visible:"TRUE",
y2:IF button=TRUE THEN 180.0 ELSE 20.0 END,
x2:100.0);
VARIABLES button
INVARIANT button:BOOL
INITIALISATION button := FALSE
OPERATIONS
toggle_button /* desc change status of button */ = BEGIN
button:= bool(button=FALSE)
END
END
```
%% Output
Loaded machine: button_def
%% Cell type:code id:91082d92 tags:
```
prob
:init
```
%% Output
Executed operation: INITIALISATION()
%% Cell type:code id:7eee20b7 tags:
```
prob
:show
```
%% Output
<VisB visualization>
%% Cell type:code id:0e4f3287 tags:
```
prob
:exec toggle_button
```
%% Output
Executed operation: toggle_button()
%% Cell type:code id:1d766206 tags:
```
prob
:show
```
%% Output
<VisB visualization>
%% Cell type:code id:a921eeea tags:
```
prob
:exec toggle_button
```
%% Output
Executed operation: toggle_button()
%% Cell type:code id:15eedcc6 tags:
```
prob
:show
```
%% Output
<VisB visualization>
%% Cell type:code id:8e25955c tags:
```
prob
```
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+
1
−
1
View file @
d8ee9d4e
...
...
@@ -165,7 +165,7 @@ public final class ShowCommand implements Command {
return
null
;
}
GetVisBHtmlForStates
htmlCmd
=
new
GetVisBHtmlForStates
(
state
,
VisBExportOptions
.
DEFAULT
.
withShowVersionInfo
(
false
));
GetVisBHtmlForStates
htmlCmd
=
new
GetVisBHtmlForStates
(
state
,
VisBExportOptions
.
DEFAULT
.
withShowHeader
(
false
).
withShowVersionInfo
(
false
));
state
.
getStateSpace
().
execute
(
htmlCmd
);
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