question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sparse graph layout on first run of application.

See original GitHub issue

Hi Chris - big thanks to you and your work it’s a very cool component you’ve built.

My minor issue is on the first run of my streamlit application the resultant graph produced has a sparse structure (i.e. nodes are all a great distance from one another) whereas future outputs solve this issue and the graph has the desired shape. The images below show what I’m referring to:

Sparse

Future runs - desired shape

This is on streamlit_agraph version 0.0.35. The configurations which produces are shown below for reference:

    config = Config(width=3000, 
                    height=1000, 
                    directed=True,
                    nodeHighlightBehavior=True, 
                    highlightColor="#F7A7A6", # or "blue"
                    collapsible=False,
                    staticGraph = False,
                    staticGraphWithDragAndDrop=False,
                    ) 

    return_value = agraph(nodes=nodes, 
                        edges=edges, 
                        config=config)

Let me know if I can provide any additional information. Its obviously not a huge issue if rerunning the function that outputs the graph solves it but more curious as to why this might be the case. Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ChrisDelCleacommented, May 6, 2021

Looks awesome! Would be pleased to see you tweeting about it.

1reaction
LordLeancommented, May 6, 2021

Could be some gravity related feat actually - it’s interesting because on that first run it appears almost as if it’s started to pull the nodes together then stops. Good point on the canvas size I’ll play around with that as I do have it set to quite a large area currently. Re the unnecessary parameters: I was experimenting to see if they might have had an effect but I’ll remove them if they’re not the cause.

Glad you like the graph haha, I think this one below is my favourite thus far:

It’s mapping headlines/queries used on Twitter’s API search with a focus on the links shared to external sites. The node hierarchy goes like:

Node Class Colour Size (1-5, 1 being largest)
Headline/Query Red 1
Topic Classification Yellow 2
Domain Name Light Green 3
URL Dark Green 4
Datetime of Tweet Dark Red/Brown 5

Thanks for the reply too, I’ll let you know if I work out what was the cause.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sparse Graph Representation and Its Applications - Shuchu Han
In this thesis, we build novel sparse and nonparametric graph represen- tation algorithms for unsupervised learning. The theory foundation of our research works ......
Read more >
Deciding First-Order Properties for Sparse Graphs - IEEE Xplore
We present a linear-time algorithm for deciding first-order logic (FOL) properties in classes of graphs with bounded expansion.
Read more >
Running time for sparse graphs | Download Scientific Diagram
The second run is performed after such a reordering. In our first experiment, we consider sparse graphs with 1,000 to 30,000 nodes on...
Read more >
A greedy algorithm to construct sparse graph by using ranked ...
Introduction · 1. We propose a greedy algorithm to reduce the computational time of generating \mathcal {L}_1 graph. · 2. We introduce the...
Read more >
What are the applications of sparse graphs? - Quora
A sparse graph has relatively few edges when compared to the number of vertices. A dense graph has an edge count that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found