Skip to content

Commit 310061e

Browse files
committed
docs(api): add missing information
1 parent 95ce579 commit 310061e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = trame-matplotlib
3-
version = 2.0.0rc4
3+
version = 2.0.0rc5
44
description = Markdown widget for trame
55
long_description = file: README.rst
66
long_description_content_type = text/x-rst

trame_matplotlib/widgets/matplotlib.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@ def no_encoding(_data):
2525

2626

2727
class Figure(AbstractElement):
28-
_next_id = 0
29-
3028
"""
3129
Create a matplotlib figure viewer element
3230
3331
:param figure: Matplotlib figure to show (default: None)
3432
3533
>>> component1 = Figure(figure=fig1)
36-
>>> component2 = Figure(fig2)
34+
>>> component2 = Figure()
3735
>>> component2.update(fig1)
3836
"""
37+
_next_id = 0
3938

4039
def __init__(self, figure=None, **kwargs):
4140
Figure._next_id += 1
@@ -51,6 +50,11 @@ def __init__(self, figure=None, **kwargs):
5150
self.update()
5251

5352
def update(self, figure=None, **kwargs):
53+
"""
54+
Update the figure to show.
55+
56+
:param figure: Matplotlib figure object
57+
"""
5458
if figure:
5559
self._figure = figure
5660

@@ -59,6 +63,7 @@ def update(self, figure=None, **kwargs):
5963

6064
@property
6165
def key(self):
66+
"""Return the name of the state variable used internally"""
6267
return self._key
6368

6469
@staticmethod

0 commit comments

Comments
 (0)