Skip to content

Commit

Permalink
make path constant
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Aug 29, 2018
1 parent 1d16832 commit 82b6855
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions superset/assets/src/visualizations/country_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ function CountryMap(element, props) {
numberFormat,
} = props;

let path;

const container = element;
const format = d3.format(numberFormat);
const colorScaler = colorScalerFactory(linearColorScheme, data, v => v.metric);
Expand All @@ -42,7 +40,7 @@ function CountryMap(element, props) {
});
const colorFn = d => colorMap[d.properties.ISO] || 'none';

path = d3.geo.path();
const path = d3.geo.path();
const div = d3.select(container);
div.selectAll('*').remove();
container.style.height = `${height}px`;
Expand Down Expand Up @@ -153,7 +151,7 @@ function CountryMap(element, props) {
.scale(scale)
.center(center)
.translate([width / 2, height / 2]);
path = path.projection(projection);
path.projection(projection);

// Compute scale that fits container.
const bounds = path.bounds(mapData);
Expand Down

0 comments on commit 82b6855

Please sign in to comment.