def render(self, **kwargs): """Renders the HTML representation of the element.""" self.color_domain = [self.vmin + (self.vmax-self.vmin) * k/499. for k in range(500)] self.color_range = [self.__call__(x) for x in self.color_domain] self.tick_labels = legend_scaler(self.index) super(ColorMap, self).render(**kwargs) figure = self.get_root() assert isinstance(figure, Figure), ('You cannot render this Element ' 'if it is not in a Figure.') figure.header.add_child(JavascriptLink("https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"), name='d3') # noqa