""" Generate visual representations of palettes in Bokeh palette groups. The ``bokeh.palettes`` modules expose attributes such as ``mpl``, ``brewer``, and ``d3`` that provide groups of palettes. The ``bokeh-palette-group`` directive accepts the name of one of these groups, and generates a visual matrix of colors for every palette in the group. As an example, the following usage of the the directive: .. code-block:: rest .. bokeh-palette-group:: mpl Generates the output: .. bokeh-palette-group:: mpl """ from __future__ import absolute_import from docutils import nodes from docutils.parsers.rst import Directive from sphinx.errors import SphinxError from .. import palettes as bp from .templates import PALETTE_GROUP_DETAIL CSS = """ """ JS = """ """ class bokeh_palette_group(nodes.General, nodes.Element): pass class BokehPaletteGroupDirective(Directive): has_content = False required_arguments = 1 def run(self): node = bokeh_palette_group() node['group'] = self.arguments[0] return [node] def html_visit_bokeh_palette_group(self, node): self.body.append(CSS) self.body.append('