diff --git a/website/docusaurus.config.json b/website/docusaurus.config.json index 244e3723a0..9287ef54a4 100644 --- a/website/docusaurus.config.json +++ b/website/docusaurus.config.json @@ -37,6 +37,11 @@ "label": "Download", "position": "left" }, + { + "to": "plugin_store", + "label": "Plugins", + "position": "left" + }, { "to": "features", "label": "Features", diff --git a/website/package.json b/website/package.json index 952a586a91..61267fdcb7 100644 --- a/website/package.json +++ b/website/package.json @@ -5,9 +5,10 @@ "homepage": ".", "scripts": { "prestart": "npm run make combined.md", - "start": "docusaurus start", - "prebuild": "npm run make combined.md", + "start": "npm run fetchPlugins && docusaurus start", + "prebuild": "npm run make combined.md && npm run fetchPlugins", "build": "docusaurus build", + "fetchPlugins": "rimraf plugins.json && wget https://s3.amazonaws.com/jbrowse.org/plugin-store/plugins.json", "swizzle": "docusaurus swizzle", "predeploy": "npm run build && npm run make", "deploy": "aws s3 sync --delete build s3://jbrowse.org/jb2/ && aws s3 cp docs/jbrowse2.pdf s3://jbrowse.org/jb2/", @@ -18,9 +19,11 @@ "@docusaurus/core": "^2.0.0-alpha.72", "@docusaurus/preset-classic": "^2.0.0-alpha.72", "@material-ui/core": "^4.9.13", + "@material-ui/icons": "^4.11.2", "acorn": "^8.1.1", "acorn-jsx": "^5.3.1", "clsx": "^1.1.1", + "copy-to-clipboard": "^3.3.1", "react": "^16.8.4", "react-dom": "^16.8.4" }, diff --git a/website/plugins.json b/website/plugins.json new file mode 100644 index 0000000000..f116a861f1 --- /dev/null +++ b/website/plugins.json @@ -0,0 +1,67 @@ +{ + "plugins": [ + { + "name": "MsaView", + "authors": ["Colin Diesh"], + "description": "multiple sequence alignment browser plugin for JBrowse 2", + "location": "https://github.com/GMOD/jbrowse-plugin-msaview", + "url": "https://unpkg.com/jbrowse-plugin-msaview/dist/jbrowse-plugin-msaview.umd.production.min.js", + "license": "Apache License 2.0", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/msaview-screenshot-fs8.png" + }, + { + "name": "GDC", + "authors": ["Garrett Stevens", "Colin Diesh", "Rob Buels"], + "description": "JBrowse 2 plugin for integrating with GDC resources", + "location": "https://github.com/GMOD/jbrowse-plugin-gdc", + "url": "https://unpkg.com/jbrowse-plugin-gdc/dist/jbrowse-plugin-gdc.umd.production.min.js", + "license": "NONE", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/gdc-screenshot-fs8.png" + }, + { + "name": "Quantseq", + "authors": ["Elliot Hershberg"], + "description": "External JB2 plugin implementing a QuantitativeSequence track for displaying base-resolution models.", + "location": "https://github.com/GMOD/jbrowse-plugin-quantseq", + "url": "https://unpkg.com/jbrowse-plugin-quantseq/dist/jbrowse-plugin-quantseq.umd.production.min.js", + "license": "Apache License 2.0", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/quantseq-screenshot-fs8.png" + }, + { + "name": "GWAS", + "authors": ["Colin Diesh"], + "description": "Plugin for displaying GWAS results such as manhattan plot renderings", + "location": "https://github.com/cmdcolin/jbrowse-plugin-gwas", + "url": "https://unpkg.com/jbrowse-plugin-gwas/dist/jbrowse-plugin-gwas.umd.production.min.js", + "license": "NONE", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/gwas-screenshot-fs8.png" + }, + { + "name": "UCSC", + "authors": ["Colin Diesh"], + "description": "A JBrowse 2 plugin for accessing the UCSC API", + "location": "https://github.com/cmdcolin/jbrowse-plugin-ucsc-api", + "url": "https://unpkg.com/jbrowse-plugin-ucsc/dist/jbrowse-plugin-ucsc.umd.production.min.js", + "license": "NONE", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/ucsc-screenshot-fs8.png" + }, + { + "name": "Biothings", + "authors": ["Colin Diesh"], + "description": "Adapts to APIs like mygene.info to get super rich gene annotations", + "location": "https://github.com/cmdcolin/jbrowse-plugin-biothings-api", + "url": "https://unpkg.com/jbrowse-plugin-biothings/dist/jbrowse-plugin-biothings.umd.production.min.js", + "license": "NONE", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/biothings-screenshot-fs8.png" + }, + { + "name": "Ideogram", + "authors": ["Colin Diesh"], + "description": "JBrowse 2 plugin for rendering ideograms", + "location": "https://github.com/cmdcolin/jbrowse-plugin-ideogram", + "url": "https://unpkg.com/jbrowse-plugin-ideogram/dist/jbrowse-plugin-ideogram.umd.production.min.js", + "license": "Apache License 2.0", + "image": "https://raw.githubusercontent.com/GMOD/jbrowse-plugin-list/main/img/ideogram-screenshot-fs8.png" + } + ] +} diff --git a/website/src/pages/plugin_store.js b/website/src/pages/plugin_store.js new file mode 100644 index 0000000000..b67723174d --- /dev/null +++ b/website/src/pages/plugin_store.js @@ -0,0 +1,360 @@ +/* eslint-disable react/prop-types */ +import React, { useState } from 'react' +import copy from 'copy-to-clipboard' + +// eslint-disable-next-line import/no-unresolved +import Layout from '@theme/Layout' +// eslint-disable-next-line import/no-unresolved +import useDocusaurusContext from '@docusaurus/useDocusaurusContext' + +import { makeStyles } from '@material-ui/core/styles' +import Link from '@material-ui/core/Link' +import Typography from '@material-ui/core/Typography' +import Card from '@material-ui/core/Card' +import CardActions from '@material-ui/core/CardActions' +import CardContent from '@material-ui/core/CardContent' +import CardMedia from '@material-ui/core/CardMedia' +import Button from '@material-ui/core/Button' +import Dialog from '@material-ui/core/Dialog' +import DialogTitle from '@material-ui/core/DialogTitle' + +import PersonIcon from '@material-ui/icons/Person' +import AccountBalanceIcon from '@material-ui/icons/AccountBalance' +import GitHubIcon from '@material-ui/icons/GitHub' +import AssignmentIcon from '@material-ui/icons/Assignment' +import AssignmentTurnedInIcon from '@material-ui/icons/AssignmentTurnedIn' +import HelpIcon from '@material-ui/icons/Help' +import CodeIcon from '@material-ui/icons/Code' +import IconButton from '@material-ui/core/IconButton' +import CloseIcon from '@material-ui/icons/Close' + +import { DialogContent } from '@material-ui/core' +import { plugins } from '../../plugins.json' + +const useStyles = makeStyles(theme => ({ + button: { + textTransform: 'none', + }, + section: { + marginTop: '24px', + marginBottom: '32px', + }, + + container: { + display: 'flex', + [theme.breakpoints.down('md')]: { + flexDirection: 'column', + }, + justifyContent: 'center', + alignItems: 'center', + }, + + body: { + [theme.breakpoints.down('md')]: { + margin: '0.5em', + }, + margin: '5em', + }, + + topLinks: { + margin: '0 auto', + display: 'flex', + alignItems: 'space-between', + justifyContent: 'center', + }, + + card: { + margin: '1em auto', + width: 800, + }, + + cardMedia: { + height: 200, + width: 800, + }, + + '@media (max-width: 800px)': { + cardMedia: { + display: 'none', + }, + + card: { + width: 'auto', + }, + }, + + icon: { + marginLeft: '0.5em', + marginRight: '0.5em', + }, + + topButton: { + margin: '1em', + }, + + closeButton: { + color: '#fff', + position: 'absolute', + top: 5, + right: 0, + }, + + dataField: { + display: 'flex', + alignItems: 'center', + margin: '0.4em 0em', + }, + + dialogTitleBox: { + backgroundColor: theme.palette.primary.main, + color: '#fff', + textAlign: 'center', + }, +})) + +function TopDocumentation() { + const classes = useStyles() + const [aboutSectionOpen, setAboutSectionOpen] = useState(false) + const [developerSectionOpen, setDeveloperSectionOpen] = useState(false) + + return ( + <> +
+ + +
+ setAboutSectionOpen(false)} + > + + About + setAboutSectionOpen(false)} + > + + + + + + Welcome to the plugin store! +
+
+ This store contains the current list of white-listed JBrowse 2 + plugins that are available for use. Plugins can add functionality + that doesn't exist in the core application, such as a new data + adapter, or a custom track type. +
+
+ The configuration that is specified for each plugin can be added to + the plugins array as a top-level entry. For example: +
+
+
+
+            {configExample}
+          
+ + These plugins can also be added directly from inside the application + via the File menu. + +
+
+ setDeveloperSectionOpen(false)} + > + + Developer info + setDeveloperSectionOpen(false)} + > + + + + + + We welcome developers who want to create a new JBrowse 2 plugin. The + primary resource for getting started creating a new plugin is the{' '} + + plugin template + + . +
+
+ If you build a plugin that you would like to be featured in this + store, please follow the instructions found{' '} + + here + + . +
+
+
+ + ) +} + +function PluginCard(props) { + const classes = useStyles() + const { plugin } = props + + const [showConfig, setShowConfig] = useState(false) + + return ( + + {plugin.image ? ( + + ) : null} + +
+ {plugin.name} +
+
+ + {plugin.authors.join(', ')} + + + {plugin.license === 'NONE' ? 'No license' : plugin.license} + + + + {plugin.location} + +
+ Description: + {plugin.description} +
+ + + + {showConfig ? : null} +
+ ) +} + +function ConfigBlock(props) { + const { plugin } = props + const [clickedCopy, setClickedCopy] = useState(false) + + const configString = JSON.stringify( + { + name: plugin.name, + url: plugin.url, + }, + null, + 4, + ) + + return ( + +
+        {configString}
+      
+ +
+ ) +} + +function PluginStore() { + const context = useDocusaurusContext() + const { siteConfig = {} } = context + const classes = useStyles() + + return ( + +
+
+

JBrowse 2 Plugin Store

+
+ +
+ {plugins.map(plugin => ( + + ))} +
+
+
+ ) +} + +const configExample = `{ + "configuration": { + /* global configs here */ + }, + "assemblies": [ + /* list of assembly configurations */ + ], + "tracks": [ + /* array of tracks being loaded */ + ], + "defaultSession": { + /* optional default session */ + }, + "plugins": [ + { + "name": "Msaview", + "url": "https://unpkg.com/jbrowse-plugin-msaview/dist/jbrowse-plugin-msaview.umd.production.min.js" + } + ] +}` + +export default PluginStore diff --git a/website/yarn.lock b/website/yarn.lock index 59dc9be2b5..0c12bf28a3 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2425,6 +2425,13 @@ react-is "^16.8.0" react-transition-group "^4.4.0" +"@material-ui/icons@^4.11.2": + version "4.11.2" + resolved "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz#b3a7353266519cd743b6461ae9fdfcb1b25eb4c5" + integrity sha512-fQNsKX2TxBmqIGJCSi3tGTO/gZ+eJgWmMJkgDiOfyNaunNaxcklJQFaFogYcFl0qFuaEz1qaXYXboa/bUXVSOQ== + dependencies: + "@babel/runtime" "^7.4.4" + "@material-ui/styles@^4.10.0": version "4.10.0" resolved "https://registry.yarnpkg.com/@material-ui/styles/-/styles-4.10.0.tgz#2406dc23aa358217aa8cc772e6237bd7f0544071" @@ -4263,6 +4270,13 @@ copy-text-to-clipboard@^3.0.0: resolved "https://registry.yarnpkg.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz#8cbf8f90e0a47f12e4a24743736265d157bce69c" integrity sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q== +copy-to-clipboard@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae" + integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw== + dependencies: + toggle-selection "^1.0.6" + copy-webpack-plugin@^6.4.1: version "6.4.1" resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-6.4.1.tgz#138cd9b436dbca0a6d071720d5414848992ec47e" @@ -10564,6 +10578,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +toggle-selection@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" + integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI= + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"