iBrasten

My methods of calculating time are far superior to yours, in every way.

 

This is the blog of Brasten Sager, a freelance software developer, Mariners fan, guitarist, haphazard philosopher.

Scruffy is alive and kicking...

September 06, 2006 @ 03:49 PM

It’s been a little while since I’ve said anything about Scruffy or rolled out a release. Like all of you, I have bills to pay, so I’ve been squeezing in Scruffy time around client’s projects. I was hoping to release the next version of Scruffy a few days ago, but it looks like it will be next week sometime before that happens.

In the meantime, let me tell you about some of the things you can expect in Scruffy 0.3.0.

Pie Charts! I’ve been promising these for a while, and they will be here. A.J. has done some fantastic work on these, and I’m really excited to get this functionality in your hands and see what you people do with it. The extra time has allowed A.J. to add in some really amazing capabilities.

For a demonstration, check out Ms. Scruffy. Ms. Scruffy was made entirely with pie charts, using some very simple options (offsets and pie-slice exploding, etc). Ms. Scruffy does not actually convey any useful information.

Customization API! While A.J. has been working on pie charts, my entire focus has been on building a really nice user-facing API—something Scruffy is weak at right now. Everything from legend location and orientation, x-axis and y-axis labels and locations, and many other options will be easily setable.

Additionally, graph layouts will shift to best accommodate your options. If you hide the legend, the graph will expand to fill that space. This stuff should be really cool!

Some other cool stuff! A lot of this is changing from day to day, so I’m just going to show some actual code I’m working on right now.

1
2
3
4
5
6
7
8
9
10
11
12
13
# Rails View Helpers
<%= scruffy :performance_graph, @agent %>

# A graph is just a representation of data.
def user
  @user = User.find params[:id]

  respond_to do |wants|
    wants.html
    wants.xml
    wants.graph   # renders user.rgraph
  end
end

Soon….

6 Responses to “Scruffy is alive and kicking...”

  1. Is there a darcs / svn repos out there? Can we try out the alpha/beta code?

    Robert Hulme

  2. Excellent - I'm loving Scruffy and looking forward to the next release. I'm having a little trouble with long graph titles and legends not wrapping and am hoping that this will be sorted, or at least I can customise this aspect of a grpah's presentation.

    Richard

  3. Scruffy rocks! I've generated my first graph and notice some shifting of values and formatting problems. Take a look at this image: http://blacksquare.com/images/1.png You'll see that the first column marker is low (beneath the page), and some shifting, and overlapping. I'm currently running on windows locally - which always seems to be a problem :) graph = Scruffy::Graph.new graph.title = "Prices" graph.value_formatter = Scruffy::Formatters::Currency.new(:special_negatives => false) graph.add :line, 'Average', [1110, 1466, 1903] graph.add :line, 'Low', [525, 495, 595] graph.add :line, 'High', [2500, 5800, 8500] graph.point_markers = ['0','1 Bed', '2 Beds'] graph.render(:as => 'png', :to=>"public/images/graphs/1.png")

    jeffrey

  4. You have done something really wonderful here. Thank you. Building on your work, I have done some neat stuff with reporting to generate almost any kind of metric over models in my RoR system through a web gui. Metrics become columns in reports with dynamic filtering and date ranges. I can generate reports on literally any model in the system. What makes it sing is that I can turn any resulting grid of data into a scruffy graph. I have considered turning this into an engine/plugin so that anyone can have powerful reporting and analytics in their RoR application. Do you know of anything else out there like this? There may be spinoff business opportunities here to say nothing of consulting which you are probably already doing. An open source crystal-reports killer is still just a gleam in my eye. (one of several gleams... not enough time...) This would boost the visability of scruffy since you would not need to write any code to use scruffy. It sounds like you are already working along these lines??? I look forward to your upcoming improvements and would love to demo what I have to lead scruffy developers at some point. It is still messy but my app is pregnant with this plugin/engine or whatever. I do not have time for a blog but I anticipate being able to look into releasing some aspect of this within a couple months. All the best to you guys and thank you for your beautiful graphs. They have really helped me to sell my product. Please contact me by email. Best Regards, Steven Talcott Smith

    Steven Talcott Smith

  5. Hi Brasten Thanks for the work on scruffy!… We will be rolling it in with our site..

    I was looking around the web for an answer but did not find out… to handle IE users who do not have any SVG viewer installed, we had to render the graph as PNG, but it’s giving us an error.. and the ImageMagick lib in installed and everything looks happy..

    Here’s the actual error message ImageMagick library function failed to return a result.

    chart.render(:size=>[@gw,@gh],:minvalue =>@percent10,:maxvalue=>@percent90,:as=>”PNG”,:to=>”public/images/graphs/1.png”)

    Will appreciate if you could give us some hint as to what is going on.. thanks!

    Alfred Toh

  6. How would one hide the legend? Setting @visible to nil doesn’t appear to do it. Many thanks in advance.

    Jon