• Since Alys posted about her new little tool in the tavern I (lightsaber) came up with some ideas about pie charts to show the progress I make on habitRPG. Alys invited me to open a discussion here.

    So here the little tavern-conversation:

    lightsaber: „I wish I could code… I dream of pie-charts for tracking my weekly and monthly process. Like x% healt-related tasks, x% mental-related tasks etc or: did more habits then last week or: how many red/orange/yellow to-dos are done this month etc.“

    Alys: „Now those are some interesting ideas! Some I could add to my tool (anything that uses current data, or very recent data - basically any data available from the API ). Others could be created with a tool that also reads exported historical data. “

    As a graphic-designer I'm keen on charts and would like to develop this idea. Maybe someone of you fellow coders is interested in it and likes to realise some.

      Loading editor
    • I'm very interested in seeing this done, either by myself or anyone else.

      There's some limitations that are worth keeping in mind (either to be aware of what can't be done, or to find ways to work around them):

      - The data source that my User Data Display Tool uses is the "/user" section of the API. This has a lot of nice information but holds little historical data (data more than a few days old has to be purged out of it to keep the HabitRPG website fast and responsive). So, my tool is (currently) unable to show anything that goes back more than a few days. There are ways that I could change that, but nothing very simple, and nothing that will happen in the short term.

      - There are other data sources from the export options (wiki page) which do hold historical information but: (a) it's limited to a few months for non-subscribers (if I recall correctly); (b) even for subscribers, the habit history is condensed to save on storage space (e.g., for data more than a month old, there is just one data point per month, and that data point is a summary of all the data points that used to exist for that month). So, we'll never be able to have detailed, point-by-point historical data (unless we create our own data store, which has it's own issues, to put it mildly). But probably, we don't really need detailed historical data (just averages might give a good enough effect). I am actually quite impressed with HabitRPG's condensing idea; it's a clever solution to disk space and performance issues.

      - However, the condensing code seems to condense even data from the current day. I've logged an issue about this. I'm not sure if it's deliberate; I suspect a bug. So, for the moment at least, we can't show even detailed habit history for the current day. :(

      I might edit this comment later to add more limitations if I think of any. Don't be discouraged by this though; there's usually ways to accomplish anything you really want.

        Loading editor
    • And now the good stuff:

      - Pie charts to display any of the /user API data(recent data) are certainly achievable and I don't think they'd be too hard. I'm not familiar with how the API stores the health/mental/etc attributes, but a small amount of experimentation will let me work that out. I could then create pie charts that contained the current balance of attributes, and I could probably use completed todos from the past three days (no more) to give a tiny bit of historical information. It would be a start, at least! But there are other, easier features that I want to add to my code first (at least a few days' worth of work).

      - I have some experience with Flot ("Attractive Javascript plotting for jQuery") which does some very nice things.

      (I have to use thissomewhere!)

        Loading editor
    • So, no idea about the technical possibilities I had fun this evening to check out some graphics… If you want to click here and here . I had some more but these pleased me the best. It's a status quo of today. I'll think about comparing daily and weekly progress.

        Loading editor
    • That's gorgeous! Especially the pie charts.

        Loading editor
    • Yeah, I fell in Love with those pie charts too. They look like windows of the holy data-church to meditate into the colours. XD - Lightsaber

        Loading editor
    • LadyAlys: One thing comes to mind regarding the usability--the ability to feed the UUID (and potentially the API Token) into the page without the need to copy and paste it in each time you hit the page. Simplicity + bookmarkability suggests GET parameters, i.e.<foo>&token=<bar>

      The only issue I can see with that is perhaps anyone who can see the web server logs may be able to see the GET url, and thereby gain access to any user's backend API.

      Another option could be javascript localStorage, but I have never dealt with that at all.

      Edit: Well, until now... Here's a prototype diff.

        Loading editor
    • Lightsaber, from your Tavern comment: "Just added some graphics to the pie-chart-idea – before clicking on your links and seeing what's probably possible. ^^ But maybe it's inspiring at least."  --- Those flot links were just initial examples of what that one library can do, so we don't need to be limited by them. Your examples were certainly inspiring, although way beyond my current experience level! But that might change. :)

      What I would really like, if you don't mind doing it, is some simpler examples that I might be able to implement soon. I could probably do a pie chart that shows only the percentages of CON, INT, STR, PER for your current tasks, so it would be a pie with just four segments. What I'm interested in is nice colours for each segment. The pink, blue, green, and brown that you used in this legend might be exactly right, but I'd like to see them in a sample pie chart. Could you do one up for me that has just four basic segments in those colours? Or other colours if you want to experiment. I realise you have gone to bed now, so I'm not expecting this rapidly. :) In fact, it would be days at least before I'd be able to add even simple pie charts.

      Thepeopleseason: The url idea makes me nervous - as you say there are security issues - but the HTML5 storage is exciting!! I will look into that and your code as soon as I've finished a bit more coding. Thanks!

        Loading editor
    • I' glad you like the colors. They fit very good to my actual outfit but they are some meanings behind them as well so here a try without going more into details. More to come next week if you wnat varieties, I'll be busy over weekend. Wish you a sunny day - lightsaber

        Loading editor
    • Oh yes, that DOES look good! 

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.