[Unsupported] Progress Chart Script

I’ve published this script as “Progress Chart” which you can install via the https://community.wanikani.com/t/app-store-script/20709[.](https://greasyfork.org/en/scripts/35929-wanikani-progress-chart)

Some things to note:

  • You’ll only have data in this chart if you’re also using the “SRS Level Progress” script.
  • There’s a blip in the data from around 11/18 which I haven’t yet scrubbed.
  • Every time the “SRS Level Progress” script updates the page an entry will be recorded in the history for the chart. This means it’s pretty fine grained data and also means that if you stop using the “SRS Level Progress” script then there will be holes in the history.
  • In the future I might be able to somewhat backfill the data.
  • Due to the order in which the dashboard page is rendered (and because I haven’t put any smarts in it to compensate) you’ll often find that the chart is one step behind. You can work-around this by refreshing the page.
  • I haven’t tested the no-historic-data scenario. Hopefully it’s well behaved.

If you want to get your hands on the raw data visit https://wanikanitools-golang.curiousattemptbunny.com/srs/status/history.csv?api_key=YOUR_V2_API_KEY.

As always, any and all feedback welcome! Enjoy!


original post preserved:

I intend to start collecting historic data for users of the SRS Level Progress script. My thinking is that each time a user calls wanikanitools/srs/status, that I’ll append a new line to their personal csv server-side, and at any time the user (or a script running for the user) would be able to download the csv by visiting wanikanitools/srs/status/history.csv.

The format I’m thinking of is:

UTCDateTime,EpochSeconds,UserLevel,Total,LeechTotal,Apprentice1,Apprentice2,Apprentice3,Apprentice4,Guru1,Guru2,Master,Enlightened,Burned,LeechApprentice1,LeechApprentice2,LeechApprentice3,LeechApprentice4,LeechGuru1,LeechGuru2,LeechMaster,LeechEnlightened,LeechBurned
2017-10-23 07:09:45,1508742585,6,671,27,0,0,1,6,35,106,200,323,0,0,0,1,4,8,11,3,0,0

i.e. the same information as is displayed here, but also over time:

Got any suggestions for what else to include in the csv?

Are you interested in building a script to chart this data (or some other use that I haven’t thought of)? :slight_smile:

6 Likes

I actually have one (very shitty one) that I use just personally. I made it as a part of my Anti-burnout script, but my code is so bad I didn’t really want to share.

(The chart on the left is amount of items, the chart on the right is how much of the current dangerscore is occupied by the different categories. Both charts could be built on the data you’ve included.)

1 Like

Interesting, @finnra. What’s the logic for the chart on the right? No need to be shy about code, BTW.

Basically, I assign points per item per level. Lower levels are worth more points. Here’s my list of points (from my personal notes):

// Level 0: Paused / 0T- Lessons
// Level 1: 4h / 6T- Apprentice
// Level 2: 8h / 3T - Apprentice
// Level 3: 23h / 1.04T - Apprentice
// Level 4: 47h / 0.51T - Apprentice → Guru
// Level 5: 167h / 0.14T - Guru
// Level 6: 335h / 0.07T - Guru → Master
// Level 7: 719h / 0.03T - Master → Enlightened
// Level 8: 2879h / 0.01T - Enlightened → Burned
// Level 9: Paused / 0T -Burned

The ratios are what’s important, not what exactly the points is. But essentially the points tell you how much time you will be spending on the item, on average, during the next let’s say day, compared to other items. So if I have ten apprentice one items, they are worth 60 points. Ten enlightened items are worth 0.1 points. You can read a bit more about the algorithm on my script page. It is possible to use these numbers to gauge how burdened your WK day is, and to adjust your learning speed with real numbers.

The actual logic (pseudocode but copied sloppily) for printing the numbers is:

for (var i = 13; i < tlength+11; i++) {
    cell.offset(1,i).setValue((total_srs[i-12]*danger[i-12])/2);
 } // This basically prints a value for each of the levels in fields along the row.

