yeatmanlab / AFQ-Browser

Browser-based visualization tools for AFQ results
BSD 3-Clause "New" or "Revised" License
33 stars 15 forks source link

Add infrastructure for binder-ization #213

Closed arokem closed 6 years ago

arokem commented 6 years ago

This PR now has two notebooks. The first only shows how to load the data:

https://github.com/arokem/AFQ-Browser/blob/cf3d4ff2eebcc676e0085447639b2587cde44d2f/afqbrowser/site/client/index.ipynb

And points to the other one that has an example analysis:

https://github.com/arokem/AFQ-Browser/blob/cf3d4ff2eebcc676e0085447639b2587cde44d2f/afqbrowser/site/client/example-analysis.ipynb

This latter is written so that it is fairly robust to differences between data-sets. It doesn't point to any tract or statistic by name. And it does a visualization + analysis pipeline that should run on many data-sets, even if it doesn't produce anything particularly insightful. And it does the machine learning!

arokem commented 6 years ago

For example: Binder

arokem commented 6 years ago

Sorry - wrong link. Here: https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA/gh-pages

arokem commented 6 years ago

Even better, this one puts you straight in the index notebook:

https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA/gh-pages?filepath=index.ipynb

arokem commented 6 years ago

The question I have now is: is there any way to generate that URL from the domain name on which the site is running? Ideally, we would add a third button here: https://github.com/yeatmanlab/AFQ-Browser/blob/master/afqbrowser/site/client/index.html#L110, with the href somehow set from the domain name. Does anyone know how to do that?

richford commented 6 years ago

@arokem, I made a PR against this branch with some suggestions for how to do that. Todo:

arokem commented 6 years ago

Thanks! Looks great.

I proposed a change to the URL on your PR: it needs to launch the gh-pages branch.

And if we want to launch straight to the index notebook, it should have an additional query string after that.

arokem commented 6 years ago

Hmm. Something seems amiss. See example here: https://arokem.github.io/AFQ-Browser-TRACULA-binder-button/

The button is there, but the link doesn't get properly set.

arokem commented 6 years ago

Almost there. Need to set the right URL for binder to build properly.

richford commented 6 years ago

24487e6 is much better than my suggestion.

Do you have an updated demo site?

richford commented 6 years ago

24487e6 is much better than my suggestion.

Do you have an updated demo site?

arokem commented 6 years ago

This site:

https://arokem.github.io/AFQ-Browser-TRACULA-binderized2

links to binder, but the link is not quite correctly formed. Still needs a tiny bit more.

richford commented 6 years ago

Ahh, I see. It's sending us to: https://mybinder.org/v2/gh/arokem.github.io//AFQ-Browser-TRACULA-binderized2/gh-pages?filepath=index.ipynb

but it should be https://mybinder.org/v2/gh/arokem/AFQ-Browser-TRACULA-binderized2/gh-pages?filepath=index.ipynb

So perhaps, the replace line should just be

var user = uri.hostname().replace('.github.io', '');

i.e. no slash in the first argument to replace.

But wait, if there's no slash in uri.hostname() then where is the double slash in the first address above coming from? That's weird. We could avoid this whole issue entirely by using

var user = uri.hostname().split('.')[0];

instead.

@arokem, @akeshavan Is one method better than the other?

arokem commented 6 years ago

Yup. The split approach works. Here's an example site:

https://arokem.github.io/AFQ-Browser-TRACULA-binderized4