EyeWire Stats - another TamperMonkey script

ok so I had an ew tab open, opened a new one (with right click) to check on a cube from chat and then I tried to check my profile in new tab it worked, then i refreshed old tab and new tab does this:

old tab loads it okay with stats graphs etc.
I’m sure if I refresh the new tab it’ll load ok and old one won’t lol.

I also tried with ctrl+left click one time it didn’t do it another it did, lol

Unfortunately, I wasn’t able to reproduce it. I’ve tried different combinations, but it always worked for me. Could you describe more precise steps to do it? Like:

  1. I refreshed the original tab and didn’t open Profile
  2. I opened a new tab by right-clicking on a cube in the chat/Accuracy Tracker.
  3. I opened the Profile in the new rab still not opening it in the old one.
  4. I refreshed the old tab without ever opening the Profile tab here.
  5. I closed the new tab.
  6. The original tab shows an empty space instead of the stats in the Profile.
    Don’t know, if those were exactly the steps needed, just added an example. The important part here is, when and if you have opened the Profile dialog, because the chart is created when the dialog is opened and some of its properties are shared between tabs.

But for now, I have slightly different problem to face - weeks. Namely, there are Eurasia/ISO 8601 weeks (starting on Monday) and Americas’ weeks (starting on Sunday). There are also gregorian calendars (with gregorian counting of the weeks) and ISO 8601 week dates. In the gregorian, there are always 52 weeks and 1 day or 2 days on leap years. However, in ISO week years most years have exactly 52 weeks, but there 71 years in each 400 years, which have exactly 53 weeks. And those years aren’t in regular intervals, e.g. 2015, 2020, 2026, 2032, 2037, 2043, 2048, 2054, 2060 - the next leap years according to the ISO standard.
Also ISO week starts on Monday and are usually used in most programming languages in their date/time functions, while HQ time weeks start on Sunday.
Long story short: weeks currently don’t work as they should in the Profile stats. I’m working on it. I will probably just count, how many Wednesdays were in a year from the 1st of January til a given day. That should give me the correct number of weeks US-style.
Fun, fun, fun xD

2 Likes

ver. 2.0.4
Which (hopefully) FIXES the problems with weeks described above.

2 Likes

question dunno if its possible/feasible but say i click on my profile and i see that my accu has dropped to (for example) 78% in lv2 can it when i hover over the 78% except for the over/under percentages also tell me which cube(s) is/are doing me in and either let me seclect copy/paste or jump me there like chat links?

Added to my todo list :wink:
However, if/when I’ll do it, it will probably just be a list of cubes, which are already visible in the Activity Tracker. Maybe, possibly, filtered to show only cubes with e.g. 90% or less accuracy.

may not be in activity tracker, for example there’s a cube somewhere currently dropping my freaking lv2 to 92.7% and i can’t find it in neither activity tracker or in accu test page so it’s outside my 60 cubes but it’s doing me in for 9% lol :stuck_out_tongue: so i want it gone somehow lol so I somehow have to be able to find it and then inspect and reap it to kingdom come :stuck_out_tongue: lol

But i think it could work nicely if that list could only show cubes which are contributing to your over/under regardless of if they are cube 1 or cube 500 lol (in the 60 roll) so say I play:

Cube 1
Cube 2
Cube 3
Cube etc
Cube 60
Cube etc
Cube 500

