Skip to content

Commit

Permalink
Changed: Changed time heatmap default color scheme for sequential data.
Browse files Browse the repository at this point in the history
  • Loading branch information
AAnzel committed Jan 5, 2022
1 parent f27d2a4 commit ed4d683
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion Source/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,16 @@ def time_heatmap(data, target_feature, temporal_feature):

target_type = 'ordinal' if target_column_type == 'string'\
else 'quantitative'
target_color_scheme = 'tableau20' if target_column_type == 'string'\
else 'greys'

chart = alt.Chart(
data,
title=target_feature + ' time heatmap').mark_rect().encode(
alt.X('date(' + temporal_feature + ')', type='temporal'),
alt.Y('month(' + temporal_feature + ')', type='temporal'),
alt.Color(target_feature, type=target_type),
alt.Color(target_feature, type=target_type,
scale=alt.Scale(scheme=target_color_scheme)),
alt.Tooltip([temporal_feature, target_feature]))

return chart.interactive()
Expand Down

0 comments on commit ed4d683

Please sign in to comment.