# HG changeset patch # User Jeff Hammel # Date 1427744006 25200 # Node ID 310290f957873e6b1aaca90f7b6761a00bffc68e # Parent 9acea302899a6f4fcb859c4d2f62d7a9c9aeae4f cleanup; now it really doesnt do anything diff -r 9acea302899a -r 310290f95787 numerics/bar.py --- 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__':