Calysto / calysto

Tools for Jupyter and Python
BSD 2-Clause "Simplified" License
20 stars 6 forks source link

Problem with GrahWin() #8

Closed smartinsightsfromdata closed 8 years ago

smartinsightsfromdata commented 8 years ago

I'm using the following, on apple OS X El Capitan

python 3.5
calysto-1.0.0
jupyter 1.0

This is what I do:

from calysto.zgraphics import *
from IPython.display import display, clear_output
import time
#
win = GraphWin()

p = Point(50, 60)

I get:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-30093c7aac25> in <module>()
----> 1 win = GraphWin()
      2 
      3 p = Point(50, 60)

/Users/e/anaconda/lib/python3.5/site-packages/calysto/zgraphics.py in __init__(self, title, width, height)
     24         self.mouse_y = widgets.IntText()
     25         self.svg_canvas = widgets.HTML(
---> 26             self.get_html(onClick="window.clicked(evt, '%s', '%s')" % (self.mouse_x.model_id, self.mouse_y.model_id)))
     27         self.window = widgets.HBox([self.title, 
     28                                     self.svg_canvas])

/Users/e/anaconda/lib/python3.5/site-packages/calysto/graphics.py in get_html(self, **attribs)
    202 
    203     def get_html(self, **attribs):
--> 204         return self._repr_svg_(**attribs)
    205 
    206     def _repr_svg_(self, **attribs):

/Users/e/anaconda/lib/python3.5/site-packages/calysto/graphics.py in _repr_svg_(self, **attribs)
    205 
    206     def _repr_svg_(self, **attribs):
--> 207         drawing = self._render(**attribs)
    208         return drawing.tostring()
    209 

TypeError: _render() got an unexpected keyword argument 'onClick'

Taking into account I'm totally new to Calysto, what do I do wrong?

dsblank commented 8 years ago

You are doing nothing wrong... I have a fix waiting in the wings.... should be able to update tonight.

dsblank commented 8 years ago

Should be fixed with version 1.0.1, now in pypi. Thanks!

smartinsightsfromdata commented 8 years ago

Many thanks!. It's a superb product.