Lively Kernel canvas
Demo40true
sav0rfalsenulltruetruenull
Inoldentimeswhenwishingstillhelpedone,therelivedakingwhosedaughterswereallbeautiful;andtheyoungestwassobeautifulthatthesunitself,whichhasseensomuch,wasastonishedwheneveritshoneinherface.Closebytheking'scastlelayagreatdarkforest,andunderanoldlime-treeintheforestwasawell,andwhenthedaywasverywarm,theking'schildwentouttotheforestandsatdownbythefountain;andwhenshewasboredshetookagoldenball,andthrewituponhighandcaughtit;andthisballwasherfavoriteplaything.11
0.110null
10
createLayer("TeXBoxVisualizationLayer");layerClass(TeXBoxVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;result=proceed(t,w);this.boxes=[];this.net.nodes.forEach(function(value){if(!!value.bounds){varm;if(valueinstanceofprojects.TeX.TeX.Box){m=Morph.makeRectangle(value.bounds);m.setFill(null);}if(valueinstanceofprojects.TeX.TeX.Glue){varhalfheight=value.bounds.height/2;m=Morph.makeRectangle(value.bounds.withY(value.bounds.y+halfheight).withHeight(halfheight));m.setFill(Color.tangerine);}m.suppressHandles=true;m.suppressGrabbing=true;this.boxes.push(m);this.addMorphBack(m);}},this);returnresult;},resetRendering:function(proceed){this.boxes.forEach(function(box){this.removeMorph(box)},this);proceed();},});truetruefalse32truetruetrue
00.11
true
truetrue
nullfalsetruenull
VisualizingBoxesfalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
createLayer("TeXToleranceVisualizationLayer");layerClass(TeXToleranceVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;result=proceed(t,w);vary=t.y-5;varx=t.x;varrnode=NodeFactory.create("tspan");this.textContent.rawNode.appendChild(rnode);rnode.appendChild(NodeFactory.createText(""+this.net.config.tolerance));rnode.setAttributeNS(null,"x",x);rnode.setAttributeNS(null,"y",y);returnresult;},});truetruefalse15truetruetrue
00.11
true
truetrue
nullfalsetruenull
VisualizingTolerancefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
createLayer("TeXRatioVisualizationLayer");console.log("TeXRatioVisualizationLayerloaded.");layerClass(TeXRatioVisualizationLayer,projects.TeX.TeX.Line,{render:function(proceed,textContent){proceed(textContent);vary=this.topLeft.y+this.currentFont.getBaselineHeight();varx=this.topLeft.x+this.compositionWidth+10;varrnode=NodeFactory.create("tspan");textContent.rawNode.appendChild(rnode);rnode.appendChild(NodeFactory.createText(""+this.ratio.toFixed(3)));rnode.setAttributeNS(null,"x",x);rnode.setAttributeNS(null,"y",y);},});layerClass(TeXRatioVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;withLayers([TeXRatioVisualizationLayer],function(){result=proceed(t,w);});returnresult;},});truetruefalsenull22truetruetruefalse
00.11
true
truetruefalse
nullfalsetruenullfalse
VisualizingRatiofalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
module('projects.TeX.TeX').load()$m=$morph('TeXText');$m=$morph('LivelyText');$m=$morph('source');$m.renderText($m.textTopLeft(),$m.compositionWidth());$m.resetRendering();$m.setWithLayers([]);$m.setWithLayers([TeXLayer]);$m.setWithLayers([TeXLayer,TeXRatioVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXBoxVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXToleranceVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXBoxVisualizationLayer,TeXRatioVisualizationLayer,TeXToleranceVisualizationLayer]);$m.getWithLayers();truetruefalse14truetruefalse
00.11
true
truetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
In olden times when wishing still helped one, there lived aking whose daughters were all beautiful; and the youngestwas so beautiful that the sun itself, which has seen so much,was astonished whenever it shone in her face. Close bythe king's castle lay a great dark forest, and under an oldlime-tree in the forest was a well, and when the day wasvery warm, the king's child went out to the forest and satdown by the fountain; and when she was bored she took agolden ball, and threw it up on high and caught it; and thisball was her favorite plaything.null
truetruenull
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
Inoldentimeswhenwishingstillhelpedone,therelivedakingwhosedaughterswereallbeautiful;andtheyoungestwassobeautifulthatthesunitself,whichhasseensomuch,wasastonishedwheneveritshoneinherface.Closebytheking'scastlelayagreatdarkforest,andunderanoldlime-treeintheforestwasawell,andwhenthedaywasverywarm,theking'schildwentouttotheforestandsatdownbythefountain;andwhenshewasboredshetookagoldenball,andthrewituponhighandcaughtit;andthisballwasherfavoriteplaything.1true
$s=$morph('slider')connect($s,'value',{tex:$morph('TeXText'),liv:$morph('LivelyText'),src:$morph('source'),setPercent:function(p){varnumChr=(this.src.textString.length*(p/10)).roundTo(1);varnewStr=this.src.textString.slice(0,numChr);varselRange=this.liv.selectionRange;this.liv.updateTextString(newStr);this.liv.selectionRange=[0,numChr];this.liv.emphasizeSelection({align:'justify'});this.liv.selectionRange=selRange;this.tex.updateTextString(newStr);}},'setPercent');disconnectAll($s)$s.attributeConnectionsdelete$s.attributeConnectionstruetruefalsenull18truetrue
00.11
true
truetrue
nullfalsetruenull
Workspacefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Wikicontroltruetrue
null261