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

Truely Embed JBrowse #2

Open
laceysanderson opened this issue May 9, 2018 · 4 comments
Open

Truely Embed JBrowse #2

laceysanderson opened this issue May 9, 2018 · 4 comments

Comments

@laceysanderson
Copy link
Member

With JBrowse release 1.14.1, it should now be possible to embed JBrowse in a Drupal page without an iFrame! This was my original design goal back when this module was created and thanks to git, the code is still there! 36e5015

Here is the original template: 36e5015#diff-536353ccb1e44f0c85ac43303aa53fdc
and the original module file: 36e5015#diff-75d77511f4513b21d1a231432afdd006

Ideally we would use the libraries api this time around and have a single source of the jbrowse code to make updates easier.

@laceysanderson
Copy link
Member Author

laceysanderson commented May 9, 2018

This is started in branch 7.x-3.x. Currently having troubles loading the "chunks" ;-)

My current approach is for JBrowse instances to be stored in sites/all/files. I need to find a way to set the base directory for the JBrowse package manager (webpack I think? ).

NOTE: I can't just change webpack.conf.js since it is only used when the chunks are first built, not when they're served to the browser. Unless I repackage JBrowse 👀

@laceysanderson
Copy link
Member Author

laceysanderson commented May 12, 2018

One way to fix this is to set the publicPath to [your drupal site]/sites/default/files which would be most extensible done via an environmental variable. However, environmental variable are set when the module is packed meaning we would have to rebuild JBrowse 😞

Perhaps we need a drush script/command that downloads JBrowse in the correct spot, sets the environmental variable and rebuilds using webpack? Unfortunately this would require installing webpack...

@laceysanderson
Copy link
Member Author

A quick fix is to change src=i.p+""+({}[t]||t)+".bundle.js" to src="https://my.drupalsite.com/"+i.p+""+({}[t]||t)+".bundle.js" in dist/main.bundle.js

This results in the following error: Must provide a 'baseUrl' in configuration
screen shot 2018-05-12 at 10 24 39 am

@laceysanderson
Copy link
Member Author

Revisiting this JBrowse2 on Drupal 9 / Tripal 4

I was prompted to play with this quickly by @scottcain who got this working. He created a node and added javascript in the body field. It was a quick implementation with hard-coded location/URLs just to make sure that the JBrowse js didn't clash with Drupal and it worked! He used this tutorial: https://jbrowse.org/jb2/docs/tutorials/embed_linear_genome_view/02_simple_site/.

And his final result rendered as:
Screen Shot 2022-03-30 at 3 23 00 PM

I tested this out myself and documented it in a Gist for later development into this module: https://gist.github.com/laceysanderson/c241b816cb5a254797b19e3abe7776eb

Screen Shot 2022-03-31 at 12 17 19 PM

@laceysanderson laceysanderson removed their assignment Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant