cellyzer/visualization.py
def view_home_work_locations(home_location=None, work_location=None, map_name="home_work_location", notebook=False):
    """
    Visualize a map of home and work locations
    :param home_location: home locations
    :param work_location: work locations
    :param map_name: name of the map to be displayed
    :param notebook: set True if run in notebook
    :return: shows a map with home/work locations around cells
    """

    if home_location is None and work_location is None:
        print('XXX home location or work location is not provided with data inputs XXX')
    else:
        map1 = folium.Map(location=home_location,
                          zoom_start=11)
        if home_location is None:
            map1 = folium.Map(location=work_location,
                              zoom_start=11)
        if home_location is not None:
            folium.Marker(location=home_location,
                          popup='Home',
                          icon=folium.Icon(color='green', icon_color='white', icon='home', angle=0, prefix='fa'),
                          tooltip='Home Location'
                          ).add_to(map1)
        if work_location is not None:
            folium.Marker(location=work_location,
                          popup='Work Location',
                          icon=folium.Icon(color='darkblue', icon_color='white', icon='building', angle=0, prefix='fa'),
                          tooltip='Work Location'
                          ).add_to(map1)
        if notebook:
            return map1
        else:
            # visualize in web browser
            file_path = 'outputs\\' + map_name + '.html'
            map1.save(file_path)
            webbrowser.open(file_path)

    Visualize a map of home and work locations
    :param home_location: home locations
    :param work_location: work locations
    :param map_name: name of the map to be displayed
    :param notebook: set True if run in notebook
    :return: shows a map with home/work locations around cells
    
Visualize a map of home and work locations
Visualize a map of home and work locations
def view_home_work_locations(home_location=None, work_location=None, map_name="home_work_location", notebook=False):
    if home_location is None and work_location is None:
        print('XXX home location or work location is not provided with data inputs XXX')
    else:
        map1 = folium.Map(location=home_location,
                          zoom_start=11)
        if home_location is None:
            map1 = folium.Map(location=work_location,
                              zoom_start=11)
        if home_location is not None:
            folium.Marker(location=home_location,
                          popup='Home',
                          icon=folium.Icon(color='green', icon_color='white', icon='home', angle=0, prefix='fa'),
                          tooltip='Home Location'
                          ).add_to(map1)
        if work_location is not None:
            folium.Marker(location=work_location,
                          popup='Work Location',
                          icon=folium.Icon(color='darkblue', icon_color='white', icon='building', angle=0, prefix='fa'),
                          tooltip='Work Location'
                          ).add_to(map1)
        if notebook:
            return map1
        else:
            file_path = 'outputs\\' + map_name + '.html'
            map1.save(file_path)
            webbrowser.open(file_path)
def view_home_work_locations ( home_location = None , work_location = None , map_name = "home_work_location" , notebook = False ) : if home_location is None and work_location is None : print ( 'XXX home location or work location is not provided with data inputs XXX' ) else : map1 = folium . Map ( location = home_location , zoom_start = 11 ) if home_location is None : map1 = folium . Map ( location = work_location , zoom_start = 11 ) if home_location is not None : folium . Marker ( location = home_location , popup = 'Home' , icon = folium . Icon ( color = 'green' , icon_color = 'white' , icon = 'home' , angle = 0 , prefix = 'fa' ) , tooltip = 'Home Location' ) . add_to ( map1 ) if work_location is not None : folium . Marker ( location = work_location , popup = 'Work Location' , icon = folium . Icon ( color = 'darkblue' , icon_color = 'white' , icon = 'building' , angle = 0 , prefix = 'fa' ) , tooltip = 'Work Location' ) . add_to ( map1 ) if notebook : return map1 else : file_path = 'outputs\\' + map_name + '.html' map1 . save ( file_path ) webbrowser . open ( file_path )
Visualize a map of home and work locations
Visualize a map of home and work locations
"""
    Visualize a map of home and work locations
    :param home_location: home locations
    :param work_location: work locations
    :param map_name: name of the map to be displayed
    :param notebook: set True if run in notebook
    :return: shows a map with home/work locations around cells
    """ # visualize in web browser
shows a map with home/work locations around cells
shows a map with home / work locations around cells
home_location
None
work_location
None
map_name
name of the map to be displayed
name of the map to be displayed
notebook
set True if run in notebook
set True if run in notebook