# \[Userscript\] WaniKani Workload Graph

**URL:** <https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731>\
**Category:** API And Third-Party Apps\
**Created:** [February 27, 2021, 2:27pm UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731 "2021-02-27T14:27:23Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![sansarret](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/sansarret/32/370654_2.png) [@sansarret](https://community.wanikani.com/u/sansarret)\
**Post date:** [February 28, 2021, 11:43pm UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/21 "2021-02-28T23:43:31Z")

</div>

Looks correct.  
 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/2/5/a/25a77cd27ea0b93f9420435cec6dfc13cb29b439.png)

Awesome script!

---

<div class="post-metadata">

**Author:** ![Pep95](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/pep95/32/280870_2.png) [@Pep95](https://community.wanikani.com/u/Pep95)\
**Post date:** [March 1, 2021, 2:52pm UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/22 "2021-03-01T14:52:41Z")

</div>

Finally had time to install it. Looks like my workload came to a very abrupt stop halfway 😅

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/1/f/c/1fc69fc6be835f791894730d051591d270e41422.png)

---

<div class="post-metadata">

**Author:** ![Kumirei](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kumirei/32/480522_2.png) [@Kumirei](https://community.wanikani.com/u/Kumirei)\
**Post date:** [March 4, 2021, 5:26am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/23 "2021-03-04T05:26:43Z")

</div>

Soooo… how about a toggle between reviews and lessons? 👀

---

<div class="post-metadata">

**Author:** ![Skywarp21](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/skywarp21/32/167406_2.png) [@Skywarp21](https://community.wanikani.com/u/Skywarp21)\
**Post date:** [March 4, 2021, 6:42am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/24 "2021-03-04T06:42:33Z")

</div>

Oooh more data to play with

so I didn’t get the chart button showing up in the heatmap originally, so I had to click on the Graph button in the header instead - but then the chart button did show up after I reloaded the page…

Anyway, my chart is:

 ![Screen Shot 2021-03-03 at 10.20.17 PM](https://global.discourse-cdn.com/wanikanicommunity/original/4X/5/8/0/580799ac51dd935c48d2e591cd42c780cb8c190e.png)

I like how it shows how I virtually quit WK right after I hit L60 around Christmas 2018, but then came back to a mountain of reviews later on 😜

---

<div class="post-metadata">

**Author:** ![2000kanji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/2000kanji/32/310132_2.png) [@2000kanji](https://community.wanikani.com/u/2000kanji)\
**Post date:** [March 4, 2021, 7:09am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/25 "2021-03-04T07:09:01Z")

</div>

Here is mine. The decrease after all lessons have been done is impressive.  
 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/9/7/5/975805434a1b39c83efbbc36f4348eabcf5b764d.png)

---

<div class="post-metadata">

**Author:** ![anon3564849](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/wanikanicommunity/original/3X/f/d/fd4c154120954695f788402f3bcf4e616499bc2d.png) [@anon3564849](https://community.wanikani.com/u/anon3564849)\
**Post date:** [March 4, 2021, 7:11am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/26 "2021-03-04T07:11:50Z")

</div>

I love it! Thanks for making this 😸

Edit : Also shows my lack of dedication 😅

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/b/9/9/b996cd54fef4c700707322c6e02ec64afc19e2a9.png)

---

<div class="post-metadata">

**Author:** ![Pep95](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/pep95/32/280870_2.png) [@Pep95](https://community.wanikani.com/u/Pep95)\
**Post date:** [March 4, 2021, 8:54am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/27 "2021-03-04T08:54:41Z")

</div>

> [@Skywarp21](#):
>
> so I didn’t get the chart button showing up in the heatmap originally, so I had to click on the Graph button in the header instead - but then the chart button did show up after I reloaded the page…

Yes, I have the same issue.  
When I load a page for the first time, it implements the “Graph” button.  
When I refresh the page, it is again attached to the heatmap.  
My guess is that since I have done so many reviews, it is not given enough time to determine whether the heatmap script is there. Just as an indication, I am currently sitting at 144k+ reviews.  
EDIT: It takes 8 seconds for heatmap to show up. (Actually when I tested it this time it was correctly placed on the heatmap, even when using Shift+F5 🤷‍♂️)

---

<div class="post-metadata">

**Author:** ![Kumirei](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kumirei/32/480522_2.png) [@Kumirei](https://community.wanikani.com/u/Kumirei)\
**Post date:** [March 4, 2021, 9:22am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/28 "2021-03-04T09:22:21Z")

</div>

Yeah, the Heatmap is pretty slow to load. I think it’s rather because it’s a lot of elements to render than it being a lot of reviews, but I’m not sure. I’ve been wanting to look into how to make it quicker.

Anyway, the workload graph only gives the heatmap around 6.4 seconds to load

---

<div class="post-metadata">

**Author:** ![Skywarp21](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/skywarp21/32/167406_2.png) [@Skywarp21](https://community.wanikani.com/u/Skywarp21)\
**Post date:** [March 4, 2021, 9:23am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/29 "2021-03-04T09:23:30Z")

</div>

> [@UdonMagoo](#):
>
> My guess is that since I have done so many reviews, it is not given enough time to determine whether the heatmap script is there. Just as an indication, I am currently sitting at 144k+ reviews.

Yes, I had a similar thought ⤴. It usually takes around 10s for the heatmap to show up when I haven’t loaded WK in a while, and then the graph button in the header appears before the heatmap.  
(and when I tried my ancient macbook just now, it took 90s for the heatmap to arrive 😅)

---

<div class="post-metadata">

**Author:** ![Pep95](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/pep95/32/280870_2.png) [@Pep95](https://community.wanikani.com/u/Pep95)\
**Post date:** [March 4, 2021, 9:24am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/30 "2021-03-04T09:24:21Z")

</div>

> [@Kumirei](#):
>
> the workload graph only gives the heatmap around 6.4 seconds to load

Well there ya go, extending that time should probably solve the issue.

---

<div class="post-metadata">

**Author:** ![Kumirei](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kumirei/32/480522_2.png) [@Kumirei](https://community.wanikani.com/u/Kumirei)\
**Post date:** [March 4, 2021, 9:27am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/31 "2021-03-04T09:27:04Z")

</div>

Or if @rwesterhof wants to cooperate I could send out a custom event when it loads

---

<div class="post-metadata">

**Author:** ![rwesterhof](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rwesterhof/32/296309_2.png) [@rwesterhof](https://community.wanikani.com/u/rwesterhof)\
**Post date:** [March 4, 2021, 10:05am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/32 "2021-03-04T10:05:40Z")

</div>

> [@Skywarp21](#):
>
> so I didn’t get the chart button showing up in the heatmap originally, so I had to click on the Graph button in the header instead - but then the chart button did show up after I reloaded the page…

> [@UdonMagoo](#):
>
> Well there ya go, extending that time should probably solve the issue.

Yeah, I’ve already given it more time locally - so it’ll be part of the next update. The time mostly goes into the loading of the reviews and review\_statistics via the wkof - the API calls tend to take a little longer than I originally accounted for.

> [@Kumirei](#):
>
> Or if @rwesterhof wants to cooperate I could send out a custom event when it loads

I’d be very interested!

> [@Kumirei](#):
>
> Soooo… how about a toggle between reviews and lessons? 👀

You think a graph of lessons would be interesting? Maybe I didn’t consider this because mine would be so boring. I did think about providing an input field + button so people could change the nr of days used in the running average calculation - it’s something to play with 🙂

---

<div class="post-metadata">

**Author:** ![Kumirei](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kumirei/32/480522_2.png) [@Kumirei](https://community.wanikani.com/u/Kumirei)\
**Post date:** [March 4, 2021, 10:08am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/33 "2021-03-04T10:08:19Z")

</div>

Not nearly as interesting as reviews, but once you see one you start feeling like you have to see the other

---

<div class="post-metadata">

**Author:** ![rwesterhof](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rwesterhof/32/296309_2.png) [@rwesterhof](https://community.wanikani.com/u/rwesterhof)\
**Post date:** [March 4, 2021, 10:12am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/34 "2021-03-04T10:12:09Z")

</div>

Need to do lessons and go for a run now, but I’ll take a look at it this afternoon. Lessons are retrieved quite differently I think - haven’t looked at that at all yet.

---

<div class="post-metadata">

**Author:** ![kloxy](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kloxy/32/796844_2.png) [@kloxy](https://community.wanikani.com/u/kloxy)\
**Post date:** [March 4, 2021, 10:21am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/35 "2021-03-04T10:21:49Z")

</div>

Here’s mine!

![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/b/4/d/b4d783985ec4512e60127e2903fdbacc854c5936.png)

---

<div class="post-metadata">

**Author:** ![Kumirei](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/kumirei/32/480522_2.png) [@Kumirei](https://community.wanikani.com/u/Kumirei)\
**Post date:** [March 4, 2021, 10:23am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/36 "2021-03-04T10:23:23Z")

</div>

Since that data is available in the WKOF ItemData it’s pretty easy to fetch

I have added a custom event `heatmap-loaded` that fires on the heatmap element (and bubbles) once it’s inserted into the page. Let me know if you want me to set a flag or something just to let your script know that the heatmap script is running at all

edit: Just remembered that WKOF has a flag system that we could use. I guess it doesn’t make much of a difference. If you prefer that just let me know and I’ll change it

---

<div class="post-metadata">

**Author:** ![Sproingle](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/sproingle/32/275063_2.png) [@Sproingle](https://community.wanikani.com/u/Sproingle)\
**Post date:** [March 4, 2021, 11:26am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/37 "2021-03-04T11:26:06Z")

</div>

> [@anon3564849](#):
>
> Edit : Also shows my lack of dedication

Well you are still here, so I’d call that big dedication 👍 👍

---

<div class="post-metadata">

**Author:** ![anon3564849](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/wanikanicommunity/original/3X/f/d/fd4c154120954695f788402f3bcf4e616499bc2d.png) [@anon3564849](https://community.wanikani.com/u/anon3564849)\
**Post date:** [March 4, 2021, 11:37am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/38 "2021-03-04T11:37:07Z")

</div>

> [@Sprongdiddlydooo](#):
>
> Well you are still here, so I’d call that big dedication 👍 👍

Thank you kindly 🙇‍♂️

---

<div class="post-metadata">

**Author:** ![rwesterhof](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rwesterhof/32/296309_2.png) [@rwesterhof](https://community.wanikani.com/u/rwesterhof)\
**Post date:** [March 5, 2021, 11:07pm UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/39 "2021-03-05T23:07:25Z")

</div>

I’m catching the heatmap-loaded event now. My graph script initially pushes the Graph button into the header and then moves it to the heatmap if the event is caught (meaning that dashboards without a heatmap will keep it in the header).

I had planned to do this yesterday, but I ended up Marie-Kondo’ing my linen closet. Took more time than I thought 😫

---

<div class="post-metadata">

**Author:** ![est\_fills\_cando](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/wanikanicommunity/original/3X/f/d/fd4c154120954695f788402f3bcf4e616499bc2d.png) [@est\_fills\_cando](https://community.wanikani.com/u/est_fills_cando)\
**Post date:** [March 6, 2021, 7:02am UTC](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731/40 "2021-03-06T07:02:39Z")

</div>

It looks like this script has a conflict with the level duration 2 script where it causes the level duration to display in the wrong place.

[Previous page](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731.md?page=1)

[Next page](https://community.wanikani.com/t/userscript-wanikani-workload-graph/49731.md?page=3)
