Skip to content

Commit

Permalink
Allow setting a maximum height for the loading indicator (#2910)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Nov 12, 2021
1 parent 7328019 commit 674e908
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions panel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class _config(_base_config):
loading_color = param.Color(default='#c3c3c3', doc="""
Color of the loading indicator.""")

loading_max_height = param.Integer(default=400, doc="""
Maximum height of the loading indicator.""")

profiler = param.Selector(default=None, allow_None=True, objects=[
'pyinstrument', 'snakeviz'], doc="""
The profiler engine to enable.""")
Expand Down
3 changes: 2 additions & 1 deletion panel/io/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def loading_css():
b64 = b64encode(svg.encode('utf-8')).decode('utf-8')
return f"""
.bk.pn-loading.{config.loading_spinner}:before {{
background-image: url("data:image/svg+xml;base64,{b64}")
background-image: url("data:image/svg+xml;base64,{b64}");
max-height: {config.loading_max_height}px;
}}
"""

Expand Down

0 comments on commit 674e908

Please sign in to comment.