public static void ConvertGitHubUserDataToHaloUserAsync(GitHubUserData userData, ref User user) { //DaysActive => 'size': (float), //Velocity => 'speed': (float), //PullConversionRate => 'brightness': (float), //Complexity(inverse) => 'complexity': (float), //CreateEventCount => 'color': (float), //Total Code Line Count => 'wobble': (float), //PushEventCount => 'colorCenter': (float), //PullEventCount => 'colorCenterRatio': (float), //EventFrequencyCount 'waveCount': (int), //OverallContributorRanking => 'highlightRing': (float) // that last one is... by adding up all the other ones, sort all users by total, then rank order user.Size = Normalize(userData.GetDaysActive()); user.Speed = userData.GetVelocity(); user.Brightness = userData.GetPullConversionRate(); user.Complexity = userData.GetPullConversionRate(); // $todo user.Color = Normalize(userData.GetEventFrequency()); user.Wobble = Normalize(userData.GetNumberOfCommits()); // $todo GetTotalLinesOfCode broken because of private repos not reporting data user.ColorCenter = Normalize(userData.GetPushEventCount()); user.ColorCenterRatio = Normalize(userData.GetPullRequestEventCount()); user.WaveCount = userData.GetCreateEventCount(); user.HighlightRing = Normalize(userData.GetCreateEventCount() + userData.GetPushEventCount()); // $todo //raw github metrics (for prototyping halo) user.CreateEventCount = userData.GetCreateEventCount(); user.PushEventCount = userData.GetPushEventCount(); user.CommitCount = userData.GetNumberOfCommits(); user.PullRequestCount = userData.GetPullRequestEventCount(); user.DaysActive = userData.GetDaysActive(); user.ActionVelocity = userData.GetVelocity(); user.PullConversionRate = userData.GetPullConversionRate(); }