I am creating a Google colab with some data visualisations of a heatmaps over an image. I've been using the code similar to the one found in the plotly website.
It works fine with the link from the website, but when trying to use a Google Drive link, it does not work. I am using a link in this format: https://docs.google.com/uc?export=download&id=<file-id>
The image is shown fine when using it in a markdown field, but not through plotly.
Sample of the code:
fig = px.density_heatmap(df, x="x", y="y",
color_continuous_scale = [(0, "rgba(0, 255, 0, 0)"),
(0.5, "rgba(0, 255, 0, 0.5)"),
(1, "rgba(0, 255, 0, 1)")],
height=810, width=1440)
fig.add_layout_image(
dict(
source="https://docs.google.com/uc?export=download&id=1JEyyYCse6sWM3yMUwDG2l7XzaGxej-VZ",
xref="x",
yref="y",
x=0,
y=0,
sizex=1920,
sizey=1080,
sizing="stretch",
opacity=1,
layer="below")
)
fig.update_layout(template="plotly_white")
fig.show()
Is there a solution to this, or is it just a case of the library not accounting for the corner case?
EDIT: I was looking to use a Google Drive Link that is not publically available, was hoping I could use the Google Colab credentials. Found a possible answer for that here