Skip to content

Commit

Permalink
alignment with modular master
Browse files Browse the repository at this point in the history
This update changes the project structure towards easier updates. Particularly, it integrates components and api.js in line with progenetix-web, and moves most site specific code & configs to `site-specific`. Now, besides CSS ... the content specific for a project should be in `site-specific` and in `pages`.

These changes are probably incomplete & can use refinements so more re-shuffling to be expected.
  • Loading branch information
mbaudis committed Dec 2, 2024
1 parent f805c7e commit 887dbac
Show file tree
Hide file tree
Showing 48 changed files with 2,424 additions and 1,951 deletions.
10 changes: 5 additions & 5 deletions docs/common/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ The standard format for (plot-)images generated on Progenetix is Scalable Vector

On most pages where plots are being displayed there is a download option for the images - (please alert us where those are missing). Browsers also have the option to export SVGs themselves e.g. as PDF.

## The `byconaut` plotting library
## `bycon`'s' plotting library

Functionality of the Progenetix and cancercellline.org plotting API is provided
by the [`byconaut`](https://byconaut.progenetix.org/) software project. It supports:
by the [`bycon`](https://bycon.progenetix.org/) software project. It supports:

* render plots of sample-specific and aggregate CNV data, such as histograms clustered
CNV sample strips
* read and write e.g. [Progentix `.pgxseg` segment files](/doc/fileformats.html)
* read and write e.g. [Progenetix `.pgxseg` segment files](/doc/fileformats.html)

!!! alert "Plot Parameters and Documentation"

Please visit the documentation of the `byconaut` software repository for
documentation about the use of the plotting API, e.g. how to modify
plots using specific parameters (sizes, color, labels...):

* [`byconaut` plot documentation](https://byconaut.progenetix.org/plotting/) with all
* [`bycon` plot documentation](https://bycon.progenetix.org/plotting/) with all
plot parameters

## Plot Examples

Below are just some plot examples; for detailed use please refer to the
[documentation](https://byconaut.progenetix.org/plotting/).
[documentation](https://bycon.progenetix.org/plotting/).

Examples link to or are embedded from **{{api_site_label}}**.

Expand Down
3 changes: 1 addition & 2 deletions src/components/AncestryData.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export function AncestryData({ individual }) {
return (
<>
{processedData && processedData.length > 0 && (
// <div ref={containerRef} style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", width: "100%", marginBottom: "0px" }}>
<div ref={containerRef} style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", width: "100%", marginBottom: "0px", height: "200px" }}>
<div ref={containerRef} style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", width: "100%", marginBottom: "0px" }}>
<VictoryPie
data={processedData}
x="label"
Expand Down
33 changes: 33 additions & 0 deletions src/components/BeaconPlusNav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react"
import Link from "next/link"
import { SITE_DEFAULTS } from "../hooks/api"

export default function BeaconPlusNav() {
return (
<header className="section Nav__header">
<nav
className="BeaconPlus__container Nav__wrapper"
role="navigation"
aria-label="main navigation"
>
<Link href="/">
<a className="Nav__logo">
Beacon<sup className="Nav__plus">+</sup>
</a>
</Link>

<div className="Nav__links">
{/*
<ActiveLink label="Aggregator" href="/beaconAggregator/" />
*/}
<a href={SITE_DEFAULTS.MASTERROOTLINK} className="navbar-item">
Progenetix
</a>
<a href={SITE_DEFAULTS.MASTERDOCLINK} className="navbar-item">
Help
</a>
</div>
</nav>
</header>
)
}
50 changes: 0 additions & 50 deletions src/components/DownloadButton.js

This file was deleted.

59 changes: 59 additions & 0 deletions src/components/EntityLayout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react"
import { ErrorBoundary } from "react-error-boundary"
import Head from "next/head"
import BeaconPlusNav from "./BeaconPlusNav"
import {ErrorFallback} from "./MenuHelpers"
import { SITE_DEFAULTS, THISYEAR } from "../hooks/api"

export function EntityLayout({ title, headline, children }) {
return (
<>
<BeaconPlusNav />
<div className="section">
<div className="BeaconPlus__container">
<Head>
<title>{title || ""}</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<div className="Layout__lead">
{headline && <h1 className="title is-4">{headline}</h1>}
<ErrorBoundary
FallbackComponent={ErrorFallback}
onReset={() => {
// reset the state of your app so the error doesn't happen again
}}
>
{children}
</ErrorBoundary>
</div>
</div>
</div>
<footer className="footer">
<div className="content container has-text-centered">
© 2000 - {THISYEAR} Progenetix Cancer Genomics Information Resource by
the{" "}
<a href={SITE_DEFAULTS.ORGSITELINK}>
Computational Oncogenomics Group
</a>{" "}
at the{" "}
<a href="https://www.mls.uzh.ch/en/research/baudis/">
University of Zurich
</a>{" "}
and the{" "}
<a href="http://sib.swiss/baudis-michael/">
Swiss Institute of Bioinformatics{" "}
<span className="span-red">SIB</span>
</a>{" "}
is licensed under CC BY 4.0
<a rel="license" href="https://creativecommons.org/licenses/by/4.0">
<img className="Layout__cc__icons" src="/img/cc-cc.svg" />
<img className="Layout__cc__icons" src="/img/cc-by.svg" />
</a>
<br />
No responsibility is taken for the correctness of the data presented
nor the results achieved with the Progenetix tools.
</div>
</footer>
</>
)
}
4 changes: 2 additions & 2 deletions src/components/Infodot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from "prop-types"
import Tippy from "@tippyjs/react"
import { markdownToReact } from "../utils/md"
import { MarkdownParser } from "./MarkdownParser"
import { FaInfoCircle, FaLink } from "react-icons/fa"
import React from "react"

Expand All @@ -9,7 +9,7 @@ Infodot.propTypes = {
}
export function Infodot({ infoText }) {
return (
<Tippy theme="light-border" content={markdownToReact(infoText)}>
<Tippy theme="light-border" content={MarkdownParser(infoText)}>
<span className="icon__wrapper">
<FaInfoCircle className="ml-2 icon is-small has-text-grey-light" />
</span>
Expand Down
121 changes: 87 additions & 34 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function Layout({ title, headline, children }) {
<title>{title || ""}</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<div className="Layout__header__celllines">
<div className="Layout__header">
{!sideOpen ? (
<span
className="Layout__burger icon"
Expand Down Expand Up @@ -52,9 +52,9 @@ export function Layout({ title, headline, children }) {
</main>
<footer className="footer">
<div className="content container has-text-centered">
© 2023 - {THISYEAR} <i>cancercelllines.org</i> Information Resource by
© 2000 - {THISYEAR} Progenetix Cancer Genomics Information Resource by
the{" "}
<a href="https://info.baudisgroup.org">
<a href={SITE_DEFAULTS.ORGSITELINK}>
Computational Oncogenomics Group
</a>{" "}
at the{" "}
Expand Down Expand Up @@ -86,70 +86,123 @@ function Side({ onClick }) {
<a href="/">
<img
className="Layout__side-logo"
src="/img/cancercelllines-icon-400x300.png"
alt="cancer cell lines by Progenetix"
src="/img/progenetix-logo-black.png"
alt="progenetix"
/>
</a>
<ul className="Layout__side__items">
<MenuInternalLinkItem
href="/"
label="Cancer Cell Lines"
href="/subsets/NCIT-subsets"
label="CNV Profiles by Cancer Type"
/>
<MenuInternalLinkItem
href="/subsets/cellosaurus-subsets"
label="Cell Line Listing"
href="/subsets/NCIT-subsets"
label="NCIT Neoplasia Codes"
isSub="isSub"
/>
<MenuInternalLinkItem
href="/search"
label="Search Cell Lines"
href="/subsets/icdom-subsets"
label="ICD-O Morphologies"
isSub="isSub"
/>
<MenuInternalLinkItem
href="/subsets/NCIT-subsets"
label="CNV Profiles by Cancer Type"
href="/subsets/icdot-subsets"
label="ICD-O Organ Sites"
isSub="isSub"
/>
<MenuInternalLinkItem
href="/subsets/NCIT-subsets"
label="NCIT Codes"
href="/subsets/NCITclinical-subsets"
label="TNM & Grade"
isSub="isSub"
/>
<MenuInternalLinkItem href="/search/" label="Search Samples" />
<MenuInternalLinkItem
href="/subsets/icdom-subsets"
label="ICD-O 3 Morphologies"
href="/progenetix-cohorts/arraymap"
label="Data Cohorts"
/>
<MenuInternalLinkItem
href="/progenetix-cohorts/arraymap"
label="arrayMap"
isSub="isSub"
/>
<MenuInternalLinkItem href={SITE_DEFAULTS.PROJECTDOCLINK} label="Documentation" />
{/*
<MenuInternalLinkItem
href={SITE_DEFAULTS.NEWSLINK}
label="News"
href="/progenetix-cohorts/TCGA"
label="TCGA Cancer Samples"
isSub="isSub"
/>
*/}
<MenuInternalLinkItem href={SITE_DEFAULTS.MASTERROOTLINK} label="External ..." />
<MenuInternalLinkItem
href={SITE_DEFAULTS.MASTERROOTLINK}
label="Progenetix Data"
href="/subsets/cbioportal-subsets"
label="cBioPortal Studies"
isSub="isSub"
/>
<MenuInternalLinkItem
href={`${SITE_DEFAULTS.MASTERDOCLINK}`}
label="Progenetix Docs"
href="http://cancercelllines.org"
label={
<>
Cancer Cell Lines<sup style={{ color: "red" }}>o</sup>
</>
}
/>
<MenuInternalLinkItem href="/publications" label="Publication DB" />
<MenuInternalLinkItem
href="/publications"
label="Genome Profiling"
isSub="isSub"
/>
{/*
<MenuInternalLinkItem
href={`${SITE_DEFAULTS.MASTERROOTLINK}/publications`}
label="Publication DB"
href="/publicationsProgenetixRef"
label="Progenetix Use"
isSub="isSub"
/>
*/}
<MenuInternalLinkItem
href="https://info.baudisgroup.org/"
label="Baudisgroup @ UZH"
href="/service-collection/ontologymaps"
label="Services"
/>
<MenuInternalLinkItem
href="/service-collection/ontologymaps"
label="NCIt Mappings"
isSub="isSub"
/>
<MenuInternalLinkItem
href="/service-collection/uberonmaps"
label="UBERON Mappings"
isSub="isSub"
/>
<MenuInternalLinkItem
href="/service-collection/uploader"
label="Upload & Plot"
/>
<MenuInternalLinkItem
href="https://beaconplus.progenetix.org/"
label={
<>
Beacon<sup style={{ color: "red" }}>+</sup>
</>
}
/>
<MenuInternalLinkItem href={SITE_DEFAULTS.MASTERDOCLINK} label="Documentation" />
<MenuInternalLinkItem
href={SITE_DEFAULTS.NEWSLINK}
label="News"
isSub="isSub"
/>
<MenuInternalLinkItem
href={`${SITE_DEFAULTS.MASTERDOCLINK}/use-cases`}
label="Downloads & Use Cases"
isSub="isSub"
/>

<MenuInternalLinkItem
href={`${SITE_DEFAULTS.MASTERDOCLINK}/services`}
label="Sevices & API"
isSub="isSub"
/>

<MenuInternalLinkItem
href={SITE_DEFAULTS.ORGSITELINK}
label="Baudisgroup @ UZH"
/>
</ul>
</div>
)
}

7 changes: 7 additions & 0 deletions src/components/MarkdownParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import unified from "unified"
import parse from "remark-parse"
import remark2react from "remark-react"

export function MarkdownParser(md) {
return unified().use(parse).use(remark2react).processSync(md).result
}
Loading

0 comments on commit 887dbac

Please sign in to comment.