Skip to content

Accept iterables? #178

@Fil

Description

@Fil

Use case:

  • a list of top scientific journals, yearly data such as citation index, etc.
  • links are certain similarities (same publisher, same domain area…)

It would be nice to write:

const group = d3.group(data, d => d.title)
simulation.nodes(group)

and have 1 node per title, indexed with the title.

This is easy to do currently with nodes(d3.groups(…)), accepting an iterable form would be a simple addition of Array.from(), as shown in this notebook which groups the Misérables by the group id: https://observablehq.com/d/ea47e3f4c38082e0

We could have something similar for links, although it's not clear to me yet how:

simulationLinks.links(d3.rollup(groups, v => v.map(d => d.title), d => d.publisher))
to group titles that have a common publisher (it's not 1-to-1 links in this case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions