Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Support to change colors and label nodes #7

Open
ranjanan opened this issue Mar 18, 2016 · 12 comments
Open

Support to change colors and label nodes #7

ranjanan opened this issue Mar 18, 2016 · 12 comments

Comments

@ranjanan
Copy link

Could you point me to functions that can help me change colors of nodes and label them too?

Something like changeColor(g::Graph, n::Integer, color) and setLabel(g::Graph, n::Integer, text) would be nice.

cc: @rohitvarkey

@ranjanan
Copy link
Author

I guess since you're using ThreeJS under the hood, it would make sense to abstract out the color options and such from there to your package too.

@abhijithanilkumar
Copy link
Owner

I haven't added that functionality yet. I'll try to implement that by tonight.

@ranjanan
Copy link
Author

Awesome, thanks. It would also be nice to modify the defaults (or allow me to do that) so the graph looks a lot more beautiful.

@abhijithanilkumar
Copy link
Owner

I'll be happy to have your contributions here. plot() function in utils.py is what draws the graph using ThreeJS.

@ranjanan
Copy link
Author

What might be interesting is to be able to change the points from tiny little squares to small coloured circles, and to increase the thickness of the edges a touch. That might make it look a bit more professional.

@abhijithanilkumar
Copy link
Owner

@ranjanan I've implemented the node color change feature. You can use the drawGraph function to draw nodes with colors now. Like,

drawGraph(g,colors=color,z=1)
where color is Vector::Color

I've changed drawGraph function such that it accepts kwargs now.

About the squares, currently they are points drawn using the pointcloud function from ThreeJS. I'm not sure how they can be changed to circles. @rohitvarkey can help I guess.

@ranjanan
Copy link
Author

Thanks, @abhijithanilkumar. The coloring works on nodes. Is there an equivalent way to color edges? If some of those aforementioned customization features can be included, I think it would be great for the package.

@rohitvarkey
Copy link

Hi @ranjanan, I'll look into the circles thing. ThreeJS does let you change colors of lines and also sizes of the squares. @abhijithanilkumar, you can go ahead and add those features even now!

Also is it time to make a type to represent the Graph visualization with the Graph and the customizable parameters as attributes?

@abhijithanilkumar
Copy link
Owner

@rohitvarkey Creating a new type is a good idea. It will help us modify the graph more easily. I'll look into it. Thanks for the suggestion.

@ranjanan
Copy link
Author

Guys, any updates on changing the colors of the edges and sizes of the squares? @rohitvarkey does changing squares to circles look possible?

@abhijithanilkumar
Copy link
Owner

I'm planning to restructure the library according to @rohitvarkey 's suggestion. Once that is done, changes can be made easily. I'll complete the work soon.
He has already changed squares to circles. He hasn't pushed the changes yet. It looks better!

@rohitvarkey
Copy link

@ranjanan @abhijithanilkumar I've just pushed the fix to ThreeJS to render points as circles in rohitvarkey/ThreeJS.jl#26. Just waiting on AppVeyor(:snail:) to complete to merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants