mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 00:18:11 +08:00
Add menu (#631)
* add menu * Added library versions to config and tests * add template version number
This commit is contained in:
@@ -5,7 +5,15 @@ import * as d3 from "d3";
|
||||
import { connect } from "react-redux";
|
||||
import mat4 from "gl-mat4";
|
||||
import _regl from "regl";
|
||||
import { Button, AnchorButton, Tooltip } from "@blueprintjs/core";
|
||||
import {
|
||||
Button,
|
||||
AnchorButton,
|
||||
Tooltip,
|
||||
Popover,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Position
|
||||
} from "@blueprintjs/core";
|
||||
|
||||
import * as globals from "../../globals";
|
||||
import setupSVGandBrushElements from "./setupSVGandBrush";
|
||||
@@ -32,7 +40,8 @@ import { World } from "../../util/stateManager";
|
||||
scatterplotXXaccessor: state.controls.scatterplotXXaccessor,
|
||||
scatterplotYYaccessor: state.controls.scatterplotYYaccessor,
|
||||
celllist1: state.differential.celllist1,
|
||||
celllist2: state.differential.celllist2
|
||||
celllist2: state.differential.celllist2,
|
||||
library_versions: _.get(state.config, "library_versions", null)
|
||||
}))
|
||||
class Graph extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -415,9 +424,9 @@ class Graph extends React.Component {
|
||||
dispatch,
|
||||
responsive,
|
||||
crossfilter,
|
||||
resettingInterface
|
||||
resettingInterface,
|
||||
library_versions
|
||||
} = this.props;
|
||||
|
||||
const { mode } = this.state;
|
||||
return (
|
||||
<div id="graphWrapper">
|
||||
@@ -505,6 +514,56 @@ class Graph extends React.Component {
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ marginLeft: 10 }}>
|
||||
<Popover
|
||||
content={
|
||||
<Menu>
|
||||
<MenuItem
|
||||
href="https://chanzuckerberg.github.io/cellxgene/faq.html"
|
||||
target="_blank"
|
||||
icon="help"
|
||||
text="FAQ"
|
||||
/>
|
||||
<MenuItem
|
||||
href="https://join-cziscience-slack.herokuapp.com/"
|
||||
target="_blank"
|
||||
icon="chat"
|
||||
text="Chat"
|
||||
/>
|
||||
<MenuItem
|
||||
href="https://chanzuckerberg.github.io/cellxgene/"
|
||||
target="_blank"
|
||||
icon="book"
|
||||
text="Docs"
|
||||
/>
|
||||
<MenuItem
|
||||
href="https://github.com/chanzuckerberg/cellxgene"
|
||||
target="_blank"
|
||||
icon="git-branch"
|
||||
text="Github"
|
||||
/>
|
||||
<MenuItem
|
||||
target="_blank"
|
||||
text={`cellxgene v${
|
||||
library_versions && library_versions.cellxgene
|
||||
? library_versions.cellxgene
|
||||
: null
|
||||
}`}
|
||||
/>
|
||||
<MenuItem text="MIT License" />
|
||||
</Menu>
|
||||
}
|
||||
position={Position.BOTTOM_RIGHT}
|
||||
>
|
||||
<Button
|
||||
type="button"
|
||||
className="bp3-button bp3-icon-cog"
|
||||
style={{
|
||||
cursor: "pointer"
|
||||
}}
|
||||
/>
|
||||
</Popover>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -65,6 +65,11 @@ class ConfigAPI(Resource):
|
||||
"parameters": {
|
||||
"max_category_items": current_app.data.max_category_items
|
||||
},
|
||||
"library_versions": {
|
||||
"scanpy": pkg_resources.get_distribution("scanpy").version,
|
||||
"cellxgene": pkg_resources.get_distribution("cellxgene").version,
|
||||
"anndata": pkg_resources.get_distribution("cellxgene").version
|
||||
}
|
||||
}
|
||||
}
|
||||
return make_response(jsonify(config), HTTPStatus.OK)
|
||||
|
||||
@@ -54,6 +54,7 @@ class EndPoints(unittest.TestCase):
|
||||
self.assertEqual(result.status_code, HTTPStatus.OK)
|
||||
self.assertEqual(result.headers["Content-Type"], "application/json")
|
||||
result_data = result.json()
|
||||
self.assertIn("library_versions", result_data["config"])
|
||||
self.assertEqual(result_data["config"]["displayNames"]["dataset"], "pbmc3k")
|
||||
self.assertEqual(len(result_data["config"]["features"]), 4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user