mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 12:58:11 +08:00
prettier
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
/* rc slider https://www.npmjs.com/package/rc-slider */
|
/* rc slider https://www.npmjs.com/package/rc-slider */
|
||||||
|
|
||||||
import React from 'react';
|
import React from "react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
|
||||||
import styles from './parallelCoordinates.css';
|
import styles from "./parallelCoordinates.css";
|
||||||
import SectionHeader from "../framework/sectionHeader";
|
import SectionHeader from "../framework/sectionHeader";
|
||||||
|
|
||||||
import setupParallelCoordinates from "./setupParallelCoordinates";
|
import setupParallelCoordinates from "./setupParallelCoordinates";
|
||||||
@@ -13,19 +13,22 @@ import drawLinesCanvas from "./drawLinesCanvas";
|
|||||||
|
|
||||||
import HistogramBrush from "./histogramBrush";
|
import HistogramBrush from "./histogramBrush";
|
||||||
|
|
||||||
import {
|
import { margin, width, height, createDimensions } from "./util";
|
||||||
margin,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
createDimensions,
|
|
||||||
} from "./util";
|
|
||||||
|
|
||||||
@connect((state) => {
|
@connect(state => {
|
||||||
|
const ranges =
|
||||||
|
state.cells.cells && state.cells.cells.data.ranges
|
||||||
|
? state.cells.cells.data.ranges
|
||||||
|
: null;
|
||||||
|
const metadata =
|
||||||
|
state.cells.cells && state.cells.cells.data.metadata
|
||||||
|
? state.cells.cells.data.metadata
|
||||||
|
: null;
|
||||||
|
|
||||||
const ranges = state.cells.cells && state.cells.cells.data.ranges ? state.cells.cells.data.ranges : null;
|
const initializeRanges =
|
||||||
const metadata = state.cells.cells && state.cells.cells.data.metadata ? state.cells.cells.data.metadata : null;
|
state.initialize.data && state.initialize.data.data.ranges
|
||||||
|
? state.initialize.data.data.ranges
|
||||||
const initializeRanges = state.initialize.data && state.initialize.data.data.ranges ? state.initialize.data.data.ranges : null;
|
: null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ranges,
|
ranges,
|
||||||
@@ -35,8 +38,8 @@ import {
|
|||||||
colorScale: state.controls.colorScale,
|
colorScale: state.controls.colorScale,
|
||||||
graphBrushSelection: state.controls.graphBrushSelection,
|
graphBrushSelection: state.controls.graphBrushSelection,
|
||||||
currentCellSelection: state.controls.currentCellSelection,
|
currentCellSelection: state.controls.currentCellSelection,
|
||||||
axesHaveBeenDrawn: state.controls.axesHaveBeenDrawn,
|
axesHaveBeenDrawn: state.controls.axesHaveBeenDrawn
|
||||||
}
|
};
|
||||||
})
|
})
|
||||||
class Continuous extends React.Component {
|
class Continuous extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -45,26 +48,20 @@ class Continuous extends React.Component {
|
|||||||
svg: null,
|
svg: null,
|
||||||
ctx: null,
|
ctx: null,
|
||||||
axes: null,
|
axes: null,
|
||||||
dimensions: null,
|
dimensions: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {}
|
||||||
|
componentWillReceiveProps(nextProps) {}
|
||||||
|
|
||||||
}
|
componentDidMount() {}
|
||||||
componentWillReceiveProps(nextProps) {
|
handleBrushAction(selection) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
|
|
||||||
}
|
|
||||||
handleBrushAction (selection) {
|
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: "continuous selection using parallel coords brushing",
|
type: "continuous selection using parallel coords brushing",
|
||||||
data: selection
|
data: selection
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
handleColorAction (key) {
|
handleColorAction(key) {
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: "color by continuous metadata",
|
type: "color by continuous metadata",
|
||||||
colorAccessor: key,
|
colorAccessor: key,
|
||||||
@@ -73,32 +70,25 @@ class Continuous extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{
|
{_.map(this.props.ranges, (value, key) => {
|
||||||
_.map(this.props.ranges, (value, key) => {
|
const isColorField = key.includes("color") || key.includes("Color");
|
||||||
const isColorField = key.includes("color") || key.includes("Color");
|
if (value.range && key !== "CellName" && !isColorField) {
|
||||||
if (
|
return (
|
||||||
value.range &&
|
<HistogramBrush
|
||||||
key !== "CellName" &&
|
key={key}
|
||||||
!isColorField
|
metadataField={key}
|
||||||
) {
|
ranges={value.range}
|
||||||
return (
|
/>
|
||||||
<HistogramBrush
|
);
|
||||||
key={key}
|
}
|
||||||
metadataField={key}
|
})}
|
||||||
ranges={value.range}/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export default Continuous;
|
export default Continuous;
|
||||||
|
|
||||||
|
|
||||||
// <SectionHeader text="Continuous Metadata"/>
|
// <SectionHeader text="Continuous Metadata"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user