Commits

Ralph Bean committed bdf1a98

Style tips for sample of treemap.

Comments (0)

Files changed (1)

tw2/rrd/samples.py

         ]
     ]
 
+
+    Tips = {
+        'enable' : True,
+        'offsetX' : 20,
+        'offsetY' : 20,
+        'onShow' : twc.JSSymbol(src="""
+            (function(tip, node, isLeaf, domElement) {
+                   var html = '<div class="tip-title">' + node.name
+                     + '</div><div class="tip-text">';
+                   var data = node.data;
+                   if(data['$area']) {
+                     html += ' hits per second:  ' + data['$area'].toFixed(2);
+                   }
+                   tip.innerHTML =  html;
+            })
+            """)
+    }
+
+    onCreateLabel = twc.JSSymbol(src="""
+        (function(domElement, node){
+           domElement.innerHTML = node.name;
+           var style = domElement.style;
+           style.display = '';
+           style.border = '1px solid transparent';
+           style.color = '#000000';
+           domElement.onmouseover = function() {
+             style.border = '1px solid #9FD4FF';
+           };
+           domElement.onmouseout = function() {
+             style.border = '1px solid transparent';
+           };
+        } )
+        """)
+
+
+
 class DemoNestedRRDProtoCirclePackingWidget(
     tw2.rrd.NestedRRDProtoCirclePackingWidget):
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.