Is it possible to create outPorts to both top and bottom part of joint js element? - jquery-plugins

I have created elements with outPorts in bottom or top part. My requirement is to create an element which have outPorts in top and bottom parts.
Is it possible?

Since JointJS v1.0 there are many pre-defined port layouts. Including Bottom/top positions. It comes also with a new port API where ports can be added to any shape easily (joint.shapes.devs.Model is not needed anymore).
demo:
http://resources.jointjs.com/docs/jointjs/v1.0/demo/layout/Port/port.html
doc:
http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#layout.Port

Related

Highlight buildings in a map

I have a requirement where I need to highlight the buildings around my current location on a map. I am using Xamarin and was wondering if anyone can point me to a correct library or control that can fulfill my requirement.
I am currently using Mapsui for Xamarin but I don't think it has the feature I am looking for.
If you have access to the geometries of the buildings there are many ways you could implement highlighting.
One way that comes to mind. Create a layer on top of your background layer with the same geometries as data source. Use a ThemeStyle to show only the selected geometry. The ThemeStyle class is created with a callback method which determines the style. In that method you should return no style unless the feature id is the same as selected feature id.
You can take a look at the ThemeStyle sample for a more general use of themes (no highlighting).
Also you could look at Mapsui.Sample.Wpf.Editing. Here is a screenshot of that sample:

2 Image in root of tree in nattable

I have inserted one image in the tree body in one of my columns with
new TreeImagePainter(true, GUIHelper.getImage("right"), GUIHelper.getImage("right_down"), image);
in class TreeConfiguration, but I need to add one more image beside root rows.
Moreover I need to dynamicly obtain this image from some other class, where data is already read . As it turns out i can't because either this class is null or it is called later than it should. Could you guild me how to do that.
Kind Regards
The painting of the tree structure with node icons etc. is done by the IndentedTreeImagePainter. The TreeImagePainter is used as a decorator to the base painter for the content (typically text). If you need an additional icon you need to wrap the IndentedTreeImagePainter with another CellPainterDecorator.
Or in case the additional icon should be on the right of the tree icon, maybe the base painter can already be a CellPainterDecorator that combines both, an ImagePainter and a TextPainter.
If you only want to show that icon on root nodes, you will need some more customization, probably with a custom painter.
Sorry, I don't really understand your requirement.

JsPlumb - Basic setup advice

I've never used jsplumb before and I have read some of the documentation and looked at the demos, but I still don't understand..
I want to create a DIV like this :
One Input and upto 8 outputs (this value may change)
How do I do this ?
I will be looking at cloning this div and incrementing the divs ID, so I could end up with two or more divs that need to be able to join like this.
Can anyone help with this or point me to some simple examples..
Thanks
You need to add the bigger div as a target endpoint and the smaller div's as source end point.
var e1 = jsPlumb.addEndpoint(idSource, sourceEndpoint);
var e2 = jsPlumb.addEndpoint(idTarget, targetEndpoint);
where sourceEndpoint and targetEndpoints are objects with definitions for how the endpoint will look and behave .
Have a look at one of the examples to get the behaviour you desire.
jsPlumb should then allow you to drag and drop connections from source to targets.
The state machine demo does almost the same thing as what you need.
http://www.jsplumb.org/demo/flowchart/dom.html

Cytoscape.js 2.0 Load and Add methods

I am implementing Cytoscape.js web 2.0. I am a bit confused on the difference between load and add. I understand that in load, we do not need to specific the positions of the nodes. I used add to add a node which works when I include the position attribute, but the edges do not show even when I add the position attribute. Also, what is the difference between load and add behind the scenes? I believe that load renders the entire graph, so every time we use load, it would re render the graph. It seems that add does not do that which is good for operational costs? Is that true?
Thanks!
Putting cy.add() outside of the object right after the full object is initialized allowed adding nodes to update the graph.
cy.load() is used to load a new graph and run a layout on that graph. This is deprecated in newer versions of 2.x and it's not available in 3.x! Run a layout after calling cy.add() if you want this kind of behaviour.
cy.add() is used to just add elements to the existing graph.

Highlight Data Points in Birt Reports

creating simple charts with BIRT is easy, but now I would like to bring some more life to them...
imagine a simple line chart. Let's define as a requirement, that the maximum value should be highlighted. A further requirement would be that if the user clicks on this data point, something happens.
How can I solve this?
I can imagine that I could created a second value series which consists only of the highlighted data points.
But it would be nicer if there was a JavaScript API (or even a server side java api) with which I could loop through the data points and add a highlight on the fly. Is this possible?
I think I've found a good starting point:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/276-birt-chart-scripting-dynamic-markers-and-datapoint-colors/
Now I have to find a way to add on click events to certain data points...

Resources