Multiple popup events

Popups provide information about features through either click or hover interactivity events. Features can listen to both events or multiple properties from the same event.

For more information on popups, run help(Popup).

In this example, there are two different definitions for popup information depending on whether it is a hover or click event.


In [1]:
from cartoframes.auth import set_default_credentials

set_default_credentials('cartoframes')

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

Layer(
    'countries_africa',
    popup_hover=[
        popup_element('name', title='Country'),
    ],
    popup_click=[
        popup_element('pop_est', title='Population'),
        popup_element('gdp_md_est', title='GDP')
    ]
)


Out[2]:
:
StackTrace
    ">