where:
var tlength = total_srs.length; // this finds out how many items are in the array iirc.
var total_srs[] = wkDataIterate() // this builds an array of numbers of items per level from apprentice to enlightened.
var danger = [0, 6, 3, 1.04, 0.51, 0.14, 0.07, 0.03, 0.01, 0]

The chart is a 100% stacked area chart, which shows the ratios day by day. I found it interesting to see if my main burden is apprentice items, or guru items, or even enlightened items. It will depend on how many items you add per day.

I’m sorry if anything is unclear. I tried to explain as well as I could.

The actual actual code is:

Summary
// Level 0: Paused / 0 GGE - Lessons
// Level 1: 4h     / 6 GGR - Apprentice
// Level 2: 8h     / 3 GGR - Apprentice
// Level 3: 23h    / 1.04 GGR - Apprentice
// Level 4: 47h    / 0.51 GGR - Apprentice --> Guru
// Level 5: 167h   / 0.14 GGR - Guru
// Level 6: 335h   / 0.07 GGR - Guru --> Master
// Level 7: 719h   / 0.03 GGE - Master --> Enlightened
// Level 8: 2879h  / 0.01 GGE - Enlightened --> Burned
// Level 9: Paused / 0 GGE -Burned

var apikey = '4185e81b-c0f5-4e69-ac5b-5fe4420cf1c8';
var danger = [0, 6, 3, 1.04, 0.51, 0.14, 0.07, 0.03, 0.01, 0]
var sheet = SpreadsheetApp.getActiveSheet();

function statisticsPrint() {
  var cell = sheet.getRange(sheet.getLastRow(),1);
  var total_srs = wkDataIterate();
  var tlength = total_srs.length;
  cell.offset(1,0).setValue(new Date());
      for (var i = 1; i < tlength; i++) {
       cell.offset(1,i).setValue(total_srs[i]);
    }
        for (var i = 13; i < tlength+11; i++) {
       cell.offset(1,i).setValue((total_srs[i-12]*danger[i-12])/2);
    }
  
}

function dangerPrint() {
  var basecell = sheet.getRange(2,1);
  var total_srs = wkDataIterate();
  var tlength = total_srs.length
  var calc_danger = 0
  
    for (i = 0; i < tlength; i++) {
       basecell.offset(0,i).setValue(total_srs[i]);
       calc_danger += total_srs[i] * danger[i]
    }
  basecell.offset(0,10).setValue(calc_danger / 2);
}

function wkDataIterate() {
    var total_srs = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
    tlength = total_srs.length

    for (i = 0; i < tlength; i++) {
        total_srs[i] = wkDataGet(i).total_count

        if (total_srs[i] == null) {
            total_srs[i] = 0
        } 
    }
  return total_srs
}

function wkDataGet(srsLevel) {
    var headers = {
        'Authorization': 'Token token={' + apikey + '}'
    };

    var options = {
        'headers': headers,
        'Cache-Control': 'max-age=0, must-revalidate',
        'muteHttpExceptions': true,
    };
    var wkData = UrlFetchApp.fetch("https://www.wanikani.com/api/v2/assignments?srs_stages=" + srsLevel, options).getContentText();
    var wkDataSerialized = JSON.parse(wkData);
  
    return wkDataSerialized;
}

(I have since changed my api key.)

Doesn’t this basically do what you want? Just with not as much data.

1 Like

Part of the reason I rolled my own is that the chart you linked uses API v1. This API is supposed to be sunset (whatever that means), and I’m not sure if I would want any long term projects running on it.

I stole the charting idea from it though!

Ah, I forgot about that. :frowning: Maybe someone will generously update the script to v2 for everyone.

It feels like that’s kind of what hitechbunny wants to do in this thread!

Okay! Anyone can now use the CORS-friendly URL here to download their history of SRS level counts (and leech counts)
by visiting https://wanikanitools-golang.curiousattemptbunny.com/srs/status/history.csv?api_key=YOUR_V2_API_KEY. Of course this is only populated with data if you use [Unsupported] Dashboard Userscript: Leech, Apprentice, and Guru detail (aka SRS level progress).

I only just started recording this information, so it will be historic data from now onwards. What to see what this looks like? If you visit the URL without an api_key parameter then it will show you data for my user, hitechbunny:

https://wanikanitools-golang.curiousattemptbunny.com/srs/status/history.csv

The content of the file looks like this:

UTCDateTime,EpochSeconds,UserLevel,Total,LeechTotal,Apprentice1,Apprentice2,Apprentice3,Apprentice4,Guru1,Guru2,Master,Enlightened,Burned,LeechApprentice1,LeechApprentice2,LeechApprentice3,LeechApprentice4,LeechGuru1,LeechGuru2,LeechMaster,LeechEnlightened,LeechBurned
2017-10-24 15:51:38,1508860298,6,671,24,0,1,1,3,35,102,206,323,0,0,1,1,3,6,10,3,0,0

You can see where those numbers are in the corresponding dashboard view:

image

To further illustrate, I just did a review:

So my updated dashboard looks like this:

image

And likewise my history csv is:

UTCDateTime,EpochSeconds,UserLevel,Total,LeechTotal,Apprentice1,Apprentice2,Apprentice3,Apprentice4,Guru1,Guru2,Master,Enlightened,Burned,LeechApprentice1,LeechApprentice2,LeechApprentice3,LeechApprentice4,LeechGuru1,LeechGuru2,LeechMaster,LeechEnlightened,LeechBurned
2017-10-24 15:51:38,1508860298,6,671,24,0,1,1,3,35,102,206,323,0,0,1,1,3,6,10,3,0,0
2017-10-24 15:57:36,1508860656,6,671,24,0,1,1,3,35,102,206,323,0,0,1,1,3,6,10,3,0,0
2017-10-24 15:57:38,1508860658,6,671,24,0,1,1,3,35,102,206,323,0,0,1,1,3,6,10,3,0,0
2017-10-24 15:59:12,1508860752,6,671,24,0,1,1,3,34,103,205,324,0,0,1,1,3,6,10,3,0,0

I’m not doing anything to eliminate duplicate lines yet. You get the idea, I hope.

Let me know if you have questions. I’d love for someone to do something with this in some way. :smiley:

1 Like

I’ve put something together. What do you all think? See animated gif:

I have more information to show (leech total, and leech totals by SRS stage). I’m not sure how to show it. Thoughts welcome.

5 Likes

Genuinely impressed.

This would be an instant installation for me.

Seems to be motivating !

I’ve published this script and updated the OP with details. You can get the “Progress Chart” script from the [Unsupported] App Store script.

Looking good!

A data import, for those of us that have some data but arrived late to the party, would be great.

Otherwise, I’ll have to wait until I have some data to show before I can see how it looks.

2 Likes

Any update on this?
I just found out about this and it would be nice if i could show the data from level 1 to current.
Nice script either way!

Suddenly stopped working today for me.
I didn’t change any settings/installed new scripts.

The space where the progress chart is supposed to go is just an empty space now.
It seems the dev isn’t around anymore, so I hope someone else will start maintaining this in the future, I really like having this.

EDIT: the website linked in OP’s post is no longer working, so I assume that has something to do with it. Seems it was taken offline :frowning:
more info here GitHub - curious-attempt-bunny/wanikanitools: Tools for users of Wanikani.com (a japanese study website)

Yeah, I see what you mean, it is empty for me too :cry:

I like this script a lot. I was expecting this to happen eventually since @hitechbunny is not around anymore but I would hoping it would just “magically” continue to work. Maybe we are lucky and the server goes back up at some point.

It will be difficult to maintain this one without his server doing all the work in the background.

I just opened an issue on his github page asking if its permanent or a temporary hiccup. fingers crossed

2 Likes

I think that all the scripts by @hitechbunny stopped working :frowning:

Both the review leech script and the SRS level progress script aren’t working D:

1 Like

They all worked fine until yesterday for me. I guess it might have to do with them not getting any data from the wanikanitools site.
I already messaged some friends that might be able to maintain this. will see how it goes i guess.

1 Like