Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6965

Adding ports to an image to make it "toLinkable" and "fromlinkable"

$
0
0

@Uriel_abs wrote:

Hi,
Please could you help me to add ports on import images drag in a main diagram from a palette?

I base my code on the snap link reshaping example.

Here's my code:

myPalette =
_ $$(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element_
_ {_
_ maxSelectionCount: 1,_
_ nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram_
_ model: new go.GraphLinksModel([ // specify the contents of the Palette_
_ { _
_ text: "Router\ncore", _
_ figure: "Circle", _
_ fill: "green" _
_ },_
_ { _
_ text: "Zone" _
_ },_
_ { _
_ text: "Database", _
_ figure: "Database", _
_ fill: "lightgray" _
_ },_
_ { _
_ text: "Internet", _
_ figure: "Cloud", _
_ fill: "lightskyblue" _
_ },_
_ { _
_ text: "Router", _
_ figure: "Circle", _
_ fill: "red",_
_ width: 20, _
_ height: 20,_
_ },_
_ { _
_ text: "Commentaire", _
_ figure: "RoundedRectangle", _
_ fill: "lightyellow" _
_ }_
_ ])_
_ }_
_ );_

_ /*================= Objets Palette imgs manually added =================*/_

_ myPalette.add(_
_ $$(go.Part, "Table",_
_ $$(go.Picture, _
_ {_
_ source: "../Architectures_services_ocm/img/eqpmt/serveur.png",_
_ width: 45, _
_ height: 61, _
_ row: 1_
_ // margin: 5_
_ },_
_ new go.Binding("source")_
_ )_
_ )_
_ );_

Here's a screenshot of the view:

Thanks for your help.
If you need mor information to help me, please tell me.

Posts: 18

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6965

Trending Articles