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

Add a user network plot #17

Merged
merged 6 commits into from
Mar 7, 2022
Merged

Add a user network plot #17

merged 6 commits into from
Mar 7, 2022

Conversation

johrpan
Copy link
Collaborator

@johrpan johrpan commented Feb 22, 2022

This PR does the following things:

  • The code for creating plots is moved out of the report template to make reuse easier.
  • Column types are now prespecified when converting the JSON data to tibbles. This was needed because I noticed some bugs related to the type conversions when dealing with different rooms.
  • A new function for conveniently getting all joined room IDs from a sync result is added.
  • Room members are added to the room state by using the members API.
  • Finally, a new plot is added that utilizes the room membership data to visualize a network of known users.

@GregSutcliffe
Copy link
Owner

This PR contains the logging changes from #16, which has been merged, so this conflicts. Can you rebase?

Otherwise this looks pretty good, I'm trying it out now!

This takes out the code for creating plots from the report template as
it may also be useful in other contexts. In addition to that, the time
limit is removed. I would expect the data to either be prefiltered for
the desired timespan or the initial fetch to have an appropriate `since`
parameter. Also, some of the message type filtering was changed because
I encountered some bugs in the process.
@johrpan
Copy link
Collaborator Author

johrpan commented Mar 7, 2022

I have rebased the branch. I wonder, why the commit from #16 is different now. Normally there shouldn't be any conflicts if the commit is identical. I mean, that's what you ensure by rebasing.

@GregSutcliffe
Copy link
Owner

I rebased #16 on merge, and rebase changes the SHAsum - so Git probably doesn't realise they're the same anymore.


### Daily Activity & trend (last 30 days)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why you're dropping the 30 day filter here?

We pass rooms rather than rooms$events to the report, so it's not trivial to filter the event list before calling the report. Perhaps we should allow a filter YAML parameter instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the data would either be prefiltered as desired or only reach back to the time. But going back to it, I think the functions for plotting should accept the time filter parameter with a default value.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. I was seeing some weirdness in my get_rooms calls after merging #16 that I am not seeing with these patches, so I think I'm going to merge this in the next hour or so (to keep HEAD working cleanly). We can roll-forward on adding time filters to the plots.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the branch reintroducing the time limit. But as it applies to all plots, I added it to the introducing paragraphs. I think that this makes more sense, but we can also go back to the initial visuals.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks! I wasn't trying to make you rush, I would have been happy to merge as is and then fix this later - but this is great. I agree we probably need to revisit the report itself - the new member calls mean we should probably add some of that data too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

In addition, an optional parameter allows for tweaking the desired
timespan.
@GregSutcliffe GregSutcliffe merged commit 886303b into main Mar 7, 2022
@GregSutcliffe
Copy link
Owner

Merged, thanks @johrpan!

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