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 team score over time line graphs #1

Closed
glen3b opened this issue Dec 14, 2017 · 9 comments
Closed

Add team score over time line graphs #1

glen3b opened this issue Dec 14, 2017 · 9 comments
Assignees
Labels

Comments

@glen3b
Copy link
Owner

glen3b commented Dec 14, 2017

Add line graphs of team scores over time.

@glen3b
Copy link
Owner Author

glen3b commented Dec 23, 2017

Unfortunately I can't seem find a good .NET Core bitmap manipulation library, which makes this harder.

@glen3b
Copy link
Owner Author

glen3b commented Dec 23, 2017

Something like OxyPlot can render a graph to an SVG, but Discord does not accept SVG image embeds, so a PNG renderer is still required. It's possible we could build a platform abstraction library and make native calls for the rendering, which is ugly. There are bitmap libraries, such as ImageSharp, but I haven't looked at these in conjunction with SVG rendering. There are libraries such as vvvv/SVG, but that one in particular includes a reference to System.Drawing and is thus probably unsuitable without modification.

@glen3b
Copy link
Owner Author

glen3b commented Dec 24, 2017

Possibility is using my bitmap graphing library, which is written with this use case in mind, but it's another component to maintain.

@lighthouse64
Copy link

By graph, do you mean a histogram?

@glen3b
Copy link
Owner Author

glen3b commented Dec 30, 2017

The CCS scoreboard includes line graphs of individual team scores over time:
Score over time

I'd like to replicate that in the bot.

@aopell
Copy link
Collaborator

aopell commented Dec 30, 2017

Histograms of score distributions would not be a bad feature either

@glen3b
Copy link
Owner Author

glen3b commented Dec 30, 2017

I agree, feel free to open a separate feature issue for that.

@glen3b glen3b changed the title Add team score graphs Add team score over time line graphs Dec 30, 2017
@glen3b
Copy link
Owner Author

glen3b commented Jan 4, 2018

Proposed model for bitmaps (also relevant in #35):

Project CyberPatriot.BitmapProvider: common glue types and abstractions

  • CyberPatriot.BitmapProvider.IGraphProviderService
    • Task WriteHistogramPngAsync(... some data arguments, maybe some rendering options like Color ..., Stream target)
  • CyberPatriot.BitmapProvider.Color: an RGBA32 struct for color
  • any other common types across bitmap libraries
  • probably won't implement a complete, abstract, image drawing API here, just any common types which each individual backend can convert

Project CyberPatriot.BitmapProvider.ImageSharp: Implementation backed by ImageSharp

  • ImageSharpGraphProviderService : CyberPatriot.BitmapProvider.IGraphProviderService, uses an Image and drawing tools to generate the requisite bitmaps, can probably also reference BitmapGraphing (which is pretty tightly tied to ImageSharp) for line graphing

In terms of the line graphing, BitmapGraphing needs work, but I think it's a good start

glen3b added a commit that referenced this issue Jan 4, 2018
@glen3b
Copy link
Owner Author

glen3b commented Jan 5, 2018

In terms of data retrieval:
We'll add another method to the score retriever interface. Possible return types:

  • A Dictionary<string, Something>, keyed by image name and with values being an enumerable of DTO to int keyvaluepairs (or a custom struct)
  • A Dictionary<string, SortedDictionary<DateTimeOffset, int>>
  • A custom type overriding indexers of [string] and of [string, DateTimeOffset], mirroring a Dictionary<string, SortedDictionary<DateTimeOffset, int>> in terms of behavior. Largely matches the actual implementation's initialization code:
    var data = new google.visualization.arrayToDataTable([
['Time', 'Debian7_regional_platinum', 'Ubuntu14_regional_platinum', 'Windows8_regional_platinum'],
['02/05 17:15', 9, 4, 3],
['02/05 17:20', 16, 22, 9],
['02/05 17:25', 27, 22, 22],
['02/05 17:30', 34, 24, 37],
['02/05 17:35', 45, 36, 41],
['02/05 17:40', 45, 43, 50],
['02/05 17:45', 50, 55, 59],
['02/05 17:50', 56, 58, 69],
['02/05 17:55', 64, 77, 69],
['02/05 18:00', 64, 77, 73],
['02/05 18:05', 64, 77, 73],
['02/05 18:10', 67, 80, 73],
['02/05 18:15', 64, 80, 73],
['02/05 18:20', 64, 83, 75],
['02/05 18:25', 64, 83, 75],
...
['02/05 22:25', 57, 86, 85],
['02/05 22:30', 68, 86, 85],
['02/05 22:35', 73, 86, 85],
['02/05 22:40', 82, 86, 85],
['02/05 22:45', null, 86, null],
    ]);

glen3b added a commit that referenced this issue Jan 22, 2018
@aopell aopell closed this as completed in ea6911a Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants