Displaying a Leaderboard
Leaderboards are a dynamic list of ranked Articles that can highlight how Articles of a similar type rank in certain categories based on Assertions about those Articles in your repo.
Creating the Data for a leaderboard
The data for a leaderboard can come from any Assertion and a common pattern for creating leaderboards in WarmHub is to create a Claim Computed on WarmHub that takes an Assertion Type, and creates a new Assertion that picks out the properties that should be displayed on the leaderboard and gives them more display-friendly names.
Then the Leaderboard can be displayed on a repo's ReadMe by using a related-list
component. Here's what the template for displaying a leaderboard looks like in MDC:
::related-list
---
label: My New Leaderboard
query: /api/myorg/myrepo/myclaimtype
selectedColumns: ['instance.about.0', 'instance.property1', 'instance.property2']
headers: ['ArticleNames', 'Property1', 'property2']
---
::
Example
As an example, lets look at how a leaderboard for evaluating compression algorithms could be made using the claim type CompressionAlgorithmEvaluation
.
Lets say that we have run our compression evaluator and stored the results of the evaluations in an Evidence Type called CompressionEvaluationResultsRaw
,
Then we would create a Claim from that Evidence called CompressionAlgorithmEvaluation
and use the related list shown below, to create a leaderboard for that Claim.
::related-list
---
label: Compression Algorithm Leaderboard
query: /api/janedoe/CompressionRepo/CompressionAlgorithmEvaluation
selectedColumns: ['instance.about.0', 'instance.compression_ratio', 'instance.compression_time']
headers: ['Algorithm', 'Compression Ratio', 'Time']
---
::
Last updated