Skip to content

selectAll type #16

@clayrat

Description

@clayrat

Hello, I'm a Purescript newbie, trying to rewrite some D3 snippets. I'm currently working on Arc and Pie chart examples, so I've added some wrappers for them in my fork. However, while transcribing http://bl.ocks.org/mbostock/3888852, I've ran into trouble with this part:

    svg.selectAll(".arc")
        .data(function(d) { return pie(d.ages); })
      .enter().append("path")
        .attr("class", "arc")
        .attr("d", arc)
        .style("fill", function(d) { return color(d.data.name); });

If I understand correctly, here we need something like bindData' :: forall oldData newData. (oldData -> newData) -> Selection oldData -> D3Eff (Update newData). However, selectAll always gives us Selection Void, not allowing to modify previously bound data. Can this type signature be made more elaborate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions