PeerJ / paper-now

Create, edit and display a journal article, entirely in GitHub

Home Page:https://peerj.github.io/paper-now/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

d3.js animations as data

chorasimilarity opened this issue · comments

Is it possible to have data in the form of d3.js (say) animations? I want to use paper-now for an article about artificial chemistry which HAS to contain data like in the demos from here http://chorasimilarity.github.io/chemlambda-gui/dynamic/demos.html

It should be possible, yes, as HTML can be included in any of the sections.

There are a few options:

  • Make each visualisation a standalone component, and include them using iframes into the body of an article section or a figure.
  • If the visualisation is a figure, you might still want to supply a figure image, for situations where the live visualisation isn't able to be displayed (e.g. when printed).
  • Instead of using standalone visualisations, you could edit the article.html layout and add the JavaScript files that are needed (e.g. D3). Perhaps it would be better if we found a way to specify dependencies through configuration, though, in the index.md file?

Of course, if you end up submitting the paper to a journal, they might not support HTML + JavaScript in the final publication…

Another alternative is to host all the live visualisations permanently somewhere else, and just include static images in the journal article, along with links to the visualisations.

I prefer the first option (standalone visualisations, with iframes, or added in the article.html, perhaps something to help the user with that?) because is hosted on my github.io pages.
This would be a huge plus over the standard article format.
There are multiple reasons:

  • you can merge the article with animations, databases, any programs which one can execute in the browser.
  • you export an uniform PeerJ format which can be used by anybody, so later it is easier to make semantical queries in all the articles in this format, whereever they are.

Should be some option for comments, managed by the author, a disguise for peer-review.

Can you clarify if the visualisations would be figures (e.g. "Figure 1") or as part of the article text?

If they're figures, then an embed URL similar to the current image URL would work (possibly with width and height, as well).

If they're in the text, then it's easy enough for the author to add this:

<iframe height="400" width="600" src="https://example.com/visualisations/1"></iframe>

Figures are good! The point for using D3, for example, is to show an
animation, something which is interesting to see how it moves, vs what it
becomes eventually.
So embed should work, I shall try, thank you.

This is possible now - see figure 2 of the example article: https://peerj.github.io/paper-now/#figure-2 and the source file: https://raw.githubusercontent.com/PeerJ/paper-now/gh-pages/_figures/figure-2.md

Note that as GitHub Pages sites are (or at least can be) served over HTTPS, the visualisation (and all its requirements) must also be loaded over HTTPS.