Slashdot Mirror


Biochemistry Animations Using SVG

Milo Fungus writes "I've been working on a project for my biochemistry research lab that may be of interest to a few Slashdotters. We study the enzymes in an important biochemical pathway that produces (among other things) terpenes, carotenes, and sterols. I have been making a web-based tutorial to summarize our research, with animations of the proposed reaction mechanisms of the enzymes. I'm finding that SVG is a very good tool for the job because it is easy to learn (because of my experience with HTML) and the file sizes are amazingly small, even for complex animations. The files are typically ~5 KB for a g-zipped animation about 1:00 minute long, compared to 2 MB or more for a lossy-compressed video file of the same length, which is locked into a certain resolution. I have been wanting to do this project ever since I saw Hongyun Wang and George Oster's animations of ATP synthase. I would appreciate any feedback about the tutorial's usablilty, etc."

26 comments

  1. SVG Viewer by I_Love_Pocky! · · Score: 1, Redundant

    If you are looking for an SVG viewer (as I was), Adobe has one for download.

    1. Re:SVG Viewer by I_Love_Pocky! · · Score: 3, Informative

      Sorry, this is a more direct link.

    2. Re:SVG Viewer by Sparr0 · · Score: 1
    3. Re:SVG Viewer by merdark · · Score: 1

      Epiphany, which uses the mozilla engine, doesn't show SVGs it seems.

      Epiphany 1.0.8
      Mozilla 1.6

      Additionally, the page you linked to states that the Mozilla SVG implementation doesn't yet support animations (if I understand it correctly). So not only is it only in, I presume, a bleeding edge version, but even then it won't view this page!

      It's cool to pimp your fav. software, but it won't reflect well on Mozilla when you say it does stuff that it don't.

    4. Re:SVG Viewer by Eric+Pierce · · Score: 2, Interesting

      I'm hopelessly depressed to see how little interest there appears to be on Slashdot with regards to SVG animations in web browsers.

      Is SVG not our only hope to usurp Macromedia's proprietary hold on all things vector on the internet?

      Sorry to wimper... Eric

    5. Re:SVG Viewer by I_Love_Pocky! · · Score: 1

      If it makes you feel better, I would have to install flash if I wanted to look at any SWF files too.

    6. Re:SVG Viewer by Sparr0 · · Score: 2, Informative

      Epiphany should render SVG if you configure the engine with '--enable-svg' before you compile it. Ditto for Mozilla 1.6. That page doesnt say it doesnt support them, it says the support is lacking. Running through the 'official' SVG test suite Mozilla renders almost all of them perfectly.

    7. Re:SVG Viewer by merdark · · Score: 1

      I tend to be one of those guys that likes mostly packaged stuff. But fair enough, it's probably just my distro's fault (Debian). I'm not at all surprised that it wasn't compiled that way. :(

      I really should not judge open source software by using Debian since it tends not to be .. uh... optimal for desktop. *ducks and runs from debian fans*

      Thanks for the clarification.

    8. Re:SVG Viewer by azav · · Score: 2, Insightful

      Flash's file format is open.

      The authoring tool is created by MM and is payware.

      Sooo, the format's open. If you're frustrated, time to get to work writing your own authoring tool.

      --
      - Zav - Imagine a Beowulf cluster of insensitive clods...
    9. Re:SVG Viewer by Directrix1 · · Score: 1

      No, the format is available. But it is absolutely under the control of Macromedia. So I would definetely not call it "open". Also, if I'm not mistaken they only make the previous version of the file spec available. SVG and SMIL are open on the other hand.

      --
      Occam's razor is the blind faith in the natural selection of least resistance and in universal oversimplification. -- EF
    10. Re:SVG Viewer by azav · · Score: 1

      The term the use is "open" as in not proprietary. I remember the VP of products telling me this.

      Maybe it's not the same "open" as in open source.

      --
      - Zav - Imagine a Beowulf cluster of insensitive clods...
    11. Re:SVG Viewer by Directrix1 · · Score: 1

      They make the file format, so they can make money off of it. It is not in their best interest, to have a format that can be implemented better on a free platform. This is why they decide new features, to deprecate the superiority of the truly "open" alternatives.

      --
      Occam's razor is the blind faith in the natural selection of least resistance and in universal oversimplification. -- EF
    12. Re:SVG Viewer by Anonymous Coward · · Score: 0

      Unfortunately, Adobe's SVG viewer cannot even render the examples from the W3 specification pages correctly. See for yourself if you don't believe me.

  2. Feedback by I_Love_Pocky! · · Score: 1

    I viewed your SVG animations using Mac OSX 10.3, in Safari 1.2.1 (v125.1), using the Adobe SVG viewer 3.0, and there was one noticable problem I thought perhaps you were unaware of. For some reason on my platform, the alpha in alpha-ketol was not rendering properly. In place of the alpha was an empty box (most probably a font problem). Interestingly, the HTML "MEP Synthase (&#945-ketol rearrangement)" showed the alpha just fine for me.

    Just thought you would like to know.

    Other than that, the animations were excellent. Did you write the SVG by hand, or use a tool?

    1. Re:Feedback by Milo+Fungus · · Score: 1

      Yeah, I've noticed that problem. I bought a 12" iBook a few months ago and started doing my animations on it. That was one of the first things I noticed.

      There are big inconsistencies between the different versions of Adobe's SVG viewer. Version 3 for win32 doesn't support the end-marker attribute that I use for making arrowheads, but version 3 for Mac does. Version 6 (win32 only) is the only one that didn't crash Mozilla Firebird.

      Before I got my Mac I was using win32 for development, and version 6 supports a lot of CSS tricks that version 3 doesn't. Most importantly, I made a common defs.svg file for all of the patterns, gradients, filters etc that I reused on every animation. Version 6 allows you to reference definitions in a separate file (ex: filter:defs.svg#shadow), but version 3 won't let you do that. When I saw that my CSS tricks were failing on the Mac, I had to include the definitions in each file individually.

      Yes, I'm hard-coding in a text editor. My favorite one to use is SciTE, but there's not a version for Mac. I've been using jEdit on Mac. I always have the SVG Recommendation open in a browser tab.

  3. Mac?? by azav · · Score: 1

    Any mac viewers out there?

    --
    - Zav - Imagine a Beowulf cluster of insensitive clods...
    1. Re:Mac?? by martinX · · Score: 1

      Try here.

      --
      When they came for the communists, I said "He's next door. Take him away. Goddam commies."
  4. Feedback. by azav · · Score: 2, Interesting

    Ok, I've already mentioned that you need a mac viewer. For those people who use these macs.

    Your inspiration's example is terrible - with respect to bandwidth.

    It is good because it has Mpeg AND Quicktime. That's a choice that is nice. Almost everything plays mpeg1 and quicktime is a FREE and easy to get download that is xplat.

    The bandwidth on the QT is terrible - 852 Kbps. It is using the wrong codec.
    The bandwidth on the Mpeg 1 is also rather high - 355 Kbks.
    Quality on both is good.

    Bandwidth can be improved by exporting the quicktime to Sorenson or 3ivx and running a few comparison tests to compare quality and bandwidth.
    What is LOVELY about 3ivx is that is can create pure MPEG 4 output so Quicktime can create a movie that can be played outside of quicktime. Like in WMP.

    Using 3ivx I was able to get the videos output as pure MPEG 4 at almost identical quality at 150 K per second with just a few tests. That's taking a 5 meg movie and turning it to 860 K. I'm sure we could do better if we tried.

    Now, If you've got a mac plugin, I'd love to see those 5 K movies!!

    --
    - Zav - Imagine a Beowulf cluster of insensitive clods...
  5. Ok by azav · · Score: 1

    Thanks to someone else on this thread, I found an SVG viewer (adobe) and installed it. Safari required a restart, I restarted it.

    You really need to set up instructions for people who may not have svg viewers.

    Also, your animations were lovely but the greek characters were replaced with square blocks. Alpha, lambda, anything else, I can't tell what they are on the mac since they are square blocks.

    Looks like you've got a great start there. Just time to wrap up the details to bullet proof it.

    --
    - Zav - Imagine a Beowulf cluster of insensitive clods...
  6. Embedding SVG? by torpor · · Score: 1

    SVG seems to me to be a very good user interface tool. Instead of programmatically defining objects, "UI" Artists could define it all with their authoring program, then set the files in an embedded SVG player for 'playback' and 'interaction'.

    Has anyone seen this done yet? I know that Flash animators are quite capable of creating very nice interactive unique interfaces which often put "Windowing systems" and "Standard GUI's" to shame ... what about the possibility that SVG can be used to replace/supplant/suplement existing GUI systems by abstracting the motin/behaviour out to an authoring system, then just having it embedded in the final app ...

    Know what I mean? I guess the question is, a) has this been done/is it feasible/possible, and b) what is the event model?

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
    1. Re:Embedding SVG? by Milo+Fungus · · Score: 1

      There is a lot of work going on at Gnome and KDE to use SVG on the desktop. They are using SVG for the GUI: icons, program launchers, etc. See here and here.

  7. So near and yet so far by ynotds · · Score: 1

    It was great to see really good use being made of SVG, but I let myself get sidetracked by some of the technical comments elsewhere in this thread and managed to blow away my browser, so I'm writing this before attempting a second look.

    Having used the smallest possible amount of non-animated SVG on one of my own sites, I some time ago settled on the still current release Mozilla (1.6) with the Adobe plug in, because the SVG build for Mac really isn't there yet. There was a brief period in which I was checking some of my stuff with Safari first, but once I fixed my code there was nothing that Safari did better than Moz, so I switched back to the only standards compliant browser that shows on my and my clients' traffic stats. (5-25% for those who must know, and not near all mine!)

    At first Moz seemed not to be keen to actually finish loading the page linked from the submission, most likely because our DSL is having a bad afternoon, so I booted Safari which loaded it completely quite quickly, by which time Moz had finished too. Safari also showed a couple of the animations, which Moz started on and then gave up (spinning cursor) so I quit Safari and still had to kill Moz.

    It was the comment about alpha not rendering that particulary intrigued me as one of the really pleasing discovery for me in recent works is that Unicode characters really work in my set up, though I haven't gone so far as to try to use them within SVG yet.

    I belatedly posted more of my continuing hopes for SVG in another thread the other day and won't repeat them here.

    --
    -- Our systemic servants do not good masters make.
    1. Re:So near and yet so far by Milo+Fungus · · Score: 1

      I use Safari for developing, and I'm not sure what to do about the missing unicode character. I just looked through the SVG recommendation, but I can't find anything about character entity references like in HTML. I suppose I could create an alpha using alternate glyphs. I'll have to think it over. That was one of my disappointments when I started using my Mac for SVG.

      I haven't ever used an SVG build of Mozilla, but Adobe's SVG viewer slows Firefox to a crawl on OS X. (I have a G3 with 128 MB RAM.) Safari is still quick when viewing SVG, so I use it instead.

  8. --enable-svg by default in Mozilla by Eric+Pierce · · Score: 2, Interesting

    I wish Mozilla (and friends) would ship with --enable-svg compiled by default.

    I know the SVG implementation in Mozilla isn't 100% (the builds I've tried do crash more often), but neither has the DOM-JavaScript implementation been 100% in all the major browsers all these years, and we've worked around it (albeit a pain but) with great success.

    I say turn SVG on by default and let the SVG websites a cometh. Soon enough you'll have the Mozilla crowd surfing a slew of fantastic SVG sites and their IE friends will be jumping ship in droves.

    You can wet your whistle by grabbing the Mozilla-Firefox SVG build for Linux/Solaris and experience the fantastic SVG work at Croczilla. The bezier-paths demo shows some serious potential.

    The progression for better SVG implementation in Mozilla (or any browser for that matter) will go hand in hand with the easy availability for the user to be able to browse these websites w/o jumping through hoops.

    <last-blurb-of-nonsense>SVG is a native implementation in Mozilla, so the end effect is completely smooth and transparent unlike Macromedia's Flash which feels like a browser afterthought.</last-blurb-of-nonsense>

    1. Re:--enable-svg by default in Mozilla by denis-The-menace · · Score: 1

      Why can't they just let it compile with the SVG in but have it disabled in the Preferences menu?

      That way, the people who want to try it don't have to "Roll their own" Mozilla just to enable SVG.

      --
      Obama's legacy: (N)othing (S)ecure (A)nywhere and (T)error (S)imulation (A)dministration