2
$\begingroup$

Here's a picture of what I mean by a stacked bar chart:

Question: For the following GitHub repos:

  1. Organization1/Repo1 (branch: branch1)
  2. Organization2/Repo2 (branch: branch2)

How can one make a stacked bar chart of the commits per day? So if, i.e., on 2019-07-08 we had 2 commits in the first repo and 3 commits in the second repo, then the bar chart should show 5 total commits on that date segmented across the two repos.

It would be nice also if we could limit this to a single contributor (say with username contributor1).

Attempt

EDIT: I can use answers from elsewhere in this site to get part of this question answere, but not all of it. Suppose that we wish to pull data for

  1. WolframResearch/WolframClientForPython
  2. WolframResearch/WolframLanguageForJupyter

We can use

Import["https://raw.githubusercontent.com/antononcube/\
MathematicaForPrediction/master/Misc/GitHubPlots.m"];

Import["https://raw.githubusercontent.com/antononcube/\
MathematicaForPrediction/master/Misc/GitHubDataObjects.m"];

reposToAnalyze = {"WolframClientForPython", 
   "WolframLanguageForJupyter"};

ghs = Map[MakeGitHubDataObject["WolframResearch", #] &, 
   reposToAnalyze];
ghComposite = GitHubDataComposite[Unique[], ghs];
ghComposite[
 "Plot3D"["ProjectPlanes" -> True, "GlobalTimeOrder" -> False, 
  BoxRatios -> {1, 2, 2}, ImageSize -> {Automatic, 1000}]]

ghDLPlots = 
  Map[GitHubDateListPlot["WolframResearch", #, 
     PlotLabel -> Style[#, "Subsubtitle"], 
     FrameTicks -> {{All, All}, {Automatic, Automatic}}, 
     AspectRatio -> 4] &, reposToAnalyze];
Grid[{ghDLPlots}]

which yields:

enter image description here enter image description here

Problems with this solution:

  1. There is no way (AFAIK) to get information on a particular branch (or for a particular contributor) using antononcube's (wonderful) library.
  2. The graphs are segmented, when I'd like to view these parts as a "whole" (I think the stacked bar chart is the best way to do this, unless I'm mistaken).
$\endgroup$
3

1 Answer 1

1
$\begingroup$

Thanks for using that package!

There is no way (AFAIK) to get information on a particular branch (or for a particular contributor) using antononcube's (wonderful) library.

Yes, there is an OOP method implemented for that. Using ghs from your code:

ghs[[1]]["CommitRecords"]

enter image description here

$\endgroup$
1
  • $\begingroup$ Is there a way to isolate this data on a particular branch? $\endgroup$
    – George
    Commented Jul 10, 2019 at 16:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.