How to implement FlipHorizontal and FlipVertical dynamically?


#1

How to implement FlipHorizontal and FlipVertical dynamically?
We want to implement FlipHorizontal & FlipVertical of image of nodes.
How to implement dynamically change flip value?
I am checking https://gojs.net/latest/intro/pictures.html.
This is static.
We want it dynamically.


#2

Just set or bind the https://gojs.net/latest/api/symbols/Picture.html#flip property.

As with any other GraphObject property, simply setting it gets you the visual results that you want. But having a TwoWay Binding on that property means that that setting will be saved in the model. Alternatively, use a OneWay Binding and call Model.set to change the model state.


#3

Can we perform flip on

$(go.Panel, “Vertical”, {
name: “img”
}, new go.Binding(“angle”, “angle”).makeTwoWay(),

We want to implement flip on go.Panel.

When we call

$(go.Panel, “Vertical”, {
name: “img”,
flip: go.GraphObject.None,
}, new go.Binding(“angle”, “angle”).makeTwoWay(),new go.Binding(“flip”),

We are getting error “Error: Trying to set undefined property “flip” on object: Panel([object Object])#695”.


#4

We did not implement flip on GraphObject partly because people normally do not want their text to be flipped. And they really wanted to rearrange the contents of their panels in non-systematic ways. So even if you don’t have any text in your panel and really do want to flip it, that’s why we didn’t go to the trouble to implement that property on GraphObject.

So you will need to implement the functionality yourself, rather than “flipping a switch”.


#5

We have image & ports around it.
We want to flip image & ports all together.
Also we want to slip value in DB & show it as it after flip.


#6

Well, you know how to flip a Picture. How are the ports defined and arranged? Can you provide an outline of that panel template?