Thanks to visit codestin.com
Credit goes to github.com

Skip to content

geoChoropleth binds static data and hides dynamic data #1268

Open
@gordonwoodhull

Description

@gordonwoodhull

I took a close look at geoChoropleth when working on #1239:

This chart uses a non-standard data model, so these uses, although they look suspicious, actually work in the presence of data not updated in place. This is because the join is only between the map data and the elements, not between the crossfilter(ish) data and the elements. Instead the crossfilter data is read separately from its own array.

In fact, selectAll may be wanted in order not to rebind anything, because it should stay bound to the map.

I'm uncomfortable with this data model, and think that the crossfilter data should probably be bound with the map data before both are bound with the svg elements. This is the problem that causes it to be hard to e.g. add d3.tip support to the choropleth, because the crossfilter(ish) data is hidden. But I don't propose to fix that atm.

I think this is a design bug, and the binding should be reversed, so that the polygons are bound to the dynamic data, pulling the map data from a static map. This makes the crossfilter data available to renderlets, tooltips, etc.

However, the polygons that do not have data will still need to be drawn. So there will need to be some kind of dummy value created for any polygons which do not have data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions