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

document normalize #1354

Merged
merged 3 commits into from
Mar 23, 2023
Merged

document normalize #1354

merged 3 commits into from
Mar 23, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 17, 2023

for #1343

lots of repetitions, but looks ok?

@Fil Fil requested a review from mbostock March 17, 2023 18:10
@@ -22,12 +22,73 @@ export interface NormalizeOptions {
basis?: NormalizeBasis;
}

/**
* Normalize series values relative to the given basis. For example, if the
Copy link
Member

Choose a reason for hiding this comment

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

This is another instance where we want the first sentence to emphasize what is unique about normalizeX as opposed to shared across all variations of the normalize transform: it should mention specifically which channels are going to be transformed. (Fixing as I edit.)

Copy link
Member

@mbostock mbostock Mar 23, 2023

Choose a reason for hiding this comment

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

Also, since the normalize transform is built on top of the map transform, we should also mention that data are first grouped into series. From Plot.map in the README:

Groups on the first channel of z, fill, or stroke, if any, and then for each channel declared in the specified outputs object, applies the corresponding map method.

Something like:

Groups data into series using the first channel of z, fill, or stroke, if any, and then derives new x, x1, and x2 channels for each corresponding input channel by applying the given normalize basis.

@mbostock mbostock enabled auto-merge (squash) March 23, 2023 16:53
@mbostock mbostock merged commit fcb1991 into main Mar 23, 2023
@mbostock mbostock deleted the fil/ts-normalize branch March 23, 2023 16:54
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* document normalize

* avoid duplication

* edits

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
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.

2 participants