vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Sparkline graphing hack... I've built one, is there a demand for it to be published? (https://vborg.vbsupport.ru/showthread.php?t=83200)

buro9 06-16-2005 07:41 AM

Sparkline graphing hack... I've built one, is there a demand for it to be published?
 
I've built a sparkline plugin named sparkplug.

Sparklines are documented here:
http://www.edwardtufte.com/bboard/q-...1OR&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

Quote:

Originally Posted by buro9
I've built a sparkline plugin named sparkplug.

Sparklines are documented here:
http://www.edwardtufte.com/bboard/q-...1OR&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

Quote:

Originally Posted by Bad Bunny
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

Quote:

Originally Posted by buro9
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

Quote:

Originally Posted by Bad Bunny
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

Quote:

Originally Posted by Boofo
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 :)

Quote:

Originally Posted by buro9
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. ;)


All times are GMT. The time now is 01:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01217 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete