[Date Prev] [Date Next] [Thread Prev] [Thread Next] Indexes: Main | Date | Thread | Author

Re: [ba-ohs-talk] TouchGraph used on Langreiter.com


Hi Eugene,    (01)

I'm working with the TouchGraph GraphLayout code on Windows with jdk1.3.    (02)

(Warning: crude but effective hack incoming! Good code purists might want to
take cover.)    (03)

If you slap this:    (04)

public void getBDBGraph()
 {
    String line = "";    (05)

    try
    {
        BufferedReader bdbReader = new BufferedReader(new
FileReader("C:\\Temp\\backlinks.txt"));
        while(line != null)
        {
           line = bdbReader.readLine();
           if(line == null) {continue;}
              System.out.println(line);
           int midspace = line.indexOf(9); //hunts TAB chars
           if(midspace != -1)
           {
              System.out.println("midspace: " + midspace);
              int linelngth= line.length();
              String firststr = line.substring(0, midspace-1);
              String secondstr= line.substring(midspace+1, linelngth);
              Node r = new Node(firststr);
              Node n = new Node(secondstr);
              tgPanel.addNode(r);
              tgPanel.addNode(n);    (06)

                 if(tgPanel.findEdge(r, n)==null)
                 {
                    tgPanel.addEdge(r, n, 4000);
                 }
               }
            }
         }
      catch(IOException exc)
      {
         System.out.println("getBDBGraph: " + exc);
      }    (07)

   }    (08)

... into the GLPanel class, and then in the main() method replace the call
to,
//randomGraph();
//with
  getBDBGraph();    (09)

Making sure that the backlinks.txt file is in C:\temp\    (010)

then you can look at the backlink data as a graph.... a bit slowly though,
because the long Node names seem to really slow the lovely app down when it
comes to working out the tensions, label overlaps and so forth(on my box
anyway).
(Something to add to your list, I figure, Alex.)    (011)

--
Cheers,
Peter    (012)



----- Original Message -----
From: "Eugene Eric Kim" <eekim@eekim.com>
To: <ba-ohs-talk@bootstrap.org>
Sent: Friday, December 14, 2001 7:24 AM
Subject: Re: [ba-ohs-talk] TouchGraph used on Langreiter.com    (013)


> On Mon, 10 Dec 2001, Alex Shapiro wrote:
>
> > Great news: Christian Langreiter of http://www.langreiter.com has
> > integrated TouchGraph into his Vanilla Hypertext System
> > http://www.langreiter.com/space/vanilla-download
>
> This is really great news; congratulations, Alex!  I'll look forward to
> the day when TouchGraph is part of every Wiki implementation. :-)
>
> > This implementation is interesting, because one can easily see it being
> > applied to visualize that recently created Backlink Database. The same
> > strategy of rendering the DB as a series of connected trees with a
> > Date/Post/Internal-link hierarchy could be followed.
> >
> > Unfortunately, I don't have the time to undertake this task myself,
> > because I am working hard to get out the next LinkBrowser version. As
> > usual though, I would be more then happy to assist anyone willing to try
> > it. (Maybe it would be best to wait for the next LinkBrowser release,
> > because this should clear up a lot of the coding issues.)
>
> I actually attempted this before posting my original announcement, but
> couldn't do it in less than 15 minutes, and gave up. :-)  I do want to
> give this a shot myself when I do get a chance -- unless someone wants to
> beat me to it -- and will definitely take you up on your offer.  When's
> the ETA for the next release?
>
> -Eugene
>
> --
> +=== Eugene Eric Kim ===== eekim@eekim.com ===== http://www.eekim.com/
===+
> |       "Writer's block is a fancy term made up by whiners so they
|
> +=====  can have an excuse to drink alcohol."  --Steve Martin
===========+
>
>    (014)