Show evolution of win/draw/loss evaluation over time (white point of view), can be filtered in between turns to show a single chessgame.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://raw.githubusercontent.com/CGI-FR/crowd-chess-data/refs/heads/main/20240927-turns.csv"
},
"width": 800,
"height": 600,
"transform": [
{"filter": {"field": "id", "lt": 6210}},
{"filter": {"field": "id", "gt": 6152}},
{"fold": ["win", "draw", "loss"], "as": ["Résultat", "Probabilité"]},
{"calculate": "indexof(['win', 'draw', 'loss'], datum.Résultat)", "as": "order"}
],
"mark": "area",
"encoding": {
"x": {"field": "end_of_turn", "type": "temporal", "title": "Heure"},
"y": {
"field": "Probabilité",
"type": "quantitative",
"stack": "normalize",
"title": "Probabilité cumulée (%)",
"axis": {"format": "%"}
},
"color": {
"field": "Résultat",
"type": "nominal",
"title": "Résultat",
"scale": {
"domain": ["win", "draw", "loss"],
"range": ["#f5f5dc", "#808080", "#000000"]
}
},
"order": {"field": "order", "type": "ordinal"}
}
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://raw.githubusercontent.com/CGI-FR/crowd-chess-data/refs/heads/main/202409-votes.csv"
},
"vconcat": [
{
"width": 800,
"height": 600,
"params": [{"name": "jour", "select": {"type": "point", "encodings": ["x"]}}],
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "date",
"field": "instant",
"type": "temporal",
"title": "Jour",
"bandPosition": 0
},
"y": {
"aggregate": "distinct",
"field": "player_pseudo",
"type": "quantitative",
"title": "Nombre de joueurs"
},
"color": {
"aggregate": "distinct",
"field": "player_pseudo",
"legend": {
"title": "Nombre de joueurs"
}
}
}
},
{
"width": 800,
"height": 600,
"transform": [{"filter": {"param": "jour"}}],
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "hours",
"field": "instant",
"type": "temporal",
"title": "Heure",
"bandPosition": 0,
"axis": {
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
}
},
"y": {
"aggregate": "distinct",
"field": "player_pseudo",
"type": "quantitative",
"title": "Nombre de joueurs"
},
"color": {
"aggregate": "distinct",
"field": "player_pseudo",
"legend": {
"title": "Nombre de joueurs"
},
"scale": {
"scheme": "reds"
}
}
}
}]
}
Compute average accuracy of players with at least 5 active votes (an active vote is the last vote submitted on each turn).
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://raw.githubusercontent.com/CGI-FR/crowd-chess-data/refs/heads/main/20241018-votes-effective.csv"
},
"width": 800,
"height": 600,
"transform": [
{
"filter": "datum.turn_id < 10552"
},
{
"groupby": ["player_pseudo"],
"aggregate": [
{"op": "count", "as": "nb_moves"},
{"op": "mean", "field": "accuracy", "as": "avg_accuracy"},
{"op": "mean", "field": "points", "as": "avg_points"}
]
},
{
"filter": "datum.nb_moves >= 5"
}
],
"mark": {
"type": "bar",
"color": "#b41f1f"
},
"encoding": {
"x": {
"field": "avg_accuracy",
"type": "quantitative",
"title": "Précision moyenne par tours"
},
"y": {
"field": "player_pseudo",
"type": "nominal",
"sort": "-x",
"title": "Joueur"
},
"color": {
"field": "nb_moves",
"type": "quantitative",
"scale": {"scheme": "blues"},
"title": "Nombre de tours joués"
}
},
"config": {
"axis": {
"labelFontSize": 10,
"titleFontSize": 14
}
}
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://raw.githubusercontent.com/CGI-FR/crowd-chess-data/refs/heads/main/20241018-votes-effective.csv"
},
"width": 800,
"height": 600,
"transform": [
{
"filter": "datum.turn_id < 10552"
},
{
"groupby": ["player_pseudo"],
"aggregate": [
{"op": "count", "as": "nb_moves"},
{"op": "mean", "field": "accuracy", "as": "avg_accuracy"},
{"op": "mean", "field": "points", "as": "avg_points"}
]
},
{
"filter": "datum.nb_moves >= 5"
}
],
"mark": {
"type": "bar",
"color": "#b41f1f"
},
"encoding": {
"x": {
"field": "avg_points",
"type": "quantitative",
"title": "Quantité moyenne de points engrangés par tours"
},
"y": {
"field": "player_pseudo",
"type": "nominal",
"sort": "-x",
"title": "Joueur"
},
"color": {
"field": "nb_moves",
"type": "quantitative",
"scale": {"scheme": "reds"},
"title": "Nombre de tours joués"
}
},
"config": {
"axis": {
"labelFontSize": 10,
"titleFontSize": 14
}
}
}