Default Widget

When using a style helper, it's possible to set the default widget for this helper by setting the default_widget Layer parameter to True.


In [1]:
from cartoframes.auth import set_default_credentials

set_default_credentials('cartoframes')

In [2]:
from cartoframes.viz import Map, Layer, color_bins_style

Map(
  Layer(
    'demographics_sf',
    style=color_bins_style('masters_percent'),
    default_widget=True
  )
)


Out[2]:
:
StackTrace
    ">

    Also, the legend that is displayed automatically when using style helpers, can be removed by setting default_legend parameter to False

    
    
    In [3]:
    from cartoframes.viz import Map, Layer, color_bins_style, default_widget
    
    Map(
      Layer(
        'demographics_sf',
        style=color_bins_style('masters_percent'),
        widgets=default_widget(title="Percent Master's Degree"),
        default_legend=False
      )
    )
    
    
    
    
    Out[3]:
    :
    StackTrace
      ">