Graphoon (Now with online demo)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: Graphoon (Now with online demo)

Post by rmcode »

Ref wrote:Conclusion: Very interesting but really don't know what to do with it.
Yeah, I know what you mean :awesome: I guess it doesn't really have any other point than data visualisation and looking nice.
Ref wrote:Really surprised as to how easy it was to add rotation (just press 'R')
Really a neat script.
Good job.
Thank you (and yeah I should really remove the semi-colons at some point) :)

Camera rotation and all the other stuff is why I decided against adding a custom drawing function. In LoGiVi I just use the callbacks:

Code: Select all

    graph:draw( function( node )
            if showLabels then
                local x, y = node:getPosition();
                local radius = node:getRadius();
                love.graphics.setFont( LABEL_FONT );
                love.graphics.print( node:getName(), x, y, -camrot, 1 / camscale, 1 / camscale, -radius * camscale, -radius * camscale );
                love.graphics.setFont( DEFAULT_FONT );
            end
        end,
        function( edge )
            love.graphics.setColor( EDGE_COLOR );
            love.graphics.setLineWidth( edgeWidth );
            love.graphics.line( edge.origin:getX(), edge.origin:getY(), edge.target:getX(), edge.target:getY() );
            love.graphics.setLineWidth( 1 );
            love.graphics.setColor( 255, 255, 255, 255 );
        end);
I'll take a closer look at your changes when I have some time to see if I can include them in the lib. Also feel free to open a PR on github :)
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Graphoon (Now with online demo)

Post by Ref »

Just trying to see what makes it tick.
Moved the deck chairs around a bit to make for easy access to variable (functions with closures really obscure variables).
Added ability to turn on/off various aspect to script. Seems text and drawing are the most time demanding - as expected.
Only suggestions are:
1. Enable rotation as it makes it easier to read some of the node names.
2. Require only an edge table. It's easy for the script to get the unique nodes from the edge table thereby making data entry easier.
Very interesting code. :awesome:
Best!
Attachments
GraphoonMod.love
Added ability to turn on/off features
(27.47 KiB) Downloaded 93 times
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Graphoon (Now with online demo)

Post by Ref »

Hi again rmcode!

Just another demo with some features you might want to include in your library.
Demo has the following new features:
key 'T' allows keyboard input of a new node name. After hitting return, the next node you grab will have the new name. (Name doesn't have to be unique.)
key 'U' saves screen shoot.
key 'Z' shows system specs
key 'D' shows grabbed node's settings
keys 'F/G' change grabbed node's mass
keys 'Q/W' change grabbed node's size
key 'A' toggles node's anchor status
key 'K' logs key strokes
key 'L' toggles node names on/off
key 'E' toggle edges
key 'P' toggle nodes on/off
data input using an 'edge.txt' file (of node pairs)

Code is not in appropriate condition for use as a library - only rearranged to demonstrate some of what you could do with your code.
(If you're brave, type 'S' to show an orbiting node.)
Attachments
demoGraphoon.love
Graphic Data Display
(47.67 KiB) Downloaded 82 times
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: Graphoon (Now with online demo)

Post by rmcode »

I love it! I didn't have time to take a look at your code yet, but I love the stuff you added like the anchor icons for example :D

Also it's nice to see that someone else has fun playing around with my lib ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest