in reply to Re: interactive web graphics
in thread interactive web graphics

WoW! That's an impressive reply, I really appreciate the fact that you're loyal to perl. I'm not sure about Tk::Animation, let me try to explain some more, I'm gonna start writing a Java applet today to see how that goes... There's going to be a simple diagram of three rows of amino acid residues, with lines interlinking the rows representing the bonds...that would be easy GIF wise. But the resulting GIF picture is cluttered bond wise, lots of hydrophobic interactions. So though i will be putting in buttons that would enable you to turn off the different type of bonds (4 types) or even show the bonds that are under a certain length (ie show the more important bonds) i want to be able to pick a letter, or even a group of letters and move them to a different place within the applet, AND AT THE SAME TIME, realign the lines/bonds, so that they are still linking the correct letters. this is so that a user will be able to re-arrange the image to their liking. As you can imagine, I was excited when I realise that you could 'move' objects within the Tk::Canvas, but to reflect this movement within the applet is another matter...one idea, is to have every letter and line as their own little 'gif', and use javascript to send back the co-ordinates via CGI for rewriting the GIFs and the HTML document, but it seems like a long way round... any more hints? S

Replies are listed 'Best First'.
Re: Re: Re: interactive web graphics
by BrowserUk (Patriarch) on Sep 30, 2002 at 14:43 UTC

    Glad you liked it. Now to ruin it all by suggesting a non-perl solution:)

    Have you looked at the power and ease of the (free I believe, but don't quote me), MDL Chime application designed from the ground up for doing exactly this type of thing, and with its own command language.

    It runs as a plug-in to either Netscape or IE and runs under Windows or Mac. They also have an older version of the application with a command line interface rather than a GUI interface that runs under Linux. The ouput from this can be used to drive the Chime application from what I understand.

    Since writing my original response, I have had a go at doing something along the lines I described and have encountered difficulties with using Tk::Animation myself. Specifically, on my system using my near verbatim copy of a peice of sample code I found kicking around the web, my attempts to load even a simple GIF, a 6k static or a 14k 2 page animation causes Tk to expand to fill all of my available memory (over 200MB!) and then start to swap whilst chewing 100% of my cpu. I have yet to resolve this problem.

    In terms of your latest question, I think it would be possible to use multiple layers of GIF's with transparent backgrounds as overlays, and JS buttons and a bit of dynamicHTML or Stylesheet attributes to turn the overlays on and off (show/hide usng visibilty attributes?), but I think that making this run quickly enough to have a reasonable response time as a Server-driven web app would be very difficult indeed. AS I said before, if you just want the protiens to rotate or zoom, that's quite easy, but dragging and dropping on the client with a server driven app would be pushing you luck I think.

    Maybe when Perl6 arrives we will see a PerlVirtualMachine plug-in written and it might become viable then, but in the meantime, I think that Java is your way forward as its here now and works.

    Now if only there was a Perl to Java Byte-code complier, but I guess thats just too fanciful :^)

    I think I would, unless you have extremely good reasons not to, take a long, hard look at MDL Chime, and even if there is some cost involved--I'm sure the plugin is free, but there maybe other components that you would need to purchase. Unless it is hugely expensive, you could probably trade that against the substantial costs of developing such an application in-house.

    Good luck, and if your able, keep me informed of your progress, this type of app is a personal favourite of mine.


    Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!
      I do know all about MDL Chime, being a bioinformatician, but the goal is simplicity, to enable any user to upload a 'bonds' file, and see the bonds in the simplest possible format. But I'll have another chat with my boss, as most people who would want to see the bonds, probably use Chime as a PDB viewer anyway. I'll let you know more when I get something done. cheers S