Skip to content

Commit

Permalink
Add updateChoroplethOptions prop
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills committed Jul 1, 2016
1 parent 9844278 commit 4b6acf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions examples/choropleth-example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ export default class ChoroplethExample extends React.Component {
return (
<Example label="Choropleth">
<Datamap
projection="mercator"
data={this.state.data}
fills={{
defaultFill: '#abdda4',
authorHasTraveledTo: '#fa0fa0'
}}
data={this.state.data}
projection="mercator"
updateChoroplethOptions={{ reset: false }}
/>
</Example>
);
Expand Down
4 changes: 3 additions & 1 deletion src/datamap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default class Datamap extends React.Component {
height: React.PropTypes.any,
labels: React.PropTypes.bool,
style: React.PropTypes.object,
updateChoroplethOptions: React.PropTypes.object,
width: React.PropTypes.any
};

Expand Down Expand Up @@ -56,6 +57,7 @@ export default class Datamap extends React.Component {
data,
graticule,
labels,
updateChoroplethOptions,
...props
} = this.props;

Expand All @@ -68,7 +70,7 @@ export default class Datamap extends React.Component {
element: this.refs.container
});
} else {
map.updateChoropleth(data);
map.updateChoropleth(data, updateChoroplethOptions);
}

if (arc) {
Expand Down

0 comments on commit 4b6acf3

Please sign in to comment.