1. Ralph Bean
  2. tw2.d3

Commits

Ralph Bean  committed e13b348 Merge

Merge branch 'release/0.0.6'

  • Participants
  • Parent commits 74d1267, 099946c
  • Branches default

Comments (0)

Files changed (2)

File setup.py

View file
 
 setup(
     name='tw2.d3',
-    version='0.0.5',
+    version='0.0.6',
     description='toscawidgets2 wrapper for d3 (data-driven documents)',
     long_description=long_description,
     author='Ralph Bean',

File tw2/d3/static/ext/bar.js

View file
 
 $.extend(tw2.d3, {
     util: {
-        filter: function(data) {
+        filter: function(data, epsilon) {
             // Generic utility.  Remove elements with 0 value from the list.
             // Equivalent to the following python:
             //     >>> data = [d for d in data if d.value > epsilon]
             }
             return data;
         },
+        remove_key: function(selector, key) {
+            var i = tw2.d3.util.index_of(selector, key);
+            tw2.store[selector].data.splice(i, 1);
+        },
         schedule_bump_random: function(selector, interval) {
             // Schedule randomly bump data points for `selector`
             setInterval(function() {
                 tw2.store[selector].data[index].value + 1;
             }
         },
+        keys: function(selector) {
+            var keys = [];
+            for (var i = 0; i < tw2.store[selector].data.length; i++) {
+                keys.push(tw2.store[selector].data[i].key);
+            }
+            return keys;
+        },
     },
 
     bar: {
                 epsilon
             );
         },
+        schedule_decay: function(selector, amount, interval, epsilon) {
+            setInterval(function() {
+                tw2.d3.bar.decay_amount(selector, amount, epsilon);
+            }, interval);
+        },
         schedule_halflife: function(selector, halflife, interval, epsilon) {
             setInterval(function() {
                 // halflife means 'In this many milliseconds, the value should