- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Add back the mime renderer JL extension #5096
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            72 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      5cb5754
              
                Default to notebook connected mode
              
              
                marthacryan e5e2994
              
                Add back JL extension for mimerenderer ability
              
              
                marthacryan 583dea9
              
                Use original code to maintain image load
              
              
                marthacryan bed4c45
              
                Move js into labextension directory
              
              
                marthacryan 1cd7c4f
              
                update gitignore
              
              
                marthacryan aa13a97
              
                remove print statement
              
              
                marthacryan 23dad18
              
                Update npm build to include jupyter lab extension build
              
              
                marthacryan 74724a5
              
                Update paths and build for CI
              
              
                marthacryan b8375f3
              
                Replace pip with uv in plotly.js dev build CI
              
              
                marthacryan df3970f
              
                Update path to js in commands
              
              
                marthacryan 4353bba
              
                Add labextension to additional package data
              
              
                marthacryan ef5add1
              
                Add labextension to additional package data
              
              
                marthacryan 14b5a0d
              
                Fix CI
              
              
                marthacryan af46e25
              
                Change pin so that jupyterlab is >= 4
              
              
                marthacryan 5ced43e
              
                Fix filepath in docs ci
              
              
                marthacryan 847b87c
              
                Make extension compatible with jupyterlab 3 and 4
              
              
                marthacryan 00a794b
              
                Merge branch 'main' of github.com:plotly/plotly.py into notebook-conn…
              
              
                marthacryan 61df8d7
              
                Update test for slightly different value
              
              
                marthacryan 8f32ac5
              
                Update test for slightly different value
              
              
                marthacryan 0ee60e7
              
                Pin shapely version in test requirements
              
              
                marthacryan 4a2f699
              
                Make default renderer in jupyterlab/notebook plotly_mimetype
              
              
                marthacryan 18f70ac
              
                AUpdate file structure and make package include jupyterlab files
              
              
                marthacryan ca54548
              
                Update js access to use new filepaths
              
              
                marthacryan b827f02
              
                Update path of js output
              
              
                marthacryan c67cada
              
                Add metadata about jupyterlab extension
              
              
                marthacryan e3afcf7
              
                Add version into package
              
              
                marthacryan 62721e9
              
                Add js build to dev build
              
              
                marthacryan 3a6f3ee
              
                Revert changes to requirements
              
              
                marthacryan 0859aef
              
                Merge branch 'main' of github.com:plotly/plotly.py into notebook-conn…
              
              
                marthacryan 1260612
              
                Update node root path in commands.py
              
              
                marthacryan 1db6c81
              
                Add js build to CI
              
              
                marthacryan 4bcbd30
              
                Black
              
              
                marthacryan b8cc069
              
                Update build files included in output
              
              
                marthacryan cbfddad
              
                Add CI to check for changes to js build files
              
              
                marthacryan 5254258
              
                Add build step to check for js build changes in CI
              
              
                marthacryan f51b3dc
              
                Add build file
              
              
                marthacryan b4cd36c
              
                Make js uncommitted files check its own job
              
              
                marthacryan 5d0aa9c
              
                Make js uncommitted files check its own job
              
              
                marthacryan 56433a7
              
                Add jupyter to env before running npm run build
              
              
                marthacryan a7cf8e1
              
                Commit built widget js
              
              
                marthacryan 54cc73f
              
                Use tmp to compare the build files before and after build
              
              
                marthacryan afc511a
              
                Remove extra call to check js build job
              
              
                marthacryan 87c5260
              
                Update diff and only run CI when there are changes in the js directory
              
              
                marthacryan f167e6f
              
                Attempt running CI
              
              
                marthacryan daac60e
              
                Try different approach to only running on changes to js/
              
              
                marthacryan 024325e
              
                Add debugging statements to the diff checker
              
              
                marthacryan 0df9265
              
                Add special handling for package.json
              
              
                marthacryan e26d9da
              
                Update ignore pattern
              
              
                marthacryan ab922bf
              
                Add debugging print statements
              
              
                marthacryan a56c55a
              
                update diff method
              
              
                marthacryan f7df6a8
              
                update diff method
              
              
                marthacryan ce27281
              
                Add artifact upload when ci finds differences between build and src
              
              
                marthacryan f918835
              
                Dummy commit to check CI
              
              
                marthacryan cd26c8f
              
                Use github actions instead of circleci for checking js build files
              
              
                marthacryan 585cf4a
              
                fix syntax error
              
              
                marthacryan 4fdca55
              
                Dummy js commit
              
              
                marthacryan d7157f6
              
                Fix artifact upload
              
              
                marthacryan d10fd16
              
                Update labextension source
              
              
                marthacryan ce161d9
              
                Update CONTRIBUTING.md
              
              
                marthacryan 48c510c
              
                Add back npm build to full release build
              
              
                marthacryan 2dbb09c
              
                Remove extraneous or true
              
              
                marthacryan 9e097ec
              
                Update CONTRIBUTING.md
              
              
                marthacryan f3a4278
              
                Update logic for deciding whether js has changed
              
              
                marthacryan 5baedf3
              
                Update name of CI step
              
              
                marthacryan 2e9a296
              
                Update CONTRIBUTING.md
              
              
                emilykl 15ea2d7
              
                Update .github/workflows/check-js-build.yml
              
              
                marthacryan a4b0c42
              
                Merge pull request #5144 from plotly/js-contributing-md-updates
              
              
                marthacryan 35506f3
              
                remove check for changes in js folder to avoid missing CI failures
              
              
                marthacryan ce867a1
              
                Update node version in github actions
              
              
                marthacryan 8f3227e
              
                remove extraneous persist_credentials flag
              
              
                marthacryan 3ac4224
              
                Update version to match plotly.py version
              
              
                marthacryan 60735fe
              
                Update build files
              
              
                marthacryan File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| on: push | ||
|  | ||
| jobs: | ||
| check-js-build: | ||
| name: Check JS build artifacts | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
|  | ||
| - name: Install Node | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: '22' | ||
|  | ||
| - name: Copy current files to a temporary directory | ||
| run: | | ||
| cp -R plotly/labextension/ plotly/labextension-tmp/ | ||
|  | ||
| - name: Install dependencies and build | ||
| run: | | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| uv venv | ||
| source .venv/bin/activate | ||
| uv pip install jupyter | ||
| cd js | ||
| npm ci | ||
| npm run build | ||
| - name: Check JupyterLab build artifacts | ||
| run: | | ||
| # 1. Hash contents of all static files, sort by content hash | ||
| find plotly/labextension/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > new_hashes.txt | ||
| find plotly/labextension-tmp/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > old_hashes.txt | ||
|  | ||
| # 2. Compare the sorted content hashes | ||
| diff old_hashes.txt new_hashes.txt > content_diff.txt | ||
|  | ||
| # Remove the "load" line from both package.json files before comparing | ||
| grep -v '"load": "static/' plotly/labextension/package.json > pkg1.json | ||
| grep -v '"load": "static/' plotly/labextension-tmp/package.json > pkg2.json | ||
|  | ||
| # Compare stripped versions | ||
| diff pkg1.json pkg2.json > package_json_diff.txt | ||
|  | ||
| # 5. Final check | ||
| if [ -s content_diff.txt ] || [ -s package_json_diff.txt ]; then | ||
| echo "❌ Build artifacts differ:" | ||
| echo "--- Unexpected diffs ---" | ||
| cat content_diff.txt | ||
| echo "--- Unexpected package.json diffs ---" | ||
| cat package_json_diff.txt | ||
| echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run." | ||
| exit 1 | ||
| else | ||
| echo "✅ Build artifacts match expected output (ignoring known 'load' hash in package.json)." | ||
| fi | ||
|  | ||
| - name: Store the build artifacts from plotly/labextension | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: labextension | ||
| path: plotly/labextension | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "schemaVersion": 1, | ||
| "name": "jupyterlab-plotly", | ||
| "version": "6.0.1", | ||
| "jupyterlab": { | ||
| "mimeExtension": "lib/mimeExtension.js" | ||
| } | ||
| } | ||
|  | 
Large diffs are not rendered by default.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.