Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[country_map] use Albers USA projection #3946

Merged
merged 3 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export const controls = {
['white_black', 'white/black'],
['black_white', 'black/white'],
['dark_blue', 'light/dark blue'],
['pink_grey', 'pink/white/grey'],
],
default: 'blue_white_yellow',
clearable: false,
Expand Down
3 changes: 2 additions & 1 deletion superset/assets/javascripts/explore/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,9 @@ export const visTypes = {
},
{
label: t('Options'),
expanded: true,
controlSetRows: [
['select_country'],
['select_country', 'number_format'],
['linear_color_scheme'],
],
},
Expand Down
5 changes: 5 additions & 0 deletions superset/assets/javascripts/modules/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export const spectrums = {
'#1B4150',
'#092935',
],
pink_grey: [
'#E70B81',
'#FAFAFA',
'#666666',
],
};

/**
Expand Down
112 changes: 58 additions & 54 deletions superset/assets/visualizations/countries/usa.geojson

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion superset/assets/visualizations/country_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function countryMapChart(slice, payload) {
let resultText;
const container = slice.container;
const data = payload.data;
const format = d3.format(fd.number_format);

const colorScaler = colorScalerFactory(fd.linear_color_scheme, data, v => v.metric);
const colorMap = {};
Expand Down Expand Up @@ -91,7 +92,7 @@ function countryMapChart(slice, payload) {

const updateMetrics = function (region) {
if (region.length > 0) {
resultText.text(d3.format(',')(region[0].metric));
resultText.text(format(region[0].metric));
}
};

Expand Down