Is it possible that I am using input and output ports directly on Raphael.js rectangle object? - graphiti-js

I want to know that can u used Graphiti.js Input/Output ports on Raphael.js Rectangle Objects?
so that it is easy for me to get functionality for set operation.

I think you should use Graphiti because it is built up on Raphael.

Related

LibGDX FreetypeFont in 3D

Is there a proper way to use GDX FreeTypeFont in 3D?
I'm not trying to rotate the text, but I do want the text to go behind 3D objects if the object's center is in front of the text.
Any ideas on how to do this?
Is there somehow a way to attach a Bitmap to a ModelInstance or something, so I can pass it into a ModelBatch?
Thanks
One way would be to use a Decal and DecalBatch (which are sorted in 3D space). Your can draw the BitmapFont to a Pixmap and then draw that on a decal. You can use the same approach to create a TextureRegion and attach it to a 3D ModelInstance, but I think the Decal way is a little easier.

Axes on image in IDL

I have an image displayed in an IDL window using the TV command, and would like to add x and y axes to the image. Seems straightforward, but I can't find a way to do it.
Can anyone help with this?
Thanks
Are you tied to direct graphics, i.e., TV? Easiest way to display with axis is to use IMAGE function:
im = image(arr, axis_style=1)
I would echo Mike's answer - go with the new graphics Image function if possible.
If you absolutely have to use direct graphics, then I would recommend using David Fanning's coyote graphics wrappers:
http://www.idlcoyote.com/idldoc/cg/cgimage.html
It's still a lot more work to do this using direct graphics, but at least with the "cg" commands it's easier.

Java 8/JavaFX: Drawing text in a rectangle

Is there a way to bind text to a JavaFX shape (for my purposes, I want to use rectangles) the same way you could using Graphics2D's drawString in previous versions of Java?
You may be able to just use Graphics2D still; I just don't know how to implement it.
Note: What isn't helpful is a way to place a Text object at the same x and y position as the shape on canvas. Rather, is there a way to actually write onto the Rectangle?

Paperjs write text

I'm trying to understand how Paperjs works and I would like to know if it's possible to write text vectors, if yes how?
I tried Raphael.js before this, and I was almost satisfied with it but it seems that Paperjs is more (cross)browser compliant for some reasons, right?
Some examples would be nice!
Thanks for your answers.
Yes, it is definitely possible to create texts in paper.js.
var awesometext = new paper.PointText();
awesometext.content='awesome';
paper is better than raphael because its canvas based. Canvas is better supported on mobiles/tabs and hence the advantage of paperjs. However, since canvas is just a bitmap implementation, zooming will make canvas renderings not so good compared to svg renderings like in raphael.
So, it depends on what your priorities are for your application..
Paperjs handles text-scaling well, but it uses canvas' native methods to render the characters, so you can't access the vector data once they're drawn. But I imagine you'd only want vector characters to manipulate their shape, for example, morphing one letter into another, or creating a font editor.
If you just want hi res text then paperjs can do that no problem... or you could just set a bigger font size.
If you want to render text as vectors in paperjs, have a look at https://nodebox.github.io/opentype.js/

Are there event listeners to detect mouse clicks on dot/SVG graph?

I am playing with generating dot files and then turned them into SVG graphs with a lot of nodes.
My question is that are there event listeners to detect mouse clicks on dot/SVG graph nodes?
For example, right click on a node in the SVG graph, I do something(maybe get the related information from the node and then do something),
Then how to generate dot file or SVG file to achieve this?
There are several ways to create an interactive SVG graph:
Use SMIL, an extension to svg (Example tutorial http://apike.ca/prog_svg_smil.html)
Javascript (the Raphael library is excellent)
CSS animations
In any case, you'll have to display the svg graphs in a client which supports any of those technologies (browser), and you will have to code it in addition to the svg output graphviz creates.
Just another thought on this (realizing the question is old, but maybe it helps someone coming across).
Depending on what you want to do, it may be easiest to decouple the event handling from the drawing. I mean, you can find out where graphviz positions the nodes (as well as edges, labels etc.), see, for example, this post on how to do it in python. Then you can paint the graph in the background of whatever GUI you're using, and use its native event handling to react on on_click by placing invisible clickable objects over the nodes.
If you want interactive graphs then graphviz might not be the best choice.
I'd recommend having a look at D3.js. Perhaps you could construct the graph data in json and load them with D3?

Resources