{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Live Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The [HoloMap](../reference/containers/bokeh/HoloMap.ipynb) is a core HoloViews data structure that allows easy exploration of parameter spaces. The essence of a HoloMap is that it contains a collection of [Elements](http://holoviews.org/reference/index.html) (e.g. ``Image``s and ``Curve``s) that you can easily select and visualize.\n", "\n", "HoloMaps hold fully constructed Elements at specifically sampled points in a multidimensional space. Although HoloMaps are useful for exploring high-dimensional parameter spaces, they can very quickly consume huge amounts of memory to store all these Elements. For instance, a hundred samples along four orthogonal dimensions would need a HoloMap containing a hundred *million* Elements, each of which could be a substantial object that takes time to create and costs memory to store. Thus ``HoloMaps`` have some clear limitations:\n", "\n", "* HoloMaps may require the generation of millions of Elements before the first element can be viewed.\n", "* HoloMaps can easily exhaust all the memory available to Python.\n", "* HoloMaps can even more easily exhaust all the memory in the browser when displayed.\n", "* Static export of a notebook containing HoloMaps can result in impractically large HTML files.\n", "\n", "The ``DynamicMap`` addresses these issues by computing and displaying elements dynamically, allowing exploration of much larger datasets:\n", "\n", "* DynamicMaps generate elements on the fly, allowing the process of exploration to begin immediately.\n", "* DynamicMaps do not require fixed sampling, allowing exploration of parameters with arbitrary resolution.\n", "* DynamicMaps are lazy in the sense they only compute as much data as the user wishes to explore.\n", "\n", "Of course, these advantages come with some limitations:\n", "\n", "* DynamicMaps require a live notebook server and cannot be fully exported to static HTML.\n", "* DynamicMaps store only a portion of the underlying data, in the form of an Element cache and their output is dependent on the particular version of the executed code. \n", "* DynamicMaps (and particularly their element caches) are typically stateful (with values that depend on patterns of user interaction), which can make them more difficult to reason about.\n", "\n", "In addition to the different computational requirements of ``DynamicMaps``, they can be used to build sophisticated, interactive visualisations that cannot be achieved using only ``HoloMaps``. This notebook demonstrates some basic examples and the [Responding to Events](./12-Responding_to_Events.ipynb) guide follows on by introducing the streams system. The [Custom Interactivity](./13-Custom_Interactivity.ipynb) shows how you can directly interact with your plots when using the Bokeh backend.\n", "\n", "When DynamicMap was introduced in version 1.6, it supported multiple different 'modes' which have now been deprecated. This notebook demonstrates the simpler, more flexible and more powerful DynamicMap introduced in version 1.7. Users who have been using the previous version of DynamicMap should be unaffected as backwards compatibility has been preserved for the most common cases.\n", "\n", "All this will make much more sense once we've tried out some ``DynamicMaps`` and showed how they work, so let's create one!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "