mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
slow animation down a bit
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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 (
|
||||
<Spring endValue={{x: {val: this.props.dx}, y: {val: this.props.dy}}}>
|
||||
<Spring endValue={{x: {val: this.props.dx, config: animConfig}, y: {val: this.props.dy, config: animConfig}}}>
|
||||
{function(interpolated) {
|
||||
const transform = 'translate(' + interpolated.x.val + ',' + interpolated.y.val + ')';
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user