Skip to content

Instantly share code, notes, and snippets.

View MarcSkovMadsen's full-sized avatar

Marc Skov Madsen MarcSkovMadsen

View GitHub Profile
console.log("hiplot 1");
@MarcSkovMadsen
MarcSkovMadsen / panel_getting_started.ipynb
Last active March 4, 2024 04:58
Panel - Getting Started Notebook Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MarcSkovMadsen
MarcSkovMadsen / hvPlot_render.ipynb
Last active December 21, 2023 18:46
hvplot notebook with rendered output
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MarcSkovMadsen
MarcSkovMadsen / messages.py
Last active November 1, 2023 04:46
Panel with Tranquilizer REST API
import ast
import requests
url = 'http://localhost:5006/rest/post_data'
def post(value):
data = {'data': value}
response = requests.post(url, data = data)
if response.status_code==200:
print(ast.literal_eval(response.text))
@MarcSkovMadsen
MarcSkovMadsen / HvplotInteractive.ipynb
Created November 1, 2021 19:42
HvplotInteractive.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MarcSkovMadsen
MarcSkovMadsen / hvplot_interactive.py
Last active January 3, 2023 20:12
Example of using hvPlot .interactive with Panel
import pandas as pd
import hvplot.pandas
import panel as pn
pn.extension(sizing_mode="stretch_width")
PALETTE = [
"#ff6f69",
"#ffcc5c",
"#88d8b0",
@MarcSkovMadsen
MarcSkovMadsen / matplotlib_interactive.py
Last active December 14, 2022 09:07
Matplotlib interactive extension
import panel as pn
from panel.pane.plot import Matplotlib as _MatplotlibPane
import param
import numpy as np
from matplotlib.figure import Figure
from matplotlib import cm
from matplotlib.backends.backend_agg import FigureCanvasAgg # not needed for mpl >= 3.1
pn.extension()
@MarcSkovMadsen
MarcSkovMadsen / fastgridtemplate_walkthrough.py
Last active August 24, 2022 15:42
FastGridTemplate Walk Through
import holoviews as hv
import numpy as np
import panel as pn
pn.extension(sizing_mode="stretch_width")
ACCENT_COLOR = "#37718e" # "#DF3874"
XS = np.linspace(0, np.pi)
@MarcSkovMadsen
MarcSkovMadsen / app.py
Created May 29, 2022 05:03
Data App with Altair Selections
import altair as alt
import pandas as pd
import panel as pn
pn.extension("vega", sizing_mode="stretch_width")
data = pd.read_json(
"https://raw.githubusercontent.com/vega/vega/master/docs/data/penguins.json"
)
@MarcSkovMadsen
MarcSkovMadsen / holoviz_linked_brushing.py
Last active May 19, 2022 09:10
Linked brushing with HoloViz
# pip install panel==0.12.4 bokeh==2.4.0 holoviews==1.14.6 hvplot==0.7.3 shapely==1.7.1
# panel serve holoviz_linked_brushing.py --autoreload --show
import hvplot.pandas
import holoviews as hv
import panel as pn
from bokeh.sampledata.iris import flowers
pn.extension(sizing_mode="stretch_width")
hv.extension("bokeh")