Skip to content

Commit

Permalink
Updated PR (#11)
Browse files Browse the repository at this point in the history
* -Added a Makie GUI
-test3.jl to run the gui
-added GLMakie to the project's dependencies

* -Added a Makie GUI
-test3.jl to run the gui
-added GLMakie to the project's dependencies

* Added MINDFulMakie Plots
Added Fullscreen Button, refining still WIP

* Added Fullscreen support
More features still WIP, as well as a general rewrite of functions and control flow

* Updated .gitignore

* Delete .idea directory

* Delete .vscode directory

* Delete data directory

* Delete test.jl

* Delete test2.jl

* Delete test3.jl

* Delete test/data directory

* Delete Manifest.toml

* Delete Project.toml

* Delete MINDFulMakieApp.iml

* modified:   .gitignore

* Added colors to the buttons

* Fixed Fullscreen

* Automatic .graphml file detection (Menu gets updated)
Automatic detection of the number of available IBN Indexes per .graphml (Menu gets updated)
Added struct with nested dicts for much used variables (WIP)
Code cleanup (WIP)

* updated README.md

* Update README.md
  • Loading branch information
Niels1006 authored Jul 26, 2023
1 parent e5810aa commit 5bc9a62
Show file tree
Hide file tree
Showing 9 changed files with 660 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
/Manifest.toml
/.idea
/.vscode
/data
/src/test.jl
/src/test2.jl
/src/test3.jl
/test/data
/test/Manifest.toml
/test/Project.toml
/MINDFulMakieApp.iml
80 changes: 76 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.9.2"
julia_version = "1.9.1"
manifest_format = "2.0"
project_hash = "c0b4dc5d9a2726fe1c32ec3f4b3cbd1ee29dd10d"
project_hash = "9d3e51c39ca6be55a2f9044488aec6cee51022ce"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -174,7 +174,7 @@ weakdeps = ["Dates", "LinearAlgebra"]
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.5+0"
version = "1.0.2+0"

[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -407,6 +407,24 @@ version = "1.0.10+0"
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[deps.GLFW]]
deps = ["GLFW_jll"]
git-tree-sha1 = "35dbc482f0967d8dceaa7ce007d16f9064072166"
uuid = "f7f18e0c-5ee9-5ccd-a5bf-e8befd85ed98"
version = "3.4.1"

[[deps.GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "d972031d28c8c8d9d7b41a536ad7bb0c2579caca"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.8+0"

[[deps.GLMakie]]
deps = ["ColorTypes", "Colors", "FileIO", "FixedPointNumbers", "FreeTypeAbstraction", "GLFW", "GeometryBasics", "LinearAlgebra", "Makie", "Markdown", "MeshIO", "ModernGL", "Observables", "PrecompileTools", "Printf", "ShaderAbstractions", "StaticArrays"]
git-tree-sha1 = "6e3ff93abf0f3ec09989359067a4575e72471981"
uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
version = "0.8.6"

[[deps.GPUArraysCore]]
deps = ["Adapt"]
git-tree-sha1 = "2d6ca471a6c7b536127afccfa7564b5b39227fe0"
Expand Down Expand Up @@ -717,6 +735,12 @@ git-tree-sha1 = "64613c82a59c120435c067c2b809fc61cf5166ae"
uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4"
version = "1.8.7+0"

[[deps.Libglvnd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"]
git-tree-sha1 = "6f73d1dd803986947b2c750138528a999a6c7733"
uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29"
version = "1.6.0+0"

[[deps.Libgpg_error_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c333716e46366857753e273ce6a69ee0945a6db9"
Expand Down Expand Up @@ -839,6 +863,12 @@ deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.2+0"

[[deps.MeshIO]]
deps = ["ColorTypes", "FileIO", "GeometryBasics", "Printf"]
git-tree-sha1 = "8be09d84a2d597c7c0c34d7d604c039c9763e48c"
uuid = "7269a6da-0436-5bbc-96c2-40638cbb6118"
version = "0.4.10"

[[deps.MetaGraphs]]
deps = ["Graphs", "JLD2", "Random"]
git-tree-sha1 = "1130dbe1d5276cb656f6e1094ce97466ed700e5a"
Expand Down Expand Up @@ -866,6 +896,12 @@ version = "1.1.0"
[[deps.Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[deps.ModernGL]]
deps = ["Libdl"]
git-tree-sha1 = "b76ea40b5c0f45790ae09492712dd326208c28b2"
uuid = "66fc600b-dfda-50eb-8b99-91cfa97b1301"
version = "1.1.7"

[[deps.MosaicViews]]
deps = ["MappedArrays", "OffsetArrays", "PaddedViews", "StackViews"]
git-tree-sha1 = "7b86a5d4d70a9f5cdf2dacb3cbe6d251d1a61dbe"
Expand Down Expand Up @@ -1041,7 +1077,7 @@ version = "0.42.2+0"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.9.2"
version = "1.9.0"

[[deps.PkgVersion]]
deps = ["Pkg"]
Expand Down Expand Up @@ -1198,6 +1234,12 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac"
uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46"
version = "1.1.1"

[[deps.ShaderAbstractions]]
deps = ["ColorTypes", "FixedPointNumbers", "GeometryBasics", "LinearAlgebra", "Observables", "StaticArrays", "StructArrays", "Tables"]
git-tree-sha1 = "0d15c3e7b2003f4451714f08ffec2b77badc2dc4"
uuid = "65257c39-d410-5151-9873-9b3e5be5013e"
version = "0.3.0"

[[deps.SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
Expand Down Expand Up @@ -1445,6 +1487,12 @@ git-tree-sha1 = "6035850dcc70518ca32f012e46015b9beeda49d8"
uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec"
version = "1.0.11+0"

[[deps.Xorg_libXcursor_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd"
uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724"
version = "1.2.0+4"

[[deps.Xorg_libXdmcp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "34d526d318358a859d7de23da945578e8e8727b7"
Expand All @@ -1457,6 +1505,30 @@ git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3"
uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3"
version = "1.3.4+4"

[[deps.Xorg_libXfixes_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4"
uuid = "d091e8ba-531a-589c-9de9-94069b037ed8"
version = "5.0.3+4"

[[deps.Xorg_libXi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"]
git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246"
uuid = "a51aa0fd-4e3c-5386-b890-e753decda492"
version = "1.7.10+4"

[[deps.Xorg_libXinerama_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"]
git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123"
uuid = "d1454406-59df-5ea1-beac-c340f2130bc3"
version = "1.1.4+4"

[[deps.Xorg_libXrandr_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631"
uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484"
version = "1.5.2+4"

[[deps.Xorg_libXrender_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96"
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.1.0"
AttributeGraphs = "d091dd56-f8c5-469d-b7f7-ff847498145f"
DiscreteEvents = "127e53a7-d08a-4bd9-afb0-daf0d2b65a85"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GraphIO = "aa1b3936-2fda-51b9-ab35-c553d3a640a2"
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Expand All @@ -22,9 +23,9 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
GraphMakie = "0.5.5"
MINDFul = "0.2"
NestedGraphMakie = "0.1"
GraphMakie = "0.5.5"
julia = "1.9"

[extras]
Expand Down
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# MINDFulGLMakieApp

[![Build Status](https://github.com/filchristou/MINDFulGLMakieApp.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/filchristou/MINDFulGLMakieApp.jl/actions/workflows/CI.yml?query=branch%3Amain)
# Graphical User Interface for [MINDFulMakie.jl](https://github.com/UniStuttgart-IKR/MINDFulMakie.jl)

This project aims to interactively visualize [MINDFulMakie.jl](https://github.com/UniStuttgart-IKR/MINDFulMakie.jl) graphs while being lightweight, trivial and flexible to use.

It is still in a very early state, so there is much more to come. This only shows a small set of current features.


## Features

- Visualize graphs from [simplenotebook](https://unistuttgart-ikr.github.io/MINDFulNotebookExamples.jl/simplenotebookexample.html).
- Add any compatible .graphml topologies, they get detected automatically!
- Choose between different IBNs, they get dynamically updated when switching topologies.
- You can zoom, stretch and move all graphs. Or even make it fullscreen.


## Screenshots

![App Screenshot](https://i.imgur.com/561Cu5J.png)
Draw graphs with topologies of your choice.

![App Screenshot](https://i.imgur.com/xU1wWht.png)
Compare the different parts of a graph to each other.

![App Screenshot](https://i.imgur.com/7oVSTz7.png)
Or make it fullscreen.


## Authors

- [@Niels1006](https://www.github.com/niels1006)


## Credits

- [MINDFul.jl](https://github.com/UniStuttgart-IKR/MINDFul.jl)
- [MINDFulMakie.jl](https://github.com/UniStuttgart-IKR/MINDFulMakie.jl)

12 changes: 12 additions & 0 deletions src/HelpFunctions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


function get_graph_names()
files = readdir("data/")
println("Available topologies: " * join(files, ", "))


files_wo_ending = [replace(files[i], ".graphml" => "") for i in 1:length(files)]
print(files_wo_ending)

return files_wo_ending
end
16 changes: 15 additions & 1 deletion src/MINDFulGLMakieApp.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#=
MINDFulGLMakieApp:
- Julia version: 1.9.1
- Author: Niels
- Date: 2023-07-8
=#


export MINDFulGLMakieApp

module MINDFulGLMakieApp
using GLMakie

include("MINDFulGraphs.jl")
include("functions.jl")
include("HelpFunctions.jl")

# Write your package code here.

end
141 changes: 141 additions & 0 deletions src/MINDFulGraphs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#=
MINDFulGraphs:
- Julia version: 1.9.1
- Author: Niels
- Date: 2023-07-11
=#

#module MINDFulGraphs

using MINDFul, GraphIO, NestedGraphsIO, NestedGraphs, Graphs, MetaGraphs

using MINDFulMakie, GLMakie, Unitful

function get_ibn_size(topology)
topology *= ".graphml"

MINDF = MINDFul
defaultlinecards() = [MINDF.LineCardDummy(10, 100, 26.72), MINDF.LineCardDummy(2, 400, 29.36), MINDF.LineCardDummy(1, 1000, 31.99)]

defaultlinecardchassis() = [MINDF.LineCardChassisDummy(Vector{MINDF.LineCardDummy}(), 4.7, 16)]

defaulttransmissionmodules() = [MINDF.TransmissionModuleView("DummyFlexibleTransponder",
MINDF.TransmissionModuleDummy([MINDF.TransmissionProps(5080.0u"km", 300, 8),
MINDF.TransmissionProps(4400.0u"km", 400, 8),
MINDF.TransmissionProps(2800.0u"km", 500, 8),
MINDF.TransmissionProps(1200.0u"km", 600, 8),
MINDF.TransmissionProps(700.0u"km", 700, 10),
MINDF.TransmissionProps(400.0u"km", 800, 10)], 0, 20)),
MINDF.TransmissionModuleView("DummyFlexiblePluggables",
MINDF.TransmissionModuleDummy([MINDF.TransmissionProps(5840.0u"km", 100, 4),
MINDF.TransmissionProps(2880.0u"km", 200, 6),
MINDF.TransmissionProps(1600.0u"km", 300, 6),
MINDF.TransmissionProps(480.0u"km", 400, 6)], 0, 8))
]

myibns =
let
# read in the NestedGraph
globalnet = open(joinpath("data/" * topology)) do io
loadgraph(io, "main", GraphIO.GraphML.GraphMLFormat(), NestedGraphs.NestedGraphFormat())
end

# convert it to a NestedGraph compliant with the simulation specifications
simgraph = MINDF.simgraph(globalnet;
distance_method=MINDF.euclidean_dist,
router_lcpool=defaultlinecards(),
router_lccpool=defaultlinecardchassis(),
router_lcccap=3,
transponderset=defaulttransmissionmodules())

# convert it to IBNs
myibns = MINDFul.nestedGraph2IBNs!(simgraph)
end

return size(myibns)
end

function generate_ibns(axis, topology; pos=0)
topology *= ".graphml"


MINDF = MINDFul
defaultlinecards() = [MINDF.LineCardDummy(10, 100, 26.72), MINDF.LineCardDummy(2, 400, 29.36), MINDF.LineCardDummy(1, 1000, 31.99)]

defaultlinecardchassis() = [MINDF.LineCardChassisDummy(Vector{MINDF.LineCardDummy}(), 4.7, 16)]

defaulttransmissionmodules() = [MINDF.TransmissionModuleView("DummyFlexibleTransponder",
MINDF.TransmissionModuleDummy([MINDF.TransmissionProps(5080.0u"km", 300, 8),
MINDF.TransmissionProps(4400.0u"km", 400, 8),
MINDF.TransmissionProps(2800.0u"km", 500, 8),
MINDF.TransmissionProps(1200.0u"km", 600, 8),
MINDF.TransmissionProps(700.0u"km", 700, 10),
MINDF.TransmissionProps(400.0u"km", 800, 10)], 0, 20)),
MINDF.TransmissionModuleView("DummyFlexiblePluggables",
MINDF.TransmissionModuleDummy([MINDF.TransmissionProps(5840.0u"km", 100, 4),
MINDF.TransmissionProps(2880.0u"km", 200, 6),
MINDF.TransmissionProps(1600.0u"km", 300, 6),
MINDF.TransmissionProps(480.0u"km", 400, 6)], 0, 8))
]

myibns =
let
# read in the NestedGraph
globalnet = open(joinpath("data/" * topology)) do io
loadgraph(io, "main", GraphIO.GraphML.GraphMLFormat(), NestedGraphs.NestedGraphFormat())
end

# convert it to a NestedGraph compliant with the simulation specifications
simgraph = MINDF.simgraph(globalnet;
distance_method=MINDF.euclidean_dist,
router_lcpool=defaultlinecards(),
router_lccpool=defaultlinecardchassis(),
router_lcccap=3,
transponderset=defaulttransmissionmodules())

# convert it to IBNs
myibns = MINDFul.nestedGraph2IBNs!(simgraph)


end


#println(length(myibns))

if pos == 0
let
p = ibnplot!(axis, myibns)
#hidedecorations!(a)
return p, length(myibns)
end
else
#println(pos)
p = ibnplot!(axis, myibns[pos])
return p, length(myibns)


end


#= let
f = Figure()
a,p = ibnplot(f[1,1], myibns[1]; axis=(title="myibns[1]",))
hidedecorations!(a)
a,p = ibnplot(f[1,2], myibns[2]; axis=(title="myibns[2]",))
hidedecorations!(a)
a,p = ibnplot(f[2,2], myibns[3]; axis=(title="myibns[3]",))
hidedecorations!(a)
a,p = ibnplot(f[2,1], myibns[4]; axis=(title="myibns[4]",))
hidedecorations!(a)
f
end =#


end

#end


#export generate_ibns


Loading

0 comments on commit 5bc9a62

Please sign in to comment.