Wedge

Public area => Features => The Pub => Features: Miscellaneous => Topic started by: Nao on November 26th, 2013, 07:21 PM

Title: Cool stats!
Post by: Nao on November 26th, 2013, 07:21 PM
Feature: Statistics charts
Developer: Nao
Target: everyone
Status: 90% (stats page believed complete; planning to implement on other stats, but not right now.)

http://wedge.org/do/stats/

Look at that... :)

Needs some work, most notably I'll implement some select boxes to automatically refresh data (or Ajaxively refresh it), so you can get a 'range' of your choice, and/or disable the entries that you're not interested in (new members, etc.)
But this is what I managed to cook up after a few hours of work, and I'm very happy with it. Great plugin, really! It only had a bug which prevented the tooltips from working, so I fixed that, and I may start contributing to the project, because I'm thinking of adding more details in tooltips, etc.

Feedback welcome, as always!

:edit: Read following posts to view progress on implementation, which is now 100% on the main stats page.
:edit: Moved the topic to public!
Title: Re: Cool stats!
Post by: Pandos on November 26th, 2013, 07:56 PM
Looks really cool!
But this should be visible for admins only :)



Title: Re: Cool stats!
Post by: Nao on November 27th, 2013, 12:27 AM
Stats, for admins only..? Well, I could always add privacy settings to these things (and I guess I can, this privacy system is as flexible as one wants it to be), but I've never seen anyone complain about that, really...
Of course, as it's more graphical, it's easier to see that the participation level on wedge.org is decreasing steadily, but the same can be seen on the sexy-less page, so... It's just less striking, I guess. But it's not a problem, I'm not in a competition anyway. I just like nice charts...!
Title: Re: Cool stats!
Post by: Nao on November 27th, 2013, 05:02 PM
No one else..?
Title: Re: Cool stats!
Post by: TE on November 27th, 2013, 08:00 PM
I like it, tested today morning with my mobile phone and it still looks very good, even on a 480x800 Screen resolution. Welll done :cool:
Title: Re: Cool stats!
Post by: Nao on November 28th, 2013, 01:17 PM
Thanks :)
Yeah, it's supposed to look good in mobile, actually this is the first I saw of that jQuery plugin -- on my smartphone. I got the immediate 'wow' effect, and although there are tons of other graph plugins, I settled on that one. I updated it yesterday to be more in line with my coding guidelines[1]. Once the updated stats page is out for the public to see (or at least Wedge is out), I'll try to do a pull request over there, and offer my changes.

I made a small change to reduce the height of charts in mobile. Also, I'm working on 'modularizing' the list of stats to be shown there.
 1. Spacinazi etc., overhauled semi-colon handling to allow minifying through Packer, and fixed tooltips to work in Chrome.
Title: Re: Cool stats!
Post by: Nao on November 30th, 2013, 12:23 AM
So... I've been working on rewriting the entire daily/monthly stat stuff, at this point. It just 'didn't' work the way it used to, with the new chart system.

I'm working with ranges at this point. You'll get a select box, with these (at least) three options:
- Last 30 days (daily stats) (default)
- Last 12 months (monthly stats)
- Custom: I'm planning to add an additional range type selector, where you can select a beginning month, and an end. If you choose an end month, you'll get monthly stats; otherwise, daily stats for that month.

Does that seem sensible at all..? Or overkill? Or not enough?
Title: Re: Cool stats!
Post by: Nao on November 30th, 2013, 01:15 PM
Updated the wedge.org version with the latest.
It still doesn't allow you to change your scope/range (don't bother with the select box, it does nothing), but this one is updated to show the last year's statistics.

It's important to point out -- I made a change to gather monthly statistics by average, rather than sum. I'm still determining whether it's for the best, and whether I should make SOME statistics sums, and the rest averages. e.g., number of registrations: it might be best as a sum. Hits: I don't know. Topics, posts: I think an average is best..??!!
The thing to remember with averages, is that they solve the problem of harmonizing months with a large difference in days (namely, from January to February, you might lose up to 15% even when retaining the same averages.)

Opinions are welcomed.
Title: Re: Cool stats!
Post by: Nao on November 30th, 2013, 05:54 PM
I think I'll be going for filters. Allowing you to get either averages or sums. That way, I don't have to choose for you, ah ah....
Title: Re: Cool stats!
Post by: Nao on December 1st, 2013, 11:58 PM
Updated the site with a more recent version; it's far from working 'just fine', but at least, its select boxes are now working. ;)
Posted: December 1st, 2013, 11:44 PM

