mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix Calendar Heatmap (#6445)
* fix D3 v4.0, selections are not arrays anymore * added vale checking * fixed linting * cleanup
This commit is contained in:
committed by
Maxime Beauchemin
parent
b0a55743b3
commit
529cb5cab1
@@ -95,7 +95,7 @@ function Calendar(element, props) {
|
||||
cal.init({
|
||||
start: UTCTS(data.start),
|
||||
data: timestamps,
|
||||
itemSelector: calContainer[0][0],
|
||||
itemSelector: calContainer.node(),
|
||||
legendVerticalPosition: 'top',
|
||||
cellSize,
|
||||
cellPadding,
|
||||
|
||||
@@ -789,10 +789,13 @@ class CalHeatmapViz(BaseViz):
|
||||
data = {}
|
||||
records = df.to_dict('records')
|
||||
for metric in self.metric_labels:
|
||||
data[metric] = {
|
||||
str(obj[DTTM_ALIAS] / 10**9): obj.get(metric)
|
||||
for obj in records
|
||||
}
|
||||
values = {}
|
||||
for obj in records:
|
||||
v = obj[DTTM_ALIAS]
|
||||
if hasattr(v, 'value'):
|
||||
v = v.value
|
||||
values[str(v / 10**9)] = obj.get(metric)
|
||||
data[metric] = values
|
||||
|
||||
start, end = utils.get_since_until(form_data.get('time_range'),
|
||||
form_data.get('since'),
|
||||
|
||||
Reference in New Issue
Block a user