Skip to content

Commit 679a350

Browse files
Merge branch 'main' of https://github.com/KIT-ISAS/web-app
2 parents 22c815e + bc8b121 commit 679a350

File tree

130 files changed

+9258
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+9258
-779
lines changed

.github/workflows/test_only.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name : Tests
2+
on:
3+
push:
4+
branches:
5+
- vlad/devel
6+
- main
7+
- staging
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
- name: Build Docker Image
14+
run: docker compose --profile test build tests
15+
- name: Run Tests
16+
run: docker compose --profile test run --rm tests

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,7 @@ cython_debug/
160160
#.idea/
161161

162162
#.kate-swp
163+
164+
.vscode/
165+
time_taken_for_various*
166+

app.py

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,49 @@
44
import dash_bootstrap_components as dbc
55

66
# Usage Locally:
7-
# $ python app.py
7+
# $ poetry run python app.py
88

99
# select theme
1010
# https://dash-bootstrap-components.opensource.faculty.ai/docs/themes/
1111
external_stylesheets = [dbc.themes.CERULEAN] # CERULEAN, DARKLY, PULSE
1212

1313
server = flask.Flask(__name__)
1414

15-
app = Dash(__name__, external_stylesheets=external_stylesheets, server=server, use_pages=True) # , suppress_callback_exceptions=True
15+
app = Dash(
16+
__name__,
17+
external_stylesheets=external_stylesheets,
18+
server=server,
19+
use_pages=True,
20+
serve_locally=True,
21+
suppress_callback_exceptions=True # this is needed because renderer generate callbacks dynamically with per instance uuids
22+
)
1623

1724
app.layout = dbc.Container([
18-
html.H1('ISAS Interactive'),
19-
dbc.Nav([
20-
dbc.NavLink(html.Div(f"{page['name'].lower()}"), href=page["relative_path"], active="exact")
21-
for page in dash.page_registry.values()
22-
], pills=True, className='bg-light'),
23-
html.P(),
24-
dash.page_container
25-
], fluid=True)
25+
html.H1('ISAS Interactive',
26+
style={
27+
"caretColor": "transparent",
28+
"userSelect": "none"
29+
}
30+
),
31+
dbc.Nav([
32+
dbc.NavLink(
33+
html.Div(
34+
f"{page['name'].lower()}"),
35+
href=page["relative_path"],
36+
active="exact",
37+
className='rounded-3'
38+
)
39+
for page in dash.page_registry.values()
40+
], pills=True, className='bg-light rounded-3'),
41+
html.P(),
42+
html.Div(dash.page_container, className="flex-grow-1 d-flex flex-column", id="outer-page-container", style={'minHeight': '0'})
43+
],
44+
fluid=True,
45+
className="vh-100 d-flex flex-column"
46+
)
2647

2748
if __name__ == '__main__':
28-
# processes=6, threaded=False,
29-
app.run(debug=True, threaded=True, host='0.0.0.0', port='8080')
30-
# app.run(debug=True, processes=6, threaded=False, host='0.0.0.0', port='8080')
31-
# app.run(debug=True)
49+
# processes=6, threaded=False,
50+
app.run(debug=True, threaded=True, host='0.0.0.0', port='8080')
51+
# app.run(debug=True, processes=6, threaded=False, host='0.0.0.0', port='8080')
52+
# app.run(debug=True)

assets/blockquote.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Danger / error-style blockquote inside dcc.Markdown */
2+
blockquote {
3+
border-left: 4px solid #e53935;
4+
background-color: #ffebee;
5+
padding: 1rem 1.25rem 1rem 2.7rem;
6+
margin: 1rem 0;
7+
color: #b71c1c;
8+
border-radius: 6px;
9+
position: relative;
10+
}
11+
12+
/* Warning icon */
13+
blockquote::before {
14+
content: "⚠";
15+
position: absolute;
16+
left: 0.9rem;
17+
top: 0.9rem;
18+
font-size: 1.1rem;
19+
}
20+
21+
blockquote p {
22+
margin: 0;
23+
}

assets/dpr.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
window.dash_clientside = Object.assign({}, window.dash_clientside, {
2+
utils: {
3+
getDevicePixelRatio: function(_) {
4+
return window.devicePixelRatio || 1;
5+
}
6+
}
7+
});

assets/favicon.ico

5.3 KB
Binary file not shown.

assets/full_page.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Dash puts pages inside 2 divs that are not styleable otherwise */
2+
#outer-page-container > * { /* this is the empty div dash puts pages inside */
3+
flex-grow: 1;
4+
display: flex;
5+
flex-direction: column;
6+
min-height: 0;
7+
}
8+
#_pages_content {
9+
flex-grow: 1;
10+
display: flex;
11+
flex-direction: column;
12+
min-height: 0;
13+
}
14+
15+
16+
#panelgroup-parent-container {
17+
min-height: 0;
18+
}
19+
20+
.split-pane-group {
21+
height: 100%;
22+
}
23+
24+
@media (min-width: 768px) {
25+
.split-pane-handle {
26+
cursor: col-resize;
27+
}
28+
}
29+
30+
/* < md: "mobile" layout */
31+
@media (max-width: 767.98px) {
32+
.split-pane-group {
33+
flex-direction: column !important;
34+
}
35+
36+
37+
.split-pane-left .bg-light {
38+
max-height: 40vh;
39+
overflow-y: auto;
40+
}
41+
42+
.split-pane-handle {
43+
display: none !important; /* no resize on mobile */
44+
}
45+
}

assets/tooltip.js

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
window.dccFunctions = window.dccFunctions || {};
22
window.dccFunctions.trafo_L = function(value) {
3-
if (value < Math.log10(1.25)) {
4-
return 0;
5-
} else {
6-
return Math.round(Math.pow(10, value));
7-
}
3+
if (value < Math.log10(1.25)) {
4+
return 0;
5+
} else {
6+
return Math.round(Math.pow(10, value));
7+
}
8+
}
9+
window.dccFunctions.transform_log_nice = function(value) {
10+
let x = Math.pow(10, value);
11+
// same as transform_up in log_slider.py
12+
if (x == 0){
13+
return 0;
14+
}
15+
const sign = Math.sign(x);
16+
x = Math.abs(x);
17+
18+
let step = Math.pow(10, Math.floor(Math.log10(x))) / 10;
19+
let nice_value = sign * Math.round(x / step) * step;
20+
nice_value = Number(nice_value.toFixed(4));
21+
return nice_value;
22+
}
23+
24+
window.dccFunctions.transform_fib = function(value) {
25+
function fibonacci(n) {
26+
return n < 1 ? 0
27+
: n <= 2 ? 1
28+
: fibonacci(n - 1) + fibonacci(n - 2)
29+
}
30+
return fibonacci(value);
31+
}
32+
33+
window.dccFunctions.transform_fib_m1 = function(value) {
34+
function fibonacci(n) {
35+
return n < 1 ? 0
36+
: n <= 2 ? 1
37+
: fibonacci(n - 1) + fibonacci(n - 2)
38+
}
39+
return fibonacci(value) - 1;
40+
}
41+
42+
window.dccFunctions.transform_square = function(value) {
43+
return value * value;
844
}

components/__init__.py

Whitespace-only changes.

components/label.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from dash import html
2+
3+
# wrapps component in a label
4+
def Label(label, component):
5+
return html.Div([
6+
html.Label(label),
7+
component,
8+
])

0 commit comments

Comments
 (0)