Skip to content

The segment style fields are strings, and the format doc says so - #71

Merged
turner merged 1 commit into
mainfrom
docs/segment-style-fields-are-strings
Sep 1, 2026
Merged

turner merged 1 commit into
mainfrom
docs/segment-style-fields-are-strings

Conversation

@turner

@turner turner commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

docs/band-format.md documented a segment's fillOpacity and strokeWidth as numbers — 0.4 and 2. The payload sends "0.4" and "2px", verified against the post-#66 fixture subgraph_chr8_78771162_78771252_v2_with_walk.band.json.gz. The four appearance fields come through tubemap.js as the document's own attribute values and go back out as attributes on the SVG route, so they travel as written.

The doc is what a client is written against, and pgb's reader is being written from it now (pgb#151). Its SegmentBox.stroke is a number its overlay does arithmetic with, so a reader trusting the spec turns "2px" into NaN and lays a border of the wrong width — silently, since NaN in a CSS length is an ignored declaration rather than an error. Same class as pclaiScore in #67, caught the same way: by reading the spec instead of the encoder.

The document moves, not the payload. No encoder change, no bytes move, version stays 1 — this corrects what the format claims, not what it sends.

The new paragraph sits after the #66 discussion rather than directly under the segments description, so that "It travelled as a path command" keeps pointing at the box.

Closes #70

🤖 Generated with Claude Code

https://claude.ai/code/session_012QQpjq82mqv6GS2GQyoUrm

`docs/band-format.md` documented a segment's `fillOpacity` and `strokeWidth` as
numbers — `0.4` and `2` — and the payload sends `"0.4"` and `"2px"`. The four
appearance fields come through `tubemap.js` as the document's own attribute
values and go back out as attributes on the SVG route, so they travel as written.

The doc is what a client is written against, and `pgb`'s reader is being written
from it now (pgb#151). Its `SegmentBox.stroke` is a number its overlay does
arithmetic with, so a reader trusting the spec turns `"2px"` into `NaN` and lays
a border of the wrong width — silently, because `NaN` in a CSS length is an
ignored declaration rather than an error. Same class as `pclaiScore` in #67, and
caught the same way: by someone reading the spec instead of the encoder.

The document moves, not the payload. No encoder change, no bytes move, and
`version` stays 1 — this corrects what the format claims, not what it sends.

Closes #70

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012QQpjq82mqv6GS2GQyoUrm
@turner
turner merged commit f9b05f6 into main Sep 1, 2026
2 checks passed
@turner
turner deleted the docs/segment-style-fields-are-strings branch September 1, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The band format documents a segment's strokeWidth and fillOpacity as numbers; the payload sends strings

1 participant