{
    "tiddlers": {
        "$:/plugins/ihm/tidgraph/changelog": {
            "created": "20151024161547099",
            "creator": "ihm4u",
            "modified": "20151031061347109",
            "modifier": "ihm4u",
            "tags": "",
            "title": "$:/plugins/ihm/tidgraph/changelog",
            "text": "For the complete changelog see\n\nhttps://ihm4u.github.io/tw5plugs/#Tidgraph%20-%20Changelog\n"
        },
        "$:/plugins/ihm/tidgraph/documentation": {
            "title": "$:/plugins/ihm/tidgraph/documentation",
            "text": "!!Example\nThe following example shows a tiddler which tags 7 children:\n\n``<$tidgraph start=\"Virtues\" />``\n\nlooks like this:\n\n{{$:/plugins/ihm/tidgraph/tidgraph.png}}\n\n!!Usage\nSimple usage:\n\n``<$tidgraph start=\"MyRootTiddler\" />``\n\nThe map will start with MyRootTiddler on the left, and show all its children recursively. The default maximum depth is 10 levels, it can be changed with the `maxdepth` attribute.\n\nAll  options:\n\n|!Attribute |!Description|!Default |\n|`start`      |Initial tiddler that starts the map | none |\n|`startat`   |First level to display. 0 is the root tiddler named in the `start` attribute. 1 is the next level, etc. | 0 |\n|`maxdepth`   |Maximum depth to display.| 10 |\n|`mode` |//tagging// or //linking// or custom. This is how to identify the children of a node. With //tagging// Tiddlers that tag other tiddlers become their parent. With //linking// tiddlers that link to other tiddlers become their parent. A custom mode can be specified by a `$:/config/tidgraph/modes/MyMode` tiddler where `MyMode` is the name of the mode. The subfilter can be also specified directly; e.g. `mode=\"fields[]\"`. See [[Custom Mode Demo|https://ihm4u.github.io/tw5plugs/#Custom%20Mode%20Demo]] for an example | //tagging//  |\n|`nodetitle` |Field to use as title for the node. | //title// (or //caption// if present) |\n|`tooltip` |List of fields to use for node tooltip. The first field with a non empty value is used. | //summary// |\n|`filter` |Only tiddlers matching filter will be used | none |\n|`nocollapse` |Disable ability to collapse nodes. The graph allows node collapsing by default. | false |\n|`nodetemplate` |One or mode node templates to make node look like you want. See the [[Node Templates Demo|https://ihm4u.github.io/tw5plugs/#Node%20Templates%20Demo]] for examples of how to use them. | none |\n|`layout` |`E` for East (Vertical) or `S` for south (Horizontal) layout. | E |\n\n!CSS classes\nYou can also change colors, and other styles with the following CSS classes.\n\n|!Class |!Description |\n|tgr-node |Style for each node. If you want to change the color of the links inside the node use the `.tgr-node a` selector. |\n|tgr-edge |Style for the SVG path that connects the nodes. The old name was tgr-link. |\n|tgr-arrow |Style for the SVG polyline that draws the arrow at the end of the link |\n"
        },
        "$:/plugins/ihm/tidgraph/readme": {
            "created": "20151024054526558",
            "modified": "20151024065317719",
            "tags": "",
            "title": "$:/plugins/ihm/tidgraph/readme",
            "text": "!!How\nSimply put this in your tiddler:\n\n``<$tidgraph start=\"MyRootTiddler\" />``\n\nThere are other options covered in the [[documentation|$:/plugins/ihm/tidgraph/documentation]].\n\n!!Features\n* No third-party libraries\n* Light weight\n* Rendering of map/graph with HTML5 and SVG (no heavy png or jpg images)\n* Automatic map/graph creation, no need for dragging/connecting/etc\n* Figures out tree-graph by means of tags or links, or custom modes \n* Collapse/expand nodes\n* User defined Node Templates!!\n\n!!Limitations\n* Layout is horizontal from left to right, if needed a vertical layout will be added later\n"
        },
        "$:/plugins/ihm/tidgraph/stylesheet": {
            "tags": "$:/tags/Stylesheet",
            "title": "$:/plugins/ihm/tidgraph/stylesheet",
            "type": "text/css",
            "text": "/*Eliminate border in table and cells*/\n.ihm-tgr-table {\n   border-collapse: collapse;\n   border: none;\n   background-color: transparent;\n   padding: 0;\n   margin: 0;\n}\n\n.ihm-tgr-tablediv {\n   /* We need this margin to prevent spurius vertical scroll\n   * in tgr-container. It needs to have the SAME pixel value\n   * as top and left in tgr-svg-int class so that the SVG\n   * arrows match properly (this assures same origin coordinates\n   * for table and svg)\n   */\n   margin: 10px; \n}\n\n.tgr-container table  td {\n   border: none;\n   background-color: transparent;\n}\n\n/*nice round box around tiddlers*/\n.tgr-container td  a  {\n \n}\n\n.tgr-container {\n   position:relative; \n   left:0px; \n   top:0px; \n   background-color: transparent;\n   overflow: auto; /* This is needed to scroll on big maps */\n   z-index:1;\n}\n.tgr-svg-int { \n\tz-index: -1;\n\tposition:absolute;\n\tbackground-color:transparent;\n\topacity: 1;\n   left: 10px;\n   top: 10px;\n}\n\n/* SVG arrows */\n.ihm-tgr-link {\n   fill: none;\n   stroke-width: 2;\n   stroke: #aeb0b5;\n}\n\n.tgr-edge-weak {\n   stroke-dasharray: 3,5;\n}\n\n.tgr-arrow {\n   fill: #aeb0b5;\n   stroke-width: 0;\n}\n\n.ihm-tgr-node-container {\n   position: relative;\n}\n\n.ihm-tgr-node-container-east {\n   margin: 6px 10px;\n}\n\n.ihm-tgr-node-container-south {\n   margin: 16px 4px;\n   display: inline-block; /*FIXME*/\n}\n\n.ihm-tgr-node-container p {\n   margin-top: 0px;\n   margin-bottom: 0px;\n}\n\n.ihm-tgr-node {\n   background-color: #dce4ef;\n   border-radius: 15px;\n   padding: 0.1em 0.4em;\n   /* border: 0px dashed #cd2026; */\n   box-shadow: 4px 4px 5px #888888;\n   text-align: center;\n   vertical-align: middle;\n   font-size: 1em;\n   color: #0071bc;\n}\n\n/* Collapse feature */\n.ihm-tgr-collapse {\n    position: absolute;\n    cursor: pointer;\n    width: 14px;\n    height: 14px;\n    right: -14px;\n}\n\n.ihm-tgr-collapse-east {\n    top: 50%;\n    transform: translateY(-50%);\n    -ms-transform: translateY(-50%);\n    -webkit-transform: translateY(-50%);\n}\n\n.ihm-tgr-collapse-south {\n    left: 50%;\n    transform: translateX(-50%);\n    -ms-transform: translateX(-50%);\n    -webkit-transform: translateX(-50%);\n}\n\na.ihm-tgr-collapse:hover {\n    text-decoration: none;\n    background: #999999;\n}\n\n/* Vertical layout divs */\n.ihm-tgr-divtable {\n   display: table;\n}\n\n.ihm-tgr-node-group {\n   display: table-row;\n}\n\n.ihm-tgr-node-cell {\n   display: table-cell;\n   vertical-align: top;\n   text-align: center;\n}\n"
        },
        "$:/plugins/ihm/templates/collapse": {
            "created": "20151120174133063",
            "modified": "20151120180705805",
            "tags": "",
            "title": "$:/plugins/ihm/templates/collapse",
            "type": "text/vnd.tiddlywiki",
            "text": "<svg version=\"1.1\"  xmlns=\"http://www.w3.org/2000/svg\"  x=\"0px\"\n\t y=\"0px\" width=\"14px\" height=\"14px\" >\n<circle cx=\"7\" cy=\"7\" r=\"6\"  stroke=\"#aeb0b5\" stroke-width=\"1\" fill=\"#aeb0b5\"/>\n<polyline points=\"4,7 10,7\" fill=\"none\" stroke=\"white\"/>\n</svg>\n"
        },
        "$:/plugins/ihm/templates/expand": {
            "created": "20151120174133063",
            "modified": "20151120180705805",
            "tags": "",
            "title": "$:/plugins/ihm/templates/expand",
            "type": "text/vnd.tiddlywiki",
            "text": "<svg version=\"1.1\"  xmlns=\"http://www.w3.org/2000/svg\"  x=\"0px\"\n\t y=\"0px\" width=\"14px\" height=\"14px\" >\n<circle cx=\"7\" cy=\"7\" r=\"6\"  stroke=\"#aeb0b5\" stroke-width=\"1\" fill=\"#aeb0b5\"/>\n<polyline points=\"4,7 10,7 7,7 7,10 7,4\" fill=\"none\" stroke=\"white\"/>\n</svg>\n"
        },
        "$:/plugins/ihm/tidgraph/utils.js": {
            "text": "/*\\\ntitle: $:/plugins/ihm/tidgraph/utils.js\ntype: application/javascript\nmodule-type: library\n\nInternal utility functions for tidgraph plugin.\n\n\\*/\n(function(){function u(a){var c=a.getBoundingClientRect(),b=document.body,e=document.documentElement,g=c.top-(a.scrollTop||window.pageYOffset||e.scrollTop||b.scrollTop)-(e.clientTop||b.clientTop||0);a=c.left-(a.scrollLeft||window.pageXOffset||e.scrollLeft||b.scrollLeft)-(e.clientLeft||b.clientLeft||0);return{top:g,left:a,width:c.width,height:c.height,right:a+c.width,bottom:g+c.height}}function q(a,c,b){b=b||function(a,b,c){if(a)return!0};a=$tw.utils.parseStringArray(a);for(var e=a.length,g=c.length,\nf=0;f<g;f++)for(var h=0;h<e;h++){var d=$tw.wiki.getTiddler(c[f]);if(d&&(d=d.getFieldString(a[h]),b(d,a[h],c[f])))return d}return\"\"}function x(a){var c=!1;return(a=q(\"_tgr_node_class _tgr_node_class_add\",[a.id,a.template],function(a,e,g){if(a)return c=\"_tgr_node_class_add\"===e?!0:!1,!0}))&&\"tgr-default\"!==a?c?\"ihm-tgr-node tgr-node \"+a:a:\"ihm-tgr-node tgr-node\"}function w(a,c,b){var e;a=u(a);if(\"string\"===typeof b){if(e=document.querySelector(b),null==e)return null}else b instanceof HTMLElement&&(e=\nb);var g=u(e);b=g.bottom-a.top;e=g.left-a.left;var f=g.right-a.left;a=g.top-a.top;g=\"\";switch(c.toUpperCase()){case \"L\":g=[Math.round(e),Math.round(b/2+a/2)];break;case \"R\":g=[Math.round(f),Math.round(b/2+a/2)];break;case \"T\":g=[Math.round(f/2+e/2),Math.round(a)];break;case \"B\":g=[Math.round(f/2+e/2),Math.round(b)]}return g}function y(a,c,b,e,g){var f;a:{var h=u(c),d=u(b);f=h.left+h.width/2;var h=h.top+h.height/2,n=d.left+d.width/2,d=d.top+d.height/2;switch(e){case \"E\":f=4>n-f?[\"R\",\"R\"]:[\"R\",\"L\"];\nbreak a;case \"S\":f=4>d-h?[\"B\",\"B\"]:[\"B\",\"T\"];break a}f=void 0}d=w(a,f[0],c);a=w(a,f[1],b);var m,l,h=10,n=\"\";g&&(n=' class=\"tgr-edge-weak\"');if(null==c||null==b)return error(\"can't connect null element\");if(null==d)return error(\"port not found for \"+c.tagName+\" - \"+c.innerHTML);if(null==a)return error(\"port not found for \"+b.tagName+\" - \"+b.innerHTML);c=Math.abs(a[1]-d[1]);b=Math.abs(a[0]-d[0]);switch(e){case \"E\":return a[1]>d[1]&&(m=c/2),a[1]<d[1]&&(m=-c/2),5>c&&(m=0),\"L\"==f[1]&&(l=-10),\"R\"==f[1]&&\n(l=10,h=20),'<path d=\"M'+d[0]+\",\"+d[1]+\" Q\"+(d[0]+h)+\",\"+d[1]+\"  \"+(d[0]+h)+\",\"+(d[1]+m)+\" Q\"+(d[0]+h)+\",\"+a[1]+\"  \"+(a[0]+l)+\",\"+a[1]+'\"'+n+' marker-end=\"url(#tgr-arrow)\"/>';case \"S\":return a[0]>d[0]&&(l=b/2),a[0]<d[0]&&(l=-b/2),5>b&&(l=0),\"T\"==f[1]&&(m=-10,h=10),\"B\"==f[1]&&(m=10,h=20),'<path d=\"M'+d[0]+\",\"+d[1]+\" Q\"+d[0]+\",\"+(d[1]+h)+\"  \"+(d[0]+l)+\",\"+(d[1]+h)+\" Q\"+a[0]+\",\"+(d[1]+h)+\"  \"+a[0]+\",\"+(a[1]+m)+'\"'+n+' marker-end=\"url(#tgr-arrow)\"/>'}}function v(a,c){var b;switch(c.mode){case \"tagging\":b=\n\"[[\"+a+\"]tagging[]]+\"+c.filter;break;case \"linking\":b=\"[[\"+a+\"]links[]!is[missing]]+\"+c.filter;break;default:b=\"[[\"+a+\"]\"+c.mode+\"]+\"+c.filter}return $tw.wiki.filterTiddlers(b)}function z(a,c,b){switch(b.mode.toLowerCase()){case \"tagging\":return(b=$tw.wiki.getTiddler(a))?b.hasTag(c):!1;default:return b=v(c,b),-1!==b.indexOf(a)}}function A(a,c){function b(b,l,k){h=l;d=b;n=encodeURIComponent(h);m=encodeURIComponent(d);g=document.getElementById(c.id+\"-\"+n);f=document.getElementById(c.id+\"-\"+m);g&&f&&\ne.push(y(a,g,f,c.layout,k))}var e=[],g,f,h,d,n,m;p(c.root,function(a,c,d){(c=a.parent)&&b(a.id,c.id)},{},{skipvisited:!0});for(var l=c.outliers.length,k=0;k<l;k++)b(c.outliers[k][0],c.outliers[k][1],!0);return e.join(\" \")}function p(a,c,b,e){e=e||{};var g=e.done||[],f=e.getCh||function(a){return a.collapse?[]:a.children},h=e.lvl||0,d=void 0===e.skipvisited?!0:e.skipvisited;e.leave=e.leave||!1;if(d&&-1!==g.indexOf(a))return b;g.push(a);f=f(a);d=f.length;b=b||{};e.lvl=h+1;e.done=g;if(!1===c(a,b,h))return e.leave=\n!0,b;for(a=0;a<d;a++)if(b=p(f[a],c,b,e),e.leave)return b;e.lvl--;return b}function B(a,c,b,e){e=e||{};var g=e.getCh||function(a){return a.collapse?[]:a.children},f=e.getId||function(a){return a.id},h=void 0===e.skipvisited?!0:e.skipvisited,d=e.maxdepth||Number.MAX_VALUE;b=b||{};var n=[],m=[],l=[],k=0;n.push(a);l[f(a)]=void 0;do{a=n.length;for(var q=0;q<a;q++){var r=n.shift(),p;p=h?-1===m.indexOf(r)?!1:!0:!1;if(!p&&!1===c(r,l[f(r)],b,k))return b;m.push(r);p=g(r);n=n.concat(p);p&&p.forEach(function(a){var b=\nl[f(a)];b?f(b)!==f(r)&&e.outlier&&e.outlier(a,r):l[f(a)]=r})}k++}while(0!==n.length&&k<=d);return b}function C(a,c){return p(a,function(a,c){c.cnt++;return!0},{cnt:0},{skipvisited:c}).cnt-1}function D(a,c,b){function e(a,b){if(-1!==$tw.utils.parseStringArray(b).indexOf(c.toString()))return!0}b=$tw.utils.parseStringArray(b);var g=q(\"_tgr_node_template\",[a]),f=[];$tw.utils.each(b,function(b){var c=$tw.wiki.getTiddler(b),c=c?c.getFieldString(\"_tgr_node_filter\"):\"\",d=$tw.wiki.filterTiddlers(c);c&&-1===\nd.indexOf(a)&&f.push(b)});0<f.length&&$tw.utils.removeArrayEntries(b,f);g||q(\"_tgr_node_filter\",b,function(b,c,d){c=$tw.wiki.filterTiddlers(b);if(b&&-1!==c.indexOf(a))if(b=$tw.wiki.getTiddler(d).getFieldString(\"_tgr_node_level\")){if(e(d,b))return g=d,!0}else return g=d,!0});g||q(\"_tgr_node_level\",b,function(a,b,c){if(e(c,a))return g=c,!0});if(!g)for(var h=b.length,d=0;d<h;d++){var n=$tw.wiki.getTiddler(b[d]);if(n&&!n.hasField(\"_tgr_node_level\")&&!n.hasField(\"_tgr_node_filter\")){g=b[d];break}}g||(g=\n\"tgr-default\");return g}function t(a,c,b,e){if(!(this instanceof t))throw\"Error: call new tnode(id=\"+c+\")\";this.parent=a;this.id=c;this.children=[];this.collapse=!1;this.widget=e;this.template=void 0;a=D(c,b,e.nodetemplate);\"tgr-default\"!==a&&(this.transcluder=b=\"$:/temp/tidgraph/\"+e.tidtree.id+\"/\"+c,this.template=a,$tw.wiki.addTiddler(new $tw.Tiddler({title:b,text:\"{{\"+c+\"||\"+a+\"}}\"})),-1===e.templatesInUse.indexOf(a)&&e.templatesInUse.push(a))}exports.buildTable=function(a,c){function b(a,b){return $tw.utils.domMaker(a,\n$tw.utils.extend(b,{document:c.document}))}function e(a){var d=encodeURIComponent(a.id),e;var f=a.id;e=$tw.wiki.tiddlerExists(f)?c.nodetitle?q(c.nodetitle,[f]):q(\"caption title\",[f]):f;var g=$tw.wiki.tiddlerExists(a.id)?\"tc-tiddlylink-resolves\":\"tc-tiddlylink-missing\",g=\"tc-tiddlylink \"+g,f=x(a);a.template?a=b(\"div\",{\"class\":f,innerHTML:$tw.wiki.renderTiddler(\"text/html\",a.transcluder)}):(a=b(\"a\",{\"class\":g,text:e,attributes:{href:\"#\"+d}}),a=b(\"div\",{\"class\":f,children:[a]}));return a}function g(a,\nd){var e=1+C(a,!0),f=encodeURIComponent(a.id),g=q(c.tooltip,[a.id]),k;!1===c.nocollapse&&a.children&&0<a.children.length?(k=$tw.wiki.renderTiddler(\"text/html\",\"$:/plugins/ihm/templates/\"+(a.collapse?\"expand\":\"collapse\")).replace(/^<p>/,\"<span>\").replace(/<\\/p>$/,\"</span>\"),k=b(\"span\",{\"class\":\"ihm-tgr-collapse \"+(\"E\"==a.widget.tidtree.layout?\"ihm-tgr-collapse-east\":\"ihm-tgr-collapse-south\")+\" tc-tiddlylink\",innerHTML:k}),$tw.utils.addEventListeners(k,[{name:\"click\",handlerObject:a,handlerMethod:\"collapseClickEvent\"}]),\nk=[d,k]):k=[d];f=b(\"div\",{\"class\":\"ihm-tgr-node-container \"+(\"E\"==a.widget.tidtree.layout?\"ihm-tgr-node-container-east\":\"ihm-tgr-node-container-south\"),children:k,attributes:{id:c.id+\"-\"+f,title:g}});return\"E\"===c.layout?b(\"td\",{attributes:{rowspan:e},children:[f]}):b(\"div\",{attributes:{\"class\":\"ihm-tgr-node-cell\"},children:[f]})}var f;f=\"E\"==c.layout?b(\"table\",{\"class\":\"ihm-tgr-table\",attributes:{id:c.id+\"-table\"}}):b(\"div\",{\"class\":\"ihm-tgr-divtable\",attributes:{id:c.id+\"-table\"}});(function(a){switch(c.layout){case \"E\":p(c.root,\nfunction(d,f,m){m>=c.startat&&(f=e(d),d=g(d,f),d=b(\"tr\",{children:[d]}),a.appendChild(d));return!0},{},{skipvisited:!0});break;case \"S\":p(c.root,function(d,f,m){if(m>=c.startat){var l=e(d),l=g(d,l),k=f.nodegroup[f.nodegroup.length-1];k?m>=f.lastdepth?k.appendChild(l):m<f.lastdepth&&(f.nodegroup.pop(),k=f.nodegroup[f.nodegroup.length-1],k.appendChild(l)):a.appendChild(l);!d.collapse&&0<d.children.length&&(d=b(\"div\",{\"class\":\"ihm-tgr-node-group\"}),f.nodegroup.push(d),l.appendChild(d))}f.lastdepth=m;\nreturn!0},{nodegroup:[],lastdepth:-1},{skipvisited:!0})}})(f);return f};exports.error=function(a){return'<span style=\"color:green; font-size:1.5em\">\\u26a0 Tidgraph: </span><span style=\"color:red\">'+a+\"</span>\"};exports.buildSVG=function(a,c){var b=document.getElementById(c.id+\"-table\");if(b)return getComputedStyle(b),'<svg  xmlns=\"http://www.w3.org/2000/svg\" height=\"'+a.offsetHeight+'px\" width=\"'+a.offsetWidth+'px\" style=\"overflow: visible\"><g class=\"ihm-tgr-link tgr-link tgr-edge\" style=\"overflow: visible\"> <defs> <marker id=\"tgr-arrow\" viewBox=\"0 0 10 10\" refX=\"1\" refY=\"5\" markerUnits=\"strokeWidth\" orient=\"auto\" markerWidth=\"8\" markerHeight=\"6\"> <polyline class=\"ihm-tgr-arrow tgr-arrow\" points=\"0,0 10,5 0,10 0,5\" style=\"opacity:1;\" /></marker></defs> '+\nA(a,c)+\"</g> </svg>\"};exports.isDescendant=function(a,c,b){if(z(a,c,b))return!0;var e=!1;p(c,function(b,c,h){if(b===a)return e=!0,!1},{},{skipvisited:!0,getCh:function(a){return v(a,b)}});return e};exports.makeTidTree=function(a,c,b){b=b||{};var e=!1;c.outliers=[];var g=new t(void 0,a,0,b.widget);B(a,function(a,c,d,e){if(c){a:{for(var g=d.visited,l=g.length,k=0;k<l;k++)if(g[k].id===c){c=g[k];break a}c=void 0}a=c.addChild(a,e,b.widget);d.visited.push(a)}return!0},{visited:[g]},{getId:function(a){return a},\ngetCh:function(a){return v(a,c)},maxdepth:c.maxdepth,skipvisited:!0,outlier:function(a,b){e=!1;$tw.utils.each(c.outliers,function(c){c[0]===a&&c[1]===b&&(e=!0)});e||c.outliers.push([a,b])}});return g};t.prototype.addChild=function(a,c,b){a=new t(this,a,c,b);this.children.push(a);return a};t.prototype.toString=function(){return\"tnode(id=\"+this.id+\")\"};t.prototype.collapseClickEvent=function(a){this.collapse=!this.collapse;this.widget.paint()}})();\n",
            "title": "$:/plugins/ihm/tidgraph/utils.js",
            "type": "application/javascript",
            "module-type": "library"
        },
        "$:/plugins/ihm/tidgraph/tidgraph.png": {
            "created": "20151024064703806",
            "modified": "20151024064720670",
            "title": "$:/plugins/ihm/tidgraph/tidgraph.png",
            "type": "image/png",
            "text": "[encoded data, 4996 characters]\n"
        },
        "$:/plugins/ihm/widgets/tidgraph.js": {
            "text": "/*\\\ntitle: $:/plugins/ihm/widgets/tidgraph.js\ntype: application/javascript\nmodule-type: widget\n\nTidgraph widget to render HTML5/SVG graph of tiddlers\n\n\\*/\n(function(){var e=require(\"$:/core/modules/widgets/widget.js\").widget,c=function(b,f){this.initialise(b,f)},d=require(\"$:/plugins/ihm/tidgraph/utils.js\");c.prototype=new e;c.prototype.render=function(b,f){this.tidtree&&this.delTempTiddlers();this.parentDomNode=b;this.nextSiblingDomNode=f;this.computeAttributes();this.execute();-1===[\"tagging\",\"linking\"].indexOf(this.mode)&&(this.mode=$tw.wiki.getTiddlerText(\"$:/config/tidgraph/modes/\"+this.mode)||this.mode);this.tidtree=[];this.tidtree.mode=this.mode;\nthis.tidtree.maxdepth=this.maxdepth;this.tidtree.startat=this.startat;this.tidtree.nodetitle=this.nodetitle;this.tidtree.tooltip=this.tooltip;this.tidtree.filter=this.filter;this.tidtree.nocollapse=this.nocollapse;this.tidtree.document=this.document;this.tidtree.nodetemplate=this.nodetemplate;this.tidtree.layout=this.layout;this.templatesInUse=$tw.utils.parseStringArray(this.nodetemplate);this.tidtree.id=(new Date).valueOf();if($tw.wiki.getTiddler(this.startTid)){this.div=this.document.createElement(\"div\");\nthis.div.className=\"tgr-container tgr\";this.tablediv=this.document.createElement(\"div\");this.tablediv.className=\"ihm-tgr-tablediv\";this.table=void 0;this.div.appendChild(this.tablediv);this.svgdiv=this.document.createElement(\"div\");this.svgdiv.className=\"tgr-svg-int\";this.div.appendChild(this.svgdiv);this.parentDomNode.insertBefore(this.div,this.nextSiblingDomNode);this.domNodes.push(this.div);this.tidtree.root=d.makeTidTree(this.startTid,this.tidtree,{widget:this});this.paint();var a=this,c=function(){a.svgdiv.innerHTML=\nd.buildSVG(a.tablediv,a.tidtree);a.oldresize&&a.oldresize()},e=function(){a.svgdiv.innerHTML=d.buildSVG(a.tablediv,a.tidtree)};this.div.onscroll=function(){a.scroll_to||clearTimeout(a.scroll_to);a.scroll_to=setTimeout(e,100)};this.onresize_updated||(window.onresize&&void 0==this.oldresize&&(this.oldresize=window.onresize),window.onresize=function(){a.resize_to||clearTimeout(a.resize_to);a.resize_to=setTimeout(c,100)},this.onresize_updated=!0)}};c.prototype.delTempTiddlers=function(){var b=$tw.wiki.filterTiddlers(\"[prefix[$:/temp/tidgraph/\"+\nthis.tidtree.id+\"]]\");$tw.utils.each(b,function(b){$tw.wiki.deleteTiddler(b)})};c.prototype.paint=function(){this.sidebar=$tw.wiki.getTiddlerText(\"$:/state/sidebar\");var b=d.buildTable(this.startTid,this.tidtree);this.table?this.tablediv.replaceChild(b,this.table):this.tablediv.appendChild(b);this.svgdiv.innerHTML=d.buildSVG(this.tablediv,this.tidtree);this.table=b};c.prototype.execute=function(){this.startTid=this.getAttribute(\"start\");this.mode=this.getAttribute(\"mode\",\"tagging\");this.maxdepth=\nparseInt(this.getAttribute(\"maxdepth\",\"10\"));this.startat=this.getAttribute(\"startat\",\"0\");this.nodetitle=this.getAttribute(\"nodetitle\");this.tooltip=this.getAttribute(\"tooltip\",\"summary\");this.filter=this.getAttribute(\"filter\",\"[!is[system]]\");this.nocollapse=this.hasAttribute(\"nocollapse\");this.nodetemplate=this.getAttribute(\"nodetemplate\",\"\");this.layout=this.getAttribute(\"layout\",\"E\");-1==[\"E\",\"S\"].indexOf(this.layout)&&(this.layout=\"E\")};c.prototype.refresh=function(b){var c=!1,a;this.computeAttributes();\nthis.execute();for(a in b)if((b=document.getElementById(this.tidtree.id+\"-\"+encodeURIComponent(a))||d.isDescendant(a,this.startTid,this.tidtree)||-1!==this.templatesInUse.indexOf(a))||(b=(b=$tw.wiki.getTiddler(a))&&b.hasTag(\"$:/tags/Stylesheet\")?!0:!1),b||-1!==a.indexOf(\"$:/config/tidgraph/modes\")){c=!0;break}$tw.wiki.getTiddlerText(\"$:/state/sidebar\")!==this.sidebar&&(c=!0);return c?(this.refreshSelf(),!0):!1};exports.tidgraph=c})();\n",
            "title": "$:/plugins/ihm/widgets/tidgraph.js",
            "type": "application/javascript",
            "module-type": "widget"
        }
    }
}