From 8dbb13a972e795054b557c8473a945f5c5919525 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Tue, 8 Sep 2015 14:00:52 +0200 Subject: [PATCH] slow animation down a bit --- client/app/scripts/charts/edge.js | 6 ++++-- client/app/scripts/charts/node.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/app/scripts/charts/edge.js b/client/app/scripts/charts/edge.js index bb962803e..97797195f 100644 --- a/client/app/scripts/charts/edge.js +++ b/client/app/scripts/charts/edge.js @@ -10,11 +10,13 @@ const line = d3.svg.line() .x(function(d) { return d.x; }) .y(function(d) { return d.y; }); +const animConfig = [80, 20]; // stiffness, bounce + const flattenPoints = function(points) { const flattened = {}; points.forEach(function(point, i) { - flattened['x' + i] = {val: point.x}; - flattened['y' + i] = {val: point.y}; + flattened['x' + i] = {val: point.x, config: animConfig}; + flattened['y' + i] = {val: point.y, config: animConfig}; }); return flattened; }; diff --git a/client/app/scripts/charts/node.js b/client/app/scripts/charts/node.js index 4ed254cb6..eff188b02 100644 --- a/client/app/scripts/charts/node.js +++ b/client/app/scripts/charts/node.js @@ -21,6 +21,7 @@ const Node = React.createClass({ const onMouseLeave = this.handleMouseLeave; const classNames = ['node']; const ellipsis = this.ellipsis; + const animConfig = [80, 20]; // stiffness, bounce if (this.props.highlighted) { classNames.push('highlighted'); @@ -31,7 +32,7 @@ const Node = React.createClass({ } return ( - + {function(interpolated) { const transform = 'translate(' + interpolated.x.val + ',' + interpolated.y.val + ')'; return (