panel.theme Package#


theme Package#

The theme module contains Design and Theme components.

Each Design applies a coherent design system (e.g. bootstrap or material) to a template or a set of components, while Theme objects implement different color palettes (e.g. dark or default).

class panel.theme.Bootstrap(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.DarkTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Theme

Baseclass for dark themes.

Parameters inherited from:

base_css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/dark.cssā€™), label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b5daf50>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

bokeh_theme = param.ClassSelector(allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), default=<bokeh.themes.theme.Theme object at 0x10f26ba10>, label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b55b890>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

class panel.theme.DefaultTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Theme

Baseclass for default or light themes.

Parameters inherited from:

panel.theme.base.Theme: bokeh_theme, css

base_css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/default.cssā€™), label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b615910>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

class panel.theme.Design(theme=None, **params)[source]#

Bases: Parameterized, ResourceComponent

theme = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ā€˜panel.theme.base.Themeā€™>, constant=True, label=ā€™Themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b6526d0>)

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.Fast(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.Inherit[source]#

Bases: object

Singleton object to declare stylesheet inheritance.

class panel.theme.Material(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.Native(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.Theme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Parameterized

Theme objects declare the styles to switch between different color modes. Each Design may declare any number of color themes.

modifiers

The modifiers override parameter values of Panel components.

base_css = param.Filename(allow_None=True, allow_refs=False, check_exists=True, label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b4ef510>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

bokeh_theme = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b501510>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

css = param.Filename(allow_None=True, allow_refs=False, check_exists=True, label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b4efc10>, search_paths=[])

A stylesheet that overrides variables specifically for the Theme subclass. In most cases, this is not necessary.


base Module#

class panel.theme.base.DarkTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Theme

Baseclass for dark themes.

Parameters inherited from:

base_css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/dark.cssā€™), label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169a57550>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

bokeh_theme = param.ClassSelector(allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), default=<bokeh.themes.theme.Theme object at 0x10f26ba10>, label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169810b90>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

class panel.theme.base.DefaultTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Theme

Baseclass for default or light themes.

Parameters inherited from:

panel.theme.base.Theme: bokeh_theme, css

base_css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/default.cssā€™), label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169a68550>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

class panel.theme.base.Design(theme=None, **params)[source]#

Bases: Parameterized, ResourceComponent

theme = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ā€˜panel.theme.base.Themeā€™>, constant=True, label=ā€™Themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1699526d0>)

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.base.Inherit[source]#

Bases: object

Singleton object to declare stylesheet inheritance.

class panel.theme.base.Theme(*, base_css, bokeh_theme, css, name)[source]#

Bases: Parameterized

Theme objects declare the styles to switch between different color modes. Each Design may declare any number of color themes.

modifiers

The modifiers override parameter values of Panel components.

base_css = param.Filename(allow_None=True, allow_refs=False, check_exists=True, label=ā€™Base cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1696bbf50>, search_paths=[])

A stylesheet declaring the base variables that define the color scheme. By default this is inherited from a base class.

bokeh_theme = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1697dab10>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

css = param.Filename(allow_None=True, allow_refs=False, check_exists=True, label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1696bb890>, search_paths=[])

A stylesheet that overrides variables specifically for the Theme subclass. In most cases, this is not necessary.


bootstrap Module#

class panel.theme.bootstrap.Bootstrap(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.bootstrap.BootstrapDarkTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: DarkTheme

The BootstrapDarkTheme is a Dark Theme in the style of Bootstrap

Parameters inherited from:

panel.theme.base.DarkTheme: base_css, bokeh_theme

css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/bootstrap_dark.cssā€™), label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168e0f050>, search_paths=[])

A stylesheet that overrides variables specifically for the Theme subclass. In most cases, this is not necessary.

class panel.theme.bootstrap.BootstrapDefaultTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: DefaultTheme

The BootstrapDefaultTheme is a light theme.

Parameters inherited from:

css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/bootstrap_default.cssā€™), label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168e02390>, search_paths=[])

A stylesheet that overrides variables specifically for the Theme subclass. In most cases, this is not necessary.


fast Module#

