plot icon indicating copy to clipboard operation
plot copied to clipboard

constant numeric x and y for text marks

Open Fil opened this issue 4 years ago • 4 comments

position the text relative to the anchor

anchor can be any of "top", "bottom", "left", "right" or combinations such as "top-left"

demo: https://observablehq.com/@observablehq/text-facet-alignment-523

closes #523

todo:

  • [x] create unit tests for the possible anchors
  • [ ] should "right" and "bottom" be counted "inwards" like in css?
  • [ ] generalize to all marks?

Fil avatar Nov 24 '21 12:11 Fil

A question: here we add x and y regardless of the anchor, but we could decide that the sign of the "right" and "bottom" positions should be negated (to go "inset"). I don't know which is the most intuitive.

Fil avatar Nov 29 '21 20:11 Fil

converted to draft with the two questions that came up in review

Fil avatar Dec 02 '21 08:12 Fil

I've now generalized the feature to dots and images. Not sure if it can/should be done for other marks?

Fil avatar Dec 22 '21 15:12 Fil

Demo https://observablehq.com/@fil/constant-numeric-x-y-594

Fil avatar Dec 22 '21 15:12 Fil

Obsolete. This can be achieved with frameAnchor: left and dx: 10 instead of x: 10.

Fil avatar Feb 06 '23 11:02 Fil