Skip to content

map option for map[XY] #480

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

Closed
wants to merge 2 commits into from
Closed

map option for map[XY] #480

wants to merge 2 commits into from

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Aug 3, 2021

Fixes #479.

My first take was to support Plot.normalizeX(basis, options) and Plot.normalizeY(basis, options). While that’s more consistent with Plot.mapX(map, options) and Plot.mapY(map, options), it’s not consistent with Plot.windowX(options) and Plot.windowY(options). So, I then decided it would be better to standardize on Plot.mapX(options) and Plot.mapY(options), and only use the two-argument form when you want to declare the output channels explicitly (e.g., Plot.map, Plot.group, and Plot.bin).

For backwards-compatibility we can continue to support the old form of Plot.mapX and Plot.mapY, but I consider it deprecated and removed it from the documentation.

@mbostock mbostock requested a review from Fil August 3, 2021 21:46
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! Since we're still in the 0.x, do we have to maintain any sort of backwards-compatibility? And if so, for how many versions?

@mbostock
Copy link
Member Author

mbostock commented Aug 4, 2021

We need to maintain backwards-compatibility for Observable until we ship version pinning. Otherwise notebooks will upgrade and break.

Also, I’ve realized that the pattern in this PR is inconsistent with the pattern I proposed for basic transforms in #472, so I want to think about how to resolve this discrepancy before landing.

@mbostock
Copy link
Member Author

Closing in favor of #494.

@mbostock mbostock closed this Aug 10, 2021
@mbostock mbostock deleted the mbostock/map-longhand branch August 20, 2021 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plot.normalizeX and Plot.mapX have different structure
2 participants