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

Add polyfill for promise.allsettled #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
^\.Rproj\.user$
^\.travis\.yml$
^\.BBSoptions$
^\.envrc$
^\.nvmrc$
^.github$
^package\.json$
^package-lock\.json$
Expand Down
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nvm
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.14.2
132 changes: 54 additions & 78 deletions inst/htmlwidgets/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/htmlwidgets/dist/index.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions inst/htmlwidgets/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Vitessce } from 'vitessce';
import allSettled from 'promise.allsettled';
import 'vitessce/dist/es/production/static/css/index.css';
import './index.css';

if((new URLSearchParams(window.location.search)).get("viewer_pane") === "1") {
// This Vitessce instance is currently running in the Viewer pane of RStudio.
// The built-in browser does not support all modern JavaScript features used by Vitessce.
// Click the 'Show in new window' button to run in a standalone web browser if the polyfill does not work.
console.log("Detected running in the RStudio Viewer pane which does not implement Promise.allSettled. Using polyfill.");
allSettled.shim();
}

export function render_vitessce(el, config, width, height, theme) {
ReactDOM.render(
<Vitessce
Expand Down
Loading