Skip to content

Commit

Permalink
fix(binder): Update XArrayViewer to check for binder env
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkit committed Nov 21, 2024
1 parent c33fde6 commit b84e6d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pan3d/viewers/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import vtkmodules.vtkRenderingOpenGL2 # noqa

import json
import os
import traceback
from pathlib import Path

Expand Down Expand Up @@ -85,9 +86,11 @@ def __init__(self, server=None, local_rendering=None):
)
args, _ = self.server.cli.parse_known_args()
self.local_rendering = local_rendering
if args.wasm:
if os.environ.get("BINDER_REQUEST") is not None:
self.local_rendering = "vtkjs"
elif args.wasm:
self.local_rendering = "wasm"
if args.vtkjs:
elif args.vtkjs:
self.local_rendering = "vtkjs"

# Process CLI
Expand Down

0 comments on commit b84e6d7

Please sign in to comment.