Skip to content

Commit

Permalink
remove console logs. disable action logging middleware.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshadfield committed Feb 20, 2018
1 parent 446e7a5 commit f95eac3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
21 changes: 11 additions & 10 deletions src/components/tree/phyloTree/change.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { timerFlush } from "d3-timer";
import { calcConfidenceWidth } from "./confidence";
import { applyToChildren } from "./helpers";
import { timerStart, timerEnd } from "../../../util/perf";

/* loop through the nodes and update each provided prop with the new value
* additionally, set d.update -> whether or not the node props changed
*/
const updateNodesWithNewData = (nodes, newNodeProps) => {
console.log("update nodes with data for these keys:", Object.keys(newNodeProps));
let tmp = 0;
// console.log("update nodes with data for these keys:", Object.keys(newNodeProps));
// let tmp = 0;
nodes.forEach((d, i) => {
d.update = false;
for (let key in newNodeProps) { // eslint-disable-line
const val = newNodeProps[key][i];
if (val !== d[key]) {
d[key] = val;
d.update = true;
tmp++;
// tmp++;
}
}
});
console.log("marking ", tmp, " nodes for update");
// console.log("marking ", tmp, " nodes for update");
};


Expand Down Expand Up @@ -96,15 +97,15 @@ const createUpdateCall = (treeElem, properties) => (selection) => {
};

const genericSelectAndModify = (svg, treeElem, updateCall, transitionTime) => {
console.log("general svg update for", treeElem);
// console.log("general svg update for", treeElem);
svg.selectAll(treeElem)
.filter((d) => d.update)
.transition().duration(transitionTime)
.call(updateCall);
if (!transitionTime) {
/* https://github.com/d3/d3-timer#timerFlush */
timerFlush();
console.log("\t\t--FLUSHING TIMER--");
// console.log("\t\t--FLUSHING TIMER--");
}
};

Expand All @@ -117,7 +118,7 @@ const genericSelectAndModify = (svg, treeElem, updateCall, transitionTime) => {
export const modifySVG = function modifySVG(elemsToUpdate, svgPropsToUpdate, transitionTime, extras) {
let updateCall;
const classesToPotentiallyUpdate = [".tip", ".vaccineDottedLine", ".vaccineCross", ".branch"]; /* order is respected */
console.log("modifying these elems", elemsToUpdate)
// console.log("modifying these elems", elemsToUpdate)
/* treat stem / branch specially, but use these to replace a normal .branch call if that's also to be applied */
if (elemsToUpdate.has(".branch.S") || elemsToUpdate.has(".branch.T")) {
const applyBranchPropsAlso = elemsToUpdate.has(".branch");
Expand Down Expand Up @@ -240,8 +241,8 @@ export const change = function change({
tipRadii = undefined,
branchThickness = undefined
}) {
console.log("\n** phylotree.change() (time since last run:", Date.now() - this.timeLastRenderRequested, "ms) **\n\n");
console.time("phylotree.change");
// console.log("\n** phylotree.change() (time since last run:", Date.now() - this.timeLastRenderRequested, "ms) **\n\n");
timerStart("phylotree.change()");
const elemsToUpdate = new Set();
const nodePropsToModify = {}; /* modify the actual data structure */
const svgPropsToUpdate = new Set(); /* modify the SVG */
Expand Down Expand Up @@ -334,5 +335,5 @@ export const change = function change({
}

this.timeLastRenderRequested = Date.now();
console.timeEnd("phylotree.change");
timerEnd("phylotree.change()");
};
4 changes: 2 additions & 2 deletions src/components/tree/phyloTree/layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { timerStart, timerEnd } from "../../../util/perf";
* ["rect", "radial", "unrooted", "clock"]
*/
export const setLayout = function setLayout(layout) {
console.log("set layout");
// console.log("set layout");
timerStart("setLayout");
if (typeof layout === "undefined" || layout !== this.layout) {
this.nodes.forEach((d) => {d.update = true;});
Expand Down Expand Up @@ -266,7 +266,7 @@ export const setScales = function setScales(margins) {
* @return {null}
*/
export const mapToScreen = function mapToScreen() {
console.log("mapToScreen")
// console.log("mapToScreen")
timerStart("mapToScreen");
/* set the range of the x & y scales */
this.setScales(this.params.margins);
Expand Down
2 changes: 1 addition & 1 deletion src/components/tree/reactD3Interface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const changePhyloTreeViaPropsComparison = (reactThis, nextProps) => {
}

if (Object.keys(args).length) {
console.log('\n\n** changePhyloTreeViaPropsComparison **', args);
// console.log('\n\n** changePhyloTreeViaPropsComparison **', args);
phylotree.change(args);
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { loggingMiddleware } from "../middleware/logActions"; // eslint-disable-
const middleware = [
thunk,
changeURLMiddleware, // eslint-disable-line comma-dangle
loggingMiddleware
// loggingMiddleware
];

let CreateStoreWithMiddleware;
Expand Down
2 changes: 1 addition & 1 deletion src/util/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const defaultDistanceMeasures = ["num_date", "div"];
export const fastTransitionDuration = 350; // in milliseconds
export const mediumTransitionDuration = 700; // in milliseconds
export const slowTransitionDuration = 1400; // in milliseconds
export const enableNarratives = true;
export const enableNarratives = false;
export const narrativeWidth = 500;
export const animationWindowWidth = 0.075; // width of animation window relative to date slider
export const animationTick = 50; // animation tick in milliseconds
Expand Down

0 comments on commit f95eac3

Please sign in to comment.