Commits

Ralph Bean committed 7c326fc

initial commit

  • Participants

Comments (0)

Files changed (24)

+build
+tw2.jit.egg-info
+*.pyc
+*.swp
+virtualenv-tw2.jit
+tw2core
+tw2devtools
+README.pdf
+dist
+*.egg
+include README.rst
+recursive-include tw2/protovis/templates *
+recursive-include tw2/protovis/static *
+tw2.protovis
+=======
+
+:Author: Ralph Bean <ralph.bean@gmail.com>
+
+.. comment: split here
+
+.. _toscawidgets2 (tw2): http://toscawidgets.org/documentation/tw2.core/
+.. _protovis: http://vis.stanford.edu/protovis/
+
+tw2.protovis is a `toscawidgets2 (tw2)`_ wrapper for `protovis`_.
+
+Live Demo
+---------
+
+Peep the `live demonstration <http://craftsman.rc.rit.edu/module?module=tw2.protovis>`_.
+
+Links
+-----
+
+You can `get the source from github <http://github.com/ralphbean/tw2.protovis>`_,
+check out `the PyPI page <http://pypi.python.org/pypi/tw2.protovis>`_, ant
+d
+report or look into `bugs <http://github.com/ralphbean/tw2.protovis/issues/>`_.
+
+Description
+-----------
+
+`toscawidgets2 (tw2)`_ aims to be a practical and useful widgets framework
+that helps people build interactive websites with compelling features, faster
+and easier. Widgets are re-usable web components that can include a template,
+server-side code and JavaScripts/CSS resources. The library aims to be:
+flexible, reliable, documented, performant, and as simple as possible.
+
+The JavaScript InfoVis Toolkit (`protovis`_) is a javascript library that
+provides web standard based tools to create interactive data visualizations
+for the Web.  It is pretty, interactive, and fast.
+
+This module, tw2.protovis, provides `toscawidgets2 (tw2)`_ widgets that render `protovis`_ data visualizations.
+
+
+Sampling tw2.protovis in the WidgetBrowser
+-------------------------------------
+
+The best way to scope out ``tw2.protovis`` is to load its widgets in the 
+``tw2.devtools`` WidgetBrowser.  To see the source code that configures them,
+check out ``tw2.protovis/samples.py``
+
+To give it a try you'll need git, mercurial, python, and virtualenv.  Run:
+
+    ``git clone git://github.com/ralphbean/tw2.protovis.git``
+
+    ``cd tw2.protovis``
+
+The following script will set up all the necessary tw2 dependencies in a
+python virtualenv:
+
+    ``./develop-tw2-destroy-and-setup.sh``
+
+The following will enter the virtualenv and start up ``paster tw2.browser``:
+
+    ``./develop-tw2-start.sh``
+
+...and browse to http://localhost:8000/ to check it out.
+
+
+

File development-deps/develop-tw2-destroy-and-setup.sh

+#!/bin/bash -e
+
+devbase=development-deps
+venv=$devbase/virtualenv-tw2.jit
+$(
+    rm -rf $venv
+) || echo "Did not destroy $venv"
+
+virtualenv $venv --no-site-packages
+
+source $venv/bin/activate
+pushd $devbase
+hg clone http://bitbucket.org/paj/tw2core || echo "tw2core exists."
+hg clone http://bitbucket.org/paj/tw2devtools || echo "tw2devtools exists."
+pushd tw2core;hg pull;python setup.py develop;popd
+pushd tw2devtools;hg pull;python setup.py develop;popd
+popd
+

File development-deps/develop-tw2-start.sh

+#!/bin/bash
+
+devbase=development-deps
+venv=$devbase/virtualenv-tw2.jit
+source $venv/bin/activate
+
+python setup.py develop && paster tw2.browser
+
+
+
+from setuptools import setup, find_packages
+
+f = open('README.rst')
+long_description = f.read().strip()
+long_description = long_description.split('split here', 1)[1]
+f.close()
+
+setup(
+    name='tw2.protovis',
+    version='0.1.a0',
+    description='toscawidgets2 wrapper for the stanford protovis toolkit',
+    long_description=long_description,
+    author='Ralph Bean',
+    author_email='ralph.bean@gmail.com',
+    url='',
+    install_requires=[
+        "tw2.core",
+        "genshi",
+        "mako",
+        ],
+    packages=find_packages(exclude=['ez_setup']),
+    namespace_packages = ['tw2'],
+    zip_safe=False,
+    include_package_data=True,
+    entry_points="""
+        [tw2.widgets]
+        # Register your widgets so they can be listed in the WidgetBrowser
+        tw2.protovis = tw2.protovis
+    """,
+    keywords = [
+        'toscawidgets.widgets',
+    ],
+    classifiers = [
+        'Development Status :: 3 - Alpha',
+        'Environment :: Web Environment',
+        'Environment :: Web Environment :: ToscaWidgets',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+        'Topic :: Software Development :: Widget Sets',
+        'Intended Audience :: Developers',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Programming Language :: JavaScript',
+    ],
+)

File tests/__init__.py

Empty file added.

File tests/test_widgets.py

+from webob import Request
+from webob.multidict import NestedMultiDict
+from tw2.core.testbase import assert_in_xml, assert_eq_xml, WidgetTest
+from nose.tools import raises
+from cStringIO import StringIO
+from tw2.core import EmptyField, IntValidator, ValidationError
+from cgi import FieldStorage
+import formencode
+
+import webob
+if hasattr(webob, 'NestedMultiDict'):
+    from webob import NestedMultiDict
+else:
+    from webob.multidict import NestedMultiDict
+
+import tw2.protovis.widgets as w
+
+# TODO -- test 'em all!

File tw2/__init__.py

+__import__('pkg_resources').declare_namespace(__name__)

File tw2/protovis/__init__.py

+"""
+This package contains the basic protovis widgets.
+
+Get this source from http://github.com/ralphbean/tw2.protovis
+
+Protovis itself can be found here:  http://vis.stanford.edu/protovis/
+"""
+
+__basename__ = "protovis"
+__version__ = "3.2"
+
+from widgets import *

File tw2/protovis/samples.py

+""" Samples of how to use tw2.jit
+
+Each class exposed in the widgets submodule has an accompanying Demo<class>
+widget here with some parameters filled out.
+
+The demos implemented here are what is displayed in the tw2.devtools
+WidgetBrowser.
+"""
+

File tw2/protovis/static/protovis/3.2/.DS_Store

Binary file added.

File tw2/protovis/static/protovis/3.2/LICENSE

+Copyright (c) 2010, Stanford Visualization Group
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+  * Neither the name of Stanford University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File tw2/protovis/static/protovis/3.2/README

+Protovis v3.2
+
+For documentation, see http://protovis.org.
+For development, see http://gitorious.org/protovis.