Need generic arduino data plotter in processing

I'm sure someone has made something like this at some point, but I'm not sure exactly where to find it...

I'm looking for a customizable processing sketching for drawing a moving plot plot based on serial data from an arduino (i.e., the graph would display the last x samples sent from the arduino, with the shifting to the left with every new sample). I need to test a variety of sensors, each operating differently, but I've yet to learn processing...

Hopefully, the sketch could be easily changed to accept different data formats, so long as each datum sent over serial was properly delimited (ie, one sensor might send values as nibbles, another as (unsigned) bytes, and yet another as signed bites) and sent in a consistent format. I know this wouldn't be hard to do using a sort of mapping function, which if not in Processing by default, is easy to implement.

It would also be helpful if the code could be changed to modify the x and y scale of the graph (even better, if this could be modified on the fly while the sketch is running) so that I could calibrate a piezo knock sensor (which would have a pretty short region of interest on the time-axis) and then a temperature sensor (which would have a much longer region of interest). It would be even better if when I changed the time scale while running the sketch, it could inform the arduino of the change via serial, which I could then reflect in my arduino sketch by changing the sample rate (but that really isn't necessary, just a neat extension...).

Finally, it would be helpful if the sketch could do a dump of the raw serial data to a text file (ie, I press a button to begin recording, and press it again to stop). Again, a neat extension would be the ability to automatically trigger recording (triggering once above or below a certain level is the simplest trigger), and then storing x samples after the trigger. Also not hard to implement, but I'm hoping someone has done it already.

Does anyone know of processing sketches like this, or ones that I could modify to operate something like this? It seems to me like a logical thing to do for the arduino, condering it's basis in Processing, as well as Processing's focus on graphical elements. I recall seeing processing sketches for an arduino logic analyzer and an arduino oscilloscope that had similar functions, but I'm not sure if that's the right direction to look in...

I think the sketch at the bottom of this post will do nearly everything you want:

You might need to do some tweaking to read in the values with different delims, but the base graphing functionality is there.

I'm currently working on my own graphing app, but with the purpose of reading in source files and graphing them. Thus I don't need to worry about shifting each sample. Unfortunately it also means I need to worry about x columns and anything up to 20 million rows. From there I also do auto-scaling and have functions to zoom in to specific areas.