Label positioning for facet scale

Somehow the labels for a faceted scale in a Plot I’m creating are not shown in my viewport. I’ve tried all kinds of options to tweak the positioning, but can’t find the right magic.

My notebook: Loading of Megabytes of RIS data / Internet Data Junkie / Observable

specific plot: Loading of Megabytes of RIS data / Internet Data Junkie / Observable

I know how to create enough marginLeft, but after (what feels like) hours of fiddling I still don’t know how to make my labels use that margin.

marginLeft can be specified in the facet option:

Plot.plot({
  caption: `RIS updates for ${asn}, per RIS peer`,
  facet: {
    data: updates,
    y: d => d.peer_ip,
    marginLeft: 100
  },
  fy: {
    axis: 'left',
    labelAnchor: 'center'
  },
  x: {
    tickRotate: 45
  },
  marks: [
    Plot.tickX(updates, {x: "ts", strokeOpacity: 0.1, stroke: d => d.type=='A' ? "black" : "red"})
  ]
})

PS: we’re working on an interactive cheat sheet for plot’s layout.

2 Likes

oooh, cheat sheet would be really nice! Thanks for the answer!