[object Object]

← back to Rentv Market Pulse

Keep curve endpoint value labels inside plot area

bc3665dfb9c0389d4b96087ce5ca198e6440cb28 · 2026-07-24 18:24:31 -0700 · Steve

Files touched

Diff

commit bc3665dfb9c0389d4b96087ce5ca198e6440cb28
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Jul 24 18:24:31 2026 -0700

    Keep curve endpoint value labels inside plot area
---
 index.html        |   7 ++++---
 preview-curve.png | Bin 0 -> 199241 bytes
 preview.png       | Bin 0 -> 555719 bytes
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.html b/index.html
index 420ff7e..9cd5102 100644
--- a/index.html
+++ b/index.html
@@ -372,11 +372,12 @@ function drawYieldCurve(){
     ctx.fillStyle = '#0e131c'; ctx.fill();
     ctx.lineWidth = 2.5; ctx.strokeStyle = '#38bdf8'; ctx.stroke();
 
-    // value label above point
+    // value label above point — keep endpoints inside the plot area
     ctx.fillStyle = '#e8edf5';
     ctx.font = 'bold 12px ' + getCSS('--mono');
-    ctx.textAlign = 'center';
-    ctx.fillText(d.value, px, py - 16);
+    if (i === 0)                    { ctx.textAlign = 'left';  ctx.fillText(d.value, px - 4,  py - 16); }
+    else if (i === data.length - 1) { ctx.textAlign = 'right'; ctx.fillText(d.value, px + 4,  py - 16); }
+    else                            { ctx.textAlign = 'center';ctx.fillText(d.value, px,      py - 16); }
 
     // x-axis tenor label
     ctx.fillStyle = '#8a97ad';
diff --git a/preview-curve.png b/preview-curve.png
new file mode 100644
index 0000000..948610b
Binary files /dev/null and b/preview-curve.png differ
diff --git a/preview.png b/preview.png
new file mode 100644
index 0000000..57e2e01
Binary files /dev/null and b/preview.png differ

← 8446660 RENTV CRE Market Pulse dashboard — rebuilt from Qwen3 14B at  ·  back to Rentv Market Pulse  ·  Ignore preview screenshots e3f7e58 →