Skip to content

Commit

Permalink
Implemented HeatMap constructor conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 10, 2015
1 parent b2ad91b commit ce7fe2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion holoviews/element/raster.py
Expand Up @@ -4,7 +4,7 @@
import param

from ..core import util
from ..core import OrderedDict, Dimension, NdMapping, Element2D, Overlay
from ..core import OrderedDict, Dimension, NdMapping, Element2D, Overlay, Element
from ..core.boundingregion import BoundingRegion, BoundingBox
from ..core.sheetcoords import SheetCoordinateSystem, Slice
from .chart import Curve
Expand Down Expand Up @@ -215,6 +215,10 @@ def _process_data(self, data, params):
dimensions['vdims'] = data.vdims
elif isinstance(data, (dict, OrderedDict, type(None))):
data = NdMapping(data, **dimensions)
elif isinstance(data, Element):
data = data.table()
if not data.ndims == 2:
raise TypeError('HeatMap conversion requires 2 key dimensions')
else:
raise TypeError('HeatMap only accepts dict or NdMapping types.')

Expand Down

0 comments on commit ce7fe2d

Please sign in to comment.