百度首页 | 
百度搜藏
快照
(百度和http://www.igvita.com/blog/2006/12/11/visual-database-explorer-in-ruby/的作者无关,不对其内容负责。百度快照谨为网络故障时之索引,不代表被搜索网站的即时页面。)

igvita.com » Blog Archive » Visual Database Explorer in Ruby

Visual Database Explorer in Ruby

… svg code here

DOCTYPE is only supposed to be sent once and it is supposed to be the first thing we send back to the client. We met the second requirement (check the htmlHeader in step 1), but we don’t want to resend the DOCTYPE within the graphs generated by Scruffy. Here is a quick hack to remove the first two lines:

svg = graph.render(:width => 800).split(”\n”)
session.print svg[2, svg.size].join(”\n”)

We split the SVG code on the newline character and effectively discard the first two lines (and put the code back together with join) when we send the code back to the client. Now we are all done, point your browser to your homemade data visualization tool and explore the data! Here is a few more interesting screenshots from my dataset:

Security vs ThreatPope SciavoOld NewUSA IraqBush Iraq


About this entry

Published:
11.12.06 / 11pm
Category:
Projects, Ruby on Rails, Ruby
Tagged:
db, hci, ruby, scruffy, vis


Related Posts


Social Bookmarks

del.icio.us:Visual Database Explorer in Ruby  digg:Visual Database Explorer in Ruby  spurl:Visual Database Explorer in Ruby  blinklist:Visual Database Explorer in Ruby  furl:Visual Database Explorer in Ruby  blogmarks:Visual Database Explorer in Ruby  Y!:Visual Database Explorer in Ruby  magnolia:Visual Database Explorer in Ruby



7 Comments

comments rss | trackback uri
  1. Gravatar Icon The Development of a Visual Database Explorer with Ruby 12.12.06 / 4pm

    […] Ilya Grigorik has put together a great article explaining how he has used Ruby, along with the Scruffy graphing library, to develop a basic visual database explorer. Last night I wrote a quick database explorer for one of my projects (screenshot above). I had a database of lead stories for BBC, Yahoo News and NY Times over a period spanning Sept. 2004 to Aug. 2005 and I wanted to juxtapose and visualize different queries. The concept is simple, given two words (ex: war / peace), I wanted to see some aggregate calculations over the available document corpus. […]

  2. Gravatar Icon Visual Database Explorer in Ruby at There was Code; Then there was AJAX! 13.12.06 / 1am

    […] read more | digg story Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. […]

  3. Gravatar Icon BLOGical Thoughts » Wednesday, 13 December, 2006 13.12.06 / 10am

    […] Free/Open Source Software What’s Next in Linux Desktop Standardization? Questions I鈥檇 like to see asked about the Microsoft-Novell deal OpenOffice .org 2.1 Released The Pre-Installed Linux Vendor Database Visual Database Explorer in Ruby […]

  4. Gravatar Icon Ilya Grigorik 13.12.06 / 7pm

    Well, it seems that the storm has subsided. My little visualization app. grazed the front pages of digg and del.icio.us last night. Combined, they literally brought this server to its knees. Apologies to anyone who faced the dreaded Wordpress error page. I’ve learned my lesson - time to make some adjustments on the backend!

    Also, welcome to all the new RSS subscribers! :)

  5. Gravatar Icon Happy Life :: Visual Database Explorer in Ruby 14.12.06 / 12am

    […] A how-to for a quick visual database explorer in Ruby. Learn how to build a quick threaded web-server, access SQL databases from Ruby, and how to create SVG graphs on the fly. The result.. A dynamic visual browser to help you find that needle in the haystack of information hidden away in your databases!read more | digg story […]

  6. Gravatar Icon Akkam’s Razor 14.12.06 / 9am

    […] igvita.com 禄 Blog Archive 禄 Visual Database Explorer in Ruby (tags: ruby database graph visualization rails programming howto) […]

  7. Gravatar Icon jess 15.12.06 / 3pm

    Haha your blog has turned quite popular! Congrats on all the technical hits!

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>




Safari hates me

Portfolio

GW GW

Graphics World is an educational, user-driven graphics community. It is a place to share, organize and explore CG resources on the web.

First launched in 1999, Graphics World has evolved through six generations to become what it is today. In the latest incarnation, it is powered by Ruby on Rails, ForteHost, and a number of experimental Machine Learning algorithms (an interest of mine).

Version 6 is now live! See for yourself.

Recently

Amazon Review

iCon Steve Jobs

iCon Steve Jobs by Jeffrey S. Young

    Captivating personality, great book
December 7, 2006 read review

My Flickr Photos

Ruby DB Visualizer grazes digg's front pageRuby DB Visualizer grazes delicious' front pageOld vs New - ExploreSecurity vs Threat - NewsPope vs SchiavoDeath vs Fun - News view gallery