plot icon indicating copy to clipboard operation
plot copied to clipboard

className option for marks

Open Fil opened this issue 3 years ago • 5 comments

className should be optional and have no default value, so you have to decide what names you want to use and there are no implicit classes

Related: #253 #6 #126 #490

(Note: for the general plot there is already a top-level className; we'd initially want this only for marks.)

Fil avatar Jul 20 '22 07:07 Fil

Going to take a first stab at this

RLesser avatar Jul 20 '22 08:07 RLesser

This would make my life a lot easier - when you have to do something outside the bounds of plot, being able to specify a class name would be a big help

llimllib avatar Oct 11 '22 19:10 llimllib

I can try to have a pull request up this weekend @llimllib, been meaning to do this

RLesser avatar Oct 12 '22 03:10 RLesser

This functionality would be an excellent addition. Are there any updates on the progress? It looks like there is a PR, but it hasn't been updated in some time.

miketalley avatar Dec 20 '23 19:12 miketalley

Adding support for this issue—I want to further describe a few scenarios where I found custom styling particularly important:

  • a single plot is embedded in an article as "an additional chart" and needs to blend in with the existing plots of non-observable origin;
  • plots rely on Observable Inputs, which can be nearly unusable when mixed with specific CSS rules;
  • even when published mostly in entirety, it is still important to match the notebook style with the navigation bar, etc, see our blog here so the page doesn't feel alien.

We benefit greatly from the capabilities and convenience of Plot. That said, our current solution around these styling issues is partly hacking CSS and partly rewriting some observable visual elements (especially inputs). I'd love to stop doing those two things and stick closer to the vanilla Plot throughout the prototyping to production pipeline.

thinkingfish avatar Apr 30 '24 00:04 thinkingfish