django-dataplot 0.5

2008-03-04 Thread Toby Dylan Hocking

I just released a new version of my django-based plotting framework to 
http://sf.net/projects/django-dataplot. Here's one example of making a 
plot in an app that tracks goals in a series of soccer games:

from dataplot import plotmodels as models
class Player(models.Model):
 name=models.CharField(max_length=100)
 goals_per_game=models.FloatField()
 win_percent=models.FloatField()
 MANAGER_DATAPLOTS=[
 (R.SquareScatter,{'get_plot_args':{
 'x':'goals_per_game',
 'y':'win_percent',
 'ann':'name',
 'main':"Does scoring a lot of goals make you win?"
 }})]

Django-dataplot takes care of the rest so you can just put this in your 
template:

{{player.objects.SquareScatter.to_html}}

and a scatterplot image will show up on the web page, representing each 
player as a point labeled by name, with average goals_per_game on the x 
axis and win_percent on the y axis. So you can use the plot to easily tell 
if high scoring means high likelihood of winning.

There are many other examples, and the system is quite extensible, so I 
hope it will be able to help out some people in the community. I would 
appreciate anyone who is interested in making plots/graphs on 
Django-backed websites to download django-dataplot from sourceforge and 
email me back with feedback and suggestions. Thanks for your time!

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Inheritance

2007-12-27 Thread Toby Dylan Hocking

>> I have a lot of models for classifications. All of them have similar
>> attributes. When I try to use inheritance in the models design, the
>> admin interface doesn't work with ForeignKey fields.
>>
>> Example:
>>
>> class BasicModel(models.Model):
>> name=models.CharField(maxlength=30)
>> def __str__(self):
>> return self.name
>>
>> class Reference(BasicModel):
>> class Admin:
>> pass
>>
>> class Data(BasicModel):
>> ref = models.ForeingKey(Reference)
>> class Admin:
>> pass
>>
>> Here, the ref field doesn't show all of their records in the Admin Add
>> Data form.
>
> You will likely run into all kinds of problems.  Model Inheritance is
> currently not supported in Django.  There has been discussions and
> proposals on the topic so I suspect that it will be available at some
> point.  See here:
>
> http://code.djangoproject.com/wiki/ModelInheritance

Also you may try to use multiple inheritance, which has worked for me for 
extending models, i.e.

class YourModel(YourOtherModel,models.Model):

Not sure if it will work for your purpose, but give it a try!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to handle additional column in table for ManyToManyField

2007-09-28 Thread Toby Dylan Hocking

Hi,

> the  ManyToManyField creates additional refdb_reference_authors table
> in database with columns  "id", "reference_id", "author_id". now for
> every Reference I can assign one or more Author with a link keeping in
> this table. but additionally I'd like to keep the order of Author for
> every reference (it is important for scientific publications),

What you want to do is the following. Instead of using a ManyToManyField, 
create an intermediate table:

class AuthorLoc(models.Model):
   author=models.ForeignKey(Author)
   position=models.IntegerField()
   reference=models.ForeignKey(Reference,edit_inline=True)

   class Meta:
 ordering=(('position'))

Then when you want to search authors or references you can ...

# Get all authors for ref with id ref_id
as=Author.objects.filter(authorloc__reference__id__exact=ref_id).distinct()
# Get all refs for author with id author_id
Reference.objects.filter(authorloc__author__id__exact=author_id).distinct()
# Get all papers author with author_id has first-authored
as.filter(authorloc__reference__position__exact=1)
# etc...

Hope this helps.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Best Practices to Make your Apps Portable

2007-07-27 Thread Toby Dylan Hocking

> I just added it to the wiki:
>
> http://code.djangoproject.com/wiki/BestPracticesToWorkWith3rdPartyAppsAndMakingYoursPortable

Looking there, I think you made a typo. The directory diagrams for 
specific apps and generic apps are the same.

