mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 13:08:11 +08:00
stub getDerivedStateFromProps
This commit is contained in:
@@ -117,6 +117,12 @@ class Graph extends React.Component {
|
|||||||
reglRender
|
reglRender
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// static getDerivedStateFromProps(props, state) {
|
||||||
|
// console.log("getDerivedStateFromProps in graph.js");
|
||||||
|
// console.log("props", props);
|
||||||
|
// console.log("state", state);
|
||||||
|
// // console.log("this.props", this.props);
|
||||||
|
// }
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.state.regl && nextProps.crossfilter) {
|
if (this.state.regl && nextProps.crossfilter) {
|
||||||
/* update the regl state */
|
/* update the regl state */
|
||||||
@@ -204,8 +210,7 @@ class Graph extends React.Component {
|
|||||||
nextProps.responsive.width !== this.props.responsive.width
|
nextProps.responsive.width !== this.props.responsive.width
|
||||||
) {
|
) {
|
||||||
/* clear out whatever was on the div, even if nothing, but usually the brushes etc */
|
/* clear out whatever was on the div, even if nothing, but usually the brushes etc */
|
||||||
d3
|
d3.select("#graphAttachPoint")
|
||||||
.select("#graphAttachPoint")
|
|
||||||
.selectAll("svg")
|
.selectAll("svg")
|
||||||
.remove();
|
.remove();
|
||||||
const { svg, brush, brushContainer } = setupSVGandBrushElements(
|
const { svg, brush, brushContainer } = setupSVGandBrushElements(
|
||||||
@@ -251,7 +256,7 @@ class Graph extends React.Component {
|
|||||||
// transform screen coordinates -> cell coordinates
|
// transform screen coordinates -> cell coordinates
|
||||||
const invert = pin => {
|
const invert = pin => {
|
||||||
const x =
|
const x =
|
||||||
2 * pin[0] / (this.props.responsive.height - this.graphPaddingTop) -
|
(2 * pin[0]) / (this.props.responsive.height - this.graphPaddingTop) -
|
||||||
1;
|
1;
|
||||||
const y =
|
const y =
|
||||||
2 *
|
2 *
|
||||||
|
|||||||
Reference in New Issue
Block a user