-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first version of standard drawing method #69
Conversation
Pull Request Test Coverage Report for Build 87
💛 - Coveralls |
Meng, can we rip out the use of networkx drawing and just use our routines? Also, the return values for nodelist/etc are the list of nodes, not the actual handles to the plot elements. |
@dgleich Let me know how you feel on the new template. |
Okay, this is coming along! We still need stuff to visualize a vector of entries over the nodes, e.g. a fiedler vector or ACL vector. I don't like how you are creating a vector of colors, that seems like it could be done more efficiently. (And allow for colormap scaling, etc.) Groups should also take in a partition vector (e.g. each key is a group, in addition to a group-of-groups) |
@dgleich |
I'll start playing around with it. It looks very brittle thought. Also, we
are still not returning the right things...
We need to return handles to the plot elements so that someone can change
them after the fact. e.g. if I want to make nodes bigger/smaller, etc.
Also, what does draw_star do?
David
…On Tue, Nov 27, 2018 at 12:50 AM Meng Liu ***@***.***> wrote:
@dgleich <https://github.com/dgleich>
Let me know if the latest commit solves the first two issues (except the
groups).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEy8ZBxf-r7cBKi3wVcP3UF2BEdorlks5uzNKKgaJpZM4YyWvu>
.
|
@dgleich I am not very sure how to return plot handles... Is there a simple example I can refer to? "draw_star" is just plot all the edges connect to a specific node, like a star. |
Things I know we want to do.
For all the plot elements, we should be able to customize sizes, Does it make sense to draw groups and a set of values over the graph? Other G = lgc.GraphLocal() elems = G.draw_groups(coords, g) G = lgc.GraphLocal() drawing = G.draw(coords) drawing = G.draw(coords, values=fiedler(G)[0], valuecenter = 0, colormap=PuOr) drawing.highlight(set, othernodes=False, otheredges=False) # hide other nodes and edges drawing = G.draw(coords, values=v) drawing = G.draw_groups(coords, g, sizes=s) drawing.highlight(set, filled=False) # only circle the nodes drawing.nodecolor(i,c=None) # returns the current nodecolor class GraphDrawing
drawing = G.draw(coords) drawing = G.draw(coords, ax = ax) |
@dgleich There are still a lot of details to finish, but I'd like to show you the structure and some examples in "new_visualization_examples.ipynb". Let me know how you feel about it. |
Okay, I think this is getting there...!
I think we should simplify the interface to draw. I don't think it should
take a nodeset now. If you want a nodeset, then you should highlight that
explicitly.
I think there are two fundamental routines.
g.draw(values, sizes, etc...)
g.draw_groups(groups, sizes, etc...)
so in the second case, we handle all the group stuff, and in the first
case, we don't.
Given the return value from either, we should be able to highlight a set.
David
…On Thu, Nov 29, 2018 at 11:52 PM Meng Liu ***@***.***> wrote:
@dgleich <https://github.com/dgleich> There are still a lot of details to
finish, but I'd like to show you the structure and some examples in
"new_visualization_examples.ipynb". Let me know how you feel about it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEy3V4hrn997heRusgB_6eclmbc6q5ks5u0LmegaJpZM4YyWvu>
.
|
Okay, this is looking pretty good, there still needs to be more documentation. Also, please use the python pattern "_plotting" to denote "private" functions. (Most of the things you have tagged as staticmethod should be private.) For the default colormap, we have PuOr for when valuecenter is provided. Otherwise can we use magma? Can you also use ax._sci()... to setup the colormap on the values? David |
@dgleich I am not sure what ax._sci() does. Do you have a small example? |
See this -- https://matplotlib.org/api/_as_gen/matplotlib.pyplot.sci.html
David
…On Tue, Dec 4, 2018 at 5:36 PM Meng Liu ***@***.***> wrote:
@dgleich <https://github.com/dgleich> I am not sure what ax._sci() does.
Do you have a small example?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEy3Q1IJJiXxMP4JR-L75iXlPeRq_sks5u1vkDgaJpZM4YyWvu>
.
|
Okay, why were the two bioinformatics notebooks deleted? Do we need the "class" files and such? Why can't we just use the GraphML like we used to? If we need them, can you store the info as integers and lower-precision floats? These take up a lot of space! Also, the job seems to have failed :) |
@dgleich Those two were deleted because I have rewritten them using the new interface. If we stick to the original GraphML, it will take more code and even have to use graph_tools to extract the ground truth. To make the examples more clear, I decided to save the class info into a separate file so that we can read them in one line. But I will use some other data type to save the space. And yes, the job probably failed due to the new MQI code, I haven't tested it throughly. |
We depend on Networkx already, can't we use their GML reader and the
from_networkx function ?
…On Wed, Dec 5, 2018 at 11:56 AM Meng Liu ***@***.***> wrote:
@dgleich <https://github.com/dgleich> Those two were deleted because I
have rewritten them using the new interface. If we stick to the original
GraphML, it will take more code and even have to use graph_tools to extract
the ground truth. To make the examples more clear, I decided to save the
class info into a separate file so that we can read them in one line. But I
will use some other data type to save the space. And yes, the job probably
failed due to the new MQI code, I haven't tested it throughly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEy5eZsE-zDEuAFcMiH1DJw8dbz_q0ks5u1_rZgaJpZM4YyWvu>
.
|
@dgleich We can, but my point is in the original notebook, taking ppi_mips as an example, it still needs three files ppi_mips.graphml, ppi_mips_coordinates.xy and ppi_mips_ground_truth.csv to get the graph, its layout and the ground truth. Also, it needs some additional code to preprocess the coordinates and ground truth file which makes the notebook less cleaner. Right now, the new notebook needs ppi_mips.graphml, ppi_mips.xy and ppi_mips.class and it doesn't need any preprocessing at all. All I did is to save the preprocessed results and we can safely delete ppi_mips_coordinates.xy and ppi_mips_ground_truth.csv. |
I guess I like that code because anyone else who uses our stuff will have
to go through a similar process to use their data. So it's helpful to have
an example that shows it :)
David
…On Wed, Dec 5, 2018 at 2:54 PM Meng Liu ***@***.***> wrote:
@dgleich <https://github.com/dgleich> We can, but my point is in the
original notebook, taking ppi_mips as an example, it still needs three
files ppi_mips.graphml, ppi_mips_coordinates.xy and
ppi_mips_ground_truth.csv to get the graph, its layout and the ground
truth. Also, it needs some additional code to preprocess the coordinates
and ground truth file which makes the example less cleaner. Right now, the
new notebook needs ppi_mips.graphml, ppi_mips.xy and ppi_mips.class and it
doesn't need any preprocessing at all. So we can safely delete
ppi_mips_coordinates.xy and ppi_mips_ground_truth.csv.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACEy2hIy3XIi_DMgO5RdFieN-_FmVdTks5u2CRigaJpZM4YyWvu>
.
|
Btw, are there any examples of this in the notebooks folder? |
No description provided.