Furthermore, I can see how this system worked for you under the 
constraints that your system/team imposed. However, I think that having 
your apps (specific or general) simply live on the PythonPath is more 
elegant, more DRY, and more in tune with what Django already does. 
Remember when you set up Django and had to configure the PythonPath in the 
apache http.conf file?

Consequently, I appreciate your idea as a contribution to the Django 
developer community, but I think that recommending it as a "best practice" 
is rather misleading.


>
> It's available in the resources page.
>
> http://code.djangoproject.com/wiki/DjangoResources
>
>
> Best,
>
> Sebastian Macias
>
>
> On Jul 26, 12:36 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> Sebastian Macias wrote:
>>> Thanks a lot for the feedback everyone.
>>
>>> I have come up a perfect setup  and folder structure  (at least
>>> perfect for my needs) that will allow me to work on generic apps and
>>> project specific apps efficiently and just wanted to share it with
>>> everyone in case it can save a anyone a headache.
>>
>>> *Folder structure for a django project*
>>
>>> /var/django_root/my_project_name/
>>>urls.py
>>>settings.py
>>>apps/
>>>my_project_specific_app_1/
>>>my_project_specific_app_2/
>>>my_project_specific_app_3/
>>
>>> *Folder structure for generic/portable apps*
>>
>>> /var/django_root/shared/
>>>my_generic_portable_app_1/
>>>my_generic_portable_app_2/
>>>my_generic_portable_registration_app/
>>
>>> *Development Setup*
>>
>>> I added the following to the top  of my_project_name/settings.py so it
>>> appends the portable/generic apps folder to the python path.
>>
>>> DEVELOPMENT = True
>>
>>> if DEVELOPMENT:
>>> import sys
>>> sys.path.append('/var/django_root/shared')
>>
>>> For extended convenience I symlinked my portable/generic apps folder
>>> to my django project so I can quickly make changes to my generic apps
>>> without having to go outside my django project folder structure
>>
>>> ln -s `pwd`/var/django_root/shared /var/django_root/my_project_name/
>>> shared
>>
>>> *Production Setup*
>>
>>> My Apache conf file:
>>
>>> 
>>>   ServerName championsound.local
>>>   ServerAlias *.championsound.local
>>>   SetHandler python-program
>>>   PythonPath "['/var/django_root', '/var/django_root/shared'] +
>>> sys.path"
>>>   PythonHandler django.core.handlers.modpython
>>>   SetEnv DJANGO_SETTINGS_MODULE championsound.settings
>>>   PythonDebug On
>>> 
>>
>>> Note how '/var/django_root' and '/var/django_root/shared' are added to
>>> the PythonPath
>>
>>> Enjoy it!
>>
>>> Sebastian Macias
>>
>> Can you post this to the wiki?  or tell me to.  one of us should. :)
>>
>> Carl K
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django.contrib.dataplot 0.3

2007-07-24 Thread Toby Dylan Hocking

Hi Russ,

Thanks for the advice. I can certainly change the name to 
django-dataplot.

However, I thought that the contrib/ subdirectory of the django 
distribution would be the most natural place to install it, since it is an 
add-on app that is meant to be used by other apps. Can you suggest another 
location that would be more appropriate and/or less "confusing"?

Furthermore, is there a formal process for integrating into 
django.contrib? How has it worked in the past?

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Tue, 24 Jul 2007, Russell Keith-Magee wrote:

>
> On 7/24/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>>
>> If any of you are interested in creating data graphics for your web apps,
>> try checking out the new version of my plotting framework,
>> django.contrib.dataplot. Here is an example of what it can do:
>
> Hi Toby,
>
> Looks like a great app! Plotting/charting is a feature that comes up
> regularly on the list - I'm sure many people will find this useful.
>
> However, if I could make a quick suggestion: django.contrib is the
> namespace used by Django applications that ship with Django. Promotion
> into django.contrib is something that occasionally happens when a
> popular application with general appeal becomes mature enough.
>
> It's potentially quite confusing if external applications with no
> formal affiliation with Django start using the same namespace.
>
> The informal convention being followed by other Django applications is
> to prefix your app name with 'django-'
>
> For example:
> http://code.google.com/p/django-registration/
> http://code.google.com/p/django-openid/
>
> Keep up the great work!
>
> Yours,
> Russ Magee %-)
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django.contrib.dataplot 0.3

