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

Assign to specific points of the visible part

$
0
0

@ahmetgundogdu wrote:

I try to assign it to the places I marked, but it doesn’t

I’m trying this

diagram.viewportBounds.left + " " + diagram.viewportBounds.top

    var location;
                    if (args.parameters.ModelInformationLocation == 0) {
                        location = diagram.viewportBounds.left + " " + diagram.viewportBounds.top;
                    } else if (args.parameters.ModelInformationLocation == 1) {
                        location = diagram.viewportBounds.right + " " + diagram.viewportBounds.top;
                    } else if (args.parameters.ModelInformationLocation == 2) {
                        location = diagram.viewportBounds.left + " " + diagram.viewportBounds.bottom;
                    } else if (args.parameters.ModelInformationLocation == 3) {
                        location = diagram.viewportBounds.right + " " + diagram.viewportBounds.bottom;
                    }

                    var nodeData = {
                        category: "FixedText",
                        loc: location
                    };
                   diagram.model.startTransaction("node add");
                   diagram.model.addNodeData(nodeData);
                   diagram.model.commitTransaction("node add");
         
            templateMap.add("FixedText", GO(go.Node, "Spot",
                { isInDocumentBounds: false, isAnimated: false, movable: false, deletable: false, rotatable: false, selectionAdorned: false, pickable: false, selectable: false },
                new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
                GO(go.TextBlock,
                    internalHelper._getTextBlockDefaultOptions(),
                    internalHelper._getMainShapeOptions(),
                    {
                        name: "SHAPE", // resize ve rotate için gerekli
                        background: "transparent"
                    },
                    new go.Binding("text", "processTitle").makeTwoWay()
                )
            ));

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles