{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1},{"__isSmartRef__":true,"id":56},{"__isSmartRef__":true,"id":80},{"__isSmartRef__":true,"id":134}],"scripts":[],"id":"DC9B5E72-002F-4501-A6AC-AB6A0065A429","shape":{"__isSmartRef__":true,"id":184},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":191},"showsHalos":false,"name":"WordCounter","partsBinMetaInfo":{"__isSmartRef__":true,"id":192},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":195},"eventHandler":{"__isSmartRef__":true,"id":196},"layout":{"__isSmartRef__":true,"id":197},"priorExtent":{"__isSmartRef__":true,"id":198},"derivationIds":[452],"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Rotation":0,"_Scale":1,"prevScroll":[0,0],"distanceToDragEvent":{"__isSmartRef__":true,"id":199},"__LivelyClassName__":"lively.morphic.Box"},"1":{"submorphs":[{"__isSmartRef__":true,"id":2}],"scripts":[],"id":"FEBB6507-6C40-45FB-B649-C04293E209AB","shape":{"__isSmartRef__":true,"id":17},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":32},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":20},"lighterFill":{"__isSmartRef__":true,"id":33},"label":{"__isSmartRef__":true,"id":2},"name":"TextCountButton","showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":42},"attributeConnections":[{"__isSmartRef__":true,"id":43}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","owner":{"__isSmartRef__":true,"id":0},"renderContextTable":{"__isSmartRef__":true,"id":44},"eventHandler":{"__isSmartRef__":true,"id":45},"scriptAnnotations":{"__isSmartRef__":true,"id":46},"derivationIds":[1549],"_Rotation":0,"fire":"= 2011-04-14, Thu =\n\nWhere were we last night? I thought this page was lost, after I could not open it, but it seem that Robert was working on the Text at the time and it was only temporally broken. But I also managed to extract the text out of our serialized JSON so no harm done.\n\nRobert assigned me the task to think about how we can convert or migrate our old objects. So we basically have our Compatibility Layers, but I thought we should do the conversion in the deserialization process. But I think this may be not necessary. If we serialized an object of class \"A\" but want to migrate it to class \"B\" we simply activate our compatibility layer which maps \"A\" to \"B\" during the deserialization process and our object ends up being an instance of class \"B\" . This of course does not take into account, changes to property names and types and changes to the object relationships over all. How do object databases cope with such problems?\n\nSo lets see what problems there might be and how to cope with them:\n\na) class A becomes class B\nb) property a is renamed to b\nc) property a is removed (e.g. garbage / unused objects)\nd) property b is new (e.g. new default  values)\ne) property a is split up to b and c\nf) property a and b are merged into c\ng) semantical changes to a property\n\nSo what do we do when our objects do not work any more? Can we heal them? Automatically? Manually? Should we kill the horse if it can not run any more and buy a new one? Its our own data we talk about right now. What do we do with user data? Can I still read this journal in 1, 2, 5, 10 or 20 years? What happend to our word counting scripts besides that journal. I am pretty sure the text will survive but I doubt that the apps and graphics will be there too. \n\nOur objects feel a very high evolutionary pressure. If they are worked with, copied, changed, brought to new versions. They will survive. If not they will rod and at last they will. This is the downside of having a very lively environments: objects that live can also die. \n\n\n== Tracing Lively Layouting ==\n\nFor writing about out ContextJS tracing I revisited Roberts example of tracing the setExtent method during our layouting process. And I noticed that there is pretty much something broken here. We do to much stuff. I thought we removed this double signaling that the geometry has changed but I slipped back in somehow. \n\nWe need links, so that I can directly point to:\n http://lively-kernel.org/repository/webwerkstatt/!svn/bc/62659/hpi/papers/ContextJSTracing/DraftObjectTracing.xhtml\n\n------\n\nDamn, its starting to get messy. The paper is getting messy because writing about it helps to understand the limitations and problems in our argumentation better and better. So lets have a loog again at the overall structure. What is really motivating is, that it is only a workshop paper and what we want to describe is not such a big issue.  I am responsible for what I want to write about and I don't have do write about what others may think the idea should be.\nIf I think the topic is problematic or there is not contribution, then we can still throw it away.\n\n- So again, where is the contribution?\n- Would I do it again this way if I would have to do it again? \n- What are the limitations of our current implementation?\n- What is our implementation?\nShould we describe only the tracing part without ContextJS? We need to give a short overview about what ContextJS is, for what is was build. \n\n\n\n\n\n= 2011-04-13, Wed =\n\nHere I am again, writing. A little late for my taste, but I got distracted today... as it was foreseeable. But the paper is still not written. Damn, where are these pens where you could insert a coin and they would write for themselves. Sorry dear reader for are the nonsense, but I am on the clock and want to write me warm  or something like that. I hope this helps me focus my stream of consciousness to something on topic. And the topic at hand is using COP as an implementation technology for tracing. \n\nThis is actually a very simple piece of software and implementing it I spend only an evening or so. I was inspired by a presentation of Johannes Bohnet PhD thesis, where he used online tracing and visualization of the C++ application AudaCity to figure out which methods are called to create sound filters (or so). Besides this, tracing is also a big topic of my colleagues Michael Perscheid and Bastian Steinert. They use tracing in Smalltalk to reverse engineering, code comprehension and continus selective testing. So this was in my mind when I stumbled upon a problem in Lively: I wanted to change the font size of the menu entries and when I did that the menu became very big and there was too much space in everywhere. I had no clou what was happening. Debugging it was not an option at that time because the Chrome JavaScript debugger was broken at that time. I figured out manually that the padding changed. But I had no clue where. So I decided to implement a simple tracing mechanism using ContextJS to give me some insight to what is going on during text composition. By instrumenting all classes of the Lively Kernel text module, and by inspecting the changes to padding I found the place where the padding was updated. It seemed to be a feature that allowed for interactively changing the font size and adjusting the padding accordingly so that it looks nice. The fix was quick. I don't know how long It would have take with a working debugger, but the insights into the text composition it I won were very valuable. Clicking stepwise through our complex text composition would have been more troublesome. The good thing about the tracing was that I could interactively adjust and refine for what and where I was looking for. And repeating a run with the failing example was very quick because it did not need any interaction a stepping through the debugger would have required. \n\nSo using the debugger would be definitely be related as an alternative for using tracing for program comprehension. But using tracing for program comprehension is a relatively well research field, so they say. This means we have to focus purely on the benefits and problems of using COP as an implementation foundation for implementing such tracing. Gschwind and Oberleitner wrote 2003 a paper about \"Improving Dynamic Data Analysis with Aspect-Oriented Programming\", they seem to make a similar argument as we are planning to make. The differences are they they are using AOP (AspectJ). From an implementation point of view they instrument everything with AOP and then filter out what is not needed by a pluggable system. They can instrument every Java program by linking in their own code. They have to instrument everything because they can not change their advice on runtime.  \n\nIn our JavaScript environment, ContextJS allows us to load the actual tracing code at runtime as needed. A difference is, that we do not instrument every method call with one advice, but that we generate partial methods for all places we are interested. As a first granularity we choose method categories, classes and modules. So we could specify that we wan't to trace every method in the TextMorph class or that we are interested in the whole Text.js module. This partial method generation step is simple to write down in JavaScript but it is not part of COP semantics. This is a typical case of homegenus cross-cutting concern, for which COP is explicitly not build. But since JavaScript allowed for using the same function object as a partial method in several places this was not a limitation. COP implementations in less dynamic environments might be not as usable in such occasions.\n\nSo what did we gain by using COP? We did not have to manage the method instrumentations ourself. Installing and deinstalling of the method wrappers is managed by the COP implementation. The real benefit was that further the existing COP scoping mechanisms could be used. The tracing could be scoped at runtime to the execution of a specific dynamic extent. It further could be scoped to individual objects and to whole object structures [ref to Lincke 2011OIC ]. We could use this scoping to as a first filter to reduce the vast amount of data tracing can produce. By explicitly generating the tracing layer only for specific classes and modules we could further reduce the data produced. \n\nWe used this cheap tracing implementation ourselves in several cases during our work with the Lively Kernel. \n\nWhat did we not do? We did not find out how complicated an tracing implementation in JavaScript would have been to write from scratch. But Dan Ingalls wrote a similar piece of code that allowed to profile the lively kernel by tallying every message send.  \n\nSo what are the points we want to make with that paper:\n\n- COP / ContextJS is a valuable tool in the tool chain of a programmer, because it provides  instrumentation infrastructure and scoping mechanism that make it easy to experiment with custom code instrumentations\n- Scoped tracing is easy to be implemented using cop\n- COPs limitations to homogenous concerns (which is by design) can be overcome in dynamical environments with the help of a little meta programing (actually we have to admit that COP itself is implemented such environments with a little meta programing)\n\nIn our examples we show that:\n- tracing profits from being made online and feed back and combined with data from the original application. In our example we showed that coloring the trace results with matching colors from the actual morphs helped to quickly grasp the intricate interactions of morphs and their submorphs during layouting. The gained insight helped identify unnecessary calls during the layout process, speeding up the actual implementation. (Or wasn't it)\n\nPoint we can not or need not to make in the paper:\n- Tracing is a valuable approach to finding bug (specially when side effects are involved, e.g. the error is not on the stack any more)\n- Tracing is valuable for program comprehension\n\nProblems in our Argumentation:\n\nHow hard is it to scope the traces when you capture everything? It seems to be part of the filter process in Gschwind 2003. \n\nPossible Answer: We do not filter at all. Even if this is still possible and our recorder / logger can decide not to log at all. But what we go the other way around. Installing the tracing for a given set of classes (which may also be computed, computing all loaded classes in JavaScript is no problem at all) in a TracingLayer and activation that tracing layer only for a specific scope is the opposite of filtering - even if the effect is the same. But it is difficult to decide what is better. \n\n- It felt fast and reliable implementing it, but how can we measure it, how fast and how unreliable would the implementation have been without COP\n\n= 2011-04-12, Tue =\n\nSo I don't have time to port all the existing Journal Code but I wan't to use the new system for testing it to production quality. So here we go again, only a plain old Text field. But with rich text support. In the previous version the performance of our text was really bad after reaching 1000 words. I don't think this was due to the bad text composition but more to the bad layouting we did over and over... or so it weld, I actually did not measure and hope that everything here is fine now.\n","priorExtent":{"__isSmartRef__":true,"id":13},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":49},"__LivelyClassName__":"lively.morphic.Button"},"2":{"submorphs":[],"scripts":[],"id":"788FD3D9-EEFB-414A-92E8-735E0525938E","shape":{"__isSmartRef__":true,"id":3},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":9},"_MaxTextWidth":100,"_MaxTextHeight":null,"textStyle":null,"padding":{"__isSmartRef__":true,"id":10},"_Padding":{"__isSmartRef__":true,"id":10},"owner":{"__isSmartRef__":true,"id":1},"isLabel":true,"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":11}],"_ClipMode":"hidden","priorExtent":{"__isSmartRef__":true,"id":13},"renderContextTable":{"__isSmartRef__":true,"id":14},"eventHandler":{"__isSmartRef__":true,"id":15},"_HandStyle":"default","_PointerEvents":"none","_TextColor":{"__isSmartRef__":true,"id":16},"derivationIds":[1550],"_MinTextWidth":100,"_MinTextHeight":null,"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Align":"center","__LivelyClassName__":"lively.morphic.Text"},"3":{"position":{"__isSmartRef__":true,"id":4},"_Extent":{"__isSmartRef__":true,"id":5},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":6},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":7},"_Opacity":1,"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":8},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"4":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"5":{"x":100,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"6":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"7":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"8":{"x":0,"y":0,"width":0,"height":0,"__LivelyClassName__":"Rectangle","__SourceModuleName__":"Global"},"9":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"10":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"11":{"style":{"__isSmartRef__":true,"id":12},"chunkOwner":{"__isSmartRef__":true,"id":2},"storedString":"count","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"12":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"13":{"x":100,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"14":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML"},"15":{"morph":{"__isSmartRef__":true,"id":2},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"17":{"position":{"__isSmartRef__":true,"id":18},"_Extent":{"__isSmartRef__":true,"id":5},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":19},"_Fill":{"__isSmartRef__":true,"id":20},"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":30},"_Opacity":1,"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":31},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"19":{"r":0.4,"g":0.4,"b":0.4,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"20":{"stops":[{"__isSmartRef__":true,"id":21},{"__isSmartRef__":true,"id":23},{"__isSmartRef__":true,"id":25},{"__isSmartRef__":true,"id":27}],"vector":{"__isSmartRef__":true,"id":29},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"21":{"offset":0,"color":{"__isSmartRef__":true,"id":22}},"22":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"23":{"offset":0.4,"color":{"__isSmartRef__":true,"id":24}},"24":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"25":{"offset":0.6,"color":{"__isSmartRef__":true,"id":26}},"26":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"27":{"offset":1,"color":{"__isSmartRef__":true,"id":28}},"28":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"29":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"30":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"31":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"32":{"x":9,"y":7,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"33":{"stops":[{"__isSmartRef__":true,"id":34},{"__isSmartRef__":true,"id":36},{"__isSmartRef__":true,"id":38},{"__isSmartRef__":true,"id":40}],"vector":{"__isSmartRef__":true,"id":29},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"34":{"offset":0,"color":{"__isSmartRef__":true,"id":35}},"35":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"36":{"offset":0.4,"color":{"__isSmartRef__":true,"id":37}},"37":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"38":{"offset":0.6,"color":{"__isSmartRef__":true,"id":39}},"39":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"40":{"offset":1,"color":{"__isSmartRef__":true,"id":41}},"41":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"42":{"partsSpaceName":"PartsBin/NewWorld","__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"43":{"sourceObj":{"__isSmartRef__":true,"id":1},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":1},"targetMethodName":"onFire","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"44":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"45":{"morph":{"__isSmartRef__":true,"id":1},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"46":{"onFire":{"__isSmartRef__":true,"id":47}},"47":{"time":{"__isSmartRef__":true,"id":48},"user":"jenslincke"},"48":{"isSerializedDate":true,"string":"Tue Jun 21 2011 14:22:40 GMT+0200 (CEST)"},"49":{"onFire":{"__isSmartRef__":true,"id":50},"reset":{"__isSmartRef__":true,"id":53}},"50":{"varMapping":{"__isSmartRef__":true,"id":51},"source":"function onFire() {\n\n        var journal = this.get('Journal');\n\n        var today = journal.submorphs.sortBy(function(ea) { \n                return ea.getPosition().y })[1];\n        \n\tvar words = 0;\n        today.submorphs.each(function(ea) {\n            if (ea.textString)\n                words += ea.textString.split(/\\s+/).length;\n        })\n\n\tvar counterText = this.get('wordCounterText')\n\tcounterText.setTextString(\n\t\tnew Date() + ': \\t' + words+ '\\n' + counterText.textString \n\t)\n}","funcProperties":{"__isSmartRef__":true,"id":52},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"51":{"this":{"__isSmartRef__":true,"id":1}},"52":{},"53":{"varMapping":{"__isSmartRef__":true,"id":54},"source":"function reset() {\n\t// this.reset()\n\tthis.setLabel('count')\n}","funcProperties":{"__isSmartRef__":true,"id":55},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"54":{"this":{"__isSmartRef__":true,"id":1}},"55":{},"56":{"submorphs":[],"scripts":[],"id":"78CBA4E1-34E5-4E2F-A8CD-F91D1FBF4E0F","shape":{"__isSmartRef__":true,"id":57},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":true,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":64},"_MaxTextWidth":344.3755872379003,"_MaxTextHeight":null,"textStyle":null,"owner":{"__isSmartRef__":true,"id":0},"layout":{"__isSmartRef__":true,"id":65},"showsHalos":false,"name":"wordCounterText","_FontSize":7,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":66}],"attributeConnections":[{"__isSmartRef__":true,"id":68}],"doNotSerialize":["$$textString"],"doNotCopyProperties":["$$textString"],"savedTextString":"Mon Jan 30 2012 18:02:04 GMT+0100 (CET): \t127\nMon Jan 30 2012 17:02:02 GMT+0100 (CET): \t100\n ","charsReplaced":"100","lastFindLoc":91,"_ClipMode":"auto","priorSelectionRange":[88,91],"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":69},"words":[17,184,184,518,518,518,13,140,208,12,68,713,845,1215,1994,2007,2266,2476,3077,3874,4033,4450,4,227,424,609,180,181,550,550,550],"renderContextTable":{"__isSmartRef__":true,"id":70},"eventHandler":{"__isSmartRef__":true,"id":71},"_TextColor":{"__isSmartRef__":true,"id":16},"derivationIds":[3804],"_MinTextWidth":344.3755872379003,"_MinTextHeight":null,"_Rotation":0,"previousSelection":[89,89],"textString":"Mon Jan 30 2012 18:02:04 GMT+0100 (CET): \t127\nMon Jan 30 2012 17:02:02 GMT+0100 (CET): \t10\n","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":72},"__LivelyClassName__":"lively.morphic.Text"},"57":{"position":{"__isSmartRef__":true,"id":58},"_Extent":{"__isSmartRef__":true,"id":59},"_BorderWidth":1.704,"_BorderColor":{"__isSmartRef__":true,"id":60},"_Fill":{"__isSmartRef__":true,"id":61},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":62},"_BorderRadius":5.91,"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"auto","_Padding":{"__isSmartRef__":true,"id":63},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"58":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"59":{"x":347.7835872379003,"y":472.6871565524251,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"60":{"r":0.662,"g":0.662,"b":0.662,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"61":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global"},"62":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"63":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"64":{"x":11,"y":43,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"65":{"resizeWidth":true,"resizeHeight":true},"66":{"style":{"__isSmartRef__":true,"id":67},"chunkOwner":{"__isSmartRef__":true,"id":56},"storedString":"Mon Jan 30 2012 18:02:04 GMT+0100 (CET): \t127\nMon Jan 30 2012 17:02:02 GMT+0100 (CET): \t10\n","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"67":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"68":{"sourceObj":{"__isSmartRef__":true,"id":56},"sourceAttrName":"textString","targetObj":{"__isSmartRef__":true,"id":56},"targetMethodName":"updateWords","__SourceModuleName__":"Global.lively.bindings","converter":null,"converterString":null,"updater":null,"updaterString":null,"__LivelyClassName__":"AttributeConnection"},"69":{"x":347.7835872379003,"y":472.6871565524251,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"70":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML"},"71":{"morph":{"__isSmartRef__":true,"id":56},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"72":{"updateWords":{"__isSmartRef__":true,"id":73},"thisIsNoDocumentation":{"__isSmartRef__":true,"id":77}},"73":{"varMapping":{"__isSmartRef__":true,"id":74},"source":"function updateWords() {\n        var lines = Strings.lines(this.textString)\n        data = lines.collect(function(line) {\n            var date = new Date(line.split('\\t')[0]),\n                count = Number(line.split('\\t')[1]);\n            return {count: count, date: date};\n        }).select(function(ea) { return ea && ea.count }).reverse()\n\n\tthis.get('WordTotalDiagram').setData(data)\n\n        var today = new Date().format(\"yymmdd\");\n\tthis.get('WordSpeedDiagram').setData( \n            data.select(function(ea) {\n                return ea.date.format(\"yymmdd\") == today\n        }))\n}","funcProperties":{"__isSmartRef__":true,"id":75},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global"},"74":{"this":{"__isSmartRef__":true,"id":56}},"75":{"timestamp":{"__isSmartRef__":true,"id":76},"user":"jenslincke","tags":[]},"76":{"isSerializedDate":true,"string":"Mon Jan 30 2012 17:01:59 GMT+0100 (CET)"},"77":{"varMapping":{"__isSmartRef__":true,"id":78},"source":"function thisIsNoDocumentation() {\n\t// sorry for missusing a script for documentation purposes, but when everything\n\t// you have is a hammer the whole world looks like a nail\n\n\t// I replaced a converter function with one more connection, because I did not want to go over this.sourceObj etc\n\n\t// I further replace the indirect connection with a direct call to the diagram because I could not figure out why it would not work the other way around with a:\n\tvar diagram = this.get('WordsDiagram');\n\tif (diagram) diagram.setData(this.words)\n\t\n\t// but then I retyped it and it worked ok, so I removed the direct call\n}","funcProperties":{"__isSmartRef__":true,"id":79},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"78":{"this":{"__isSmartRef__":true,"id":56}},"79":{},"80":{"submorphs":[],"scripts":[],"id":"049EE3D5-B79A-4999-91F7-BD9A35C91E2F","shape":{"__isSmartRef__":true,"id":81},"droppingEnabled":true,"halosEnabled":true,"data":[{"__isSmartRef__":true,"id":87},{"__isSmartRef__":true,"id":89}],"doNotSerialize":["vis"],"showsHalos":false,"_Position":{"__isSmartRef__":true,"id":91},"name":"WordTotalDiagram","partsBinMetaInfo":{"__isSmartRef__":true,"id":92},"__SourceModuleName__":"Global.apps.ProtoVisInterface","owner":{"__isSmartRef__":true,"id":0},"renderContextTable":{"__isSmartRef__":true,"id":93},"eventHandler":{"__isSmartRef__":true,"id":94},"attributeConnections":[],"doNotCopyProperties":[],"priorExtent":{"__isSmartRef__":true,"id":95},"layout":{"__isSmartRef__":true,"id":96},"distanceToDragEvent":{"__isSmartRef__":true,"id":97},"derivationIds":[2167],"_Rotation":0,"_Scale":1,"prevScroll":[0,0],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":98},"__LivelyClassName__":"ProtoVisMorph"},"81":{"position":{"__isSmartRef__":true,"id":82},"_Extent":{"__isSmartRef__":true,"id":83},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":84},"_Position":{"__isSmartRef__":true,"id":85},"_BorderWidth":0,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":86},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"82":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"83":{"x":408.4468795967764,"y":229.97777082661344,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"84":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"85":{"x":-3,"y":-1,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"86":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"87":{"count":10,"date":{"__isSmartRef__":true,"id":88}},"88":{"isSerializedDate":true,"string":"Mon Jan 30 2012 17:02:02 GMT+0100 (CET)"},"89":{"count":127,"date":{"__isSmartRef__":true,"id":90}},"90":{"isSerializedDate":true,"string":"Mon Jan 30 2012 18:02:04 GMT+0100 (CET)"},"91":{"x":392.6534822379042,"y":291.5102970766124,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"92":{"migrationLevel":1,"partsSpaceName":"PartsBin/NewWorld","__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"93":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"94":{"morph":{"__isSmartRef__":true,"id":80},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"95":{"x":408.4468795967764,"y":230.7917623387102,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"96":{"resizeWidth":true,"resizeHeight":true},"97":{"x":310.44232284277314,"y":-21.46027256047148,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"98":{"draw":{"__isSmartRef__":true,"id":99},"setData":{"__isSmartRef__":true,"id":107},"xFormat":{"__isSmartRef__":true,"id":114},"prepareForNewRenderContext":{"__isSmartRef__":true,"id":118},"render":{"__isSmartRef__":true,"id":126}},"99":{"varMapping":{"__isSmartRef__":true,"id":100},"source":"function draw(w, h) {\n\tw = w - 40;\n\th = h - 35;\n\tif (!Global.pv) return ;\n\n\tvar vis = new pv.Panel()\n\t\t.width(w)\n\t\t.height(h)\n\t\t.bottom(30)\n\t\t.left(30)\n\t\t.right(10)\n\t\t.top(5);\n\n\tvar data = this.data, // {date: Date, count: Number}\n                xMin = data.first().date,\n\t\txMax = data.last().date,\n                x = function(d) { return (d.date -xMin) / (xMax-xMin) * w },\n    \t\tyVals = data.pluck('count'),\n                yMax = pv.max(yVals) + 200,\n\t\ty = pv.Scale.linear(\n                    pv.min(yVals.concat(0)),\n                    pv.max(yVals)).range(0, h);\n\n\tvis.add(pv.Rule)\n\t\t.data(y.ticks())\n\t\t.bottom(y)\n\t\t.strokeStyle(function(d) { return d ? \"#eee\" : \"#000\"; })\n\t.anchor(\"left\").add(pv.Label)\n\t\t.text(this.yFormat || y.tickFormat);\n    \n        var timeFrame = data.last().date - data[0].date,\n            timeStep = timeFrame / 5,\n            middleDates = Array.range(1,4).collect(function(i) {\n                return {date: new Date(data[0].date.getTime() + timeStep*i)}\n            }).reverse(),\n            xText = [data[0]].concat(middleDates).concat(data.last());\n        // , data[Math.round(data.length / 2)], data.last()\n        // var xText = [data[0], data[Math.round(data.length / 2)], data.last()];\n\tvis.add(pv.Rule)\n\t\t.data(xText)\n\t\t// .visible(function(d) { return d != 0; })\n\t\t.left(x)\n\t\t.bottom(-5)\n\t\t.height(5)\n\t.anchor(\"bottom\").add(pv.Label)\n            .textBaseline(\"top\")\n        .textAngle(Math.PI / 9)\n\n\t    .text(this.xFormat || x.tickFormat);\n\n\tvis.add(pv.Area)\n\t\t.def('idx', 0)\n\t\t.data(data)\n\t\t.bottom(1)\n\t\t.left(function(d) {\n\t\t\treturn x(d);\n\t\t})\n\t\t.height(function(d) {\n                    return d.count / yMax * h\n\t\t})\n\t\t.fillStyle(\"rgb(121,173,210)\")\n\t.anchor(\"top\").add(pv.Line)\n\t\t.lineWidth(3);\n\n\treturn vis;\n}","funcProperties":{"__isSmartRef__":true,"id":105},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"100":{"this":{"__isSmartRef__":true,"id":80},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":101}},"101":{"$super":{"__isSmartRef__":true,"id":102}},"102":{"varMapping":{"__isSmartRef__":true,"id":103},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":104},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"103":{"obj":{"__isSmartRef__":true,"id":80},"name":"draw"},"104":{},"105":{"user":"robertkrahn","timestamp":{"__isSmartRef__":true,"id":106}},"106":{"isSerializedDate":true,"string":"Fri Jun 17 2011 04:36:18 GMT+0200 (CEST)"},"107":{"varMapping":{"__isSmartRef__":true,"id":108},"source":"function setData(a) {\n\tthis.data = a;\n\tif (Global.pv && this.world()) this.render(); \n}","funcProperties":{"__isSmartRef__":true,"id":113},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"108":{"this":{"__isSmartRef__":true,"id":80},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":109}},"109":{"$super":{"__isSmartRef__":true,"id":110}},"110":{"varMapping":{"__isSmartRef__":true,"id":111},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":112},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"111":{"obj":{"__isSmartRef__":true,"id":80},"name":"setData"},"112":{},"113":{},"114":{"varMapping":{"__isSmartRef__":true,"id":115},"source":"function xFormat(d) {\n    module('apps.DateFormat').load(true)\n    return d.date.format('mm/dd')\n}","funcProperties":{"__isSmartRef__":true,"id":116},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"115":{"this":{"__isSmartRef__":true,"id":80}},"116":{"user":"jenslincke","timestamp":{"__isSmartRef__":true,"id":117}},"117":{"isSerializedDate":true,"string":"Tue Jun 21 2011 16:40:54 GMT+0200 (CEST)"},"118":{"varMapping":{"__isSmartRef__":true,"id":119},"source":"function prepareForNewRenderContext(renderCtx) {\n    $super(renderCtx);\n    lively.bindings.callWhenNotNull(Global, 'pv', this, 'render');\n}","funcProperties":{"__isSmartRef__":true,"id":124},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"119":{"this":{"__isSmartRef__":true,"id":80},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":120}},"120":{"$super":{"__isSmartRef__":true,"id":121}},"121":{"varMapping":{"__isSmartRef__":true,"id":122},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":123},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"122":{"obj":{"__isSmartRef__":true,"id":80},"name":"prepareForNewRenderContext"},"123":{},"124":{"timestamp":{"__isSmartRef__":true,"id":125},"user":"jenslincke","tags":[]},"125":{"isSerializedDate":true,"string":"Mon Jan 30 2012 16:57:56 GMT+0100 (CET)"},"126":{"varMapping":{"__isSmartRef__":true,"id":127},"source":"function render() {\n    this.removeDrawing();\n\n    var w = this.getExtent().x,\n        h = this.getExtent().y;\n    this.vis = this.draw(w, h);\n\n    var svg = this.renderContext().svgNode;\n    if (svg) svg.parentNode.removeChild(svg)\n    var svg = NodeFactory.create('svg');\n    this.renderContext().shapeNode.appendChild(svg);\n    this.renderContext().svgNode = svg;\n    this.vis.canvas(svg);\n    this.vis.render();\n}","funcProperties":{"__isSmartRef__":true,"id":132},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"127":{"this":{"__isSmartRef__":true,"id":80},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":128}},"128":{"$super":{"__isSmartRef__":true,"id":129}},"129":{"varMapping":{"__isSmartRef__":true,"id":130},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":131},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"130":{"obj":{"__isSmartRef__":true,"id":80},"name":"render"},"131":{},"132":{"timestamp":{"__isSmartRef__":true,"id":133},"user":"jenslincke","tags":[]},"133":{"isSerializedDate":true,"string":"Mon Jan 30 2012 16:58:06 GMT+0100 (CET)"},"134":{"submorphs":[],"scripts":[],"id":"D65043BA-E4A2-4696-8714-054CA76B5744","shape":{"__isSmartRef__":true,"id":135},"droppingEnabled":true,"halosEnabled":true,"data":[{"__isSmartRef__":true,"id":87},{"__isSmartRef__":true,"id":89}],"doNotSerialize":["vis"],"showsHalos":false,"_Position":{"__isSmartRef__":true,"id":141},"name":"WordSpeedDiagram","partsBinMetaInfo":{"__isSmartRef__":true,"id":142},"__SourceModuleName__":"Global.apps.ProtoVisInterface","renderContextTable":{"__isSmartRef__":true,"id":143},"eventHandler":{"__isSmartRef__":true,"id":144},"attributeConnections":[],"doNotCopyProperties":[],"priorExtent":{"__isSmartRef__":true,"id":145},"layout":{"__isSmartRef__":true,"id":146},"distanceToDragEvent":{"__isSmartRef__":true,"id":147},"owner":{"__isSmartRef__":true,"id":0},"derivationIds":[2017],"_Rotation":0,"_Scale":1,"prevScroll":[0,0],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":148},"__LivelyClassName__":"ProtoVisMorph"},"135":{"position":{"__isSmartRef__":true,"id":136},"_Extent":{"__isSmartRef__":true,"id":137},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":138},"_Position":{"__isSmartRef__":true,"id":139},"_BorderWidth":0,"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":140},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"136":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"137":{"x":404.3769220362924,"y":247.07159258064587,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"138":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"139":{"x":-3,"y":-1,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"140":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"141":{"x":383.69957560483954,"y":30.219021693542402,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"142":{"migrationLevel":1,"partsSpaceName":"PartsBin/NewWorld","__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"143":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"144":{"morph":{"__isSmartRef__":true,"id":134},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"145":{"x":405.19091354838906,"y":247.07159258064587,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"146":{"resizeWidth":true,"resizeHeight":true},"147":{"x":306.37236528228914,"y":-10.87838290321315,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"148":{"draw":{"__isSmartRef__":true,"id":149},"setData":{"__isSmartRef__":true,"id":157},"xFormat":{"__isSmartRef__":true,"id":164},"prepareForNewRenderContext":{"__isSmartRef__":true,"id":168},"render":{"__isSmartRef__":true,"id":176}},"149":{"varMapping":{"__isSmartRef__":true,"id":150},"source":"function draw(w, h) {\n\tw = w - 40;\n\th = h - 35;\n\tif (!Global.pv) return ;\n\n\tvar vis = new pv.Panel()\n\t\t.width(w)\n\t\t.height(h)\n\t\t.bottom(30)\n\t\t.left(30)\n\t\t.right(10)\n\t\t.top(5);\n\n\tvar data = this.data, // {date: Date, count: Number}\n                xMin = data.first().date,\n\t\txMax = data.last().date,\n                x = function(d) { return (d.date -xMin) / (xMax-xMin) * w },\n    \t\tyVals = data.pluck('count'),\n                yMax = pv.max(yVals) + 200,\n\t\ty = pv.Scale.linear(\n                    pv.min(yVals.concat(0)),\n                    pv.max(yVals)).range(0, h);\n\n\tvis.add(pv.Rule)\n\t\t.data(y.ticks())\n\t\t.bottom(y)\n\t\t.strokeStyle(function(d) { return d ? \"#eee\" : \"#000\"; })\n\t.anchor(\"left\").add(pv.Label)\n\t\t.text(this.yFormat || y.tickFormat);\n    \n        var timeFrame = data.last().date - data[0].date,\n            timeStep = timeFrame / 5,\n            middleDates = Array.range(1,4).collect(function(i) {\n                return {date: new Date(data[0].date.getTime() + timeStep*i)}\n            }).reverse(),\n            xText = [data[0]].concat(middleDates).concat(data.last());\n        // , data[Math.round(data.length / 2)], data.last()\n        // var xText = [data[0], data[Math.round(data.length / 2)], data.last()];\n\tvis.add(pv.Rule)\n\t\t.data(xText)\n\t\t// .visible(function(d) { return d != 0; })\n\t\t.left(x)\n\t\t.bottom(-5)\n\t\t.height(5)\n\t.anchor(\"bottom\").add(pv.Label)\n            .textBaseline(\"top\")\n        .textAngle(Math.PI / 9)\n\n\t    .text(this.xFormat || x.tickFormat);\n\n\tvis.add(pv.Area)\n\t\t.def('idx', 0)\n\t\t.data(data)\n\t\t.bottom(1)\n\t\t.left(function(d) {\n\t\t\treturn x(d);\n\t\t})\n\t\t.height(function(d) {\n                    return d.count / yMax * h\n\t\t})\n\t\t.fillStyle(\"rgb(121,173,210)\")\n\t.anchor(\"top\").add(pv.Line)\n\t\t.lineWidth(3);\n\n\treturn vis;\n}","funcProperties":{"__isSmartRef__":true,"id":155},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"150":{"this":{"__isSmartRef__":true,"id":134},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":151}},"151":{"$super":{"__isSmartRef__":true,"id":152}},"152":{"varMapping":{"__isSmartRef__":true,"id":153},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":154},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"153":{"obj":{"__isSmartRef__":true,"id":134},"name":"draw"},"154":{},"155":{"user":"robertkrahn","timestamp":{"__isSmartRef__":true,"id":156}},"156":{"isSerializedDate":true,"string":"Fri Jun 17 2011 04:36:18 GMT+0200 (CEST)"},"157":{"varMapping":{"__isSmartRef__":true,"id":158},"source":"function setData(a) {\n\tthis.data = a;\n\tif (Global.pv && this.world()) this.render(); \n}","funcProperties":{"__isSmartRef__":true,"id":163},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"158":{"this":{"__isSmartRef__":true,"id":134},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":159}},"159":{"$super":{"__isSmartRef__":true,"id":160}},"160":{"varMapping":{"__isSmartRef__":true,"id":161},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":162},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"161":{"obj":{"__isSmartRef__":true,"id":134},"name":"setData"},"162":{},"163":{},"164":{"varMapping":{"__isSmartRef__":true,"id":165},"source":"function xFormat(d) {\n    module('apps.DateFormat').load(true)\n    return d.date.format('HH:mm')\n}","funcProperties":{"__isSmartRef__":true,"id":166},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"165":{"this":{"__isSmartRef__":true,"id":134}},"166":{"user":"jenslincke","timestamp":{"__isSmartRef__":true,"id":167}},"167":{"isSerializedDate":true,"string":"Tue Jun 21 2011 16:38:27 GMT+0200 (CEST)"},"168":{"varMapping":{"__isSmartRef__":true,"id":169},"source":"function prepareForNewRenderContext(renderCtx) {\n    $super(renderCtx);\n    lively.bindings.callWhenNotNull(Global, 'pv', this, 'render');\n}","funcProperties":{"__isSmartRef__":true,"id":174},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"169":{"this":{"__isSmartRef__":true,"id":134},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":170}},"170":{"$super":{"__isSmartRef__":true,"id":171}},"171":{"varMapping":{"__isSmartRef__":true,"id":172},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":173},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"172":{"obj":{"__isSmartRef__":true,"id":134},"name":"prepareForNewRenderContext"},"173":{},"174":{"timestamp":{"__isSmartRef__":true,"id":175},"user":"jenslincke","tags":[]},"175":{"isSerializedDate":true,"string":"Mon Jan 30 2012 16:55:42 GMT+0100 (CET)"},"176":{"varMapping":{"__isSmartRef__":true,"id":177},"source":"function render() {\n    this.removeDrawing();\n\n    var w = this.getExtent().x,\n        h = this.getExtent().y;\n    this.vis = this.draw(w, h);\n\n    var svg = this.renderContext().svgNode;\n    if (svg) svg.parentNode.removeChild(svg)\n    var svg = NodeFactory.create('svg');\n    this.renderContext().shapeNode.appendChild(svg);\n    this.renderContext().svgNode = svg;\n    this.vis.canvas(svg);\n    this.vis.render();\n}","funcProperties":{"__isSmartRef__":true,"id":182},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"177":{"this":{"__isSmartRef__":true,"id":134},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":178}},"178":{"$super":{"__isSmartRef__":true,"id":179}},"179":{"varMapping":{"__isSmartRef__":true,"id":180},"source":"function () {\n                try {\n                    return obj.constructor.prototype[name].apply(obj, arguments)\n                } catch(e) {\n                    alert('Error in $super call: ' + e + '\\n' + e.stack);\n                    return null;\n                }\n            }","funcProperties":{"__isSmartRef__":true,"id":181},"__SourceModuleName__":"Global","__LivelyClassName__":"lively.Closure"},"180":{"obj":{"__isSmartRef__":true,"id":134},"name":"render"},"181":{},"182":{"timestamp":{"__isSmartRef__":true,"id":183},"user":"jenslincke","tags":[]},"183":{"isSerializedDate":true,"string":"Mon Jan 30 2012 16:56:06 GMT+0100 (CET)"},"184":{"position":{"__isSmartRef__":true,"id":185},"_Extent":{"__isSmartRef__":true,"id":186},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":187},"_Fill":{"__isSmartRef__":true,"id":188},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":189},"_BorderRadius":16.995,"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":190},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"185":{"x":0,"y":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"186":{"x":840.3958811693551,"y":535.1291310887154,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"187":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global","__LivelyClassName__":"Color"},"188":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global"},"189":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"190":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global","__LivelyClassName__":"Rectangle"},"191":{"x":0,"y":0,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"192":{"partsSpaceName":"PartsBin/Jens/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"partName":"WordCounter","comment":"A word counter that counters short term and long term progress","changes":[{"__isSmartRef__":true,"id":193}],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"193":{"date":{"__isSmartRef__":true,"id":194},"author":"jenslincke","message":"Repaired the world counter from my old pages...","id":"E58FD997-702F-4A5E-8892-7E4FB4AEB310"},"194":{"isSerializedDate":true,"string":"Mon Jan 30 2012 17:03:39 GMT+0100 (CET)"},"195":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"196":{"morph":{"__isSmartRef__":true,"id":0},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"197":{},"198":{"x":840.3958811693551,"y":534.3151395766185,"__SourceModuleName__":"Global","__LivelyClassName__":"Point"},"199":{"x":174,"y":-13,"__LivelyClassName__":"Point","__SourceModuleName__":"Global"},"isSimplifiedRegistry":true}}