How to add more metrics on the country_map in Apache-superset?How to merge two dictionaries in a single expression?How do I check whether a file exists without exceptions?How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?Add new keys to a dictionary?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?
Reply ‘no position’ while the job posting is still there (‘HiWi’ position in Germany)
What is the term when two people sing in harmony, but they aren't singing the same notes?
Stereotypical names
Can I Retrieve Email Addresses from BCC?
Bob has never been a M before
Is there enough fresh water in the world to eradicate the drinking water crisis?
Would it be legal for a US State to ban exports of a natural resource?
Female=gender counterpart?
Can a malicious addon access internet history and such in chrome/firefox?
What does the "3am" section means in manpages?
Java - What do constructor type arguments mean when placed *before* the type?
Should my PhD thesis be submitted under my legal name?
The One-Electron Universe postulate is true - what simple change can I make to change the whole universe?
Can the harmonic series explain the origin of the major scale?
Is the next prime number always the next number divisible by the current prime number, except for any numbers previously divisible by primes?
Is there a good way to store credentials outside of a password manager?
Invariance of results when scaling explanatory variables in logistic regression, is there a proof?
Have I saved too much for retirement so far?
Teaching indefinite integrals that require special-casing
What to do when my ideas aren't chosen, when I strongly disagree with the chosen solution?
Did US corporations pay demonstrators in the German demonstrations against article 13?
I2C signal and power over long range (10meter cable)
Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?
For airliners, what prevents wing strikes on landing in bad weather?
How to add more metrics on the country_map in Apache-superset?
How to merge two dictionaries in a single expression?How do I check whether a file exists without exceptions?How do JavaScript closures work?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How do I include a JavaScript file in another JavaScript file?Add new keys to a dictionary?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?
I am using country_map in apache-superset for visualization purposes. When zooming in on a polygon, information from the columns appears inside of the polygon, like so:

There is only one available metric option to display:
Code for the metric update is found on this path:
superset/assets/src/visualizations/CountryMap/CountryMap.js
Code:
const updateMetrics = function (region)
if (region.length > 0)
resultText.text(format(region[0].metric));
;
The metrics are defined in controls.jsx:
/superset/static/assets/src/explore/controls.jsx
const metrics =
type: 'MetricsControl',
multi: true,
label: t('Metrics'),
validators: [v.nonEmpty],
default: (c) =>
const metric = mainMetric(c.savedMetrics);
return metric ? [metric] : null;
,
mapStateToProps: (state) =>
const datasource = state.datasource;
return
columns: datasource ? datasource.columns : [],
savedMetrics: datasource ? datasource.metrics : [],
datasourceType: datasource && datasource.type,
;
,
description: t('One or many metrics to display'),
;
const metric =
...metrics,
multi: false,
label: t('Metric'),
default: props => mainMetric(props.savedMetrics),
;
Country map is using metric, which doesn't allow multiple metrics to be selected, Code found here:
superset/assets/src/explore/controlPanels/CountryMap.js
controlPanelSections: [
label: t('Query'),
expanded: true,
controlSetRows: [
['entity'],
['metric'],
['adhoc_filters'],
],
,
label: t('Options'),
expanded: true,
controlSetRows: [
['select_country', 'number_format'],
['linear_color_scheme'],
],
,
],
The python class of country_map is located at viz.py:
class CountryMapViz(BaseViz):
"""A country centric"""
viz_type = 'country_map'
verbose_name = _('Country Map')
is_timeseries = False
credits = 'From bl.ocks.org By john-guerra'
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = [
self.form_data['metric']]
qry['groupby'] = [self.form_data['entity']]
return qry
Changing the code in CountryMap.js and viz.py from metric to metrics results in the following error:
Traceback (most recent call last):
File "/Documents/superset/superset/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/Documents/superset/superset/superset/viz.py", line 213, in get_df
self.results = self.datasource.query(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 797, in query
sql = self.get_query_str(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 471, in get_query_str
qry = self.get_sqla_query(**query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 585, in get_sqla_query
elif m in metrics_dict:
TypeError: unhashable type: 'list'
How can I add more metrics to display inside the polygon?
javascript python d3.js apache-superset
add a comment |
I am using country_map in apache-superset for visualization purposes. When zooming in on a polygon, information from the columns appears inside of the polygon, like so:

There is only one available metric option to display:
Code for the metric update is found on this path:
superset/assets/src/visualizations/CountryMap/CountryMap.js
Code:
const updateMetrics = function (region)
if (region.length > 0)
resultText.text(format(region[0].metric));
;
The metrics are defined in controls.jsx:
/superset/static/assets/src/explore/controls.jsx
const metrics =
type: 'MetricsControl',
multi: true,
label: t('Metrics'),
validators: [v.nonEmpty],
default: (c) =>
const metric = mainMetric(c.savedMetrics);
return metric ? [metric] : null;
,
mapStateToProps: (state) =>
const datasource = state.datasource;
return
columns: datasource ? datasource.columns : [],
savedMetrics: datasource ? datasource.metrics : [],
datasourceType: datasource && datasource.type,
;
,
description: t('One or many metrics to display'),
;
const metric =
...metrics,
multi: false,
label: t('Metric'),
default: props => mainMetric(props.savedMetrics),
;
Country map is using metric, which doesn't allow multiple metrics to be selected, Code found here:
superset/assets/src/explore/controlPanels/CountryMap.js
controlPanelSections: [
label: t('Query'),
expanded: true,
controlSetRows: [
['entity'],
['metric'],
['adhoc_filters'],
],
,
label: t('Options'),
expanded: true,
controlSetRows: [
['select_country', 'number_format'],
['linear_color_scheme'],
],
,
],
The python class of country_map is located at viz.py:
class CountryMapViz(BaseViz):
"""A country centric"""
viz_type = 'country_map'
verbose_name = _('Country Map')
is_timeseries = False
credits = 'From bl.ocks.org By john-guerra'
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = [
self.form_data['metric']]
qry['groupby'] = [self.form_data['entity']]
return qry
Changing the code in CountryMap.js and viz.py from metric to metrics results in the following error:
Traceback (most recent call last):
File "/Documents/superset/superset/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/Documents/superset/superset/superset/viz.py", line 213, in get_df
self.results = self.datasource.query(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 797, in query
sql = self.get_query_str(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 471, in get_query_str
qry = self.get_sqla_query(**query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 585, in get_sqla_query
elif m in metrics_dict:
TypeError: unhashable type: 'list'
How can I add more metrics to display inside the polygon?
javascript python d3.js apache-superset
What did you modify exactly? Could you post your modification toCountryMap.jsandviz.py?
– gdlmx
Mar 7 at 9:31
@gdlmx InCountryMap.jsI changed['metric']to['metrics']. I did the same inviz.py, at theCountryMapVizclass, where I just modifiedself.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
– Snow
Mar 7 at 9:56
add a comment |
I am using country_map in apache-superset for visualization purposes. When zooming in on a polygon, information from the columns appears inside of the polygon, like so:

There is only one available metric option to display:
Code for the metric update is found on this path:
superset/assets/src/visualizations/CountryMap/CountryMap.js
Code:
const updateMetrics = function (region)
if (region.length > 0)
resultText.text(format(region[0].metric));
;
The metrics are defined in controls.jsx:
/superset/static/assets/src/explore/controls.jsx
const metrics =
type: 'MetricsControl',
multi: true,
label: t('Metrics'),
validators: [v.nonEmpty],
default: (c) =>
const metric = mainMetric(c.savedMetrics);
return metric ? [metric] : null;
,
mapStateToProps: (state) =>
const datasource = state.datasource;
return
columns: datasource ? datasource.columns : [],
savedMetrics: datasource ? datasource.metrics : [],
datasourceType: datasource && datasource.type,
;
,
description: t('One or many metrics to display'),
;
const metric =
...metrics,
multi: false,
label: t('Metric'),
default: props => mainMetric(props.savedMetrics),
;
Country map is using metric, which doesn't allow multiple metrics to be selected, Code found here:
superset/assets/src/explore/controlPanels/CountryMap.js
controlPanelSections: [
label: t('Query'),
expanded: true,
controlSetRows: [
['entity'],
['metric'],
['adhoc_filters'],
],
,
label: t('Options'),
expanded: true,
controlSetRows: [
['select_country', 'number_format'],
['linear_color_scheme'],
],
,
],
The python class of country_map is located at viz.py:
class CountryMapViz(BaseViz):
"""A country centric"""
viz_type = 'country_map'
verbose_name = _('Country Map')
is_timeseries = False
credits = 'From bl.ocks.org By john-guerra'
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = [
self.form_data['metric']]
qry['groupby'] = [self.form_data['entity']]
return qry
Changing the code in CountryMap.js and viz.py from metric to metrics results in the following error:
Traceback (most recent call last):
File "/Documents/superset/superset/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/Documents/superset/superset/superset/viz.py", line 213, in get_df
self.results = self.datasource.query(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 797, in query
sql = self.get_query_str(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 471, in get_query_str
qry = self.get_sqla_query(**query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 585, in get_sqla_query
elif m in metrics_dict:
TypeError: unhashable type: 'list'
How can I add more metrics to display inside the polygon?
javascript python d3.js apache-superset
I am using country_map in apache-superset for visualization purposes. When zooming in on a polygon, information from the columns appears inside of the polygon, like so:

There is only one available metric option to display:
Code for the metric update is found on this path:
superset/assets/src/visualizations/CountryMap/CountryMap.js
Code:
const updateMetrics = function (region)
if (region.length > 0)
resultText.text(format(region[0].metric));
;
The metrics are defined in controls.jsx:
/superset/static/assets/src/explore/controls.jsx
const metrics =
type: 'MetricsControl',
multi: true,
label: t('Metrics'),
validators: [v.nonEmpty],
default: (c) =>
const metric = mainMetric(c.savedMetrics);
return metric ? [metric] : null;
,
mapStateToProps: (state) =>
const datasource = state.datasource;
return
columns: datasource ? datasource.columns : [],
savedMetrics: datasource ? datasource.metrics : [],
datasourceType: datasource && datasource.type,
;
,
description: t('One or many metrics to display'),
;
const metric =
...metrics,
multi: false,
label: t('Metric'),
default: props => mainMetric(props.savedMetrics),
;
Country map is using metric, which doesn't allow multiple metrics to be selected, Code found here:
superset/assets/src/explore/controlPanels/CountryMap.js
controlPanelSections: [
label: t('Query'),
expanded: true,
controlSetRows: [
['entity'],
['metric'],
['adhoc_filters'],
],
,
label: t('Options'),
expanded: true,
controlSetRows: [
['select_country', 'number_format'],
['linear_color_scheme'],
],
,
],
The python class of country_map is located at viz.py:
class CountryMapViz(BaseViz):
"""A country centric"""
viz_type = 'country_map'
verbose_name = _('Country Map')
is_timeseries = False
credits = 'From bl.ocks.org By john-guerra'
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = [
self.form_data['metric']]
qry['groupby'] = [self.form_data['entity']]
return qry
Changing the code in CountryMap.js and viz.py from metric to metrics results in the following error:
Traceback (most recent call last):
File "/Documents/superset/superset/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/Documents/superset/superset/superset/viz.py", line 213, in get_df
self.results = self.datasource.query(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 797, in query
sql = self.get_query_str(query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 471, in get_query_str
qry = self.get_sqla_query(**query_obj)
File "/Documents/superset/superset/superset/connectors/sqla/models.py", line 585, in get_sqla_query
elif m in metrics_dict:
TypeError: unhashable type: 'list'
How can I add more metrics to display inside the polygon?
javascript python d3.js apache-superset
javascript python d3.js apache-superset
edited Mar 7 at 9:59
Snow
asked Feb 11 at 9:59
SnowSnow
793728
793728
What did you modify exactly? Could you post your modification toCountryMap.jsandviz.py?
– gdlmx
Mar 7 at 9:31
@gdlmx InCountryMap.jsI changed['metric']to['metrics']. I did the same inviz.py, at theCountryMapVizclass, where I just modifiedself.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
– Snow
Mar 7 at 9:56
add a comment |
What did you modify exactly? Could you post your modification toCountryMap.jsandviz.py?
– gdlmx
Mar 7 at 9:31
@gdlmx InCountryMap.jsI changed['metric']to['metrics']. I did the same inviz.py, at theCountryMapVizclass, where I just modifiedself.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
– Snow
Mar 7 at 9:56
What did you modify exactly? Could you post your modification to
CountryMap.js and viz.py?– gdlmx
Mar 7 at 9:31
What did you modify exactly? Could you post your modification to
CountryMap.js and viz.py?– gdlmx
Mar 7 at 9:31
@gdlmx In
CountryMap.js I changed ['metric'] to ['metrics']. I did the same in viz.py, at the CountryMapViz class, where I just modified self.form_data['metric']] to self.form_data['metrics']], in the query_obj(self) method.– Snow
Mar 7 at 9:56
@gdlmx In
CountryMap.js I changed ['metric'] to ['metrics']. I did the same in viz.py, at the CountryMapViz class, where I just modified self.form_data['metric']] to self.form_data['metrics']], in the query_obj(self) method.– Snow
Mar 7 at 9:56
add a comment |
1 Answer
1
active
oldest
votes
The direct cause of the error TypeError: unhashable type: 'list' is your modification to file "viz.py":
self.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
As you can see in the source code here, form data metrics is a list object that contains metric, where metric is probably a string or other hashable object. In python language, a list object is not hashable. Because you replace a hashable object (metric) with an unhashable one (metrics), an unhashable type error is then raised.
The correct way to modify CoutryMapViz.query_obj() to accept metrics query can be found in the other Viz classes. The code section here is a very nice example:
class CalHeatmapViz(BaseViz):
"""Calendar heatmap."""
...
def query_obj(self):
d = super(CalHeatmapViz, self).query_obj()
fd = self.form_data
d['metrics'] = fd.get('metrics')
return d
Finally, the CoutryMapViz.query_obj() method should look like this:
class CountryMapViz(BaseViz):
...
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = fd.get('metrics')
qry['groupby'] = [self.form_data['entity']]
return qry
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with theget_datamethod. You can use the codes in theCalHeatmapViz.get_data()function as an example.
– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify thepropTypesinCountryMap.jsandCoutryMapViz.get_data()inviz.py. This is another question that worth to be discussed in another post.
– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54627930%2fhow-to-add-more-metrics-on-the-country-map-in-apache-superset%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The direct cause of the error TypeError: unhashable type: 'list' is your modification to file "viz.py":
self.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
As you can see in the source code here, form data metrics is a list object that contains metric, where metric is probably a string or other hashable object. In python language, a list object is not hashable. Because you replace a hashable object (metric) with an unhashable one (metrics), an unhashable type error is then raised.
The correct way to modify CoutryMapViz.query_obj() to accept metrics query can be found in the other Viz classes. The code section here is a very nice example:
class CalHeatmapViz(BaseViz):
"""Calendar heatmap."""
...
def query_obj(self):
d = super(CalHeatmapViz, self).query_obj()
fd = self.form_data
d['metrics'] = fd.get('metrics')
return d
Finally, the CoutryMapViz.query_obj() method should look like this:
class CountryMapViz(BaseViz):
...
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = fd.get('metrics')
qry['groupby'] = [self.form_data['entity']]
return qry
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with theget_datamethod. You can use the codes in theCalHeatmapViz.get_data()function as an example.
– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify thepropTypesinCountryMap.jsandCoutryMapViz.get_data()inviz.py. This is another question that worth to be discussed in another post.
– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
add a comment |
The direct cause of the error TypeError: unhashable type: 'list' is your modification to file "viz.py":
self.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
As you can see in the source code here, form data metrics is a list object that contains metric, where metric is probably a string or other hashable object. In python language, a list object is not hashable. Because you replace a hashable object (metric) with an unhashable one (metrics), an unhashable type error is then raised.
The correct way to modify CoutryMapViz.query_obj() to accept metrics query can be found in the other Viz classes. The code section here is a very nice example:
class CalHeatmapViz(BaseViz):
"""Calendar heatmap."""
...
def query_obj(self):
d = super(CalHeatmapViz, self).query_obj()
fd = self.form_data
d['metrics'] = fd.get('metrics')
return d
Finally, the CoutryMapViz.query_obj() method should look like this:
class CountryMapViz(BaseViz):
...
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = fd.get('metrics')
qry['groupby'] = [self.form_data['entity']]
return qry
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with theget_datamethod. You can use the codes in theCalHeatmapViz.get_data()function as an example.
– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify thepropTypesinCountryMap.jsandCoutryMapViz.get_data()inviz.py. This is another question that worth to be discussed in another post.
– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
add a comment |
The direct cause of the error TypeError: unhashable type: 'list' is your modification to file "viz.py":
self.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
As you can see in the source code here, form data metrics is a list object that contains metric, where metric is probably a string or other hashable object. In python language, a list object is not hashable. Because you replace a hashable object (metric) with an unhashable one (metrics), an unhashable type error is then raised.
The correct way to modify CoutryMapViz.query_obj() to accept metrics query can be found in the other Viz classes. The code section here is a very nice example:
class CalHeatmapViz(BaseViz):
"""Calendar heatmap."""
...
def query_obj(self):
d = super(CalHeatmapViz, self).query_obj()
fd = self.form_data
d['metrics'] = fd.get('metrics')
return d
Finally, the CoutryMapViz.query_obj() method should look like this:
class CountryMapViz(BaseViz):
...
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = fd.get('metrics')
qry['groupby'] = [self.form_data['entity']]
return qry
The direct cause of the error TypeError: unhashable type: 'list' is your modification to file "viz.py":
self.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.
As you can see in the source code here, form data metrics is a list object that contains metric, where metric is probably a string or other hashable object. In python language, a list object is not hashable. Because you replace a hashable object (metric) with an unhashable one (metrics), an unhashable type error is then raised.
The correct way to modify CoutryMapViz.query_obj() to accept metrics query can be found in the other Viz classes. The code section here is a very nice example:
class CalHeatmapViz(BaseViz):
"""Calendar heatmap."""
...
def query_obj(self):
d = super(CalHeatmapViz, self).query_obj()
fd = self.form_data
d['metrics'] = fd.get('metrics')
return d
Finally, the CoutryMapViz.query_obj() method should look like this:
class CountryMapViz(BaseViz):
...
def query_obj(self):
qry = super(CountryMapViz, self).query_obj()
qry['metrics'] = fd.get('metrics')
qry['groupby'] = [self.form_data['entity']]
return qry
edited Mar 7 at 14:15
answered Mar 7 at 14:06
gdlmxgdlmx
3,86611032
3,86611032
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with theget_datamethod. You can use the codes in theCalHeatmapViz.get_data()function as an example.
– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify thepropTypesinCountryMap.jsandCoutryMapViz.get_data()inviz.py. This is another question that worth to be discussed in another post.
– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
add a comment |
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with theget_datamethod. You can use the codes in theCalHeatmapViz.get_data()function as an example.
– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify thepropTypesinCountryMap.jsandCoutryMapViz.get_data()inviz.py. This is another question that worth to be discussed in another post.
– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This change however does not make a difference in the metrics shown inside the polygon. Even if you select more than 1 metric in the form, only the first selected metric will be shown when you hover on or click the polygons
– Snow
Mar 7 at 14:39
This is to do with the
get_data method. You can use the codes in the CalHeatmapViz.get_data() function as an example.– gdlmx
Mar 7 at 17:47
This is to do with the
get_data method. You can use the codes in the CalHeatmapViz.get_data() function as an example.– gdlmx
Mar 7 at 17:47
To make the chart display correct, you need to modify the
propTypes in CountryMap.js and CoutryMapViz.get_data() in viz.py. This is another question that worth to be discussed in another post.– gdlmx
Mar 7 at 17:58
To make the chart display correct, you need to modify the
propTypes in CountryMap.js and CoutryMapViz.get_data() in viz.py. This is another question that worth to be discussed in another post.– gdlmx
Mar 7 at 17:58
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
my question however is not about getting rid of the Type error, but rather about the end result being functional. But regardless, thanks for your contribution and the suggestions in the comment
– Snow
Mar 8 at 11:29
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54627930%2fhow-to-add-more-metrics-on-the-country-map-in-apache-superset%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What did you modify exactly? Could you post your modification to
CountryMap.jsandviz.py?– gdlmx
Mar 7 at 9:31
@gdlmx In
CountryMap.jsI changed['metric']to['metrics']. I did the same inviz.py, at theCountryMapVizclass, where I just modifiedself.form_data['metric']]toself.form_data['metrics']], in thequery_obj(self)method.– Snow
Mar 7 at 9:56