rating charts using highcharts
This commit is contained in:
parent
ed35ae66ac
commit
9016b894a1
|
@ -6,6 +6,9 @@
|
|||
@highchartsTag
|
||||
@highchartsMoreTag
|
||||
@jsTagCompiled("chart2.js")
|
||||
@info.ratingChart.map { ratingChart =>
|
||||
@embedJs(s"var lichess_rating_series = $ratingChart;")
|
||||
}
|
||||
}
|
||||
|
||||
@showPerf(name: String, perf: lila.rating.Perf) = {
|
||||
|
@ -27,6 +30,10 @@
|
|||
@showPerf("standard", u.perfs.standard)
|
||||
@showPerf("chess960", u.perfs.chess960)
|
||||
<br />
|
||||
@showPerf("bullet", u.perfs.bullet)
|
||||
@showPerf("blitz", u.perfs.blitz)
|
||||
@showPerf("slow", u.perfs.slow)
|
||||
<br />
|
||||
@u.perfs.pools.toList.sortBy(_._1).map {
|
||||
case (id, perf) => {
|
||||
@poolSetups.get(id).map { setup =>
|
||||
|
@ -37,10 +44,6 @@
|
|||
@if(u.perfs.pools.nonEmpty) {
|
||||
<br />
|
||||
}
|
||||
@showPerf("bullet", u.perfs.bullet)
|
||||
@showPerf("blitz", u.perfs.blitz)
|
||||
@showPerf("slow", u.perfs.slow)
|
||||
<br />
|
||||
@showPerf("puzzle", u.perfs.puzzle)
|
||||
</div>
|
||||
}
|
||||
|
@ -139,7 +142,7 @@ openGraph = Map(
|
|||
<div class="mod_zone"></div>
|
||||
<div class="meat">
|
||||
@info.ratingChart.map { ratingChart =>
|
||||
<div class="rating_history" title="Rating history" data-series="@ratingChart">
|
||||
<div class="rating_history" title="Rating history">
|
||||
<span>Chart loading…</span>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -43,25 +43,4 @@ final class HistoryApi(coll: Coll) {
|
|||
|
||||
def get(userId: String): Fu[Option[History]] =
|
||||
coll.find(BSONDocument("_id" -> userId)).one[History]
|
||||
|
||||
// def set(userId: String, history: Iterable[HistoryEntry]): Funit =
|
||||
// coll.insert(BSONDocument(
|
||||
// "_id" -> userId,
|
||||
// "e" -> BSONArray(history map write)
|
||||
// )).void
|
||||
|
||||
// def addEntry(userId: String, entry: HistoryEntry): Funit =
|
||||
// coll.update(
|
||||
// BSONDocument("_id" -> userId),
|
||||
// BSONDocument("$push" -> BSONDocument("e" -> write(entry))),
|
||||
// upsert = true).void
|
||||
|
||||
// def create(perfs: Perfs) = coll.insert(BSONDocument(
|
||||
// "_id" -> user.id,
|
||||
// "e" -> BSONArray(write(HistoryEntry(
|
||||
// DateTime.now,
|
||||
// user.perfs.global.glicko.intRating,
|
||||
// user.perfs.global.glicko.intDeviation,
|
||||
// Glicko.default.intRating)))
|
||||
// )).void
|
||||
}
|
||||
|
|
|
@ -35,15 +35,17 @@ $(function() {
|
|||
title: noText,
|
||||
xAxis: {
|
||||
type: 'datetime',
|
||||
labels: disabled,
|
||||
lineWidth: 0,
|
||||
tickWidth: 0,
|
||||
gridLineWidth: 0
|
||||
labels: {
|
||||
enabled: true
|
||||
},
|
||||
lineWidth: 1,
|
||||
tickWidth: 1,
|
||||
gridLineWidth: 1
|
||||
},
|
||||
yAxis: {
|
||||
gridLineWidth: 0,
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
x: 0,
|
||||
style: {
|
||||
font: Highcharts.makeFont(10),
|
||||
|
@ -66,7 +68,7 @@ $(function() {
|
|||
}
|
||||
}
|
||||
},
|
||||
series: _.map($(this).data('series'), function(serie) {
|
||||
series: _.map(lichess_rating_series, function(serie) {
|
||||
return {
|
||||
name: serie.name,
|
||||
type: 'line',
|
||||
|
|
|
@ -59,12 +59,9 @@ div.sub_ratings h3 {
|
|||
font-weight: bold;
|
||||
}
|
||||
div.user_show .rating_history {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: -15px;
|
||||
display: block;
|
||||
width: 479px;
|
||||
height: 350px;
|
||||
margin-left: -15px;
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
}
|
||||
div.user_show .rating_history span {
|
||||
position: absolute;
|
||||
|
@ -72,9 +69,6 @@ div.user_show .rating_history span {
|
|||
left: 232px;
|
||||
}
|
||||
div.user_show .user-infos {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 449px;
|
||||
padding: 0 16px;
|
||||
border-left: 1px solid #c0c0c0;
|
||||
overflow: hidden;
|
||||
|
|
Loading…
Reference in a new issue