Skip to content

accessor not always "equivalent to calling Array.from" #206

Description

@Fil

In the README we often have this sentence about the accessor to d3.extent and other reduction methods: "An optional accessor function may be specified, which is equivalent to calling Array.from before computing the extent."

However in most cases the accessor receives the original data as the third argument—whereas Array.from only sends (d, i) to its accessor.

Should we follow the README (and remove the third argument), or update this sentence in the README to be more accurate wrt the existing behavior? I'd vote for updating the README, maybe with the following sentence:

An optional accessor function may be specified, which receives the datum, the index, and the data, and returns the value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions