Devel-NYTProf
view release on metacpan or search on metacpan
lib/Devel/NYTProf/js/jit/jit-yc.js view on Meta::CPAN
(function(){function b(){}function c(w,u){for(var v in (u||{})){w[v]=u[v]}return w}function m(u){return(typeof u=="function")?u:function(){return u}}var k=Date.now||function(){return +new Date};function j(v){var u=h(v);return(u)?((u!="array")?[v]:v):...
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
(start code js)
st.switchPosition("right", "animate", {
onComplete: function() {
alert('completed!');
}
});
(end code)
*/
switchPosition: function(pos, method, onComplete) {
var Geom = this.geom, Plot = this.fx, that = this;
if(!Plot.busy) {
Plot.busy = true;
this.contract({
onComplete: function() {
Geom.switchOrientation(pos);
that.compute('endPos', false);
Plot.busy = false;
if(method == 'animate') {
that.onClick(that.clickedNode.id, onComplete);
} else if(method == 'replot') {
that.select(that.clickedNode.id, onComplete);
}
}
}, pos);
}
},
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
offsetX: 0,
offsetY: 0
},
onBeforeRequest: $empty,
onBeforeContract: $empty,
onBeforeMove: $empty,
onBeforeExpand: $empty
};
var complete = $merge(this.controller, innerController, options);
if(!this.busy) {
this.busy= true;
var node= this.graph.getNode(id);
this.selectPath(node, this.clickedNode);
this.clickedNode= node;
complete.onBeforeCompute(node);
complete.onBeforeRequest(node);
this.requestNodes(node, {
onComplete: function() {
complete.onBeforeContract(node);
that.contract({
onComplete: function() {
Geom.setRightLevelToShow(node, canvas);
complete.onBeforeMove(node);
that.move(node, {
Move: complete.Move,
onComplete: function() {
complete.onBeforeExpand(node);
that.expand(node, {
onComplete: function() {
that.busy = false;
complete.onAfterCompute(id);
complete.onComplete();
}
}); //expand
}
}); //move
}
});//contract
}
});//request
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
'exist': true,
'drawn': true
}
};
this.graph = new Graph(this.graphOptions);
this.fx = new RGraph.Plot(this);
this.op = new RGraph.Op(this);
this.json = null;
this.canvas = canvas;
this.root = null;
this.busy = false;
this.parent = false;
},
/*
Method: refresh
Computes nodes' positions and replots the tree.
*/
refresh: function() {
this.compute();
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
(start code js)
rgraph.onClick('someid');
//or also...
rgraph.onClick('someid', {
hideLabels: false
});
(end code)
*/
onClick: function(id, opt) {
if(this.root != id && !this.busy) {
this.busy = true;
this.root = id;
that = this;
this.controller.onBeforeCompute(this.graph.getNode(id));
var obj = this.getNodeAndParentAngle(id);
//second constraint
this.tagChildren(obj.parent, id);
this.parent = obj.parent;
this.compute('endPos');
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
});
var mode = this.config.interpolation;
opt = $merge({ onComplete: $empty }, opt || {});
this.fx.animate($merge({
hideLabels: true,
modes: [mode]
}, opt, {
onComplete: function() {
that.busy = false;
opt.onComplete();
}
}));
}
}
});
/*
Class: RGraph.Op
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
'drawn': true
}
};
this.graph = new Graph(this.graphOptions);
this.fx = new Hypertree.Plot(this);
this.op = new Hypertree.Op(this);
this.json = null;
this.canvas = canvas;
this.root = null;
this.busy = false;
},
/*
Method: refresh
Computes nodes' positions and replots the tree.
Parameters:
reposition - _optional_ Set this to *true* to force repositioning.
lib/Devel/NYTProf/js/jit/jit.js view on Meta::CPAN
Parameters:
pos - A <Complex> number determining the position to move the tree to.
opt - _optional_ An object containing some extra properties defined in <Hypertree.onClick>
*/
move: function(pos, opt) {
var versor = $C(pos.x, pos.y);
if(this.busy === false && versor.norm() < 1) {
var GUtil = Graph.Util;
this.busy = true;
var root = GUtil.getClosestNodeToPos(this.graph, versor), that = this;
GUtil.computeLevels(this.graph, root.id, 0);
this.controller.onBeforeCompute(root);
if (versor.norm() < 1) {
opt = $merge({ onComplete: $empty }, opt || {});
this.fx.animate($merge({
modes: ['moebius'],
hideLabels: true
}, opt, {
onComplete: function(){
that.busy = false;
opt.onComplete();
}
}), versor);
}
}
}
});
/*
Class: Hypertree.Op
t/50-errno.t view on Meta::CPAN
$! = $dflterrno;
example_xsub();
is 0+$!, $dflterrno, "\$! should not be altered by assigning fids to previously unprofiled modules ($!)";
SKIP: {
skip 'On VMS buffer does not flush', 1 if($^O eq 'VMS');
$! = $dflterrno;
while (-s $nytprof_out == $size1) {
# execute lots of statements to force some i/o even if zipping
busy();
}
is 0+$!, $dflterrno, '$! should not be altered by NYTProf i/o';
}
ok not eval { example_xsub(0, "die"); 1; };
like $@, qr/^example_xsub\(die\)/;
exit 0;
sub busy {
# none of this should alter $!
for (my $i = 1_000; $i > 0; --$i) {
example_xsub();
next if $i % 100;
example_sub();
}
}
( run in 0.389 second using v1.01-cache-2.11-cpan-87723dcf8b7 )