View Full Version : Sparkline graphing hack... I've built one, is there a demand for it to be published?
buro9
06-16-2005, 07:41 AM
I've built a sparkline plugin named sparkplug.
Sparklines are documented here:
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1
And to give you an idea, mine look like this:
https://vborg.vbsupport.ru/external/2005/10/6.gif
I have sparklines currently indicating:
* Forum stats on the home page
** Number of threads per day over the past month
** Number of posts per day over the past month
** Number of new users per day over the past month
* Member list and member info pages
** Number of posts per day over the past month by that user
It also accounts for style changes, and will modify the background colour accordingly.
Further, it has file caching built in to prevent any sparkline being generated twice within a 12 hour period. Worst case scenario is that a user gets an update once every 24 hours as I use 12 hours on the file based cache, and then add 12 hours to the expiry header of the image when we send it to the browser.
Anyhow... it works fine, but will need a little tidying if there is a demand for this kind of thing to be published... I'd also like a little peer review on the file cache side of things, namely, how to cope with errors.
I also haven't localised the tooltips/alt text of the images.
Take a look and let me know what you think.
Bad Bunny
10-06-2005, 01:35 PM
I've built a sparkline plugin named sparkplug.
Sparklines are documented here:
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR&topic_id=1
And to give you an idea, mine look like this:
http://www.bowlie.com/junk/sparklinepreview.gif
I have sparklines currently indicating:
* Forum stats on the home page
** Number of threads per day over the past month
** Number of posts per day over the past month
** Number of new users per day over the past month
* Member list and member info pages
** Number of posts per day over the past month by that user
It also accounts for style changes, and will modify the background colour accordingly.
Further, it has file caching built in to prevent any sparkline being generated twice within a 12 hour period. Worst case scenario is that a user gets an update once every 24 hours as I use 12 hours on the file based cache, and then add 12 hours to the expiry header of the image when we send it to the browser.
Anyhow... it works fine, but will need a little tidying if there is a demand for this kind of thing to be published... I'd also like a little peer review on the file cache side of things, namely, how to cope with errors.
I also haven't localised the tooltips/alt text of the images.
Take a look and let me know what you think.
It's interesting. I had no idea so much thought went into tiny graphs. I would be interested, but it looks like I am the only one. lol
buro9
10-06-2005, 02:21 PM
It's interesting. I had no idea so much thought went into tiny graphs. I would be interested, but it looks like I am the only one. lol
Well I'd taken them off my site when I upgraded.
I'm going to add them again soon... so I shall package it when I do.
It won't be a Plugin though, it will definately require uploading files... an Extension at the least.
Note though... the cached files can multiply wildly!
Bad Bunny
10-06-2005, 03:52 PM
Well I'd taken them off my site when I upgraded.
I'm going to add them again soon... so I shall package it when I do.
It won't be a Plugin though, it will definately require uploading files... an Extension at the least.
Note though... the cached files can multiply wildly!
hmmm
Extensions are fine. But I have grown lazy and don't like editing vb files anymore. lol
I even use plugin system for my own mods I do on my boards.
buro9
10-06-2005, 06:22 PM
hmmm
Extensions are fine. But I have grown lazy and don't like editing vb files anymore. lol
I even use plugin system for my own mods I do on my boards.
I loved the plugin system the first time I saw it. Then I installed loads and saw that it all ended up in the datastore and was bloating the database traffic for every page, whether or not that page needed the plugin or not.
I like the plugin system... but now I'm personally stripping out all PHP, placing it in the files in the right places or creating external files, and only using the product system to manage phrases, templates, settings, etc.
That's probably how I shall release it... as files to upload, and a product to install. I'll avoid PHP edits if I can... but if I do do them, they will be few and far between.
Boofo
10-06-2005, 06:32 PM
I want this and I want it now, mister!
How's that for showing support? ;)
buro9
10-06-2005, 06:41 PM
I want this and I want it now, mister!
How's that for showing support? ;)
Haha... I'm supposed to be packing to go see my girl in Sweden!
I'll do it next week :)
Actually... I might do it on mine this evening and then take care of packaging next week :)
Haha... I'm supposed to be packing to go see my girl in Sweden!
I'll do it next week :)
Actually... I might do it on mine this evening and then take care of packaging next week :)
Re-installed on mine, updated for 3.5.
It consists solely of file uploads and template edits at the moment, but then, I haven't yet moved the tooltips to phrases (can I be bothered? does anyone here really need a Product just to have tooltips localised?).
I've also adjusted it so that the forum home sparklines feature dots and text indicating:
In Red: Lowest value in the data
In Green: Highest value in the data
In Blue: Most recent value in the data
Finally... beware... if you have lots of styles, because alpha's do not work in .png's, I'm generating a new image for EACH UNIQUE BGCOLOR! This will simply multiply the number of images it has generated.
And erm... yeah, go have a look to see if you like:
http://www.bowlie.com/forum/
If you like, I'll package for Monday maybe... or Wednesday.
Boofo
10-06-2005, 11:21 PM
Oh, sure! Torture us over some woman. I see how you are now. ;)
buro9
10-07-2005, 12:33 PM
This appears to be working quite well... but I'm going to have a play and see if I can get PNG alpha's working rather than generate a new image per colour scheme.
Question: Would you rather have alpha's knowing they don't work in IE but do in FF, Safari, Opera... or would you rather have an image generated per unique background colour?
Boofo
10-07-2005, 12:57 PM
I use IE so the pngs wouldn't do me any good. ;)
buro9
10-07-2005, 01:04 PM
I use IE so the pngs wouldn't do me any good. ;)
png's are fine... so long as there's no transparency :)
I'll stick to creating multiple images... one per style. Of course, if you only have one style, you have no multiple images :)
Boofo
10-07-2005, 01:14 PM
I have two styles, the default vb one and the main board one. ;)
If we can use pngs in IE, then go for it. ;)
buro9
10-10-2005, 12:58 PM
Published over here.
https://vborg.vbsupport.ru/showthread.php?t=98044
Please install, see what you think, give feedback, etc.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.