2007-07-24 Thread Toby Dylan Hocking

Hi all,

If any of you are interested in creating data graphics for your web apps, 
try checking out the new version of my plotting framework, 
django.contrib.dataplot. Here is an example of what it can do:

http://www.ocf.berkeley.edu/~tdhock/dataplot-example/

There are builtin plots that you can use with just a few lines of python 
code, or for more specific applications, you can write your own code using 
R or matplotlib. Source code is here, with instructions in the doc/ 
subdirectory:

http://www.ocf.berkeley.edu/~tdhock/dataplot-0.3.tgz

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Bulk data upload

2007-07-18 Thread Toby Dylan Hocking

> What about CSV?  You can export from Excel as CSV pretty easily and it's a 
> fairly easy format to parse in python...

Either that or tab-delimited text. I have a django app that does bulk data 
upload from the admin interface according to the following protocol.

1. Users make their bulk upload data tables in excel.

2. They log onto the Django admin site, where I have a special ExcelImport 
model set up --- it just has a TextField where the data goes.

3. They copy the entire table from excel and paste it in the TextField, 
then click Save.

4. I have a custom save() method for the ExcelImport class that processes 
the data and creates the related objects.

>
> Thanks,
>
> Dave
>
> -- 
> David Reynolds
> [EMAIL PROTECTED]
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Generating graphs from db data and displaying results using Django?

2007-07-12 Thread Toby Dylan Hocking

Hi Frank,

> Wouldn't it be possible to adapt ZSVG_Graph to Django?

Thanks for the suggestion. In fact, I was already considering SVG output 
as one of the modes of django.contrib.dataplot. One of the cool things 
about django.contrib.dataplot is its extensibility -- getting a new type 
of plot, say an SVG scatterplot with id number labels and hyperlinks to 
the related detail pages, is as easy as writing a new plotting function in 
R. To that end, an SVG driver for R exists already:

http://www.stat.auckland.ac.nz/~paul/Talks/gridSVG/slide1.html

So I was planning on using R and the gridSVG package for SVG output 
functionality. I don't know how useful a contribution ZSVG_Graph would be 
to our Django community, since it seems that its last update was over 2 
years ago:

http://sourceforge.net/project/showfiles.php?group_id=9295&package_id=92256

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Thu, 12 Jul 2007, Frank Tegtmeyer wrote:

>
> Toby Dylan Hocking <[EMAIL PROTECTED]> writes:
>
>> Thanks for the input, Jeremy. I'd definitely be open to using PIL instead
>> of ImageMagick.
>
>> Do you know of a way that PIL can be used to convert PDF to PNG? A quick
>> google search reveals this pdf
>
>
> Link: http://www.zope.org/Members/aho/ZSVG_Graph
>
> Regards, Frank
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Generating graphs from db data and displaying results using Django?

2007-07-12 Thread Toby Dylan Hocking

Hi Silas,

> If it is a personal site take a look at http://www.maani.us/xml_charts/
> they have some really nice charts that are flash based.
> All the data is sent via xml.

Thanks for your input. However, I don't like the idea of forcing people to 
use flash to look at plots, since (unlike Django, R, Python, and RPy) 
Flash is not free software. Furthermore, it seems that there are no 
advanced statistical capabilities available with the XML/SWF Charts 
package, locking you into the particular charts and data analysis methods 
that the package author has written.

One of the major benefits to using R is that it is a programming language 
with many extension packages for different types of data analysis. It's 
really easy to do simple statistical tests and more advanced statistical 
modeling in R, and have the results displayed on your plot (or returned 
back to Python). Furthermore, the modes of plotting are much more 
customizable, i.e.

http://www.ocf.berkeley.edu/~tdhock/plot-history/
http://www.r-project.org/screenshots/screenshots.html

