Download:
child 309:c828dbfa7137
parent 307:6ce60c358c5c
308:9758f607f33c
Anton Shestakov <av6@dwimlabs.net>, Tue, 03 Oct 2017 19:53:50 +0800
viewer: link to individual checks on the line chart

2 файлов изменено, 5 вставок(+), 2 удалений(-) [+]
candolint/handlers.py file | annotate | diff | comparison | revisions
static/candolint.js file | annotate | diff | comparison | revisions
--- a/candolint/handlers.py Tue Oct 03 19:50:58 2017 +0800
+++ b/candolint/handlers.py Tue Oct 03 19:53:50 2017 +0800
@@ -196,7 +196,8 @@
]
return {
'points': points,
- 'current': check.ordinal
+ 'current': check.ordinal,
+ 'projectURL': check.project.get_url()
}
else:
return {}
--- a/static/candolint.js Tue Oct 03 19:50:58 2017 +0800
+++ b/static/candolint.js Tue Oct 03 19:53:50 2017 +0800
@@ -124,9 +124,11 @@
var rectW = x.step();
g.append('g')
.attr('fill-opacity', 0)
- .selectAll('rect')
+ .selectAll('a')
.data(data.points)
.enter()
+ .append('a')
+ .attr('href', function(d) { return data.projectURL + '/' + d.ordinal; })
.append('rect')
.attr('x', function(d) { return x(d.ordinal) - rectW / 2 + 0.5; })
.attr('y', -margin.top)