#!/usr/bin/env python # coding: utf-8 # ### Using plugins in PerspectiveWidget # # `PerspectiveWidget` comes with a set of plugins that are able to visualize your data. # In[ ]: from perspective import PerspectiveWidget # In[ ]: data = { "int": [i for i in range(4)], "float": [i * 1.25 for i in range(4)], "str": ["a", "b", "c", "d"], "bool": [True, False, True, False], "date": [date.today() for i in range(4)], "datetime": [datetime.now() for i in range(4)] } # Pass the plugin name into the kwargs of `PerspectiveWidget` or `start`. Once the viewer has been initialized, you can select plugins at the top left corner (and see the parsable names for each one). # In[ ]: widget = PerspectiveWidget(data, plugin="d3_x_bar") widget # In[ ]: widget2 = PerspectiveWidget(data, plugin="d3_heatmap") widget2 # Plugins can be set from the notebook: # In[ ]: widget.plugin = "datagrid" # In[ ]: widget.plugin = "d3_y_line"