The idea with django.contrib.dataplot is that it provides the framework 
for interfacing with Django, and some default generic plot types (Scatter, 
TimeSeries, etc. similar to XML/SWF Charts), but you can pop in your own 
plotting code and have a totally custom plot too, if you need to.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Thu, 12 Jul 2007, Silas wrote:

>
>
>
> On Jul 10, 6:03 pm, Chris Rich <[EMAIL PROTECTED]> wrote:
>> Hey all,
>>   So, I'm a beginner here with Django/webdesign/database stuff/all the
>> rest of it and I may be getting ahead of myself.  I am currently
>> getting my feet wet in the Django environment, but I eventually want
>> to graph/calculate averages on some of the values in my database.  I
>> would like to display the results in my Django page and maybe even
>> make it so I could change some of the graph parameters using some
>> simple Django forms.  Any ideas on the best way to go about this?
>> Thanks in advance.
>>
>> Chris
>
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hey Jeremy,

Thanks for the input. You are correct: I am running a recent copy of 
django from SVN on the primary machine I am using to develop 
django.contrib.dataplot.

In fact, I ran into the same problem that you did when I tried to port 
django.contrib.dataplot to a different machine -- a machine running Django 
0.95. After realizing the existence of the new backwards-incompatible 
changes, I was able to get the django.contrib.dataplot.bike demo app 
working on my old system by simply adding the max_digits and 
decimal_places arguments to the bike/models.py FloatFields. Another 
solution would have been to upgrade the django libraries to the new trunk 
versions.

Again, thanks for trying out my library. I'm anxious to hear if you're 
able to get it working. Once you are able to get the bike app working on 
your system, it should be straightforward to translate the design 
paradigms to your plotting application.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Jeremy Dunck wrote:

>
> On 7/11/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>> If you still need help with making data-driven plots, why don't you check
>> out my new Django package --- I'd like some testers and comments.
>
> Initial reaction-- sweet!
>
> After linking dataplot into my contribs dir and adding both dataplot
> and dataplot.bike in my INSTALLED_APPS, I get this:
>
> [EMAIL PROTECTED]:~/work/pegasus/b-schools$ ~/django-admin.py syncdb
> RHOME= /usr/lib/R
> RVERSION= 2.4.1
> RVER= 2041
> RUSER= /home/jdunck
> Loading Rpy version 2041 .. Done.
> Creating the R object 'r' ..  Done
> Error: Couldn't install apps, because there were errors in one or more models:
> bike.ride: "distance": FloatFields require a "decimal_places" attribute.
> 
>
> A quick check indicates that this is because of a backwards incompat in 
> Django:
> http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#RenamedFloatFieldtoDecimalField
>
> I guess you're running on latest trunk?
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hi Ben,

I see what you're doing now. There are a couple things I should mention.

First of all, you are right: getattr(r,'generic.scatter.plot') is not the 
same as typing r.generic.scatter.plot -- instead, it invokes the 
__getattr__ method of r, and looks for something by that name in the R 
namespace. Having found nothing, it raises an exception. If it did find 
something -- you'd have to rplot.source_for_function() or 
r.source("/path/to/generic.scatter.plot.R") first -- it would return the 
function, and assign it to r.generic_scatter_plot (rpy automatically 
translates R dots . to python underscores _ in variable names).

It also looks like our package versions are significantly different. RPy 
is notoriously touchy about what particular package versions you are 
using, so that may be the cause of django.contrib.dataplot's failure on 
your system. But despite the differences in package versions, I bet that 
if you source the R code first, you will be able to execute the getattr 
properly, i.e.

>>> from rpy import r
>>> r.source("/usr/local/lib/python2.4/site-packages/django/contrib/dataplot/R/generic.scatter.plot.R")
{'visible': False, 'value': }
>>> r.generic_scatter_plot


However, the whole point of django.contrib.dataplot is that it takes care 
of these details for you ---

>>> from django.contrib import dataplot
>>> plot=dataplot.Scatter('myscatterplot',fun_to_get_scatter_data)
>>> plot.to_html()

