Web app with hvPlot

Options
Luis_PB
Luis_PB Registered Posts: 6

Is there a way to create Web apps using the hvPlot?

Best Answer

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    Answer ✓
    Options

    Hi,
    You in can include hvplot in Dash webapp for example:
    YOu need to install dash/hvplot in the code env :

    import dashimport dash_core_components as dccimport dash_html_components as htmlimport pandas as pdimport hvplot.pandasimport holoviews as hvfrom holoviews.plotting.plotly import PlotlyRenderer# Enable the Plotly renderer for HoloViewshv.extension('plotly')# Sample datadf = pd.DataFrame({'x': [1, 2, 3, 4, 5], 'y': [2, 4, 1, 5, 3]})# Create an hvplot figureplot = df.hvplot.scatter(x='x', y='y', title='Scatter Plot')# Convert the hvplot figure to a Plotly plotplotly_plot = PlotlyRenderer.get_plot(plot).state# Define the layout of the Dash appapp.layout = html.Div(children=[html.H1(children='Scatter Plot'),dcc.Graph(id='scatter-plot', figure=plotly_plot)])



Setup Info
    Tags
      Help me…