class panel.theme.fast.Fast(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.fast.FastDarkTheme(*, style, base_css, bokeh_theme, css, name)[source]#

Bases: DarkTheme

Parameters inherited from:

style = param.ClassSelector(allow_refs=False, class_=<class ā€˜panel.theme.fast.FastStyleā€™>, default=FastStyle(accent_base_color=ā€™#0072B5ā€™, background_color=ā€™#181818ā€™, collapsed_icon=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€collapsed-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M9 5.44446V12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, color=ā€™#ffffffā€™, corner_radius=3, expanded_icon=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€expanded-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, font=ā€™Open Sans, sans-serifā€™, font_url=ā€™//fonts.googleapis.com/css?family=Open+Sansā€™, header_accent_base_color=ā€™#ffffffā€™, header_background=ā€™#0072B5ā€™, header_color=ā€™#ffffffā€™, header_luminance=0.23, header_neutral_color=ā€™#0072B5ā€™, luminance=0.1, name=ā€™FastStyle00102ā€™, neutral_color=ā€™#000000ā€™, neutral_fill_card_rest=ā€™#212121ā€™, neutral_focus=ā€™#717171ā€™, neutral_foreground_rest=ā€™#e5e5e5ā€™, shadow=False), label=ā€™Styleā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168761b50>)

property bokeh_theme#

Provide new default values for Bokeh models.

Bokeh Model properties all have some built-in default value. If a property has not been explicitly set (e.g. m.foo = 10), accessing the property will return the default value. It may be useful for users to be able to specify a different set of default values than the built-in default. The Theme class allows collections of custom default values to be easily applied to Bokeh documents.

The Theme class can be constructed either from a YAML file or from a JSON dict (but not both). Examples of both formats are shown below.

The plotting API defaults override some theme properties. Namely: fill_alpha, fill_color, line_alpha, line_color, text_alpha and text_color. Those properties should therefore be set explicitly when using the plotting API.

Args:

filename (str, optional) : path to a YAML theme file json (str, optional) : a JSON dictionary specifying theme values

Raises:
ValueError

If neither filename nor json is supplied.

Examples:

Themes are specified by providing a top-level key attrs which has blocks for Model types to be themed. Each block has keys and values that specify the new property defaults for that type.

Take note of the fact that YAML interprets the value None as a string, which is not usually what you want. To give None as a value in YAML, use !!null. To give ā€˜Noneā€™ as a value in json, use null.

Here is an example theme in YAML format that sets various visual properties for all figures, grids, and titles:

attrs:
    Plot:
        background_fill_color: '#2F2F2F'
        border_fill_color: '#2F2F2F'
        outline_line_color: '#444444'
    Axis:
        axis_line_color: !!null
    Grid:
        grid_line_dash: [6, 4]
        grid_line_alpha: .3
    Title:
        text_color: "white"

Here is the same theme, in JSON format:

{
    'attrs' : {
        'Plot': {
            'background_fill_color': '#2F2F2F',
            'border_fill_color': '#2F2F2F',
            'outline_line_color': '#444444',
        },
        'Axis': {
            'axis_line_color': None,
        },
        'Grid': {
            'grid_line_dash': [6, 4],
            'grid_line_alpha': .3,
        },
        'Title': {
            'text_color': 'white'
        }
    }
}
class panel.theme.fast.FastDefaultTheme(*, style, base_css, bokeh_theme, css, name)[source]#

Bases: DefaultTheme

Parameters inherited from:

style = param.ClassSelector(allow_refs=False, class_=<class ā€˜panel.theme.fast.FastStyleā€™>, default=FastStyle(accent_base_color=ā€™#0072B5ā€™, background_color=ā€™#ffffffā€™, collapsed_icon=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€collapsed-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M9 5.44446V12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, color=ā€™#2B2B2Bā€™, corner_radius=3, expanded_icon=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€expanded-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, font=ā€™Open Sans, sans-serifā€™, font_url=ā€™//fonts.googleapis.com/css?family=Open+Sansā€™, header_accent_base_color=ā€™#ffffffā€™, header_background=ā€™#0072B5ā€™, header_color=ā€™#ffffffā€™, header_luminance=0.23, header_neutral_color=ā€™#0072B5ā€™, luminance=1.0, name=ā€™FastStyle00101ā€™, neutral_color=ā€™#000000ā€™, neutral_fill_card_rest=ā€™#F7F7F7ā€™, neutral_focus=ā€™#888888ā€™, neutral_foreground_rest=ā€™#2B2B2Bā€™, shadow=True), label=ā€™Styleā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1687176d0>)

class panel.theme.fast.FastStyle(*, accent_base_color, background_color, collapsed_icon, color, corner_radius, expanded_icon, font, font_url, header_accent_base_color, header_background, header_color, header_luminance, header_neutral_color, luminance, neutral_color, neutral_fill_card_rest, neutral_focus, neutral_foreground_rest, shadow, name)[source]#

Bases: Parameterized

The FastStyle class provides the different colors and icons used to style the Fast Templates.

background_color = param.String(allow_refs=False, default=ā€™#ffffffā€™, label=ā€™Background colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16981a050>)

neutral_color = param.String(allow_refs=False, default=ā€™#000000ā€™, label=ā€™Neutral colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7710>)

accent_base_color = param.String(allow_refs=False, default=ā€™#0072B5ā€™, label=ā€™Accent base colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169818ad0>)

collapsed_icon = param.String(allow_refs=False, default=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€collapsed-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M9 5.44446V12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, label=ā€™Collapsed iconā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7610>)

expanded_icon = param.String(allow_refs=False, default=ā€™n<svg style=ā€stroke: var(ā€“accent-fill-rest);ā€ width=ā€18ā€ height=ā€18ā€ viewBox=ā€0 0 18 18ā€ fill=ā€noneā€ xmlns=ā€http://www.w3.org/2000/svgā€ slot=ā€expanded-iconā€>n <path d=ā€M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Zā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n <path d=ā€M5.44446 9H12.5556ā€ stroke-linecap=ā€roundā€ stroke-linejoin=ā€roundā€></path>n</svg>nā€™, label=ā€™Expanded iconā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168b0aa90>)

color = param.String(allow_refs=False, default=ā€™#2B2B2Bā€™, label=ā€™Colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7610>)

neutral_fill_card_rest = param.String(allow_refs=False, default=ā€™#F7F7F7ā€™, label=ā€™Neutral fill card restā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168b0aa90>)

neutral_focus = param.String(allow_refs=False, default=ā€™#888888ā€™, label=ā€™Neutral focusā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7590>)

neutral_foreground_rest = param.String(allow_refs=False, default=ā€™#2B2B2Bā€™, label=ā€™Neutral foreground restā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168b0aa90>)

header_luminance = param.Magnitude(allow_refs=False, bounds=(0.0, 1.0), default=0.23, inclusive_bounds=(True, True), label=ā€™Header luminanceā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd4790>)

header_background = param.String(allow_refs=False, default=ā€™#0072B5ā€™, label=ā€™Header backgroundā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168b0ab90>)

header_neutral_color = param.String(allow_refs=False, default=ā€™#0072B5ā€™, label=ā€™Header neutral colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7350>)

header_accent_base_color = param.String(allow_refs=False, default=ā€™#ffffffā€™, label=ā€™Header accent base colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7110>)

header_color = param.String(allow_refs=False, default=ā€™#ffffffā€™, label=ā€™Header colorā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7610>)

font = param.String(allow_refs=False, default=ā€™Open Sans, sans-serifā€™, label=ā€™Fontā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7250>)

font_url = param.String(allow_refs=False, default=ā€™//fonts.googleapis.com/css?family=Open+Sansā€™, label=ā€™Font urlā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bdb390>)

corner_radius = param.Integer(allow_refs=False, default=3, inclusive_bounds=(True, True), label=ā€™Corner radiusā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16922b250>)

shadow = param.Boolean(allow_refs=False, default=True, label=ā€™Shadowā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1698d0e10>)

luminance = param.Magnitude(allow_refs=False, bounds=(0.0, 1.0), default=1.0, inclusive_bounds=(True, True), label=ā€™Luminanceā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bd7090>)

create_bokeh_theme()[source]#

Returns a custom bokeh theme based on the style parameters

Returns:

Dict: A Bokeh Theme

class panel.theme.fast.FastThemeMixin(*, css, name)[source]#

Bases: Parameterized

css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/fast_variables.cssā€™), label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1687eca10>, search_paths=[])

class panel.theme.fast.FastWrapper(*, object, style, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, name)[source]#

Bases: ReactiveHTML

Wraps any Panel component and initializes the Fast design provider.

Wrapping a component in this way ensures that so that any children using the Fast design system have access to the Fast CSS variables.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, css_classes, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visible

panel.viewable.Viewable: loading

object = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ā€˜panel.viewable.Viewableā€™>, label=ā€™Objectā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168cca050>)

style = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ā€˜panel.theme.fast.FastStyleā€™>, label=ā€™Styleā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168bdc1d0>)

clone(**params) Viewable[source]#

Makes a copy of the object sharing the same parameters.

Arguments#

params: Keyword arguments override the parameters on the clone.

Returns#

Cloned Viewable object

controls(parameters: list[str] = [], jslink: bool = True, **kwargs) BasePanel[source]#

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Arguments#

parameters: list(str)

An explicit list of parameters to return controls for.

jslink: bool

Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

kwargs: dict

Additional kwargs to pass to the Param pane(s) used to generate the controls widgets.

Returns#

A layout of the controls

embed(max_states: int = 1000, max_opts: int = 3, json: bool = False, json_prefix: str = '', save_path: str = './', load_path: str | None = None, progress: bool = False, states={}) None[source]#

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Arguments#

max_states: int

The maximum number of states to embed

max_opts: int

The maximum number of states for a single widget

json: boolean (default=True)

Whether to export the data to json files

json_prefix: str (default=ā€™ā€™)

Prefix for JSON filename

save_path: str (default=ā€™./ā€™)

The path to save json files to

load_path: str (default=None)

The path or URL the json files will be loaded from.

progress: boolean (default=False)

Whether to report progress

states: dict (default={})

A dictionary specifying the widget values to embed for each widget

get_root(doc: Document | None = None, comm: Comm | None = None, preprocess: bool = True) Model[source]#

Returns the root model and applies pre-processing hooks

Arguments#

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

preprocess: boolean (default=True)

Whether to run preprocessing hooks

Returns#

Returns the bokeh model corresponding to this panel object

jscallback(args: dict[str, Any] = {}, **callbacks: str) Callback[source]#

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Arguments#

args: dict

A mapping of objects to make available to the JS callback

callbacks: dict

A mapping between properties on the source model and the code to execute when that property changes

Returns#

callback: Callback

The Callback which can be used to disable the callback.

Links properties on the this Reactive object to those on the target Reactive object in JS code.

Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Arguments#

target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned

The target to link the value to.

code: dict

Custom code which will be executed when the widget value changes.

args: dict

A mapping of objects to make available to the JS callback

bidirectional: boolean

Whether to link source and target bi-directionally

links: dict

A mapping between properties on the source model and the target model property to link it to.

Returns#

link: GenericLink

The GenericLink which can be used unlink the widget and the target model.

Links the parameters on this Reactive object to attributes on the target Parameterized object.

Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Arguments#

target: param.Parameterized

The target object of the link.

callbacks: dict | None

Maps from a parameter in the source object to a callback.

bidirectional: bool

Whether to link source and target bi-directionally

links: dict

Maps between parameters on this object to the parameters on the supplied object.

on_event(node: str, event: str, callback: Callable) None[source]#

Registers a callback to be executed when the specified DOM event is triggered on the named node. Note that the named node must be declared in the HTML. To create a named node you must give it an id of the form id=ā€nameā€, where name will be the node identifier.

Arguments#

node: str

Named node in the HTML identifiable via id of the form id=ā€nameā€.

event: str

Name of the DOM event to add an event listener to.

callback: callable

A callable which will be given the DOMEvent object.

save(filename: str | PathLike | IO, title: str | None = None, resources: Resources | None = None, template: str | Template | None = None, template_variables: dict[str, Any] = {}, embed: bool = False, max_states: int = 1000, max_opts: int = 3, embed_json: bool = False, json_prefix: str = '', save_path: str = './', load_path: str | None = None, progress: bool = True, embed_states: dict[Any, Any] = {}, as_png: bool | None = None, **kwargs) None[source]#

Saves Panel objects to file.

Arguments#

filename: str or file-like object

Filename to save the plot to

title: string

Optional title for the plot

resources: bokeh resources

One of the valid bokeh.resources (e.g. CDN or INLINE)

template:

passed to underlying io.save

template_variables:

passed to underlying io.save

embed: bool

Whether the state space should be embedded in the saved file.

max_states: int

The maximum number of states to embed

max_opts: int

The maximum number of states for a single widget

embed_json: boolean (default=True)

Whether to export the data to json files

json_prefix: str (default=ā€™ā€™)

Prefix for the auto-generated json directory

save_path: str (default=ā€™./ā€™)

The path to save json files to

load_path: str (default=None)

The path or URL the json files will be loaded from.

progress: boolean (default=True)

Whether to report progress

embed_states: dict (default={})

A dictionary specifying the widget values to embed for each widget

as_png: boolean (default=None)

To save as a .png. If None save_png will be true if filename is string and ends with png.

select(selector: type | Callable[[Viewable], bool] | None = None) list[Viewable][source]#

Iterates over the Viewable and any potential children in the applying the Selector.

Arguments#

selector: type or callable or None

The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns#

viewables: list(Viewable)

servable(title: str | None = None, location: bool | 'Location' = True, area: str = 'main', target: str | None = None) ServableMixin[source]#

Serves the object or adds it to the configured pn.state.template if in a panel serve context, writes to the DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context.

Arguments#

titlestr

A string title to give the Document (if served as an app)

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

area: str (deprecated)

The area of a template to add the component too. Only has an effect if pn.config.template has been set.

target: str

Target area to write to. If a template has been configured on pn.config.template this refers to the target area in the template while in pyodide this refers to the ID of the DOM node to write to.

Returns#

The Panel object itself

server_doc(doc: Document | None = None, title: str | None = None, location: bool | 'Location' = True) Document[source]#

Returns a serveable bokeh Document with the panel attached

Arguments#

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

Returns#

docbokeh.Document

The bokeh document the panel was attached to

show(title: str | None = None, port: int = 0, address: str | None = None, websocket_origin: str | None = None, threaded: bool = False, verbose: bool = True, open: bool = True, location: bool | 'Location' = True, **kwargs) StoppableThread' | 'Server[source]#

Starts a Bokeh server and displays the Viewable in a new tab.

Arguments#

titlestr | None

A string title to give the Document (if served as an app)

port: int (optional, default=0)

Allows specifying a specific port

addressstr

The address the server should listen on for HTTP requests.

websocket_origin: str or list(str) (optional)

A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, ā€œlocalhostā€ is used.

threaded: boolean (optional, default=False)

Whether to launch the Server on a separate thread, allowing interactive use.

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

locationboolean or panel.io.location.Location

Whether to create a Location component to observe and set the URL location.

Returns#

server: bokeh.server.Server or panel.io.server.StoppableThread

Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)


material Module#

class panel.theme.material.Material(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.material.MaterialDarkTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: MaterialThemeMixin, DarkTheme

The MaterialDarkTheme is a Dark Theme in the style of Material Design

Parameters inherited from:

bokeh_theme = param.ClassSelector(allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), default=<bokeh.themes.theme.Theme object at 0x10f740fd0>, label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b87e150>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

class panel.theme.material.MaterialDefaultTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: MaterialThemeMixin, DefaultTheme

The MaterialDefaultTheme is a light theme.

Parameters inherited from:

bokeh_theme = param.ClassSelector(allow_refs=False, class_=(<class ā€˜bokeh.themes.theme.Themeā€™>, <class ā€˜strā€™>), default=<bokeh.themes.theme.Theme object at 0x10f740e10>, label=ā€™Bokeh themeā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b87fc90>)

A Bokeh Theme class that declares properties to apply to Bokeh models. This is necessary to ensure that plots and other canvas based components are styled appropriately.

class panel.theme.material.MaterialThemeMixin(*, css, name)[source]#

Bases: Parameterized

css = param.Filename(allow_refs=False, check_exists=True, default=PosixPath(ā€˜/Users/runner/work/panel/panel/panel/theme/css/material_variables.cssā€™), label=ā€™Cssā€™, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16b889690>, search_paths=[])


native Module#

class panel.theme.native.Native(theme=None, **params)[source]#

Bases: Design

Parameters inherited from:

apply(viewable: Viewable, root: Model, isolated: bool = True)[source]#

Applies the Design to a Viewable and all it children.

Arguments#

viewable: Viewable

The Viewable to apply the Design to.

root: Model

The root Bokeh model to apply the Design to.

isolated: bool

Whether the Design is applied to an individual component or embedded in a template that ensures the resources, such as CSS variable definitions and JS are already initialized.

apply_bokeh_theme_to_model(model: Model, theme_override=None)[source]#

Applies the Bokeh theme associated with this Design system to a model.

Arguments#

model: bokeh.model.Model

The Model to apply the theme on.

theme_override: str | None

A different theme to apply.

params(viewable: Viewable, doc: Document | None = None) tuple[dict[str, Any], dict[str, Any]][source]#

Provides parameter values to apply the provided Viewable.

Arguments#

viewable: Viewable

The Viewable to return modifiers for.

doc: Document | None

Document the Viewable will be rendered into. Useful for caching any stylesheets that are created.

Returns#

modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the Viewable.

child_modifiers: Dict[str, Any]

Dictionary of parameter values to apply to the children of the Viewable.

resolve_resources(cdn: bool | Literal['auto'] = 'auto', extras: dict[str, dict[str, str]] | None = None, include_theme: bool = True) ResourceTypes[source]#

Resolves the resources required for this design component.

Arguments#

cdn: bool | Literal[ā€˜autoā€™]

Whether to load resources from CDN or local server. If set to ā€˜autoā€™ value will be automatically determine based on global settings.

extras: dict[str, dict[str, str]] | None

Additional resources to add to the bundle. Valid resource types include js, js_modules and css.

include_theme: bool

Whether to include theme resources.

Returns#

Dictionary containing JS and CSS resources.

class panel.theme.native.NativeDarkTheme(*, base_css, bokeh_theme, css, name)[source]#

Bases: DarkTheme

Parameters inherited from: