Highlight specific series on stacked chart

I am trying to highlight a specific series in a stacked rect chart. I am able to achieve my goal using a line chart, but would like to be able to do the same thing with the stacked rect chart. I ahve provided an image of the results I am trying to achieve - by selecting “taylor_swift” in the highlight topic filter I would highlight the “taylor_swift” series in the stack.

Example: Analytics 3 / mferro64 | Observable

To know which rect to highlight, Plot needs to stack the values, and so it needs to know all of them. I’ve sent you a suggestion that fixes this, in two parts:

  • first, make highlight_topic be the name of the topic (instead of a subset of the data).
  • second, use one rectY mark, with conditional formatting

https://observablehq.com/compare/24ee8b8903180e71...9351edd03cbacff9

Thanks - that is what I was trying to achieve