Unrelated, but I also added a follow_me equivalent to Wilderless topic pages. What do you think, guys....? It won't work on all browsers for now (needs some settings modified in Firefox and Chrome), but in mobile browsers it's functional (at least iOS 6.1+ and Chrome for Android). Thing is, in Chrome Android, I'm upset that the fact that the feature is obviously implemented through a JavaScript module and NOT hardware accelerated at all. It makes little sense to enable it on Chrome Android, then, because it disrupts the experience. Hmm yeah, I'm disabling it for this.
Title: Re: Cool stats!
Post by: Nao on December 2nd, 2013, 11:49 PM
Updated to latest version. It's starting to take shape. Unfortunately, there seem to be issues with the scale being too low on wedge.org, but I can't reproduce this on my local install. Hmm.
Still, plenty of things to play with, such as automatic updating of the 'total' and 'average' fields, new filters/ranges, and tooltips can now be multi-line (required a lot of changes to the original library), and have associated names.
Title: Re: Cool stats!
Post by: Nao on December 3rd, 2013, 01:50 PM
So... It's all done, I think. There are probably tons of things to improve, but it all works right now, and I'm not touching it anymore until I'm committing that.

I'll need opinions on the final result, please! Can't keep talking to myself... :P

I think it could use a 'lifetime' stats range, giving out results in quarterly groups, or something. Apart from that, I'm all good...
Title: Re: Cool stats!
Post by: Nao on December 3rd, 2013, 08:58 PM
I feel like I'm on the New Revs topic, being the only one to post... :P
Title: Re: Cool stats!
Post by: Pandos on December 3rd, 2013, 11:47 PM
Quote from Nao on December 3rd, 2013, 08:58 PM
I feel like I'm on the New Revs topic, being the only one to post... :P
It's because you can  :eheh:
Title: Re: Cool stats!
Post by: Pandos on December 3rd, 2013, 11:54 PM
Quote from Nao on December 3rd, 2013, 01:50 PM
So... It's all done, I think. There are probably tons of things to improve, but it all works right now, and I'm not touching it anymore until I'm committing that.

I'll need opinions on the final result, please! Can't keep talking to myself... :P

I think it could use a 'lifetime' stats range, giving out results in quarterly groups, or something. Apart from that, I'm all good...
Think it looks really sexy. Nice work!
But what about the Page Hits? Bug or not activated on Wedge?
It always shows 0.

Title: Re: Cool stats!
Post by: Nao on December 4th, 2013, 12:16 AM
Yes, they're disabled in wedge.org, because they obviously add one DB hit per page, and I thought Google Analytics would be more accurate anyway.[1]
The latest update (not live here, though!) actually accounts for disabled items. Only 'hits' for now, but in the end, could add more stuff.
Hits are usually not even shown at all, but they used to be enabled, so the old stats (< 2012) still have hits in them. You can look at them, if you want...
 1. It took me years to add Analytics, though... I figured, no need to force a small script to load for everyone, if I'm never looking at these stats. I only installed it because I wanted to know the IE market share here. Still less than 5%, all versions included. Lulz.
Title: Re: Cool stats!
Post by: Nao on December 4th, 2013, 02:03 PM
Works 100% in mobile, now!
The main problem I had was with the label list. On a very small screen, it just got confusing, they were overlapping each other.
I rewrote the script to actually skip up 50 or 75% of all labels, depending on the available width, to make it all clearer.

Well, I'm pretty much ready to commit... I think.
Title: Re: Cool stats!
Post by: MultiformeIngegno on December 4th, 2013, 02:56 PM
Wow!! Looks amazing on mobile :D
Title: Re: Cool stats!
Post by: Nao on December 4th, 2013, 03:30 PM
I know... :eheh:

