File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed
Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -339,27 +339,6 @@ sliders_dict = {
339339 " steps" : []
340340}
341341
342- # make data
343- year = 1952
344- for continent in continents:
345- dataset_by_year = dataset[dataset[" year" ] == year]
346- dataset_by_year_and_cont = dataset_by_year[
347- dataset_by_year[" continent" ] == continent]
348-
349- data_dict = {
350- " x" : list (dataset_by_year_and_cont[" lifeExp" ]),
351- " y" : list (dataset_by_year_and_cont[" gdpPercap" ]),
352- " mode" : " markers" ,
353- " text" : list (dataset_by_year_and_cont[" country" ]),
354- " marker" : {
355- " sizemode" : " area" ,
356- " sizeref" : 200000 ,
357- " size" : list (dataset_by_year_and_cont[" pop" ])
358- },
359- " name" : continent
360- }
361- fig_dict[" data" ].append(data_dict)
362-
363342# make frames
364343for year in years:
365344 frame = {" data" : [], " name" : str (year)}
@@ -396,6 +375,9 @@ for year in years:
396375
397376fig_dict[" layout" ][" sliders" ] = [sliders_dict]
398377
378+ # make data
379+ fig_dict[" data" ] = fig_dict[" frames" ][0 ][' data' ]
380+
399381fig = go.Figure(fig_dict)
400382
401383fig.show()
You can’t perform that action at this time.
0 commit comments