Hello everyone,
This is my first post here, I hope I’m going to do it right
and it’s the right place to post it
Here’s my problem, I have a list of string:
[" 'DataManager' ", " 'LauncherFrame' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'ToolBox' ", " 'ToolBox' ", " 'ToolBox' ", " 'ToolBox' ", " 'ToolBox' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'MonoWellInterpretationView' ", " 'ToolBox' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' ", " 'DataManager' "]
This list corresponds to the names of all the windows opened during a log(session ?) on the software I am working on. The order of the names is important since it corresponds to the sequences between the windows for example the window “DataManager” was opened first then “LauncherFrame” and then again DataManager etc …
I’m trying to make a directed graph with this list where the nodes are the different types of windows and the edges are the possible transitions from one window to another (for example here there would be an arrow from DataManager to LauncherFrame etc…).
Here’s what I have done so far :
frame = countmap(WindowsType)
Dict{Any,Int64}(" ‘MonoWellInterpretationView’ " => 11," ‘DataManager’ " => 13," ‘LauncherFrame’ " => 1," ‘ToolBox’ " => 6)
FrameLabel=
for i in keys(frame)
FrameLabel = [FrameLabel;i]
end
A = [0 0 2 3
0 0 0 0
1 3 0 0
0 0 3 0]
G = DiGraph(A)
# save to png
draw(PNG(“graph.png”, 100, 100),gplot(G, nodelabel=FrameLabel))
As you can see I managed to create a graph with arrows and with a node for each type of window, the problem is the matrix A of the edges. How could I “automate” it without having to create it “by hand” for each string list that I will have? How could I create this matrix A (for edges) directly from my list of string with inside the transitions between the windows and their frequency for each type of transitions?
I hope I have been clear and not asked a stupid question !
Thank you in advance for your answers,
Have a good day, Valentine
PS : Sorry if my english is bad