mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 07:08:11 +08:00
graph listens directly for the presence of vertices
This commit is contained in:
@@ -3,7 +3,16 @@ import _ from "lodash";
|
|||||||
import styles from "./graph.css";
|
import styles from "./graph.css";
|
||||||
import {setupGraphElements, drawGraph} from "./drawGraph";
|
import {setupGraphElements, drawGraph} from "./drawGraph";
|
||||||
import SectionHeader from "../framework/sectionHeader";
|
import SectionHeader from "../framework/sectionHeader";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
|
||||||
|
@connect((state) => {
|
||||||
|
|
||||||
|
const vertices = state.cells.cells && state.cells.cells.data.graph ? state.cells.cells.data.graph : null;
|
||||||
|
|
||||||
|
return {
|
||||||
|
vertices
|
||||||
|
}
|
||||||
|
})
|
||||||
class Graph extends React.Component {
|
class Graph extends React.Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -16,15 +25,16 @@ class Graph extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
console.log('le grpah', nextProps)
|
||||||
/* maybe should do a check here to confirm ref exists and pass it? */
|
/* maybe should do a check here to confirm ref exists and pass it? */
|
||||||
if (
|
if (
|
||||||
nextProps.vertices &&
|
this.state.context &&
|
||||||
nextProps.expressions &&
|
nextProps.vertices
|
||||||
nextProps.expressionsCountsMap &&
|
// nextProps.expressions &&
|
||||||
this.state.context
|
// nextProps.expressionsCountsMap &&
|
||||||
) {
|
) {
|
||||||
drawGraph(
|
drawGraph(
|
||||||
nextProps.vertices.data,
|
nextProps.vertices,
|
||||||
this.state.context,
|
this.state.context,
|
||||||
nextProps.expressionsCountsMap
|
nextProps.expressionsCountsMap
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user