Skip to content

Commit 827b3bc

Browse files
committed
fix gaps in app
- increase margins on all cards - no gaps in layouts - fix negative/positive margin/padding to show shadows but don't introduce scrollbars
1 parent 0b1adbb commit 827b3bc

File tree

4 files changed

+35
-14
lines changed

4 files changed

+35
-14
lines changed

NetworkDynamicsInspector/assets/app.css

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
html, body {
1+
html {
2+
margin:0px;
3+
padding:0px;
4+
height: 100%;
5+
width:100%;
6+
}
7+
body {
28
font-family: sans-serif;
39
font-size: 12px;
410
height: 100%;
5-
/* width: 100%; */
11+
margin:0px;
12+
padding:5px;
13+
box-sizing: border-box;
614
}
715

816
.select2-container .select2-selection .select2-selection__rendered,
@@ -21,18 +29,31 @@ html, body {
2129
display: grid;
2230
grid-template-columns: min-content auto;
2331
width: 100%;
24-
gap: 5px;
32+
gap: 0px;
33+
}
34+
35+
/* to keep shadows visible at overflow hidden*/
36+
/* https://stackoverflow.com/questions/70802682/parents-overflowhidden-doesnt-show-childs-box-shadow */
37+
/* to the sides we only go +- 5 px (padding of body)*/
38+
.graphplot-col{
39+
overflow: hidden; /* otherwise axis won't shrink */
40+
margin:-10px -10px -10px -5px; /* t r b l */
41+
padding:10px 10px 10px 5px;
42+
}
43+
.timeseries-col{
44+
overflow: hidden; /* otherwise axis won't shrink */
45+
margin:-10px -5px -10px -10px; /* t r b l */
46+
padding:10px 5px 10px 10px;
2547
}
2648

2749
.graphplot-col, .timeseries-col, .timeseries-stack{
2850
display: flex;
2951
flex-direction: column;
30-
gap: 5px;
31-
/* to keep shadows visible */
32-
/* https://stackoverflow.com/questions/70802682/parents-overflowhidden-doesnt-show-childs-box-shadow */
33-
overflow: hidden; /* otherwise it won't shrink */
34-
margin:-10px;
35-
padding:10px
52+
gap: 0px;
53+
}
54+
55+
.bonito-card {
56+
margin: 5px !important;
3657
}
3758

3859
.graphplot-card {

NetworkDynamicsInspector/src/NetworkDynamicsInspector.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function timeslider_card(app)
440440
justify_content="begin",
441441
align_items="center",
442442
);
443-
class="timeslider-card"
443+
class="bonito-card timeslider-card"
444444
);
445445
end
446446

@@ -478,7 +478,7 @@ function element_info_card(app, session)
478478

479479
Card(
480480
DOM.div(;id="element-info-box");
481-
class="element-info-card resize-with-gp"
481+
class="bonito-card element-info-card resize-with-gp"
482482
)
483483
end
484484

NetworkDynamicsInspector/src/graphplot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function graphplot_card(app, session)
212212
register_interaction!(ax, :edgeclick, ech)
213213
register_interaction!(ax, :edgehover, ehh)
214214

215-
Card(fig; class="graphplot-card")
215+
Card(fig; class="bonito-card graphplot-card")
216216
end
217217
function _gracefully_extract_states!(vec, sol, t, idxs, rel)
218218
isvalid(s) = SII.is_variable(sol, s) || SII.is_parameter(sol, s) || SII.is_observed(sol, s)
@@ -272,7 +272,7 @@ function gpstate_control_card(app, type)
272272
colorrange = type == :vertex ? app.graphplot.ncolorrange : app.graphplot.ecolorrange
273273
colorscheme = type == :vertex ? app.graphplot.ncolorscheme : app.graphplot.ecolorscheme
274274
class = type == :vertex ? "gpstate-control-card vertex" : "gpstate-control-card edge"
275-
class *= " resize-with-gp"
275+
class *= " resize-with-gp bonito-card"
276276

277277
####
278278
#### State selection

NetworkDynamicsInspector/src/timeseries.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function timeseries_card(app, key, session)
322322
end
323323
register_interaction!(set_time_interaction, ax, :set_time)
324324

325-
cardclass = "timeseries-card"
325+
cardclass = "bonito-card timeseries-card"
326326
if key == app.active_tsplot[]
327327
cardclass *= " active-tseries"
328328
end

0 commit comments

Comments
 (0)