legoffloic / nodz Goto Github PK
View Code? Open in Web Editor NEWNodz : Visualize your data - Free nodes based graph generator.
License: MIT License
Nodz : Visualize your data - Free nodes based graph generator.
License: MIT License
Hey I wanted to see if you feel this is within the scope of this project. The idea would be in addition to SlotItem base class we have something like PropertyItem, which based on the dataType when running createProperty, would be a UI widget for setting a value. So for example:
createProperty(node, name, dataType='bool')
would create a checkbox on the node. When the graph is saved or evaluated the state of that widget would be queried.
Looks like its not in the API implementation.
https://github.com/LeGoffLoic/Nodz/blob/master/nodz_demo.py#L173
And thank you very much for making this available and also with a generous MIT license.
Hi there,
I think it would be useful to create a node connection API.
Hello,
this project seems quite interesting. However, I don't understand the installation process to get things running and what file should be launched
Could you give me a detailed explanation on how to install and launch the demo (or main?) please?
Thanks in advance for your answer.
Hey there.
Opening a new discussion about the status of this project.
When speaking with other peoples around, we're all using this module but all having our own forks that we maintain and update, mostly because this trunk is not maintained anymore (last accepted PR was July 2018)
@LeGoffLoic : Are you still supporting this project ?
If not, would you accept to open admin rights to a couple of selected people to accept PRs ?
Sure we can fork it and accept PRs on that fork but the original project is far more followed than all forks available
hello, the mouse wheel crashes the app.
So, in nodz_main.py,
i changed 'event.delta() > 0' to 'event.angleDelta() > 0' ,
# tjp 02nov qt5 has angleDelta and pixel Delta if event.delta() > 0:
# angleDelta always increased despite wheel dir
# same for pixelDelta
if event.angleDelta() > 0:
zoomFactor = inFactor
else:
zoomFactor = outFactor
I never gto scrollwheel zoom to work
but added KEY_PLUS and KEY_MINUS to do same
if event.key() == QtCore.Qt.Key_Plus:
zoomFactor = inFactor
self.scale(zoomFactor, zoomFactor)
self.currentState = 'DEFAULT'
if event.key() == QtCore.Qt.Key_Minus:
zoomFactor = outFactor
self.scale(zoomFactor, zoomFactor)
self.currentState = 'DEFAULT'
Also enabled the scroll bars to all paning hopriz & vert
#self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
#self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
Then changed the transparency to allow nets to show through nodes
( circumventing coding to avoid other nodes )
// Custom colors > Add and remove as you want.
// Don't forget to edit the end of the dictionary if editing the
// following part.
// 03nov2021 was "bg": [80, 80, 80, 255],
"node_preset_1": {
"bg": [80, 80, 80, 127],
"border": [50, 50, 50, 255],
"border_sel": [170, 80, 80, 255],
"text": [230, 230, 230, 255]
},
// 03nov2021 was "bg": [60, 60, 60, 255],
"attr_preset_1": {
"bg": [60, 60, 60, 127],
"text": [220, 220, 220, 255],
"plug": [255, 155, 0, 255],
"socket": [255, 155, 0, 255]
},
and added arrays of nodes
as in:
mult2 = []
mult2.append( nodz.createNode(name='mult2[0]', preset='node_preset_1', position=None) )
nodz.createAttribute(node=mult2[0], name='in0', index=-1, preset='attr_preset_1', plug=False, socket=True, dataType=float)
nodz.createAttribute(node=mult2[0], name='out', index=-1, preset='attr_preset_1', plug=True, socket=False, dataType=float)
nodz.createAttribute(node=mult2[0], name='in1', index=-1, preset='attr_preset_1', plug=False, socket=True, dataType=float)
mult2.append( nodz.createNode(name='mult2[1]', preset='node_preset_1', position=None) )
....
thanks for a nice tool!
I need to make a library of widgets
and drag/drop from a palette
and make visible names for the nets/signals/wires
and allow custome widths
My application is to visulaize the Hal component files of the LinuxCNC project.
thanks TomP 21:06 03nov2021 Thailand
Hi,
currently sockets do not accept more than one plug. However, I would like to be able to connect several plugs to a socket (e.g. for routing MIDI messages). I found an if statement in the accepts
method of the SocketItem
class (line 1833) which returns False
if more than one plug is connected. However, uncommenting the corresponding line does not seem to do the trick. Can you give me a hint which lines of code I have to change?
Best,
Hanno
I just cloned the repo and ran the demo. when I trid dragging somethign into the DAG I got
builtins.AttributeError: 'NodeScene' object has no attribute 'signal_Dropped'
And sure anough the NodeScene
class does not have that signal, only a signal_NodeMoved
It would be great to formalize the project by packaging it following python std practices, so it's a bit easier to make it talk with python's ecosystem and integrate it to existing code-bases (i.e. pip, requirements, versioning, virtualenv friendly and so on).
https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/creation.html
How can I set the panel background color (i.e. the Qt Scene color)? I couldn't find any reference neither in default_config.json nor in nodz_main.py
I am currently subclassing Nodz to do some custom drawing and would like to use a subclass of NodeItem so that even more custom drawing can be done. To do this I propose splitting the line in createNode that actually instantiates a new NodeItem into it's own member function so that a subclass of Nodz can provide it's own implementation and return apropos subclass instances. Similar treatment would be applied Plug/Socket/Connection for full customization.
Any objections?
This issue is just an FYI for anyone who want to try out Nodz from within PyCharm with IPython running a Qt event loop. (I was not able to add to the Wiki, so I am adding to the issue.)
I have loaded Nodz and Qt.py repos in Pycharm and setup dependency of Qt.py on Nodz. I them marked the repos as sources root, so that they are available in PYTHONPATH.
In order for the IPython gui event loop to work properly, I first had to import Qt module and then enable application event loop in IPython.
In[1]: import Qt
In[2]: Qt
Out[2]: <module 'Qt' from 'F:\src\GitHub\nodegraph\Qt.py\Qt.py'>
In[3]: %gui qt4
Then I opened nodz_demo.py in the PyCharm editor and selectively executed code. Then in the Python Console, I interacted with the diagram.
Hi @LeGoffLoic ,
First of all, let me tell you that this library is really nice to use: it's both simple and powerful enough to start having a node UI on any application. And on a plus side, there is not many dependencies, which contributes to make it easy to use.
I think it could become a nice generic python node UI, but it needs to be maintained / upgraded in some way, otherwise everyone will just maintain it's own branch, and it'll make it hard for new comers to get what they need from all the existing branches.
And maintaining it means accepting, refusing, or at least commenting on the pull-requests to let know of were the dev is going, and how additions should be done.
As you can see, the few additions I needed for this UI to work great for my usage were pull-requested, so that everyone could benefit of them, which is the opensource way of thinking.
But doing clean pull-requests on branches that starts from your master branch (to ensure it doesn't bring changes from other branches as well and that the global graph remains clear) will become quite difficult if previous pull-requests are never accepted.
The fact is that most of my development were made outside of Maya (it's way faster to debug and check), so the bare minimum I need is the pullrequest#3 by @coderbone (#3).
My process to be able to work from the @coderbone branch but still doing clean pull-requests is:
I did it for my dev until now, but it's a too time-consuming process for me to continue this way, and next pull-request might be from the develop branch directly.
Please just let us know if you wish to accept some pull request and drive this repo the way you want, or if you consider it's now everyone's job to start from this repo and go in any direction they want. it's all fine with me either, just need to know ;)
Once again, thanks for the nice work you did on this repo, will be quite useful ;)
Cheers,
Yann
With Python 2 being retired next year, it could be nice to upgrade the code to Python 3.
It will mainly be changes on the print
function and unicode
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.