forked from Bayer-Group/cellenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
2,020 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
/.idea | ||
**/.pybiomart.sqlite | ||
**/__pycache__/ | ||
/.DS_Store | ||
/.DS_Store | ||
**/.$* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile host="Electron" modified="2023-01-26T09:30:07.634Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.7.4 Chrome/106.0.5249.199 Electron/21.3.3 Safari/537.36" version="20.7.4" etag="ZFWJRapDufXhwsbdNX54" type="device"><diagram id="5oOviqtw5uLLyDU2DDvS" name="Page-1">5Vrbcts2EP0azaQP1pCgeHu0JbtJJ+6osTtpnjoQCYmISYIBQUvK13eXF4kgqVhxLXvUPglcLpYgzsHBYqmRNU02v0qaRbciZPGIGOFmZM1GhJjEtuEHLdvGYtWWleRhZTP2hjv+ndWOjbXgIctrW2VSQsSKZ7oxEGnKAqXZqJRirbstRRxqhoyumDYMNNwFNGY9t888VFFl9Yi7t79nfBU1TzYdv7qT0Ma5DpxHNBTrlsm6HllTKYSqWslmymKcPX1ebg7c3Q1MslQd08Gg9vZr9m3jU+NGuO+/r+efyUUd5ZHGRf3CN1KkiqXhiDgjYgEM1lWreb/NYHYk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yxYikmQO3stZ/ZPE/lzZbGG2NiHy3zvtuWeXNsmO4by7x1FjJv6RS1TX/cSRCOFXrHMfVQpBPogNADS+i25ZahQ354yL7dOU24pLMsqogvuos0ZcPWwuG1Zhn1aY0PHQqqAykumBKrJQMeBdgOS+F7y8yI6InRE6vlBReGd+TCsN5yYeyOnruF0ZHkY5fFrk5bB5p0D1Inzn/Mfil2LTmm5QZNU6Ga4sO0T16Qe4mHrnL3rQg74PXn7eW8KoD09ojxePxiHLdsT9sbfM87luk/RXQMcsJdwT0H8vueXiVwredx3zQsPRDpBDo198mBdOcEucqRqcoFnkBN/Ujq2E9x8sSpyrGk/L+nKi/Gy349vKxuvx0tDZ2ROiHN12ckOQeZdEiHRs+UScfV47yySPYLsO/v7+dvwMYX5M+Bg/nr8IK4+mdXYvrPI4bVOerscsnXoka/ptt8dzPK4m6ZGk5H+28jkDBeZK1aff1FLtx94DP2xyYJoXIlqSrr8vWn2Fv6wJblZ9gO/RTbKJ1w0Fc8sCmcvVCAUpFi/Qf6xh3TkwWfhIdhWTwa+v6i03oJh727elBNcvGvPo0Z3Tr+pI7RLhG5AyWiiX+YlgdKRCP8E0bzt5CKI/t/11jX/wA=</diagram></mxfile> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
client/src/components/ExpressionDotPlot/ExpressionDotPlot.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React, {useEffect, useMemo, useState} from 'react'; | ||
import {VegaLite, View, VisualizationSpec} from "react-vega"; | ||
import {DotPlotElementFragment} from "../../generated/types"; | ||
import {ScenegraphEvent} from "vega"; | ||
|
||
|
||
function createSpec(annotationTitle: string, xAxis: "studyName" | "displaySymbol") { | ||
return { | ||
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | ||
"data": {"name": "table"}, | ||
"mark": {"type": "point", "filled": true}, | ||
"encoding": { | ||
"y": { | ||
"field": "annotationDisplayValue", | ||
"type": "ordinal", | ||
"title": annotationTitle | ||
}, | ||
"x": xAxis === "studyName" ? { | ||
"field": "studyName", "type": "nominal", "title": "Study", | ||
} : { | ||
"field": "displaySymbol", "type": "nominal", "title": "Gene", | ||
}, | ||
"size": { | ||
"field": "exprCellsFraction", | ||
"type": "quantitative", | ||
"title": "Expr. fraction" | ||
}, | ||
"color": { | ||
"field": "q3", | ||
"type": "quantitative", | ||
"scale": {"scheme": "viridis", reverse: true} | ||
} | ||
|
||
} | ||
} as VisualizationSpec; | ||
} | ||
|
||
export function ExpressionDotPlot({ | ||
data, | ||
annotationTitle, | ||
xAxis, | ||
onClick | ||
}: | ||
{ | ||
data: DotPlotElementFragment[], | ||
annotationTitle: string, | ||
xAxis: "studyName" | "displaySymbol", | ||
onClick?: (dotPlotElement: DotPlotElementFragment, event: ScenegraphEvent) => void | ||
}) { | ||
const spec = useMemo(() => createSpec(annotationTitle, xAxis), [annotationTitle, xAxis]); | ||
|
||
const setUpSelectionListener = (view: View) => { | ||
view.addEventListener("click", (event, item) => { | ||
if (item && onClick) { | ||
const dotPlotElement = item.datum as DotPlotElementFragment; | ||
onClick(dotPlotElement, event); | ||
} | ||
}); | ||
}; | ||
|
||
return <VegaLite | ||
spec={spec} | ||
onNewView={(view) => setUpSelectionListener(view)} | ||
data={{ | ||
"table": data | ||
}}/> | ||
} | ||
|
Oops, something went wrong.