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

Fix hydrogen plots e.g. plotly, altair #1212

Open
wants to merge 1 commit into
base: updated-latest-electron
Choose a base branch
from

Conversation

asiloisad
Copy link
Contributor

@asiloisad asiloisad commented Feb 11, 2025

The Content Security Policy block hydrogen-next interactive elements generated by e.g. plotly, altair. It's old issue inherited from old days of hydrogen nteract/hydrogen#1896 (comment).

image

Reproduce steps:

  1. Install hydrogen or hydrogen-next
  2. Install Python, IPython & kernel
  3. Create Python file
  4. Paste example code
    import altair as alt
    import numpy as np
    import pandas as pd
    
    x = np.arange(100)
    source = pd.DataFrame({
      'x': x,
      'f(x)': np.sin(x / 5)
    })
    
    alt.Chart(source).mark_line().encode(
        x='x',
        y='f(x)'
    )
  5. Start kernel & run all

Tested in dev build.

@savetheclocktower
Copy link
Contributor

Don't let me forget about this PR… but it feels like a bit of a scary change, so I'd like to do a little bit of research to make sure this doesn't open a Pandora's Box somehow.

@asiloisad
Copy link
Contributor Author

asiloisad commented Feb 12, 2025

I will be glad if this pr land and restore Vega plots atom/atom#14761. A scripts-src has been explained here

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

Successfully merging this pull request may close these issues.

2 participants