Skip to content

Commit de2b4c4

Browse files
authored
Merge pull request #212 from JuliaDynamics/hw/inspector
improve NetworkDynamicsInspector
2 parents 2a301aa + fac579a commit de2b4c4

23 files changed

+1606
-672
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ jobs:
3737
- name: "Run CompatHelper"
3838
run: |
3939
import CompatHelper
40-
CompatHelper.main(; subdirs=["", "docs", "test", "benchmark", "NetworkDynamicsInspector"])
40+
CompatHelper.main(; subdirs=[
41+
"",
42+
"docs",
43+
"test",
44+
"benchmark",
45+
"NetworkDynamicsInspector",
46+
"NetworkDynamicsInspector/test",
47+
])
4148
shell: julia --color=yes {0}
4249
env:
4350
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Documentation.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
contents: write
2020
statuses: write
2121
steps:
22+
- name: Install xvfb
23+
run: |
24+
sudo apt update
25+
sudo apt install -y xvfb mesa-utils mesa-vulkan-drivers dbus x11-xserver-utils
2226
- uses: actions/checkout@v4
2327
- uses: julia-actions/setup-julia@v2
2428
with:
@@ -31,10 +35,26 @@ jobs:
3135
Pkg.develop(PackageSpec(path=pwd()))
3236
Pkg.instantiate()
3337
- uses: julia-actions/julia-buildpkg@v1
34-
- uses: julia-actions/julia-docdeploy@v1
38+
# - uses: julia-actions/julia-docdeploy@v1
39+
# env:
40+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
42+
# LIBGL_ALWAYS_SOFTWARE: "1"
43+
# MESA_GL_VERSION_OVERRIDE: "4.5"
44+
# MESA_GLSL_VERSION_OVERRIDE: "450"
45+
# with:
46+
# prefix: xvfb-run
47+
- name: Build docs
3548
env:
3649
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3750
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
51+
LIBGL_ALWAYS_SOFTWARE: "1"
52+
MESA_GL_VERSION_OVERRIDE: "4.5"
53+
MESA_GLSL_VERSION_OVERRIDE: "450"
54+
shell: xvfb-run -a julia --project=docs --color=yes {0}
55+
run: |
56+
using NetworkDynamics
57+
include(pkgdir(NetworkDynamics)*"/docs/make.jl")
3858
- name: Run doctests
3959
shell: julia --project=docs --color=yes {0}
4060
run: |