Have you tried to get the demo bike app (django.contrib.dataplot.bike) to 
work? If you are able to get those simple examples working, it should be 
straightforward to translate the design paradigm to your problems.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Thu, 12 Jul 2007, Ben Ford wrote:

> Hi Toby,
> My versions are:
> R:2.4.0
> Python:   2.5.1
> Rpy:1.0-RC2
>
> Sorry I wasn't very clear earlier... I imported r into ipython to have a
> play with it and see what happens. I tried getattr(r,' generic.scatter.plot')
> which didn't work - I'm under the impression that getattr won't work with
> dotted notation like that if you're doing normal object lookup, am I right
> in saying that r does it differently to python? So i tried getattr(r,
> 'generic') and that didn't work either. The error I get is:
>> Error in get(x, envir, mode, inherits) : variable "generic.time.series"
> was not found
> I tried it with underscores too and I got exactly the same message...
>
> In fact just having looked through the source and having a play with rpy it
> seems that there are bugs all over the place:
>
>>>> from rpy import r
> RHOME= /usr/lib/R
> RVERSION= 2.4.0
> RVER= 2040
> RUSER= /home/ben
> Loading Rpy version 2040 .. Done.
> Creating the R object 'r' ..  Done
>>>> r
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/usr/lib/python2.5/site-packages/rpy.py", line 307, in __repr__
>Rver = self.__getitem__('R_version_string')
>  File "/usr/lib/python2.5/site-packages/rpy.py", line 290, in __getitem__
>obj = self.__dict__[name] = self.__dict__.get(name, self.get(name))
> rpy.RException: Error in get(x, envir, mode, inherits) : variable
> "R_version_string" was not found
>
> It looks like the logic in R.__getattr__ isn't working properly! I'll
> reinstall it at some point and see how it works :-)
> Cheers
> Ben
>
> On 12/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi Ben,
>>
>> I'm excited to hear that you got a copy of django.contrib.dataplot and you
>> are trying it out. I will try to help you debug the problem, but the
>> full traceback may be more useful. Can you send it?
>>
>> The purpose of the get_r_fun method is to look at the current R
>> environment and check if the desired R function has been source'ed yet.
>> This is one of the first steps before passing the data before R.
>>
>> I take the "r has no attribute generic" to refer to one of the generic
>> plotting functions named in one of the RPlot subclasses -- you must be
>> dealing with Scatter, TimeSeries, or NormalQQPlot, right? Are you sure it
>> doesn't say something like "r has no attribute generic.scatter.plot"? You
>> might try changing the dots . to underscores _ in the
>> r_fun_name='generic.scatter.plot' line in the definition of the
>> ScatterPlot subclass.
>>
>> Maybe your version of RPy isn't translating python names into R names the
>> same way as mine is? I'

Re: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Toby Dylan Hocking

Thanks for the input, Jeremy. I'd definitely be open to using PIL instead 
of ImageMagick. django.contrib.dataplot use of ImageMagick is relatively 
simple: taking vector PDFs drawn in R and converting them to fullscreen 
and thumbnail raster PNGs.

