-
Notifications
You must be signed in to change notification settings - Fork 2
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
Visualization: Add line types split indicator, similar to languages split indicator on GitHub #55
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The resample+groupby process creates sparsified dataframe, with periods in which there are no samples entirely missing, instead of having one entry per given frequency, even if some of them would be all zeros. This however matters for plots, so fill the dataframe with per-author data with zeros, if needed, before plotting. The author_timeline_df_freq() function was created for this purpose. It is based on experiments in the "Un-sparseify time series" section: notebooks/panel/02-contributors_graph.ipynb#Un-sparseify-time-series TimeseriesPlotForAuthor now uses this function (with the help of pn.rx()). While at it, comment-out remaining debug-print command.
Without this change the per-repo plot (the main plot) takes up toomuch space. It is most probably not the optimal solution...
This will be quite useful to show how different types of lines are distributed among changed lines per-repo, and per-author for each author shown on the authors grid. While at it, rename SpecialColumns enum to SpecialColumnsEnum.
This adds indicator for split between different line types in changed lines (both deleted and added lines). This indicator is similar to the "Languages" information in the sidebar on the right side of the repo view on GitHub. Currently it does not yet include the legend for the indicator, beside the use of the "title" attribute. The look of the indicator was developed using CodePen: https://codepen.io/jnareb/pen/jOgQYxg . TODO: fix a bug with the indicator not refreshing after changing the "Period:" widget value, as it should (similar code does work correctly in other places).
The ContributionsPercHeader now can provide legend (description) of the indicator for split between different line types in changed lines (both deleted and added lines). The legend follow style of "Languages" indicator and its legend in GitHub (present in sidebar in the repository view); though it uses slightly different SVG, and uses CSS classes instead of in-line styling. See https://codepen.io/jnareb/pen/jOgQYxg - where both SVG codes are shown.
It is now present for each author, but without the legend. You can either use mouseover, or rely on the fact that per-repo indicator has legend, and that colors match between per-repo and per-author indicators.
The 'tensorflow' dataset has only two authors, and somehow some watcher tries to run author_timeline_df_freq() with updated dataframe, but with old author_id... This workaround is not entirely succesfull, as there is still the same error: KeyError in author_timeline_df_freq().
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes the per-author plots more correct by filling missing periods with zeros, instead of skipping them.
The main part is however adding the indicator for split between different line types, as % of total number of changed lines. This indicator and its legend is patterned after the programming languages split indicator that GitHub uses (in GitHub it is shown on the right hand side, in the sidebar, in the repository view).
The "No plot" selection for the contribution makes it possible to see on one screen both the per-repo indicator, and many per-author indicators. See the relevant fragment of the screenshot below:
TODO: Make it update when changing the value of the "Period:" widget (it should, but it does not).
TODO: Fix an earlier but that makes it impossible to change the JSON data file. Or add a workaround, at least. (!!!)