thibaud frere commited on
Commit
929af42
·
1 Parent(s): 0ec257a

fix shape overflow

Browse files
app/src/content/embeds/against-baselines-deduplicated.html CHANGED
@@ -330,12 +330,14 @@
330
  }
331
  } catch {}
332
 
333
- // Update clip rect to match inner plotting area (coords local to gRoot)
 
 
334
  clipRect
335
- .attr('x', 0)
336
- .attr('y', 0)
337
- .attr('width', innerWidth)
338
- .attr('height', innerHeight);
339
 
340
  xScale.range([0, innerWidth]);
341
  yScale.range([innerHeight, 0]);
 
330
  }
331
  } catch {}
332
 
333
+ // Update clip rect to match inner plotting area with padding so
334
+ // first/last markers are not clipped at the edges
335
+ const clipPad = Math.max(6, Math.ceil(markerSize * 2));
336
  clipRect
337
+ .attr('x', -clipPad)
338
+ .attr('y', -clipPad)
339
+ .attr('width', innerWidth + clipPad * 2)
340
+ .attr('height', innerHeight + clipPad * 2);
341
 
342
  xScale.range([0, innerWidth]);
343
  yScale.range([innerHeight, 0]);
app/src/content/embeds/against-baselines.html CHANGED
@@ -320,12 +320,13 @@
320
  xScale.range([0, innerWidth]);
321
  yScale.range([innerHeight, 0]);
322
 
323
- // Update clip rect to match inner plotting area (coords of gRoot after translate)
 
324
  clipRect
325
- .attr('x', 0)
326
- .attr('y', 0)
327
- .attr('width', innerWidth)
328
- .attr('height', innerHeight);
329
 
330
  // Compute Y ticks
331
  let yTicks = [];
 
320
  xScale.range([0, innerWidth]);
321
  yScale.range([innerHeight, 0]);
322
 
323
+ // Update clip rect with padding so edge markers are not clipped
324
+ const clipPad = Math.max(6, Math.ceil(markerSize * 2));
325
  clipRect
326
+ .attr('x', -clipPad)
327
+ .attr('y', -clipPad)
328
+ .attr('width', innerWidth + clipPad * 2)
329
+ .attr('height', innerHeight + clipPad * 2);
330
 
331
  // Compute Y ticks
332
  let yTicks = [];