Skip to content

Commit c4595f8

Browse files
committed
Added mouse-over highlighting for commit path nodes in GitHubDateListPlot.
1 parent 733f6a6 commit c4595f8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Misc/GitHubPlots.m

+14-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ Mathematica is (C) Copyright 1988-2015 Wolfram Research, Inc.
8282
There are several options that would be nice to be added.
8383
1. Font size of the ticks, coloring, line thickness, etc.
8484
2. I am not sure is possible and how to retrieve commits that a password protected.
85-
3. Hyperlinks to the commits.
85+
3. DONE -- Hyperlinks to the commits.
86+
4. Error handling.
87+
5. Refactor the code so the git data be retrieved separately from the plotting.
88+
This is needed for experimentation with the plots because GitHub will reject requests
89+
after they become too many (for GitHub).
8690
8791
8892
There are probably bugs in the code. I have tested it with only 4-5 repositories.
@@ -204,14 +208,14 @@ Mathematica is (C) Copyright 1988-2015 Wolfram Research, Inc.
204208
(* DateListPlot based *)
205209
(* It would be nice to be able to specify the commits point sizes and line thickness of the dependencies. *)
206210
GitHubDateListPlot[ user_String, repo_String, opts:OptionsPattern[] ] :=
207-
Block[{commitRecs, pathsByInds, datePoints, tickLabels, gr},
211+
Block[{commitRecs, pathsByInds, datePoints, tickLabels, gr, pointSize=0.03},
208212

209213
{commitRecs, pathsByInds, datePoints, tickLabels} = CorePlotData[user,repo];
210214

211215
gr = DateListPlot[
212216
MapThread[Tooltip[#1, #2] &, {datePoints, tickLabels}],
213217
opts,
214-
Joined -> False, PlotStyle -> {PointSize[0.03]},
218+
Joined -> False, PlotStyle -> {PointSize[pointSize]},
215219
PlotRange -> All, AspectRatio -> 2, ImageSize -> {Automatic, 800},
216220
GridLines -> {None, Automatic},
217221
FrameTicks -> {{Automatic,
@@ -220,10 +224,13 @@ Mathematica is (C) Copyright 1988-2015 Wolfram Research, Inc.
220224

221225
Show[gr,
222226
Graphics[{Opacity[0.5], Thickness[0.01],
223-
MapThread[{ColorData["TemperatureMap"][#2],
224-
Line[datePoints[[#1]]]} &, {pathsByInds,
225-
RandomSample[Range[0, 1, 1/(Length[pathsByInds] - 1)]]}],
226-
Opacity[1], LightBlue, PointSize[0.02],
227+
MapThread[{
228+
ColorData["TemperatureMap"][#2],
229+
Mouseover[
230+
Line[datePoints[[#1]]], {Red, PointSize[pointSize*1.18], Point[datePoints[[#1]]]}]
231+
} &,
232+
{pathsByInds, RandomSample[Range[0, 1, 1/(Length[pathsByInds] - 1)]]}],
233+
Opacity[1], LightBlue, PointSize[pointSize*0.66],
227234
MapThread[
228235
Tooltip[
229236
Point[#1],

0 commit comments

Comments
 (0)