Skip to content

Commit

Permalink
let SVG of ui.pyplot fill its container (#3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Jun 27, 2024
1 parent ffba330 commit 054986d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions nicegui/elements/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(self, *, close: bool = True, **kwargs: Any) -> None:
raise ImportError('Matplotlib is not installed. Please run "pip install matplotlib".')

super().__init__('div')
self._classes.append('nicegui-pyplot')
self.close = close
self.fig = plt.figure(**kwargs)
self._convert_to_html()
Expand Down
4 changes: 4 additions & 0 deletions nicegui/static/nicegui.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ h6.q-timeline__title {
.nicegui-code .codehilite {
padding: 0 0.5rem;
}
.nicegui-pyplot > svg {
width: 100%;
height: 100%;
}

/* CodeMirror */
.nicegui-codemirror .cm-editor.cm-focused {
Expand Down

0 comments on commit 054986d

Please sign in to comment.