Skip to content

Choropleth keep d3.geoAlbers the default projection but deprecate it #1379

Closed
@gordonwoodhull

Description

@gordonwoodhull

In the future we want geoChoroplethChart to default to the null (identity) projection since it is built on d3.geoPath which so defaults.

However we have the opportunity to get there in a backward-compatible way, with a deprecation warning.

Here's one way to get there:

  • add a member _projection, which defaults to undefined
  • at the start of doRender and doRedraw (maybe in a helper function)
if(_projection === undefined) { 
    console.warn('choropleth projection default of geoAlbers is deprecated');
    _geoPath.projection(d3.geoAlbers());
} else {
     _geoPath.projection(_projection);
}
  • geoChoroplethChart.projection becomes a regular getter/setter of _projection (note getter is currently broken)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions