changeset 141:310290f95787

cleanup; now it really doesnt do anything
author Jeff Hammel <k0scist@gmail.com>
date Mon, 30 Mar 2015 12:33:26 -0700
parents 9acea302899a
children 6747ce2bb090
files numerics/bar.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/numerics/bar.py	Mon Mar 30 10:45:47 2015 -0700
+++ b/numerics/bar.py	Mon Mar 30 12:33:26 2015 -0700
@@ -14,8 +14,7 @@
 import argparse
 import os
 import sys
-import tempfile
-from .data import transpose
+import tempita
 from .manipulate import ManipulationParser
 from collections import OrderedDict
 
@@ -25,8 +24,9 @@
 # TODO: own module
 here = os.path.dirname(os.path.abspath(__file__))
 templates = os.path.join(here, 'templates')
-template = os.path.join(here, 'bar.d3.html')
-d3 = os.path.join(here, 'javascript', 'd3.v3.min.js')
+bar_template = os.path.join(here, 'bar.d3.html')
+with open(os.path.join(here, 'javascript', 'd3.v3.min.js')) as f:
+    d3 = f.read()
 
 
 def bar_chart(data, output, title=None):
@@ -38,6 +38,7 @@
     """
     # TODO:  abstract this to a plot class
 
+    template = None   # TODO
 
 class BarChartParser(ManipulationParser):
     """command line options parser for bar charts"""
@@ -75,9 +76,11 @@
     # ensure a mapping is given
     if len(data) != 1:
         raise NotImplementedError("TODO")
+    else:
+        data = data[0]
 
     # generate bar chart
-#    bar_chart(data, parser.plot_filename(), title=options.title)
+    bar_chart(data, parser.plot_filename(), title=options.title)
 
 
 if __name__ == '__main__':