toJsonString



Encode a Element.PathSample as a comma-separated string. Chosen over a JSON-object form to keep PEN strokes (which can have thousands of samples) small on the wire.

Length-adaptive: only emits fields that carry signal.

  • 3 parts: "x,y,w" — position + width only

  • 4 parts: "x,y,w,t" — adds tilt

  • 5 parts: "x,y,w,t,a" — adds tilt + azimuth

When only azimuth is present (tilt null), tilt is emitted as the literal _ so positional parsing stays unambiguous.