GithubHelp home page GithubHelp logo

Comments (16)

norakassner avatar norakassner commented on August 24, 2024 3

I pushed it to my repository. How do we proceed?

from nxviz.

yerraeee avatar yerraeee commented on August 24, 2024
c_sol_set = nv.CircosPlot(ticket_graph,node_color='Resolution_Set_Name', node_grouping = 'Resolution_Set_Name',node_order = 'dc',node_size = 'dc',edge_color='Ticket_Log_Parse.Active_Org',node_labels=True,figsize = (15,15) )

c_sol_set.draw()
plt.show()

from nxviz.

yerraeee avatar yerraeee commented on August 24, 2024

Also, please let me know if there is a way to change the orientation of labels or adding a custom legend on the plot.

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

Hi @yerraeee, thanks for posting this issue!

I see there are two issues here. The first is the lack of "node size". The second is the lack of "edge colours."

Node sizes

I'm debating with myself on whether node sizes do make sense in a CircosPlot. On one hand, it aesthetically makes sense to keep node sizes equal across nodes. On the other hand, size can convey information, though I have read before (but cannot remember the reference here) that it is roughly as good/bad (in terms of salience) as using colour, and definitely worse than using lines.

From a practical standpoint, computing the node positions with varying node radii might be more complicated than the current implementation (in which I assume constant node size).

For now, due to the reasons above, I'm considering this a bug in the documentation, and not a bug in the implementation, and so I'll do the following:

  1. Update the docs to highlight the fact that node sizes cannot currently vary with data
  2. Add a warning for end-users that specifying node_size=... will do nothing, with a link to the docs explaining why.

Edge colours

This is definitely a bug, as edge colours can be meaningful in conveying categorical information. I do have a day job and other commitments, so I will need a bit of time to update the package. Alternatively, if you are willing to take a stab at modifying the codebase (I saw your other issue), I'm more than happy to review a PR from you.

from nxviz.

norakassner avatar norakassner commented on August 24, 2024

Hi,
Thank you for this very nice and helpful package! I am using it to visualize DNA/RNA bindings. I also need the edge color utility for that and implemented it. It's not completely done but I can commit my updates soon if you are interested. Also I could add examples to visualize on one hand NUPACK outputs (a software to evaluate nucleic acid binding structure) and exact base pair matching between multiple DNA/RNA strands.
Nora

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

@noragak your post brought great joy to me! 😄 I would love to accept a PR from you with this contribution, and credit you with implementing it.

Going forward, yours should be the first PR that I accept from someone that's not myself, so in the process of working through this PR with you, I'm hoping to formalize the expectations I've had for myself into a checklist. Let me know if it's too burdensome for you; as the first external contributor, you have the privilege of helping to shape the PR process so that it works for others 😄.

PR checklist:

  1. Ensure that the API remains delcarative -- which means your provided implementation should work with edge_color='keyword'. As long as that interface is preserved, I'm not to worried about the underlying implementation.
  2. If you add functions or methods, do ensure they're tested! That said, if new lines of code are just rendering (i.e. they directly call matplotlib functions), then don't worry too much about them.
  3. Do remember to add yourself to the Contributors list under AUTHORS.rst!
  4. I adhere to pycodestyle conventions. They should pass that test.

If you need help anywhere, feel free to post here, ping me on Twitter or send me an email. (If you post here, of course, others will be able to learn from your experience!)

from nxviz.

norakassner avatar norakassner commented on August 24, 2024

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

Thanks @noragak! Hope you feel better soon 😄.

from nxviz.

benelot avatar benelot commented on August 24, 2024

Looking forward to that update too! I realized that both of the mentioned features do not work as expected, even though they are part of the API.

@ericmjl : I think node sizes could still be a great feature, even if it does not always convey proper information. But I think that should also partly be a decision of the user. That depends on your design philosophy if you want to add that or not.

from nxviz.

benelot avatar benelot commented on August 24, 2024

Now you can go to the repository you forked it from (this one here) and go to the top, there you can start a pull request.

I saw that you pushed your changes to your master branch. That is ok, but now you can not add more pull-requests until your master branch is accepted because your other branches would all include this pull-request.

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

@noragak I've just taken a look at your code, it's beautiful code: commented, adhering to pycodestyle! I have only a few minor requests on the code; please go ahead and submit a Pull Request in so that we can continue the discussion there.

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

@yerraeee edge colours are enabled! Please go ahead and try it out, either by installing from the master branch, from pip, or from conda! With big thanks to @noragak for contributing it in 😄

from nxviz.

selwyth avatar selwyth commented on August 24, 2024

I'm debating with myself on whether node sizes do make sense in a CircosPlot. On one hand, it aesthetically makes sense to keep node sizes equal across nodes. On the other hand, size can convey information, though I have read before (but cannot remember the reference here) that it is roughly as good/bad (in terms of salience) as using colour, and definitely worse than using lines.

Should the node sizes make sense for an ArcPlot (I think yes)? The node sizes did not vary when I tried it out with an ArcPlot. Would like documentation to be updated to say whether node_size is not supported for ArcPlot, or have it be implemented. I can help either way, just curious why it didn't work and what your stance is on node sizes in arc plots.

from nxviz.

selwyth avatar selwyth commented on August 24, 2024

Here's how to repro:

networkx version: 2.0
nxviz version: 0.3.6
Python: 3.5.2
Operating System: Linux-4.4.96+-x86_64-with-Ubuntu-16.04-xenial

import networkx as nx
import nxviz

G = nx.DiGraph()

NODES_EBUNCH = [
    ('A', {'n_visitors': '1'}),
    ('B', {'n_visitors': '3'}),
    ('C', {'n_visitors': '4'}),
]

G.add_nodes_from(NODES_EBUNCH)  # use attr_dict if you don't have to vary e.g. color by node

# An ebunch appears to be a list of 2- or 3-tuples
EDGES_EBUNCH = [
    ('A', 'B', 10),
    ('A', 'C', 20),
    ('B', 'C', 250),
    ('C', 'B', 100),
]

G.add_weighted_edges_from(
    EDGES_EBUNCH,
)

c = nxviz.ArcPlot(G, node_labels=True,
                     node_size='n_visitors',
                     node_color='n_visitors',
                     edge_width='weight')
c.draw()

image

Incidentally, looks like node_labels doesn't do anything for ArcPlot too (but does for CircosPlot), will open another issue.

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

@selwyth thanks for the post! From the blog post, node sizes do look like they have some place in ArcPlots.

What are your thoughts - should they be overlapping or not? Aesthetically, it looks a bit messier with overlapping nodes, IMO, but this might just be a matter of taste.

When thinking about variable node sizes with CircosPlots is that computing the right CircosPlot radius would be challenging.

On the other hand, for ArcPlots, the length of the node axis is basically just the sum of diameters of the nodes, if the nodes are not overlapping. If the nodes are overlapping, then it's basically some function of average radius.

I'm happy to accept a PR for node_sizes for ArcPlots, with appropriate docs and examples added in too. I'm also happy to have you decide on the design of the default behaviour (i.e. whether to have overlapping nodes or not). Looking forward to what you've got!

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024

@yeraeeee the latest commit in the master branch has rotated node labels! Please do give it a shot and see what you think 😄.

from nxviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.