Publish a visualization of a layout

This example illustrate how to publish a layout of map visualizations.

Note: CARTO Account credentials are needed to reproduce this example. https://carto.com/signup


In [1]:
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Map, Layer, Layout, basic_style, color_category_style

set_default_credentials('creds.json')

In [2]:
layout_viz = Layout([
    Map(Layer('public_table')),
    Map(Layer('private_table'))
])

In [3]:
layout_viz.publish(
    'layout_public_private_table',
    password='1234',
    if_exists='replace')


The map has been published. The "cartoframes_997c05771fd4e0916de49826722e51cd" Maps API key with value "7rj9ftFsOKUjSotnygh2jg" is being used for the datasets: "private_table". You can manage your API keys on your account.
Out[3]:
{'id': '70057fe9-57ad-4e3c-999f-a086c2a1d494',
 'url': 'https://cartoframes-org.carto.com/u/cartoframes/kuviz/70057fe9-57ad-4e3c-999f-a086c2a1d494',
 'name': 'layout_public_private_table',
 'privacy': 'password'}