ofc cubes 61-500+ are outside activity tracker and/or accu test page but they are affecting my darn accu and I can’t find them so if that list can show 500 (extreme example #) I’d greatly and vastly appreciate it lol.

Not really a bug, just a graphical annoyance. Between 2 buttons, normally, there is a 4 pixel spacing between them, aka 2 px margin, as shown here

However, between the stats and the challenge buttons, there is no spacing at all, despite the spacing between the forum and stats button, as shown here

Can you add the spacing please? It’s bugging me out, thanks

1 Like

Also, to add consistency, maybe you could also add the modified profile when viewing other users (if possible) or maybe just users who installed the script

As for the spacing - good catch. I’ll try to fix it in the next release.
As for the stats in other users’ accounts - I’m not sure about it. That might be a little too much info about other users available for everyone, which could be used even for some sort of stalking. I think, it’s a little bit safer the way it is now.

3 Likes

Imo stats are good as is, could have probs seeing all those stats from everyone else.

I have an idea for shortening the profile height. Instead of stretching the chart which makes it look weird, try to shorten each of the current, previous, best (beside the username), last 7 days, last 10 weeks, and last 12 months buttons to fit in a square button and move them all to the right. Maybe you could add a grey line between the stats and the chart so that you won’t be confused as to which buttons are for which.

Here’s a rough sketch (sorry for the slightly pixelated chart)

vs. the original

Edit: Quick question/suggestions, can you make the today, week, month, and custom buttons (from the stats button) capitalized properly? It’s driving my (not really) OCD crazy. Also, what is the proper format of the custom dates, and can you add it as a placeholder of the input field? Lastly, can you make the custom date window translucent/opaque? The text is a bit hard to read. Thanks.
(Well that edit wasn’t quick lol :stuck_out_tongue: )

2 Likes

In the next release the height of the chart will be a little smaller and that should help fitting the window in smaller resolutions.

As for the Custom button - the state that is available in the current public release, was just a stage of building, nothing useful is there, lol. In the dev version, I’m working on, the window will be opaque, there won’t be any input fields, but dropdowns, so no format will be necessary.
Also, I will not capitalize those buttons, because they aren’t capitalized in the leaderboard and I want a consistent look, lol.

2 Likes

Thanks for the reply! :smile: I now understand about the buttons and the custom date, but about the chart height, will the width also change to keep the aspect ratio? Because the purpose of the proposed design is to keep the window height the same small size while keeping the aspect ratio of the chart and prevent it from looking “squashed”.

2 Likes

The new height of the whole window will be 680px. The chart will look a little bit “squashed” for days, but if I had to make the width smaller, it would look “squeezed” for weeks and, especially, for months. So I had to compromise.

2 Likes

Ok, let me elaborate a bit more. Basically, you keep the aspect ratio of the “original” chart, meaning nothing will look squeezed or squashed, however, it will just be resized to a smaller size and aligned to the left, so that the 3 buttons (last 7 days, last 10 weeks, last 12 months) can be shortened to 3 buttons with shorter names and moved to the right of the chart, as shown in the picture I made. You could also maybe remove the link (blog.eyewire.org/stats) at the bottom, keep the current, previous, best buttons as is because it actually looks better that way, and position the top of the profile to around -10px, and bada bing bada boom, you get the perfect profile window optimized for small monitors!

1 Like

Just update the script and tell me, if it’s now ok, or we’ll try something other.
I’ve said update, because a new version is available:

ver. 2.1.0
ADDED the ability to display statistics for a custom period of time
ADDED button to check for completed cells in the SC history
ADDED button to remove completed cells in the SC history
ADDED input and button to remove cells in SC history by number of SCs in cell
ADDED context menu (right-click) to remove cells in SC history based on selected tab (mouse, zfish, both) and either number od SCs or date of last SC
FIXED 2px gap between buttons in the top menu
CHANGED size of the profile stats window to fit it better on smaller resolutions
additional FIXES for displaying weeks in the profile stats
FIXED a series or errors in the console, when a user wasn’t logged in
FIXED charts in the profile stats so for normal users only number of cubes, points and trailblazes is displayed. For scouts - also scythes and for scythes - also completes

Here’s how the custom period selection should look like:

Currently data is available only for a couple of tens of last days, for the last (ended) week and for the November. Whenever each period (day, week, month) ends, new data is added.

The new look of the SC history window:

To display the context menu, one has to right-click on a Remove button. Whenever an options says “this one”, it means, that the removing is done according to the cell, in which row the Remove button was right-clicked, e.g. if you right-clicked on the Remove buton in the first row of the table, the first options will delete all cells with last entry older than the one from the first entry. The second option will remove all cells which have number of completes lower than the cell from the first row.

Merry Christmas! :slight_smile:

2 Likes

Mr. Bug Reporter is back, and I gotta say, thanks for the update! I really like the solution for the chart, and, after making a script of my own for making minor adjustments, the profile looked PERFECT. :smile:

However, with some bug fixes comes more bugs. For example, the gap between the buttons are still absent, and while playing around with the custom stats, uhh,

This happened lol (It affects custom only and it’s also a problem for points and cubes). But overall, I really like the new features and fixes, and once again, thanks!

Edit: I just realized that the map does not automatically center when resizing the stats window, and the legends for the colors overlap on top of the points, cubes, and people button, so

This happens This happens

Edit edit: It turns out that the overlapping legends were because they randomly shifted down, and after a few reloads, it now fixed itself, so yay to that
Anyway, I made some code of my own that fixes some of the problems I mentioned.

$('head').append(`<style>
li:not(#acc) {margin-left: 2px; margin-right: 2px;}
#profileContainer {top: -10px;}
#profStatsAbout {font-size: 0px;}
#ewsWorldMap {position: relative; left: 50%; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%);}
</style>`);

The 1st line is to add the margins on the top buttons, and 2nd line is to position the profile so that the entire window can be seen, the 3rd line is to remove the stats link at the bottom of the profile, and the last line is to center the map, even after resizing.

3 Likes

Nice! Thanks for those bug reports. They are really important for making the script work as it should.
It’s hard to test everything on my own. Especially, when I’m doing a couple of features, which are connected to each other. I can do one thing and make it work as it should, then the next thing and sometimes the next one needs some fixes in the previous one. Fixes might look innocent, but can break stuff, which was already working. I’m trying to test such changes, but sometimes fixes affect also something less connected with the feature.
As Marvel says: It’s all connected :smiley:

As for margins - I though, that the problem was that there was a margin, so I’ve tried to remove it. But the actual problem is the exact opposite, lol.

The legend was kindly problematic, because the built-in to the chart.js didn’t work as expected and I had to make a custom one.

Also thanks for the code. I’ll take a look at it and add all the necessary stuff :slight_smile:

2 Likes

Wait, I just realized something!

What if… You keep the profile window back to its old days of being small (before the chart) but probably around 100 pixels bigger, but still keep the ORIGINAL chart, the really big one, meaning it will surely overflow.

BUT… You add a scrollbar!!! :open_mouth:

Well, since the original achievements (old layout) had a scrollbar, it is surely possible to add one in the profile, right?

Here’s a rough sketch of what it should look like:

PS. Because of the shorter window height, you might also wanna add the scrollbar in the achievements tab.

1 Like

and no scrollbar and larger profile for the larger screens (like mine :stuck_out_tongue: ) :stuck_out_tongue: lol

2 Likes