8000 Standalone Tooltip Icon by hoxbro · Pull Request #4909 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Panel widget
  • Loading branch information
hoxbro committed May 22, 2023
commit 33a9c5e9b2dd72896c79c95a0e0ba0cb1fd1c15c
4 changes: 3 additions & 1 deletion panel/widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from .file_selector import FileSelector # noqa
from .indicators import ( # noqa
BooleanStatus, Dial, Gauge, LinearGauge, LoadingSpinner, Number, Progress,
Tqdm, Trend,
TooltipIcon, Tqdm, Trend,
)
from .input import ( # noqa
ArrayInput, Checkbox, ColorPicker, DatePicker, DatetimeInput,
Expand Down Expand Up @@ -125,6 +125,7 @@
"SpeechToText",
"Spinner",
"StaticText",
"Switch",
"Tabulator",
"Terminal",
"TextAreaInput",
Expand All @@ -133,6 +134,7 @@
"TextToSpeech",
"Toggle",
"ToggleGroup",
"TooltipIcon",
"Tqdm",
"Trend",
"Utterance",
Expand Down
2 changes: 1 addition & 1 deletion panel/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _process_param_change(self, params: Dict[str, Any]) -> Dict[str, Any]:
params['stylesheets'] = [
ImportedStyleSheet(url=ss) for ss in css
] + params['stylesheets']
if 'description' in params:
if isinstance(params.get('description'), str):
from ..pane.markup import Markdown
parser = Markdown._get_parser('markdown-it', ())
html = parser.render(params['description'])
Expand Down
17 changes: 15 additions & 2 deletions panel/widgets/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
import numpy as np
import param

from bokeh.models import ColumnDataSource, FixedTicker
from bokeh.models import ColumnDataSource, FixedTicker, Tooltip
from bokeh.plotting import figure
from tqdm.asyncio import tqdm as _tqdm

from ..io.resources import CDN_DIST
from ..layout import Column, Panel, Row
from ..models import (
HTML, Progress as _BkProgress, TrendIndicator as _BkTrendIndicator,
HTML, Progress as _BkProgress, TooltipIcon as _BkTooltipIcon,
TrendIndicator as _BkTrendIndicator,
)
from ..pane.markup import Str
from ..reactive import SyncableData
Expand Down Expand Up @@ -1307,6 +1308,17 @@ def reset(self):
self.value = self.param.value.default
self.text = self.param.text.default


class TooltipIcon(Widget):

value = param.ClassSelector(default="Description", class_=(str, Tooltip), doc="""
The description in the tooltip.""")

_widget_type = _BkTooltipIcon

_rename: ClassVar[Mapping[str, str | None]] = {'name': None, 'value': 'description'}


__all__ = [
"BooleanIndicator",
"BooleanStatus",
Expand All @@ -1317,6 +1329,7 @@ def reset(self):
"Number",
"Progress",
"String",
"TooltipIcon",
"Tqdm",
"Trend",
"ValueIndicator",
Expand Down
0