[docs]@requires("plotly.express")def__init__(self,df:DataFrame,*,x=None,y=None,color=None,on_click:EndpointProperty=None,selected:List[str]=[],on_select:Endpoint=None,**kwargs,):"""See https://plotly.com/python-api- reference/generated/plotly.express.violin.html for more details."""ifnotenv.is_package_installed("plotly"):raiseValueError("Plotly components require plotly. Install with `pip install plotly`.")ifdf.primary_key_nameisNone:raiseValueError("Dataframe must have a primary key")fig=px.violin(df.to_pandas(),x=x,y=y,color=color,**kwargs)super().__init__(df=df,keyidxs=df.primary_key.values.tolist(),on_click=on_click,selected=selected,on_select=on_select,json_desc=fig.to_json(),)