@visualize
Visualize Decorator
Summary:
visualize
decorator is used to visualize data in a Morph Python cell. The decorator generates a diagram using the visualisation library specified by the following parameters.
Parameters:
- library: specification of the library to use for visualisation.
"matplotlib"
or"pyplot"
("plotly"
) can be specified.
Return value:
- The decorator wraps the input function and returns the result of the visualization function execution as an HTML string. The resulting diagram is then displayed on the dashboard.
Usage example:
from morphdb_utils.annotations import visualize
@visualize("plotly")
def main(data: Dict[str, pd.DataFrame]):
# write your code here
fig = px.line(data["python_78919"], x='Year', y='NO2_Concentration', markers=True)
fig.update_layout(title='Plotly Plot')
return fig