Clean comments and logs

This commit is contained in:
Emanuele Bezzi
2021-12-21 11:33:38 -05:00
parent cbf3ba240a
commit eac84c5d74
2 changed files with 1 additions and 44 deletions
-35
View File
@@ -116,7 +116,6 @@ class Graph extends React.Component {
/* /*
compute the model coordinate for each point compute the model coordinate for each point
*/ */
console.log({ X }, { Y });
const positions = new Float32Array(2 * X.length); const positions = new Float32Array(2 * X.length);
for (let i = 0, len = X.length; i < len; i += 1) { for (let i = 0, len = X.length; i < len; i += 1) {
const p = vec2.fromValues(X[i], Y[i]); const p = vec2.fromValues(X[i], Y[i]);
@@ -454,33 +453,6 @@ class Graph extends React.Component {
}); });
} }
rescalePointForSpatial = (x, y, spatialMetadata) => {
// console.log({spatialMetadata});
const translate = vec2.fromValues(
spatialMetadata.inverseTranslate[0],
spatialMetadata.inverseTranslate[1]
);
const min = vec2.fromValues(
spatialMetadata.inverseMin[0],
spatialMetadata.inverseMin[1]
);
const scalefactor = spatialMetadata.scaleref;
const wh = vec2.fromValues(
spatialMetadata.imageWidth,
spatialMetadata.imageHeight
);
// Apply the inverse transform
const p = vec2.fromValues(x, y);
vec2.sub(p, p, translate);
vec2.scale(p, p, spatialMetadata.inverseScale);
vec2.add(p, p, min);
vec2.scale(p, p, scalefactor);
vec2.div(p, p, wh);
return p;
};
setReglCanvas = (canvas) => { setReglCanvas = (canvas) => {
this.reglCanvas = canvas; this.reglCanvas = canvas;
this.setState({ this.setState({
@@ -568,8 +540,6 @@ class Graph extends React.Component {
} = props.watchProps; } = props.watchProps;
const { modelTF } = this.state; const { modelTF } = this.state;
console.log({ spatial });
const [layoutDf, colorDf, pointDilationDf] = await this.fetchData( const [layoutDf, colorDf, pointDilationDf] = await this.fetchData(
annoMatrix, annoMatrix,
layoutChoice, layoutChoice,
@@ -873,8 +843,6 @@ class Graph extends React.Component {
const imW = spatial.data.imageWidth; const imW = spatial.data.imageWidth;
const imH = spatial.data.imageHeight; const imH = spatial.data.imageHeight;
console.log({ imageUnderlay });
regl.poll(); regl.poll();
regl.clear({ regl.clear({
depth: 1, depth: 1,
@@ -921,9 +889,6 @@ class Graph extends React.Component {
const { modelTF, projectionTF, camera, viewport, regl } = this.state; const { modelTF, projectionTF, camera, viewport, regl } = this.state;
const cameraTF = camera?.view()?.slice(); const cameraTF = camera?.view()?.slice();
console.log("---RENDER");
console.log({ props: this.props });
return ( return (
<div <div
id="graph-wrapper" id="graph-wrapper"
+1 -9
View File
@@ -372,7 +372,7 @@ class DataAdaptor(metaclass=ABCMeta):
else: else:
# scale isotropically # scale isotropically
try: try:
min = np.nanmin(embedding, axis=0) min = np.nanmin(embedding, axis=0)
max = np.nanmax(embedding, axis=0) max = np.nanmax(embedding, axis=0)
@@ -388,14 +388,6 @@ class DataAdaptor(metaclass=ABCMeta):
translate = 0.5 - ((max - min) / scale / 2) translate = 0.5 - ((max - min) / scale / 2)
normalized_layout = normalized_layout + translate normalized_layout = normalized_layout + translate
# print(f"scale {scale}, translate {translate}")
# if True: # if visium
# self.data.uns["spatial"]
# adata.uns["spatial"]['V1_Adult_Mouse_Brain']["scalefactors"]["tissue_hires_scalef"]
return normalized_layout return normalized_layout
def layout_to_fbs_matrix(self, fields, spatial = None): def layout_to_fbs_matrix(self, fields, spatial = None):