@samizdata/mozaic 0.4.0 → 0.4.2

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.
@@ -26,6 +26,5 @@ The chart headline. Its id labels the chart's SVG for screen readers.
26
26
  line-height: var(--mz-line-title);
27
27
  letter-spacing: var(--mz-tracking-title);
28
28
  color: var(--mz-color-text);
29
- text-wrap: balance;
30
29
  }
31
30
  </style>
@@ -281,6 +281,8 @@ your project and change anything.
281
281
  text-anchor="end">{line}</text
282
282
  >
283
283
  {/each}
284
+ <!-- Under the rows, so group names (with a background halo) and dots sit on top of it. -->
285
+ <line class="mz-percentile-you" x1={px} x2={px} y1={-4} y2={plot.height} />
284
286
  {#each groups as g, i (g.name)}
285
287
  {@const rowTop = plot.y(g.name) ?? 0}
286
288
  {@const c = stripColor(g)}
@@ -332,7 +334,6 @@ your project and change anything.
332
334
  >
333
335
  </g>
334
336
  {/each}
335
- <line class="mz-percentile-you" x1={px} x2={px} y1={-4} y2={plot.height} />
336
337
  <text class="mz-percentile-you-label" x={px} y={-8} text-anchor={anchor}>{you}</text>
337
338
  {@render annotations?.(plot)}
338
339
  </Svg>
@@ -429,6 +430,13 @@ your project and change anything.
429
430
  .mz-percentile-you-label {
430
431
  font-weight: var(--mz-weight-strong);
431
432
  }
433
+ /* A background-coloured outline keeps names legible where the "you" line crosses them. */
434
+ .mz-percentile-name {
435
+ paint-order: stroke;
436
+ stroke: var(--mz-color-bg);
437
+ stroke-width: 4px;
438
+ stroke-linejoin: round;
439
+ }
432
440
  .mz-percentile-readout {
433
441
  font-variant-numeric: tabular-nums;
434
442
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samizdata/mozaic",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Chart components for the web and print, built on Svelte 5 and d3.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Nicu Calcea",
@@ -281,6 +281,8 @@ your project and change anything.
281
281
  text-anchor="end">{line}</text
282
282
  >
283
283
  {/each}
284
+ <!-- Under the rows, so group names (with a background halo) and dots sit on top of it. -->
285
+ <line class="mz-percentile-you" x1={px} x2={px} y1={-4} y2={plot.height} />
284
286
  {#each groups as g, i (g.name)}
285
287
  {@const rowTop = plot.y(g.name) ?? 0}
286
288
  {@const c = stripColor(g)}
@@ -332,7 +334,6 @@ your project and change anything.
332
334
  >
333
335
  </g>
334
336
  {/each}
335
- <line class="mz-percentile-you" x1={px} x2={px} y1={-4} y2={plot.height} />
336
337
  <text class="mz-percentile-you-label" x={px} y={-8} text-anchor={anchor}>{you}</text>
337
338
  {@render annotations?.(plot)}
338
339
  </Svg>
@@ -429,6 +430,13 @@ your project and change anything.
429
430
  .mz-percentile-you-label {
430
431
  font-weight: var(--mz-weight-strong);
431
432
  }
433
+ /* A background-coloured outline keeps names legible where the "you" line crosses them. */
434
+ .mz-percentile-name {
435
+ paint-order: stroke;
436
+ stroke: var(--mz-color-bg);
437
+ stroke-width: 4px;
438
+ stroke-linejoin: round;
439
+ }
432
440
  .mz-percentile-readout {
433
441
  font-variant-numeric: tabular-nums;
434
442
  }