And until yesterday, it was a bit crappy! I put a lot of thought into it today. (Heck, I learned more about canvas drawing to customize that library. Plus, I'd always wanted to look into using canvas for my own work in the future... This time was not lost, so double win.)

I'm also planning to add a 'zoom' feature so that I can default to the 'Last 10 years' feature (which should probably be something like 'all', because in the meantime I rewrote it to support both monthly and quarterly updates, making it potentially possible to support, hmm, 40-year old forums..??), and then you can choose a 'zone' to extend into daily stats. A la Github, if you will.
Title: Re: Cool stats!
Post by: agent47 on December 5th, 2013, 10:05 AM
Nao, you beauty! I love it. Sick stuff, bro.
Title: Re: Cool stats!
Post by: Nao on December 5th, 2013, 10:58 AM
Thanks!

I'm currently working on the zoom thing. I'm not sure it'll be ready for today, but I'll see what I can do.
Title: Re: Cool stats!
Post by: Aaron Smith on December 5th, 2013, 06:17 PM
First, purely from an aesthetics point of view it is sexy beautiful. Charts just kind of do it for me. So you nailed it there.

From usefulness/coolness point of view I like it. I don't really think you need to include lifetime stats. The decade stats effectively accomplishes that (at least for the next 10 years I suppose :eheh:)

One stat I'd be interested in seeing is Topic Views Overall. Not sure how easy that would be, but I'd be willing to bet the decline in activity at Wedge.org is a lot less in that statistic. I have a feeling there are a lot of people out there following Wedge who like me don't feel like they have the knowledge to contribute a lot, but come here everyday and multiple times a day to see what's going on hoping for that post they feel they can finally contribute something useful.

So yeah, the stats rock :cool:

Aaron Smith

Title: Re: Cool stats!
Post by: Nao on December 5th, 2013, 06:41 PM
My zoom feature is 90% done. I'm currently able to select a range, although I'm not doing anything with it (for now.)
Quote from Aaron Smith on December 5th, 2013, 06:17 PM
First, purely from an aesthetics point of view it is sexy beautiful. Charts just kind of do it for me. So you nailed it there.
Yup, and I think I improved (a bit) on the original script, when it comes to visuals. Just little details. The bulk of my rewrite, though, was in adding many, many more features that I think are useful in daily use...
Quote
From usefulness/coolness point of view I like it. I don't really think you need to include lifetime stats. The decade stats effectively accomplishes that (at least for the next 10 years I suppose :eheh:)
With my new technique, I could effectively go up to about 50 years, so maybe it just makes more sense to say 'lifetime'.
I'm renaming the 'last_decade' variable to 'all'. That should do. 50 years, in Internet time, is like 2 millennia... (Hmm, Chrome insists on saying that's a typo. No, it's not..?! Or maybe it doesn't agree with my comparison, I don't know...)
So, considering Wedge is unlikely to be used in 50 years, and even if it is, it'll only make the charts very ugly (rather than 'simply' break), I'm okay with not having a limit/range on these queries.
Quote
One stat I'd be interested in seeing is Topic Views Overall. Not sure how easy that would be, but I'd be willing to bet the decline in activity at Wedge.org is a lot less in that statistic.
Well, if you're talking about Page Hits (which is as close as you'll get to Topic Views, since that particular stat isn't tracked in {db_prefix}log_activity, just like in SMF or other forks, but theoretically could be added through plugins), it's also trending down. But it only makes sense, because if you're replying to a topic, chances are, you're viewing it first...
Quote
I have a feeling there are a lot of people out there following Wedge who like me don't feel like they have the knowledge to contribute a lot, but come here everyday and multiple times a day to see what's going on hoping for that post they feel they can finally contribute something useful.
Well, duly appreciated!
Title: Re: Cool stats!
Post by: Nao on December 5th, 2013, 11:57 PM
Ladies & gentlemen, I present to you... Stat zooming!

Here's how to do it...
- In the first select box, choose a time range that's very large, i.e. either a year (2013, etc.) or 'Everything'. Zooming obviously doesn't work on daily stats, since you already are at maximum zoom.
- Check out a month, or series of months (it also works on quarters, but Wedge isn't old enough to be forced to show quarters, so it's not properly tested); hold your mouse button on the LEFT of the month you're interested in, then move it to the middle of that month, so that the vertical axis representing the month is entirely covered by your selection.
- After a quick ajax load, the chart will be updated to show daily stats for the month you wanted.
- If you select two months, you'll also get daily stats.
- Three months or more, and you'll get monthly averages.

There are probably still a few hickups here and there, it's not working 100%, most notably if you select to the right of the last entry in the chart, you'll get undefined results. Or, it doesn't work on mobile (needs some adjustments to events). I'll deal with that tomorrow. For now, it's bed time for me.

Please post your thoughts, likes and dislikes! ^o^
Title: Re: Cool stats!
Post by: Aaron Smith on December 6th, 2013, 12:41 AM
Ok that's cool. Probably not necessary, but definitely cool.
Title: Re: Cool stats!
Post by: MultiformeIngegno on December 6th, 2013, 02:26 AM
I really like it!!! :)
Title: Re: Cool stats!
Post by: Drunken Clam on December 6th, 2013, 07:37 AM
Woo!  Liking that....a lot! :cool:
Title: Re: Cool stats!
Post by: Aaron on December 7th, 2013, 11:29 PM
Looks great, Nao! Well done indeed. :)
Title: Re: Cool stats!
Post by: Nao on December 8th, 2013, 12:04 AM
Thanks!

I'm kind of disgusted with the amount of time I spent on this, though... (One week is about ten times too much.)

Then again, I just spent my entire evening on my good old menu system, just to make its animations hardware accelerated. I'm beyond hope, at this point.
Title: Re: Cool stats!
Post by: Kian on August 7th, 2014, 05:22 PM
Quote from Nao on December 4th, 2013, 12:16 AM
Yes, they're disabled in wedge.org, because they obviously add one DB hit per page, and I thought Google Analytics would be more accurate anyway.[1]
The latest update (not live here, though!) actually accounts for disabled items. Only 'hits' for now, but in the end, could add more stuff.
Hits are usually not even shown at all, but they used to be enabled, so the old stats (< 2012) still have hits in them. You can look at them, if you want...
 1. It took me years to add Analytics, though... I figured, no need to force a small script to load for everyone, if I'm never looking at these stats. I only installed it because I wanted to know the IE market share here. Still less than 5%, all versions included. Lulz.
Forgot about that when I went from SMF to Wedge. Stupid question : how can I integrate Google Analytics in Wedge ? Thanks !
Title: Re: Cool stats!
Post by: Nao on August 15th, 2014, 05:13 PM
Hmm this is something that isn't supported by default, you need to add extra HTML somewhere at the bottom... There are multiple ways to do that, although there's none that I can guarantee to be 'easier' to implement. (Ahem...)