@density/chart-historical-counts
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -33,2 +33,7 @@ const axisYMaximumLineDashWidth = 2; | ||
.text(yAxisLabelFormatter(capacity, -1)); | ||
// Add a dotted line horizontally at the capacity | ||
yAxisEnterSelectionGroup.append('path') | ||
.attr('y', scale(largestCount)) | ||
.attr('class', 'axis-y-capacity-line') | ||
} | ||
@@ -73,2 +78,14 @@ | ||
})(graphWidth)}`) | ||
if (capacity) { | ||
const capacityLineYPos = scale(capacity) - 2; | ||
yAxisMergeSelection.select('.axis-y-capacity-line') | ||
.attr('d', `M0,${capacityLineYPos} ${(function(graphWidth) { | ||
let linePath = ''; | ||
for (let i = 0; i < graphWidth; i += axisYMaximumLineDashWidth + axisYMaximumLineDashSpacing) { | ||
linePath += `H${i+axisYMaximumLineDashWidth} M${i+axisYMaximumLineDashWidth+axisYMaximumLineDashSpacing},${capacityLineYPos}`; | ||
} | ||
return linePath; | ||
})(graphWidth)}`) | ||
} | ||
} |
@@ -26,2 +26,5 @@ 'use strict'; | ||
yAxisEnterSelectionGroup.append('text').attr('class', 'axis-y-capacity').attr('y', scale(capacity)).text(yAxisLabelFormatter(capacity, -1)); | ||
// Add a dotted line horizontally at the capacity | ||
yAxisEnterSelectionGroup.append('path').attr('y', scale(largestCount)).attr('class', 'axis-y-capacity-line'); | ||
} | ||
@@ -54,3 +57,14 @@ | ||
}(graphWidth)); | ||
if (capacity) { | ||
var capacityLineYPos = scale(capacity) - 2; | ||
yAxisMergeSelection.select('.axis-y-capacity-line').attr('d', 'M0,' + capacityLineYPos + ' ' + function (graphWidth) { | ||
var linePath = ''; | ||
for (var i = 0; i < graphWidth; i += axisYMaximumLineDashWidth + axisYMaximumLineDashSpacing) { | ||
linePath += 'H' + (i + axisYMaximumLineDashWidth) + ' M' + (i + axisYMaximumLineDashWidth + axisYMaximumLineDashSpacing) + ',' + capacityLineYPos; | ||
} | ||
return linePath; | ||
}(graphWidth)); | ||
} | ||
} | ||
{ | ||
"name": "@density/chart-historical-counts", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Historical Counts chart", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
658127
2352