Do you know of a way that PIL can be used to convert PDF to PNG? A quick 
google search reveals this pdf 
(http://www.pythonware.com/media/data/pil-handbook.pdf) which suggests 
that PIL is only capable of writing PDFs (p69).

What I meant by
>> general enough to handle several different backend
>> plotting languages, such as matplotlib, pil, octave,
was that if a Django app wanted to use pil to draw the initial PDF (rather 
than R), then the django.contrib.dataplot framework is perfectly 
extensible for that purpose (not with current 0.2 release, but these 
generalized plotting backends are a planned feature for my next release, 
0.3).

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Jeremy Dunck wrote:

>
> On 7/11/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>
> How hard would it be to depend on PIL rather than ImageMagick?  I'm
> asking because Django already requires PIL if you want ImageField, and
> it's a shame to depend on both.
>
> (I know there are different features in each and you may have a good
> reason for choosing Magick.)
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Toby Dylan Hocking

You guys should definitely check my new framework for making data-driven 
plots with Django (installation instructions in INSTALL.txt):

http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz

So far django.contrib.dataplot only uses the R programming language to 
generate images server-side, but the great part (as yet undocumented) is 
that it is compatible general enough to handle several different backend 
plotting languages, such as matplotlib, pil, octave, etc.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Vincent Nijs wrote:

>
> http://www.scipy.org/Cookbook/Matplotlib/Django
>
> On 7/11/07 12:06 PM, "Forest Bond" <[EMAIL PROTECTED]> wrote:
>
>> On Wed, Jul 11, 2007 at 04:56:03PM -, [EMAIL PROTECTED] wrote:
>>>
>>> I would actually suggest using Django to create a web service to get
>>> the data, and a JavaScript charting library to do the drawing client-
>>> side.
>>
>> Why not create the graphs on the server?
>>
>> -Forest
>
>
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hi Ben,

I'm excited to hear that you got a copy of django.contrib.dataplot and you 
are trying it out. I will try to help you debug the problem, but the 
full traceback may be more useful. Can you send it?

The purpose of the get_r_fun method is to look at the current R 
environment and check if the desired R function has been source'ed yet. 
This is one of the first steps before passing the data before R.

I take the "r has no attribute generic" to refer to one of the generic 
plotting functions named in one of the RPlot subclasses -- you must be 
dealing with Scatter, TimeSeries, or NormalQQPlot, right? Are you sure it 
doesn't say something like "r has no attribute generic.scatter.plot"? You 
might try changing the dots . to underscores _ in the 
r_fun_name='generic.scatter.plot' line in the definition of the 
ScatterPlot subclass.

Maybe your version of RPy isn't translating python names into R names the 
same way as mine is? I'm using RPy 0.4.6-3ubuntu2 Python 2.4.2-0ubuntu3 
and R 2.2.1-2 on ubuntu dapper. What are your versions?

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Ben Ford wrote:

> Hi Toby
> I've grabbed a copy of your code but the RPlot.get_r_fun method isn't
> working for me... Could you perhaps explain how it does the mapping to the R
> function? What my testing is saying to me is that r (the one that's imported
> at the top of __init__.py) has no attribute generic... I've had a very brief
> look at rpy before, but I'm not exactly familiar with it's inner
> workings
> Great work, I've been meaning to have a crack at something like this for
> ages!!
> Ben
>
> On 11/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi there,
>>
>> If you still need help with making data-driven plots, why don't you check
>> out my new Django package --- I'd like some testers and comments.
>> Basically it is an interface to the R programming language (for statistics
>> and graphics) through the RPy package. You can download my latest release:
>>
>> http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz
>>
>> I'm a statistician who has been using this system for some time at my
>> work, but I finally am getting around to generalizing it and packaging it
>> for general use with the Django framework.
>>
>> The installation instructions are in INSTALL.txt in the archive.
>> Documentation is mostly present in docstrings at the moment -- I'm working
>> on more tutorials, but the .txt files and the example app should be enough
>> to get you started.
>>
>> Sincerely,
>> Toby Dylan Hocking
>> http://www.ocf.berkeley.edu/~tdhock
>>
>>
>>>
>>
>
>
> -- 
> Regards,
> Ben Ford
> [EMAIL PROTECTED]
> +628111880346
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hi there,

If you still need help with making data-driven plots, why don't you check 
out my new Django package --- I'd like some testers and comments. 
Basically it is an interface to the R programming language (for statistics 
and graphics) through the RPy package. You can download my latest release:

http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz

I'm a statistician who has been using this system for some time at my 
work, but I finally am getting around to generalizing it and packaging it 
for general use with the Django framework.

The installation instructions are in INSTALL.txt in the archive. 
Documentation is mostly present in docstrings at the moment -- I'm working 
on more tutorials, but the .txt files and the example app should be enough 
to get you started.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---