Pydev Nodebox:“AttributeError:‘NoneType’对象没有属性‘WIDTH’"; [英] Pydev Nodebox: "AttributeError: 'NoneType' object has no attribute 'WIDTH'"

查看:63
本文介绍了Pydev Nodebox:“AttributeError:‘NoneType’对象没有属性‘WIDTH’";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 nodebox(ubuntu 12.04、python 2.7、django 1.3)在我的数据库中创建用户之间的连接图,但是当我输入以下说明时,我在其下方收到错误消息:

I am trying to create a graph of the connections between the users in my database using nodebox(ubuntu 12.04, python 2.7, django 1.3), but when I enter the following instructions, I get the error message underneath it:

"""    
g.draw(weighted=False, directed=False, highlight=[], traffic=None)  
Traceback (most recent call last):  
  File "/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2721, in run_code  
    exec code_obj in self.user_global_ns, self.user_ns  
  File "<ipython-input-1-0a219395b690>", line 1, in <module>  
    g.draw(weighted=False, directed=False, highlight=[], traffic=None)  
  File "/home/raymond/Documents/exchange/cet/cet/graph/__init__.py", line 453, in draw
    self.update()  
  File "/path/to/myproject//graph/__init__.py", line 416, in update  
    self.x = _ctx.WIDTH - max.x*self.d - min_.x*self.d  
AttributeError: 'NoneType' object has no attribute 'WIDTH'  

"""

我怎样才能让 nodebox 绘制我的图形?我应该向 graph/init.py 添加 try/catch 或 if 语句以防止写入 none 类型的对象吗?我知道显示更多代码有助于更快地解决问题;我遇到了格式问题,但我会尽快为问题添加代码.

How can I get nodebox to draw my graph? should I add a try/catch or if statement to graph/init.py in order to prevent object of type none from being written to? I know displaying more code would help solve the problem faster; I am running into formatting problem, but I will add code to the question as soon as I can.

推荐答案

Nodebox 有一个图形网页,它简洁、信息丰富,似乎正是我需要的.由于要下载的文件在同一页面上,这似乎很理想,但它没有提到它是适用于 Mac 的 Nodebox 1 ...仅适用于!

Nodebox has a graph web page which is concise, informative and seemed what I need. As the file to download is on the same page it seemed ideal, BUT it fails to mention it is Nodebox 1 which is for Mac ...only!

然后进一步翻找发现 NodeBox OpenGL,它有一个新的方法并且是跨平台的,但它只列出了与 python 2.5-2.6 的兼容性(所以 2.7 应该值得一试?)但是安装图形工具 Pyglet 第一次失败了时间......所以需要更多的调查.

Then a further rummage finds NodeBox OpenGL which has a new methodology and is cross platform, BUT it only lists compatibility with python 2.5-2.6 (so with 2.7 should be worth a try?) BUT installing the graphics util Pyglet failed the first time ....so more investigation required.

遗憾的是,Nodebox 3 似乎完全不同,还没有看到类似的图形命令

Sadly Nodebox 3 seems all different and haven't yet seen a comparable graph command

回顾结果

安装完成后,我使用鼠标可选属性查看器、低帧率和恒定数据集制作了网络查看器原型.这个网站展示了一种互动性

After achieving an install, I prototyped network viewer with a mouse selectable attribute viewer, low frame rate and a constant data set. A flavour of the interactiveness is demonstrated in this site

http://www.visualthesaurus.com/app/view?word=link(尝试单击并拖动中心词)

http://www.visualthesaurus.com/app/view?word=link (try a click and drag on the central word)

但我需要解决的问题是如何

But problems I needed to solve were how to

  • 一致地显示实时数据集,即处理孤儿,您可能正在查看的分支可能会从数据
  • 对大量数据的查看进行分区,即查看数百个项目中的 2 到 20 个节点
  • 显示数据时不会重叠/遮挡或脱离显示区域
  • 显示不在当前级别时的差异
  • 便携性
  • ...

就我而言,定期更新、具有颜色和缩放级别的结构化 html 表格是最好的解决方案

In my case a periodically updated, structured html table with colours and zoom levels was the best solution

这篇关于Pydev Nodebox:“AttributeError:‘NoneType’对象没有属性‘WIDTH’";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