Codex commited on
Commit
74e75b5
路
1 Parent(s): 7cbd168

Show metric progress points only on changes

Browse files
Files changed (1) hide show
  1. app.js +5 -1
app.js CHANGED
@@ -961,7 +961,11 @@ function renderMetricProgressPlots() {
961
  const prev = timeline[index];
962
  return `<line class="metric-progress-line" x1="${x(prev.date).toFixed(1)}" y1="${y(prev.value).toFixed(1)}" x2="${x(p.date).toFixed(1)}" y2="${y(p.value).toFixed(1)}" stroke="${organizationColor(p.org)}" />`;
963
  }).join("");
964
- const points = timeline.map((p) => {
 
 
 
 
965
  const rows = [
966
  ["Date", dateLabel(p.date)],
967
  ["Metric", `${TIER_SHORT[column.tier]} 路 ${metricGroupLabel(column.metric)}`],
 
961
  const prev = timeline[index];
962
  return `<line class="metric-progress-line" x1="${x(prev.date).toFixed(1)}" y1="${y(prev.value).toFixed(1)}" x2="${x(p.date).toFixed(1)}" y2="${y(p.value).toFixed(1)}" stroke="${organizationColor(p.org)}" />`;
963
  }).join("");
964
+ const pointTimeline = timeline.filter((p, index) => {
965
+ if (index === 0 || index === timeline.length - 1) return true;
966
+ return p.value !== timeline[index - 1].value;
967
+ });
968
+ const points = pointTimeline.map((p) => {
969
  const rows = [
970
  ["Date", dateLabel(p.date)],
971
  ["Metric", `${TIER_SHORT[column.tier]} 路 ${metricGroupLabel(column.metric)}`],