Commit 49dd4a57 authored by Illya Klymov's avatar Illya Klymov

Add comment with explanation

parent c8395bda
...@@ -151,6 +151,13 @@ export default { ...@@ -151,6 +151,13 @@ export default {
this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]); this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]);
this.xScale.domain(this.graphData.map(d => d.name)); this.xScale.domain(this.graphData.map(d => d.name));
/*
If we have all-zero graph we want graph to center 0 on axis and not to draw
any kind of ticks on Y axis. Infinity allows us to do that.
See https://gitlab.com/gitlab-org/gitlab/merge_requests/20627#note_251484582
for detailed explanation
*/
this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]); this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]);
// Zoom/Panning Function // Zoom/Panning Function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment