Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally clip marks to the canvas area? #165

Closed
mbostock opened this issue Feb 24, 2021 · 3 comments · Fixed by #752
Closed

Optionally clip marks to the canvas area? #165

mbostock opened this issue Feb 24, 2021 · 3 comments · Fixed by #752
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

mbostock commented Feb 24, 2021

And related, you might want overflow: visible on the SVG element?

@mbostock mbostock added the enhancement New feature or request label Feb 24, 2021
@Fil
Copy link
Contributor

Fil commented Feb 25, 2021

We can already add style: { overflow: "visible" } as a top-level property.

@Fil
Copy link
Contributor

Fil commented Sep 23, 2021

We can imagine two use cases:

  1. hiding the values that exceed the domain's bounds
  2. putting them a few pixels to the left of the min (resp. right of the max); maybe linked to the unknown/others properties (see Can't set unknown domain in colour scale #446)

Any idea for a syntax?

@mbostock
Copy link
Member Author

mbostock commented Feb 7, 2022

Motivating application: https://observablehq.com/@observablehq/plot-horizon-chart

Here I could see us supporting a clip: true option for the x and y scales. But in some cases I could see us wanting to control the clipping on a per-mark basis. I’d rather implementing the clipping functionality centrally, though; I don’t want each Mark to have to implement it on its own.

Fil added a commit that referenced this issue Feb 10, 2022
Fil added a commit that referenced this issue Feb 10, 2022
@Fil Fil closed this as completed in #752 Feb 10, 2022
Fil added a commit that referenced this issue Feb 10, 2022
* clip: true clips the mark to the frame

closes #165

related: #181

* reindex clip id

* Update src/style.js

Co-authored-by: Mike Bostock <[email protected]>

* Update src/style.js

Co-authored-by: Mike Bostock <[email protected]>

* data source (the actual notebook is broken atm)

* clippath => clip

* reformat horizon plot; nicer heuristic for color

* naming consistency

* tweak horizon example (#753)

* tweak horizon example

* use offset, not index

* nicer tick labels

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants