repometry 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -280,7 +280,7 @@ function lineChart(svg, layout, points, { format, ratio, compact, tickUnit = 1,
|
|
|
280
280
|
markBoundaries(svg, layout, points);
|
|
281
281
|
if (secondary && secondHigh > 0) {
|
|
282
282
|
const y2 = (value) => layout.top + layout.plotHeight - value / secondHigh * layout.plotHeight;
|
|
283
|
-
for (const segment of segments(secondary.values
|
|
283
|
+
for (const segment of segments(secondary.values)) {
|
|
284
284
|
const path = svgElement('path', 'tc-line tc-line-secondary');
|
|
285
285
|
path.setAttribute('d', segment.map((index, order) => {
|
|
286
286
|
const value = secondary.values[index];
|
|
@@ -292,7 +292,7 @@ function lineChart(svg, layout, points, { format, ratio, compact, tickUnit = 1,
|
|
|
292
292
|
svg.append(path);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
for (const segment of segments(points.map(point => point.value)
|
|
295
|
+
for (const segment of segments(points.map(point => point.value))) {
|
|
296
296
|
const path = svgElement('path', 'tc-line');
|
|
297
297
|
// Code keeps its state until the next commit, so the line holds each value and steps at the commit that changed it;
|
|
298
298
|
// a slope would invent values for the days between commits.
|
|
@@ -622,12 +622,12 @@ function interact(svg, tip, layout, points) {
|
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
624
|
}
|
|
625
|
-
/** Runs of consecutive measured points, broken where a measurement is missing. */
|
|
626
|
-
function segments(values
|
|
625
|
+
/** Runs of consecutive measured points, broken only where a measurement is missing; a profile change is marked, not cut. */
|
|
626
|
+
function segments(values) {
|
|
627
627
|
const result = [];
|
|
628
628
|
let run = [];
|
|
629
629
|
for (const [index, value] of values.entries()) {
|
|
630
|
-
if (value === null
|
|
630
|
+
if (value === null) {
|
|
631
631
|
if (run.length)
|
|
632
632
|
result.push(run);
|
|
633
633
|
run = [];
|