File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ const DEFAULT_COLORSCHEME = seismic
2
2
const DEFAULT_RANGESCALE = :centered
3
3
4
4
"""
5
- heatmap(values, words; kwargs...)
6
- heatmap(values, words, colors)
5
+ heatmap(values, words)
7
6
8
7
Create a heatmap of words where the background color of each word is determined by its corresponding value.
9
8
Arguments `values` and `words` (and optionally `colors`) must have the same size.
@@ -81,16 +80,13 @@ luma(c::RGB) = 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b # using BT. 709 coeffi
81
80
82
81
# Used e.g. in Pluto notebooks
83
82
function Base. show (io:: IO , :: MIME"text/html" , h:: TextHeatmap )
83
+ print (io, " <p><heatmap>" )
84
84
for (word, color) in zip (h. words, h. colors)
85
85
bg = hex (color)
86
86
fg = is_background_bright (color) ? " black" : " white"
87
87
88
- style = """
89
- background-color: #$bg ;
90
- color: $fg ;
91
- padding: 0.2em;
92
- margin: 0.2em;
93
- """
94
- print (io, """ <heatmap style="$style ">$word </heatmap>""" )
88
+ style = " background-color: #$bg ; color: $fg ; padding: 0.2em; margin: 0.2em;"
89
+ print (io, """ <heatmap-word style="$style ">$word </heatmap-word>""" )
95
90
end
91
+ print (io, " </heatmap></p>" )
96
92
end
You can’t perform that action at this time.
0 commit comments