Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DSI Parser Frontend
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DigitalDynamicMeasurement
DSI Parser Frontend
Commits
3b81e1d9
Commit
3b81e1d9
authored
1 year ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
changed arrow possition
parent
e154d6e7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dockerfile
+1
-0
1 addition, 0 deletions
dockerfile
main.py
+8
-5
8 additions, 5 deletions
main.py
with
9 additions
and
5 deletions
dockerfile
+
1
−
0
View file @
3b81e1d9
...
...
@@ -20,3 +20,4 @@ RUN pip install --no-cache-dir -r dsi-parser-frontend/requirements.txt
EXPOSE
5020
CMD
["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"]
This diff is collapsed.
Click to expand it.
main.py
+
8
−
5
View file @
3b81e1d9
...
...
@@ -39,6 +39,9 @@ issueTemplate="""There was an issue with the following unit conversion:
If there was an error with the calculation, please fill out the table above. Feel free to also add additional info here:
*Free text comment*
"""
labelOffsetX
=
[
0.0
,
0.0
,
-
0.02
,
0.07
,
0.02
,
-
0.07
]
labelOffsetY
=
[
-
0.02
,
0.09
,
0
,
0.07
,
0
,
0.07
]
class
dsiparserInput
():
def
__init__
(
self
,
defaultInput
=
""
,
additionalComparisonCallbacks
=
[]):
...
...
@@ -94,7 +97,7 @@ class dsiparserInput():
p
.
grid
.
visible
=
False
p
.
add_layout
(
Label
(
x
=
0.5
,
y
=
0.5
,
text
=
resultTree
.
toLatex
(),
text_font_size
=
"
12
px
"
,
text_baseline
=
"
middle
"
,
text_align
=
"
center
"
,
x
=
0.5
,
y
=
0.5
,
text
=
resultTree
.
toLatex
(),
text_font_size
=
"
30
px
"
,
text_baseline
=
"
middle
"
,
text_align
=
"
center
"
,
))
imageOutput
=
row
(
children
=
[
...
...
@@ -130,7 +133,7 @@ class dsiCompGraphGen:
def
__init__
(
self
,
treeA
=
None
,
treeB
=
None
):
self
.
treeA
=
treeA
self
.
treeB
=
treeB
self
.
plot
=
figure
(
width
=
5
0
0
,
height
=
500
,
x_range
=
(
-
1
,
1
),
y_range
=
(
0
,
1
),
tools
=
"
save
"
)
self
.
plot
=
figure
(
width
=
5
5
0
,
height
=
500
,
x_range
=
(
-
1
,
1
),
y_range
=
(
0
,
1
),
tools
=
"
save
"
)
self
.
plot
.
xaxis
.
visible
=
False
self
.
plot
.
yaxis
.
visible
=
False
self
.
plot
.
grid
.
visible
=
False
...
...
@@ -158,7 +161,7 @@ class dsiCompGraphGen:
tree
=
unitToDraw
[
'
baseUnit
'
]
name
=
unitToDraw
[
'
name
'
]
if
not
name
in
self
.
unitLabels
:
self
.
unitLabels
[
name
]
=
Label
(
x
=
x
,
y
=
y
,
text
=
tree
.
toLatex
(),
text_font_size
=
"
1
2px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],)
self
.
unitLabels
[
name
]
=
Label
(
x
=
x
,
y
=
y
,
text
=
tree
.
toLatex
(),
text_font_size
=
"
2
4
px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],)
self
.
plot
.
add_layout
(
self
.
unitLabels
[
name
])
else
:
self
.
unitLabels
[
name
].
text
=
tree
.
toLatex
()
...
...
@@ -181,7 +184,7 @@ class dsiCompGraphGen:
angle_deg
=
-
1
*
np
.
arctan2
(
y2
-
y1
,
x2
-
x1
)
if
abs
(
angle_deg
)
>
np
.
pi
/
8
:
angle_deg
+=-
np
.
pi
/
2
self
.
scalFactorLables
[
name1
+
'
_
'
+
name2
]
=
Label
(
x
=
np
.
abs
(
x1
-
x2
)
/
2
+
np
.
min
([
x1
,
x2
]),
y
=
np
.
abs
(
y1
-
y2
)
/
2
+
np
.
min
([
y1
,
y2
]),
text
=
"
{:.4g}
"
.
format
(
scale12
),
text_font_size
=
"
1
2px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],
text_color
=
colors
[
colIDX
],
angle
=
angle_deg
)
self
.
scalFactorLables
[
name1
+
'
_
'
+
name2
]
=
Label
(
x
=
np
.
abs
(
x1
-
x2
)
/
2
+
np
.
min
([
x1
,
x2
])
+
labelOffsetX
[
colIDX
]
,
y
=
np
.
abs
(
y1
-
y2
)
/
2
+
np
.
min
([
y1
,
y2
])
+
labelOffsetY
[
colIDX
]
,
text
=
"
{:.4g}
"
.
format
(
scale12
),
text_font_size
=
"
2
4
px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],
text_color
=
colors
[
colIDX
],
angle
=
angle_deg
)
self
.
plot
.
add_layout
(
self
.
scalFactorLables
[
name1
+
'
_
'
+
name2
])
else
:
self
.
scalFactorLables
[
name1
+
'
_
'
+
name2
].
text
=
"
{:.4g}
"
.
format
(
scale12
)
...
...
@@ -196,7 +199,7 @@ class dsiCompGraphGen:
angle_deg
=
-
1
*
np
.
arctan2
(
y2
-
y1
,
x2
-
x1
)
if
abs
(
angle_deg
)
>
np
.
pi
/
8
:
angle_deg
+=-
np
.
pi
/
2
self
.
scalFactorLables
[
name2
+
'
_
'
+
name1
]
=
Label
(
x
=
np
.
abs
(
x1
-
x2
)
/
2
+
np
.
min
([
x1
,
x2
])
+
0.05
,
y
=
np
.
abs
(
y1
-
y2
)
/
2
+
np
.
min
([
y1
,
y2
])
+
0.05
,
text
=
"
{:.4g}
"
.
format
(
scale21
),
text_font_size
=
"
1
2px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],
text_color
=
colors
[
colIDX
+
1
],
angle
=
angle_deg
)
self
.
scalFactorLables
[
name2
+
'
_
'
+
name1
]
=
Label
(
x
=
np
.
abs
(
x1
-
x2
)
/
2
+
np
.
min
([
x1
,
x2
])
+
labelOffsetX
[
colIDX
+
1
]
,
y
=
np
.
abs
(
y1
-
y2
)
/
2
+
np
.
min
([
y1
,
y2
])
+
labelOffsetY
[
colIDX
+
1
]
,
text
=
"
{:.4g}
"
.
format
(
scale21
),
text_font_size
=
"
2
4
px
"
,
text_baseline
=
unitToDraw
[
'
text_baseLine
'
],
text_align
=
unitToDraw
[
'
text_align
'
],
text_color
=
colors
[
colIDX
+
1
],
angle
=
angle_deg
)
self
.
plot
.
add_layout
(
self
.
scalFactorLables
[
name2
+
'
_
'
+
name1
])
else
:
self
.
scalFactorLables
[
name2
+
'
_
'
+
name1
].
text
=
"
{:.4g}
"
.
format
(
scale21
)
...
...
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