vega-force
Advanced tools
Comparing version 1.0.0-beta to 1.0.0-beta.1
@@ -68,6 +68,6 @@ (function (global, factory) { | ||
return this.finish(pulse); | ||
return this.finish(_, pulse); | ||
}; | ||
prototype.finish = function(pulse) { | ||
prototype.finish = function(_, pulse) { | ||
var dataflow = pulse.dataflow; | ||
@@ -89,3 +89,3 @@ | ||
// reflow all nodes | ||
return pulse.reflow().modifies(ForceOutput); | ||
return pulse.reflow(_.modified()).modifies(ForceOutput); | ||
}; | ||
@@ -92,0 +92,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-dataflow"),require("vega-util"),require("d3-force")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-force"],t):t(e.vega=e.vega||{},e.vega,e.vega,e.d3)}(this,function(e,t,a,r){"use strict";function n(e){t.Transform.call(this,null,e)}function o(e,t){return function(){e.touch(t).run()}}function i(e,t){var a=r.forceSimulation(e),n=!1,o=a.stop,i=a.restart;return a.stopped=function(){return n},a.restart=function(){return n=!1,i()},a.stop=function(){return n=!0,o()},f(a,t,!0).on("end",function(){n=!0})}function f(e,t,r){var n,o,i,f=a.array(t.forces);for(n=0,o=d.length;n<o;++n)i=d[n],i!==m&&t.modified(i)&&e[i](t[i]);for(n=0,o=f.length;n<o;++n)(r||t.modified(m,n))&&e.force(m+n,u(f[n]));for(o=e.numForces||0;n<o;++n)e.force(m+n,null);return e.numForces=f.length,e}function u(e){var t,r;s.hasOwnProperty(e.force)||a.error("Unrecognized force: "+e.force),t=s[e.force]();for(r in e)a.isFunction(t[r])&&t[r](e[r]);return t}var s={center:r.forceCenter,collide:r.forceCollide,nbody:r.forceManyBody,link:r.forceLink,x:r.forceX,y:r.forceY},m="forces",d=["alpha","alphaMin","alphaTarget","velocityDecay","drag","forces"],c=["static","iterations"],p=["x","y","vx","vy"],l=a.inherits(n,t.Transform);l.transform=function(e,t){var a=this.value,r=t.changed(t.ADD_REM),n=e.modified(d),u=e.iterations||300;if(a?(r&&(t.modifies("index"),a.nodes(t.source)),n&&f(a,e)):(this.value=a=i(t.source,e),a.on("tick",o(t.dataflow,this)),e.static||(r=!0,a.tick()),t.modifies("index")),n||r||e.modified(c)||t.changed()&&e.restart)if(a.alpha(Math.max(a.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(a.alphaMin(),1/u)),e.static)for(a.stop();--u>=0;)a.tick();else if(a.stopped()&&a.restart(),!r)return t.StopPropagation;return this.finish(t)},l.finish=function(e){for(var t,a=e.dataflow,r=this._argops,n=0,o=r.length;n<o;++n)if(t=r[n],t.name===m&&"link"===t.op._argval.force)for(var i,f=t.op._argops,u=0,s=f.length;u<s;++u)if("links"===f[u].name&&(i=f[u].op.source)){a.touch(i);break}return e.reflow().modifies(p)};var y={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"drag",type:"number",default:.6},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:["x","y","vx","vy"]}]};t.register(y,n),e.transform=t.transform,e.definition=t.definition,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega-dataflow"),require("vega-util"),require("d3-force")):"function"==typeof define&&define.amd?define(["exports","vega-dataflow","vega-util","d3-force"],t):t(e.vega=e.vega||{},e.vega,e.vega,e.d3)}(this,function(e,t,a,r){"use strict";function n(e){t.Transform.call(this,null,e)}function o(e,t){return function(){e.touch(t).run()}}function i(e,t){var a=r.forceSimulation(e),n=!1,o=a.stop,i=a.restart;return a.stopped=function(){return n},a.restart=function(){return n=!1,i()},a.stop=function(){return n=!0,o()},f(a,t,!0).on("end",function(){n=!0})}function f(e,t,r){var n,o,i,f=a.array(t.forces);for(n=0,o=m.length;n<o;++n)i=m[n],i!==d&&t.modified(i)&&e[i](t[i]);for(n=0,o=f.length;n<o;++n)(r||t.modified(d,n))&&e.force(d+n,u(f[n]));for(o=e.numForces||0;n<o;++n)e.force(d+n,null);return e.numForces=f.length,e}function u(e){var t,r;s.hasOwnProperty(e.force)||a.error("Unrecognized force: "+e.force),t=s[e.force]();for(r in e)a.isFunction(t[r])&&t[r](e[r]);return t}var s={center:r.forceCenter,collide:r.forceCollide,nbody:r.forceManyBody,link:r.forceLink,x:r.forceX,y:r.forceY},d="forces",m=["alpha","alphaMin","alphaTarget","velocityDecay","drag","forces"],c=["static","iterations"],p=["x","y","vx","vy"],l=a.inherits(n,t.Transform);l.transform=function(e,t){var a=this.value,r=t.changed(t.ADD_REM),n=e.modified(m),u=e.iterations||300;if(a?(r&&(t.modifies("index"),a.nodes(t.source)),n&&f(a,e)):(this.value=a=i(t.source,e),a.on("tick",o(t.dataflow,this)),e.static||(r=!0,a.tick()),t.modifies("index")),n||r||e.modified(c)||t.changed()&&e.restart)if(a.alpha(Math.max(a.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(a.alphaMin(),1/u)),e.static)for(a.stop();--u>=0;)a.tick();else if(a.stopped()&&a.restart(),!r)return t.StopPropagation;return this.finish(e,t)},l.finish=function(e,t){for(var a,r=t.dataflow,n=this._argops,o=0,i=n.length;o<i;++o)if(a=n[o],a.name===d&&"link"===a.op._argval.force)for(var f,u=a.op._argops,s=0,m=u.length;s<m;++s)if("links"===u[s].name&&(f=u[s].op.source)){r.touch(f);break}return t.reflow(e.modified()).modifies(p)};var y={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"drag",type:"number",default:.6},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:["x","y","vx","vy"]}]};t.register(y,n),e.transform=t.transform,e.definition=t.definition,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vega-force", | ||
"version": "1.0.0-beta", | ||
"version": "1.0.0-beta.1", | ||
"description": "Force simulation transform for Vega dataflows.", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"d3-force": "1", | ||
"vega-dataflow": ">=2.0.0-beta", | ||
"vega-dataflow": ">=2.0.0-beta.4", | ||
"vega-util": "1" | ||
@@ -33,0 +33,0 @@ }, |
@@ -69,6 +69,6 @@ import {Transform} from 'vega-dataflow'; | ||
return this.finish(pulse); | ||
return this.finish(_, pulse); | ||
}; | ||
prototype.finish = function(pulse) { | ||
prototype.finish = function(_, pulse) { | ||
var dataflow = pulse.dataflow; | ||
@@ -90,3 +90,3 @@ | ||
// reflow all nodes | ||
return pulse.reflow().modifies(ForceOutput); | ||
return pulse.reflow(_.modified()).modifies(ForceOutput); | ||
}; | ||
@@ -93,0 +93,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19348
Updatedvega-dataflow@>=2.0.0-beta.4