Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will Panel render plots made with cufflinks? #266

Open
kez4twez opened this issue Jul 9, 2021 · 0 comments
Open

Will Panel render plots made with cufflinks? #266

kez4twez opened this issue Jul 9, 2021 · 0 comments

Comments

@kez4twez
Copy link

kez4twez commented Jul 9, 2021

I am trying to render charts created by cufflinks in a Panel dashboard but nothing is working, they just won't render.

If I switch the plotting to hvplot it works so I think it's something to do with cufflinks and Panel not being compatible.

# Imports
import panel as pn
pn.extension('plotly')
import plotly.express as px
import requests
import numpy as np
import pandas as pd
import hvplot.pandas
from pathlib import Path
from dotenv import load_dotenv
# Cufflinks
import cufflinks as cf
cf.go_offline()
cf.set_config_file(theme='solar',sharing='public',offline=True) #List of Cufflinks Themes :  ['ggplot', 'pearl', 'solar', 'space', 'white', 'polar', 'henanigans']

eth_btc_twh_chart = eth_btc_twh.iplot(title="BTC/ETH/ETH 2.0 Energy usage in TWh", y=["eth_estimated", "btc_estimated", "eth_2.0"], yTitle="Terrawatt Hours")
eth_btc_twh_usd_chart = eth_btc_twh.iplot(title="BTC/ETH/ETH 2.0 Energy Cost", y=["btc_estimated", "eth_estimated", "eth_2.0"], yTitle="USD")
# Create the title
title = "Crypto Mining Energy Usage"

# Define the welcome text
welcome = "This dashboard presents a visual analysis of the ongoing energy usage of Bitcoin and Ethereum mining compared to eachother, Ethereum 2.0 and Traditional finance. The aim is to inform the user and convey that the Proof of Stake method is much more beneficial to the environment than the traditional Proof of Work method that Bitcoin and Ethereum in its current state use."

# TWh panes and column
twh_column = pn.Column(welcome, eth_btc_twh_chart, eth_btc_twh_usd_chart)

# Dashboard
dashboard = pn.Tabs(
    ("Welcome", twh_column)
)


twh_column

Screen Shot 2021-07-09 at 3 47 18 pm

The most pertinent sections of my code are these^

I know you won't be able to recreate because you need the dataframes, but does all of this look right to you?

If anyone knows whether cufflinks is compatible with Panel or not please let me know. If not does anyone have any other suggestions for making a dashboard that is compatible with cufflinks?

My aim is to deploy through Heroku or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant