I am entirely new to actual use of Streamlit. The functionality looks very promising to me.
Right now I am in the process of creating mockup in python. Yet looking into the various chart options ( Chart elements - Streamlit Docs), and following Streamlit, I do not seem to spot a visualisation rendering a network(x) infrastructure.
Is that because:
I am lacking imagination? …use e.g. plotly to display?
There is no option available?
I am a bit in doubt when using Streamlit. I did create my app.py file using the command prompt and things do seem to work, somehow. Still, trying to visualize (and maybe this points back to Q 1, above) I am not able to make the structures appear, e.g. using the below code (‘stolen’ from a tutorial elsewhere on the internet). Basically, this code ONLY provides plotly bars, representing the input provides by user, i.e. NO network structure comes from below code. It is merely intended for me to see, how I can make things happen with Streamlit (…and network(x)), In conclusion: Executing my app.py works fine, presenting charts doesn’t.
a = int(input("Enter counter value 1: "))
b = int(input("Enter counter value 2: "))
c = int(input("Enter counter value 3: "))
test_a, test_b, test_c = , ,
# test_b =
# test_c =
i, j, k = 0, 0, 0
while i < a:
pl = int(input(“Enter item value 1:”))
i += 1
while j < b:
p2 = int(input("Enter item value 2: "))
j += 1
while k < c:
p3 = int(input("Enter item value 3: "))
k += 1
print(“Please input int only…”)
one = nodes_and_edges()
user_input = tuple(one.itertuples(index=False, name=None))
interactions = user_input
G=nx.Graph(name=‘xxx Interaction Test Graph’)
interactions = np.array(interactions)
for i in range(len(interactions)):
interaction = interactions[i]
a = interaction # source node
b = interaction # destination node
w = float(interaction) # score as weighted edge where high scores = low weight
G.add_weighted_edges_from([(a,b,w)]) # add weighted edge to graph
x1 = G.nodes(interactions)
x2 = G.nodes(interactions)
x3 = G.nodes(interactions)
hist_data = [x1, x2, x3]
group_labels = [‘Value 1’, ‘value 2’, ‘Value 3’]
fig = ff.create_distplot(hist_data, group_labels, bin_size=[.1, .25, .5])
Looking very much forward to learning your reply.
Jens Steenfos, Copenhagen, Denmark