mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-20 03:18:12 +08:00
paintbrush and intialize
This commit is contained in:
@@ -61,7 +61,7 @@ const attemptCategoricalMetadataDeselection = (metadataField, value) => {
|
||||
const initialize = () => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({type: "initialize started"})
|
||||
fetch(`${globals.API.prefix}${globals.API.version}cells`, {
|
||||
fetch(`${globals.API.prefix}${globals.API.version}initialize`, {
|
||||
method: "get",
|
||||
headers: new Headers({
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -43,7 +43,7 @@ class App extends React.Component {
|
||||
first request includes query straight off the url bar for now
|
||||
*/
|
||||
this.props.dispatch(actions.requestCells(window.location.search))
|
||||
this.props.dispatch(actions.___hardcoded___requestGeneExpressionCountsPOST(window.location.search))
|
||||
// this.props.dispatch(actions.___hardcoded___requestGeneExpressionCountsPOST(window.location.search))
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -69,6 +69,21 @@ class App extends React.Component {
|
||||
<Categorical/>
|
||||
<div>
|
||||
<Graph/>
|
||||
<button
|
||||
style={{
|
||||
fontSize: 14,
|
||||
fontWeight: 400,
|
||||
color: "#41633C",
|
||||
padding: "10px 20px",
|
||||
backgroundColor: "#B9D1B5",
|
||||
border: "none",
|
||||
borderRadius: 3,
|
||||
cursor: "pointer",
|
||||
}}
|
||||
|
||||
>
|
||||
Reproject
|
||||
</button>
|
||||
<Continuous/>
|
||||
</div>
|
||||
<Expression/>
|
||||
|
||||
@@ -46,13 +46,13 @@ class Category extends React.Component {
|
||||
<span
|
||||
onClick={this.handleColorChange.bind(this)}
|
||||
style={{
|
||||
fontSize: 24,
|
||||
fontSize: 16,
|
||||
marginLeft: 10,
|
||||
position: "relative",
|
||||
top: 4,
|
||||
top: 2,
|
||||
cursor: "pointer",
|
||||
}}>
|
||||
🎨
|
||||
🖌️
|
||||
</span>
|
||||
</p>
|
||||
<span
|
||||
@@ -112,6 +112,7 @@ class Categories extends React.Component {
|
||||
marginRight: 40,
|
||||
flexShrink: 0
|
||||
}}>
|
||||
|
||||
{
|
||||
_.map(this.props.ranges, (value, key) => {
|
||||
const isColorField = key.includes("color") || key.includes("Color");
|
||||
|
||||
@@ -22,13 +22,11 @@ import {
|
||||
const metadata = state.cells.cells && state.cells.cells.data.metadata ? state.cells.cells.data.metadata : null;
|
||||
|
||||
const initializeRanges = state.initialize.data && state.initialize.data.data.ranges ? state.initialize.data.data.ranges : null;
|
||||
const initializeMetadata = state.initialize.data && state.initialize.data.data.metadata ? state.initialize.data.data.metadata : null;
|
||||
|
||||
return {
|
||||
ranges,
|
||||
metadata,
|
||||
initializeRanges,
|
||||
initializeMetadata,
|
||||
colorAccessor: state.controls.colorAccessor,
|
||||
colorScale: state.controls.colorScale,
|
||||
graphBrushSelection: state.controls.graphBrushSelection,
|
||||
@@ -74,7 +72,6 @@ class Continuous extends React.Component {
|
||||
this.state.svg,
|
||||
this.state.ctx,
|
||||
dimensions,
|
||||
nextProps.initializeMetadata, /* PERF this means brushes are always filtering on everything */
|
||||
xscale,
|
||||
height,
|
||||
width,
|
||||
|
||||
@@ -9,7 +9,6 @@ const drawAxes = (
|
||||
svg,
|
||||
ctx,
|
||||
dimensions,
|
||||
metadata,
|
||||
xscale,
|
||||
height,
|
||||
width,
|
||||
@@ -56,7 +55,7 @@ const drawAxes = (
|
||||
.on("click", (d) => { handleColorAction(d.key) })
|
||||
.attr("class", styles.title)
|
||||
.attr("text-anchor", "start")
|
||||
.text(function(d) { return "description" in d ? d.description + " 🎨" : d.key + " 🎨"; });
|
||||
.text(function(d) { return "description" in d ? d.description + " 🖌️" : d.key + " 🖌️"; });
|
||||
|
||||
// Add and store a brush for each axis.
|
||||
axes.append("g")
|
||||
|
||||
@@ -66,12 +66,12 @@ class DiffExp extends React.Component {
|
||||
<span
|
||||
onClick={this.handleGeneColorScaleClick(gene).bind(this)}
|
||||
style={{
|
||||
fontSize: 24,
|
||||
fontSize: 16,
|
||||
cursor: "pointer",
|
||||
position: "relative",
|
||||
top: 5,
|
||||
marginRight: 10
|
||||
}}>🎨</span>
|
||||
top: 2,
|
||||
marginRight: 6
|
||||
}}>🖌️</span>
|
||||
<span>{gene}</span>
|
||||
</div>
|
||||
<p style={{
|
||||
@@ -109,12 +109,12 @@ class DiffExp extends React.Component {
|
||||
<span
|
||||
onClick={this.handleGeneColorScaleClick(gene).bind(this)}
|
||||
style={{
|
||||
fontSize: 24,
|
||||
fontSize: 16,
|
||||
cursor: "pointer",
|
||||
position: "relative",
|
||||
top: 5,
|
||||
marginRight: 10
|
||||
}}>🎨</span>
|
||||
top: 2,
|
||||
marginRight: 6
|
||||
}}>🖌️</span>
|
||||
<span>{gene}</span>
|
||||
</div>
|
||||
<p style={{
|
||||
@@ -150,7 +150,6 @@ class DiffExp extends React.Component {
|
||||
|
||||
@connect((state) => {
|
||||
return {
|
||||
expression: state.expression.data,
|
||||
currentCellSelection: state.controls.currentCellSelection,
|
||||
differential: state.differential
|
||||
}
|
||||
@@ -208,7 +207,6 @@ class Expression extends React.Component {
|
||||
}
|
||||
render () {
|
||||
if (
|
||||
!this.props.expression ||
|
||||
!this.props.differential
|
||||
) {
|
||||
return null
|
||||
|
||||
2
src/reducers/controls.js
vendored
2
src/reducers/controls.js
vendored
@@ -12,7 +12,7 @@ const Controls = (state = {
|
||||
continuousSelection: null,
|
||||
axesHaveBeenDrawn: false,
|
||||
__storedStateForCelllist1__: null, /* will need procedural control of brush ie., brush.extent https://bl.ocks.org/micahstubbs/3cda05ca68cba260cb81 */
|
||||
__storedStateForCelllist1__: null,
|
||||
__storedStateForCelllist2__: null,
|
||||
}, action) => {
|
||||
switch (action.type) {
|
||||
/**********************************
|
||||
|
||||
Reference in New Issue
Block a user