Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Is there a way to create Web apps using the hvPlot?
Hi,
You in can include hvplot in Dash webapp for example:
YOu need to install dash/hvplot in the code env :
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import hvplot.pandas
import holoviews as hv
from holoviews.plotting.plotly import PlotlyRenderer
# Enable the Plotly renderer for HoloViews
hv.extension('plotly')
# Sample data
df = pd.DataFrame({'x': [1, 2, 3, 4, 5], 'y': [2, 4, 1, 5, 3]})
# Create an hvplot figure
plot = df.hvplot.scatter(x='x', y='y', title='Scatter Plot')
# Convert the hvplot figure to a Plotly plot
plotly_plot = PlotlyRenderer.get_plot(plot).state
# Define the layout of the Dash app
app.layout = html.Div(children=[
html.H1(children='Scatter Plot'),
dcc.Graph(id='scatter-plot', figure=plotly_plot)
])
Hi,
You in can include hvplot in Dash webapp for example:
YOu need to install dash/hvplot in the code env :
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import hvplot.pandas
import holoviews as hv
from holoviews.plotting.plotly import PlotlyRenderer
# Enable the Plotly renderer for HoloViews
hv.extension('plotly')
# Sample data
df = pd.DataFrame({'x': [1, 2, 3, 4, 5], 'y': [2, 4, 1, 5, 3]})
# Create an hvplot figure
plot = df.hvplot.scatter(x='x', y='y', title='Scatter Plot')
# Convert the hvplot figure to a Plotly plot
plotly_plot = PlotlyRenderer.get_plot(plot).state
# Define the layout of the Dash app
app.layout = html.Div(children=[
html.H1(children='Scatter Plot'),
dcc.Graph(id='scatter-plot', figure=plotly_plot)
])