File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -154,3 +154,28 @@ def report():
154154 report ["locations" ] = __get_locations (df )
155155
156156 return report
157+
158+ def create_tree_map (frequency_dict , width , height ):
159+ """
160+ Get a treemap of projects
161+
162+ Input parameter: dictionary
163+ Output: treemap image
164+ """
165+ labels = list (frequency_dict .keys ())
166+ values = list (frequency_dict .values ())
167+
168+ fig = go .Figure (go .Treemap (
169+ labels = labels ,
170+ parents = ['' ] * len (labels ),
171+ values = values ,
172+ textinfo = 'label+value'
173+ ))
174+
175+ fig .update_layout (title = 'Projects' , width = width , height = height )
176+
177+ today = date .today ()
178+ output_path = f'treemap-{ today .strftime ("%Y%m%d" )} .png'
179+ fig .write_image (output_path )
180+ fig .show ()
181+
You can’t perform that action at this time.
0 commit comments