.github/workflows/tests.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,25 @@ jobs:
4848
Inspector-tests:
4949
name: NetworkDynamicsInspector.jl Tests
5050
runs-on: ubuntu-latest
51+
env:
52+
DISPLAY: ":99"
53+
LIBGL_ALWAYS_SOFTWARE: "1"
54+
MESA_GL_VERSION_OVERRIDE: "4.5"
55+
MESA_GLSL_VERSION_OVERRIDE: "450"
5156
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
5257
actions: write
5358
contents: read
5459
steps:
60+
- name: Install Dependencies
61+
run: |
62+
sudo apt update
63+
sudo apt install -y xvfb mesa-utils mesa-vulkan-drivers dbus
64+
- name: Start Virtual Display
65+
run: |
66+
Xvfb :99 -screen 0 1920x1080x24 &
67+
eval $(dbus-launch)
68+
export DBUS_SESSION_BUS_ADDRESS
69+
export DBUS_SESSION_BUS_PID
5570
- uses: actions/checkout@v4
5671
- uses: julia-actions/setup-julia@v2
5772
with:
@@ -60,9 +75,11 @@ jobs:
6075
- uses: julia-actions/julia-buildpkg@v1
6176
with:
6277
project: NetworkDynamicsInspector
63-
- uses: julia-actions/julia-runtest@v1
78+
- name: Run headless test
79+
uses: GabrielBB/xvfb-action@v1
6480
with:
65-
project: NetworkDynamicsInspector
81+
run: |
82+
julia --project=NetworkDynamicsInspector --color=yes -e "using Pkg; Pkg.test(coverage=false)"
6683
# - uses: julia-actions/julia-processcoverage@v1
6784
# - uses: codecov/codecov-action@v4
6885
# with:

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ benchmark/*.txt
1717
/docs/src/assets/.auctex-auto/
1818

1919
# ignore downloadable assets
20-
/NetworkDynamicsInspector/assets/jquery.js
21-
/NetworkDynamicsInspector/assets/select2.css
22-
/NetworkDynamicsInspector/assets/select2.js
20+
/NetworkDynamicsInspector/assets/tomselect.css
21+
/NetworkDynamicsInspector/assets/tomselect.js
22+
/NetworkDynamicsInspector/assets/tomselect.bundled.js

NetworkDynamicsInspector/Project.toml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name = "NetworkDynamicsInspector"
22
uuid = "0a4713f2-d58f-43f2-b63b-1b5d5ee4e65a"
33
authors = ["Hans Würfel <git@wuerfel.io>"]
4-
version = "0.1.2"
4+
version = "0.1.3"
55

66
[deps]
77
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
88
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
99
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
10+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1011
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
1112
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1213
NetworkDynamics = "22e9dc34-2a0d-11e9-0de0-8588d035468b"
@@ -15,29 +16,26 @@ OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
1516
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1617
WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
1718

19+
[weakdeps]
20+
Electron = "a1bb12fb-d4d1-54b4-b10a-ee7951ef7ad3"
21+
1822
[sources]
1923
NetworkDynamics = {path = ".."}
2024

25+
[extensions]
26+
ElectronExt = ["Electron"]
27+
2128
[compat]
22-
Aqua = "0.8.9"
2329
Bonito = "4.0.0"
2430
ColorSchemes = "3.29.0"
2531
Colors = "0.13.0"
26-
ExplicitImports = "1.10.1"
32+
Downloads = "1.6.0"
33+
Electron = "6"
2734
GraphMakie = "0.5.14"
2835
Graphs = "1.12.0"
2936
NetworkDynamics = "0.9.13"
3037
Observables = "0.5.5"
3138
OrderedCollections = "1.8.0"
3239
SciMLBase = "2.75.1"
3340
WGLMakie = "0.11"
34-
Test = "1"
3541
julia = "1.10"
36-
37-
[extras]
38-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
39-
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
40-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
41-
42-
[targets]
43-
test = ["Aqua", "ExplicitImports", "Test"]

NetworkDynamicsInspector/assets/app.css

Lines changed: 153 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,58 @@
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

8-
.select2-container .select2-selection .select2-selection__rendered,
9-
.select2-container .select2-selection--single .select2-selection__rendered,
10-
.select2-container .select2-results__option{
11-
font-family: monospace;
12-
/* font-size: 20px; */
13-
}
14-
.select2-results__group {
15-
font-family: sans-serif;
16-
/* font-size: 12px; */
17-
/* color: blue; */
16+
span {
17+
font-size: 12px;
1818
}
1919

2020
.maingrid {
2121
display: grid;
2222
grid-template-columns: min-content auto;
2323
width: 100%;
24-
gap: 5px;
24+
gap: 0px;
25+
}
26+
27+
/* to keep shadows visible at overflow hidden*/
28+
/* https://stackoverflow.com/questions/70802682/parents-overflowhidden-doesnt-show-childs-box-shadow */
29+
/* to the sides we only go +- 5 px (padding of body)*/
30+
.graphplot-col{
31+
/* overflow: hidden; /\* otherwise axis won't shrink *\/ */
32+
margin:-10px -10px -10px -5px; /* t r b l */
33+
padding:10px 10px 10px 5px;
34+
}
35+
.timeseries-col{
36+
overflow: hidden; /* otherwise axis won't shrink */
37+
margin:-10px -5px -10px -10px; /* t r b l */
38+
padding:10px 5px 10px 10px;
2539
}
2640

2741
.graphplot-col, .timeseries-col, .timeseries-stack{
2842
display: flex;
2943
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
44+
gap: 0px;
45+
}
46+
47+
.bonito-card {
48+
margin: 5px !important;
49+
position:relative;
3650
}
3751

3852
.graphplot-card {
39-
height:400px; /* initial widht and height */
40-
width: 400px;
41-
min-width:250px;
53+
height:350px; /* initial widht and height */
54+
width: 350px;
55+
min-width:200px;
4256
resize: both;
4357
overflow: hidden;
4458
}
@@ -53,7 +67,7 @@ html, body {
5367
.timeseries-card {
5468
resize: vertical;
5569
overflow: hidden;
56-
/* grid-column: 2; */
70+
position: relative; /* for close button */
5771
}
5872
.timeseries-card.active-tseries {
5973
box-shadow: 0 4px 8px rgba(0.0, 0.0, 51.0, 0.65);
@@ -71,6 +85,25 @@ html, body {
7185
flex-grow: 1;
7286
overflow:hidden;
7387
}
88+
button.close-button {
89+
position: absolute;
90+
top: 0;
91+
right: 0;
92+
width: 20px;
93+
height: 20px;
94+
min-width: 0;
95+
min-height: 0;
96+
border-width: 0;
97+
box-shadow: none;
98+
background-color: transparent;
99+
padding: 0;
100+
margin: 0;
101+
}
102+
button.close-button:hover{
103+
box-shadow: none;
104+
background-color: transparent;
105+
text-shadow: 0 0 1px #000;
106+
}
74107

75108
.tooltip {
76109
position: absolute;
@@ -110,3 +143,100 @@ button{
110143
font-weight: normal !important;
111144
font-family: sans-serif !important;;
112145
}
146+
147+
148+
/* Style for TomSelect elements */
149+
.ts-dropdown .optgroup-header{
150+
font-weight: bolder;
151+
}
152+
.ts-dropdown .option{
153+
font-family: monospace !important;
154+
}
155+
.ts-dropdown .option.selected{
156+
background-color: #dddd;
157+
}
158+
.ts-control .item {
159+
font-family: monospace;
160+
}
161+
162+
.ts-control .item::before {
163+
display: inline-block;
164+
margin-right: 6px;
165+
}
166+
167+
.ts-control {
168+
padding: 5px !important;
169+
padding-bottom: 3px !important;
170+
}
171+
172+
173+
.help-icon {
174+
position: absolute;
175+
/* text-shadow: 0 0 1px #999999; */
176+
color: #999999;
177+
top: 0px;
178+
left: 0px;
179+
width: 20px;
180+
height: 20px;
181+
min-width: 0;
182+
min-height: 0;
183+
border-width: 0;
184+
box-shadow: none;
185+
/* background-color: #333; */
186+
padding: 0;
187+
margin: 0;
188+
text-align: center;
189+
font-size: 10px;
190+
cursor: pointer;
191+
display: flex; /* Use flexbox for centering */
192+
align-items: center; /* Vertically center */
193+
justify-content: center; /* Horizontally center */
194+
}
195+
196+
.timeseries-card .help-icon {
197+
display:none;
198+
}
199+
.timeseries-card.active-tseries .help-icon {
200+
display:flex;
201+
}
202+
203+
.tooltip.help-text {
204+
position: absolute;
205+
top: 5px; /* Adjust based on the size of the icon */
206+
left: 5px;
207+
width: 200px; /* Adjust as needed */
208+
white-space: normal; /* Allow text to wrap */
209+
word-wrap: break-word; /* Break long words if necessary */
210+
}
211+
212+
.tooltip {
213+
display: none; /* Initially hidden */
214+
position: absolute;
215+
background-color: rgba(51, 51, 51, 0.99); /* Slightly transparent */
216+
color: white;
217+
padding: 5px 5px;
218+
border-radius: 5px;
219+
font-size: 12px;
220+
white-space: normal; /* Allow text to wrap */
221+
z-index: 1000; /* Ensure it's above other elements */
222+
}
223+
224+
.tooltip ul {
225+
margin: 0; /* Remove extra padding for list items */
226+
padding-left: 10px; /* Adjust as needed for bullet alignment */
227+
}
228+
229+
.tooltip li {
230+
padding-left: 0; /* Remove extra padding for list items */
231+
}
232+
233+
.tooltip.gp-tooltip {
234+
font-family: monospace;
235+
pointer-events: none;
236+
transform: translate(12px, 12px); /* Offset from cursor */
237+
white-space: normal; /* Allow text to wrap */
238+
}
239+
240+
.help-icon:hover + .help-text {
241+
display: block; /* Show on hover */
242+
}

0 commit comments

Comments
 (0)