Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: started working on force-directed graph for visualizing category-transitions #365

Merged
merged 3 commits into from
Sep 8, 2022

Conversation

ErikBjare
Copy link
Member

@ErikBjare ErikBjare commented Sep 7, 2022

Generates a graph where:

  • node radius is based on the time spent in the category.
  • edge force & thickness is based on the number of transitions (not the best metric)

Uses category colors.

TODO

  • What should count as a transition/context-switch?
    • Currently, even the briefest of transitions are counted as just as significant (could reduce this by merging/flooding category-events and removing short category-events)
    • Also shouldn't count transitions wider than x seconds apart (or fill such gaps with events that have an "afk" category, since that might also be interesting to see)
    • @casaout might have some ideas
  • Is there a way to get directed-graph behavior, with animated edges to see direction things are flowing?
    • Seems super overkill and hard, but maybe awesome?

Screenshot (WIP)

image

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #365 (6f9f20f) into master (f9481d0) will decrease coverage by 0.28%.
The diff coverage is 7.14%.

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
- Coverage   26.00%   25.71%   -0.29%     
==========================================
  Files          26       26              
  Lines        1419     1431      +12     
  Branches      219      219              
==========================================
- Hits          369      368       -1     
- Misses        998     1011      +13     
  Partials       52       52              
Impacted Files Coverage Δ
src/route.js 0.00% <0.00%> (ø)
src/stores/activity.ts 33.20% <0.00%> (-0.39%) ⬇️
src/stores/categories.ts 63.15% <9.09%> (-7.09%) ⬇️
src/util/classes.ts 82.82% <10.00%> (-2.59%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ErikBjare ErikBjare merged commit a4c932b into master Sep 8, 2022
@ErikBjare ErikBjare deleted the dev/category-graph branch September 8, 2022 09:55
@casaout
Copy link

casaout commented Sep 8, 2022

Thanks, Erik, for pinging me!

It might be helpful to get a little bit more context on the feature aims and what you're trying to achieve/visualize, to be able to answer your question better.

Am I assuming correctly that you create categories based on the app/website usage that ActivityWatch detects?

Generally, I think it might be really challenging to come up with good, universal rules/heuristics that define which category switches (or combinations) account for a context switch. It's also highly dependent on the definition of 'context switch'; I'd probably define it to something that is similar to a task (i.e., task switch)... In some preliminary work, we've tried to train models to identify task switches and types based on users' self-reports; but these are highly individual.

What we're doing in PersonalAnalytics is to treat 'afk' as it's own 'IDLE' category. This is set if there is no user input for 2 (or 3) minutes, I think. The thing is, however, that the user might be taking some notes (but is still within the same context/task) or doing a biobreak (which would probably be a context/task switch).

@ErikBjare
Copy link
Member Author

It might be helpful to get a little bit more context on the feature aims and what you're trying to achieve/visualize, to be able to answer your question better.

I'm not quite sure yet, this is quite experimental. I wanted to try and visualize how I context switch between categories in some neat way.

Asked you because I figured you had a good view of the prior art and could point me in the right direction (since I noticed I was quite lost). Didn't want to reinvent the wheel.

Am I assuming correctly that you create categories based on the app/website usage that ActivityWatch detects?

Yes, the categorization happens using regular expressions, and form a hierarchy.

This is set if there is no user input for 2 (or 3) minutes, I think.

We use 3min :)

The thing is, however, that the user might be taking some notes (but is still within the same context/task) or doing a biobreak (which would probably be a context/task switch).

Yeah, I've figured that some context switches are larger/harder than others. Perhaps one could let the user set a threshold for how "large" switches have to be to count, somehow (maybe depending on gap size, low-likelihood transition, ...).

Will read that paper, thanks!

@casaout
Copy link

casaout commented Sep 9, 2022

A few things that came to mind:

  • The interesting thing is that I haven't been able to find a proper solution in related work and myself yet. So it's definitely awesome to have another great mind thinking about it ;)
  • You could also consider the time spent in an activity (category) before switching to the next one. I could imagine that you, e.g., switch less when working in the IDE.
  • Maybe the transition itself is the most interesting. Are there any patterns? (e.g. after social media, a person always switches to email briefly; or, more switches towards the evening when tired) Could some patterns (e.g. constant switching to email/IM when coding) indicate that you are not very focused/productive/...?
  • Regarding transitions between activities, one thing, we also looked at briefly was to identify patterns of switches that frequently come together (code -> stackoverflow -> code, email -> IM -> task list). We also did some preliminary animated visualizations, but I cannot find them anymore :( Somewhat related, maybe Chapter 5.2 in our paper on developers' work lives could be interesting too.
  • Generally, I believe such a visualization will benefit from user input, be it manual setting of thresholds/creating simple queries OR self-reporting (productivity/tiredness/focus/progress).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants