Quantcast
Channel: GoJS - Northwoods Software
Viewing all 6924 articles
Browse latest View live

Link is going through some other route and how to handle opacity changed links

$
0
0

@kishangajjar wrote:

Hi,

I am facing 2 issues with the links.
attaching the screenshot for better understanding.

image

  1. When the auto layout(LayeredDiagraph) occurs it shows link going above and then coming back for no reason when it can go straight from Node to Node.

  2. I want to hide all the links when the diagram loads, depending on the user clicks the Node, the connected links should be visible. I have used opacity property to control this, since if I use visible property then it ignores the positioning of nodes during the initial layout. Now because I have controlled it through opacity sometime when I click somewhere it highlights node as shown in the image as highlighted in yellow.

Can you please suggest a way to handle the above-mentioned issues?

Thanks.

Posts: 3

Participants: 2

Read full topic


How to get the enough width to show entire text of TextBlock? currently it is taking Entity Name width when init

$
0
0

@kumar1 wrote:

  this.dia.nodeTemplate =
      $(go.Node, "Auto",  // the whole node panel
        {
          locationSpot: go.Spot.Center,
          selectionAdorned: true,
          resizable: true,
          layoutConditions: go.Part.LayoutStandard & ~go.Part.LayoutNodeSized,
          fromSpot: go.Spot.AllSides,
          toSpot: go.Spot.AllSides,
          isShadowed: false,
          selectionAdornmentTemplate: nodeSelectionTemp,
          resizeAdornmentTemplate: resizeSelectionTemp
        },
        // new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
        // new go.Binding("angle").makeTwoWay(),
        // whenever the PanelExpanderButton changes the visible property of the "LIST" panel,
        // clear out any desiredSize set by the ResizingTool.
        new go.Binding("desiredSize", "visible", function (v) { return new go.Size(NaN, NaN); }).ofObject("LIST2"),
        // define the node's outer shape, which will surround the Table
        $(go.Shape, "Rectangle",
          {
            stretch: go.GraphObject.Fill,
            fill: 'white', stroke: "#707070", strokeWidth: 1,
            portId: "",
            fromLinkable: true, toLinkable: true, cursor: "pointer",
          }),
        $(go.Panel, "Table",
          { margin: 0,
            stretch: go.GraphObject.Fill,
            defaultRowSeparatorStroke: "gray"},
          $(go.RowColumnDefinition, { row: 0, sizing: go.RowColumnDefinition.None, background: '#404040' }),
          // the table header
          $(go.TextBlock,
            {
              row: 0, alignment: go.Spot.Center,
              margin: new go.Margin(0, 24, 0, 2),  // leave room for Button
              font: "14px sans-serif",
              isMultiline: false,
              stroke: "#FCFCFC",
              editable: true,
              textValidation: entityNameValidation,
              textEdited: updateEntityName
            },
            new go.Binding("text", "key")),
          // the collapse/expand button
          $("PanelExpanderButton", "LIST2",  // the name of the element whose visibility this button toggles
            { row: 0,
              alignment: go.Spot.TopRight,
              "ButtonIcon.stroke": "#FCFCFC"
             }),
             $(go.Panel, "Vertical",
            {
              name: "LIST2",
              row: 1,
              padding: 3,
              alignment: go.Spot.TopLeft,
              defaultAlignment: go.Spot.Left,
              stretch: go.GraphObject.Horizontal,
              itemTemplate: tableTempl,
            }, new go.Binding("itemArray", "tableHeaders").makeTwoWay()))
      );  // end Node

const itemTempl =
    $(go.Panel, "TableRow",
      $(go.Panel, "Horizontal",
        $(go.Shape,
          { desiredSize: new go.Size(7, 7), strokeJoin: "round", strokeWidth: 3, stroke: null, margin: 2 },
          new go.Binding("figure", "figure"),
          new go.Binding("fill", "color"),
          new go.Binding("stroke", "color")),
        $(go.TextBlock,
          {
            stroke: "#262626",
            font: "12px sans-serif",
            isMultiline: false,
            click: textblockClick
          },
          new go.Binding("text", "name"))
      ));

    const tableTempl = $(go.Panel, "Table",
    { margin: 0,
      stretch: go.GraphObject.Fill,
      defaultRowSeparatorStroke: "gray"},
    $(go.RowColumnDefinition, { row: 0, sizing: go.RowColumnDefinition.None, background: '#CBCBCB' }),
    // the table header
    $(go.TextBlock,
      {
        row: 0, alignment: go.Spot.Center,
        margin: new go.Margin(0, 24, 0, 2),  // leave room for Button
        font: "14px sans-serif",
        isMultiline: false,
        stroke: "#262626",
        editable: true,
        textValidation: entityNameValidation,
        textEdited: updateEntityName
      }, new go.Binding("text", "key").makeTwoWay()),
    // the collapse/expand button
    $("PanelExpanderButton", "COLLAPSIBLE",  // the name of the element whose visibility this button toggles
      { row: 0,
        alignment: go.Spot.TopRight,
        "ButtonIcon.stroke": "#262626"
       }),
       $(go.Panel, "Table",
      {
        name: "COLLAPSIBLE",
        row: 1,
        padding: 3,
        alignment: go.Spot.TopLeft,
        defaultAlignment: go.Spot.Left,
        stretch: go.GraphObject.Fill,
        itemTemplate: itemTempl,
        defaultRowSeparatorStroke: "gray"
      },new go.Binding("itemArray", "items").makeTwoWay()))

Screen Shot 2020-06-11 at 10.07.05 AM
need like below screenshot
Screen Shot 2020-06-11 at 10.07.16 AM

Posts: 2

Participants: 2

Read full topic

How to change panelExpanderbutton?

$
0
0

@kumar1 wrote:

public ngAfterViewInit() {
    createCustomButton()
}
public createCustomButton() {
    go.GraphObject.defineBuilder("PanelExpanderButton", function(args) {
      var eltname = /** @type {string} */ (go.GraphObject.takeBuilderArgument(args, "COLLAPSIBLE"));

      var button = /** @type {Panel} */ (
        go.GraphObject.make("Button",
          { // set these values for the visible binding conversion
            "_buttonExpandedFigure": "MinusLine",
            "_buttonCollapsedFigure": "PlusLine"
          },
          go.GraphObject.make(go.Shape, "PlusLine",
                              { name: "ButtonIcon", desiredSize: new go.Size(6, 4) },
                              new go.Binding("figure", "visible",
                                             function(vis) { return vis ? button["_buttonExpandedFigure"] : button["_buttonCollapsedFigure"]; })
                                  .ofObject(eltname)))
      );

      var border = button.findObject("ButtonBorder");
      if (border instanceof go.Shape) {
        border.stroke = null;
        border.fill = "transparent";
      }

      button.click = function(e, button) {
        var diagram = button.diagram;
        if (diagram === null) return;
        if (diagram.isReadOnly) return;
        var elt = button.findTemplateBinder();
        if (elt === null) elt = button.part;
        if (elt !== null) {
          var pan = elt.findObject(eltname);
          if (pan !== null) {
            diagram.startTransaction('Collapse/Expand Panel');
            pan.visible = !pan.visible;
            diagram.commitTransaction('Collapse/Expand Panel');
          }
        }
      }

      return button;
    });


    //return button;
  }```

i have tried above one used it not showing any effect

following the below giving blackscreen in place of button
$(“PanelExpanderButton”, “LIST”, // the name of the element whose visibility this button toggles
{ row: 0,
“_buttonExpandedFigure”: “MinusLine”,
“_buttonCollapsedFigure”: “PlusLine”
alignment: go.Spot.TopRight })```

Posts: 6

Participants: 2

Read full topic

Listener for dragging event for node

$
0
0

@ironwill1023 wrote:

Is there listener for dragging event, not “SelectionMoved” of diagram?
Just like this one: <p draggable="true" ondrag="myFunction(event)">Drag me!</p>

Posts: 7

Participants: 2

Read full topic

ChangingSelection event on LinkDrawn

$
0
0

@ksquibbs wrote:

Hi. I need to keep the existing selection when a link is drawn. From my research, it seems like the LinkingTool’s doMouseUp method raises a ChangingSelection event with the newly added link as the subject. I know I could override that method, but I don’t want to attempt to implement that entire method without the ChangingSelection logic. Is there a way to disable the selection change behavior of the LinkingTool without completely overriding the doMouseUp method? Thanks.

Posts: 2

Participants: 2

Read full topic

How to change target port stroke and target node stroke highlighted color when draglink from palete?

Update Scale of TextBlocks

$
0
0

@useche_dev wrote:

Hi. I have a question, when zooming, is there a way to dynamically update the scale of all the text (TextBlock) with the zoom? Mostly by zooming out, to prevent the text from being blurred. Thanks in advance.

Posts: 4

Participants: 2

Read full topic

Link drawing area on node

$
0
0

@mladenmacanovic wrote:

I can’t seem to figure this up. I have a node like on picture

image

What I want to achieve is

  • Be able to activate line drawing only outside of red area.
  • Clicking on inside of it would move the node around.
  • Also line connecting the node needs to follow the node borders.

Currently entire node is activating line drawing, so I cannot move it around.

My Code:

var groupTemplate =
    $(go.Node, "Vertical",
        { defaultStretch: go.GraphObject.Horizontal },
        {
            //fromSpot: go.Spot.RightSide, toSpot: go.Spot.LeftSide
            portId: "",
            fromLinkable: true,
            toLinkable: true,
            fromEndSegmentLength: 20,
            toEndSegmentLength: 20,
            cursor: "pointer"
        },
        $(go.Panel, "Auto",
            $(go.Shape, "RoundedTopRectangle",
                {
                    fill: "#C2C2C2",
                    stroke: "#C2C2C2",
                    //height: 25,
                },
                new go.Binding("fill", "lightgray")),
            $(go.TextBlock,
                {
                    margin: new go.Margin(4, 20, 4, 20),
                    textAlign: "center",
                    font: "10pt Roboto",
                },
                new go.Binding("text", "header"))
        ),
        $(go.Panel, "Auto",
            { minSize: new go.Size(NaN, 70) },
            $(go.Shape, "RoundedBottomRectangle",
                {
                    fill: "white",
                    stroke: "#C2C2C2"
                }),
            $(go.TextBlock,
                {
                    stroke: "#C2C2C2",
                    width: 120
                },
                { margin: new go.Margin(2, 2, 0, 2), textAlign: "center" },
                new go.Binding("text", "lsabel"))
        )
    );

Posts: 3

Participants: 2

Read full topic


Find LinkData and Focus

$
0
0

@nachoxxhh wrote:

Hello good afternoon, basically that, I want to focus on a Link,

i try:

var node1 = myDiagram.findNodeForKey(origen);
var node2 = myDiagram.findNodeForKey(destino);

var arrayLinks = node1.findLinksBetween(node2);

while (arrayLinks.next()) { 
    var link = arrayLinks.value;
    var dataLink = link.data;
        
    myDiagram.select(dataLink );
    myDiagram.centerRect(dataLink.actualBounds);
}

I use those functions to search and focus on a Node, but it doesn’t work with LinkData

Posts: 2

Participants: 2

Read full topic

How to add css class to textblock?

$
0
0

@kumar1 wrote:

how to add css class to textblock?, 'cause i need to apply styles depends upon my project theme.

$(go.TextBlock,
            {
              row: 0, alignment: go.Spot.Center,
              textAlign: 'center',
              margin: new go.Margin(0, 15, 0, 8),  // leave room for Button
              isMultiline: false,
              stroke: "#FCFCFC",
              editable: true,
              minSize: new go.Size(150, NaN),
              textValidation: entityNameValidation,
              textEdited: updateEntityName
            },
            new go.Binding("text", "key"))```

Posts: 2

Participants: 2

Read full topic

Click in Link, Mouse does not hit it

Horizontal swimlane diagram using angular framework

$
0
0

@sindhu wrote:

Hi Team,

I am trying to work on swimlanes where i have multiple nodes in multiple swimlanes and nodes are connected across and within the lanes.

Nodes can be of any shape/images/icons. My requirement is to align the nodes horizontally as below.
swimlane or
image

I’m using angular as UI framework. Please suggest how this can be achieved and if possible please share sample source code and the required library details with specific versions for the same.

Posts: 1

Participants: 1

Read full topic

Changing the layout using templatemap taking away default animation

$
0
0

@kishangajjar wrote:

By default when I collapse/expand the group, it does some sort of animation during collapsing or expanding. also, it pushes all nearby nodes away by some animations.

Now when I am using a different template (which looks more like a Node), I have to change the category of it so that it shows different representations. In this case, it doesn’t perform an animation. As soon as category changed and I call expandGroup function it happens immediately without looking like an animation.

any method I can use to give it the same behaviour as earlier?

Posts: 4

Participants: 2

Read full topic

UnconnectedLink does not generate IncrementalJson

Unknown node drop is happening

$
0
0

@STMax wrote:

After editing some properties of a node1, if I drag and drop another node (defined to sit in a different layer and inside bubble group) on the canvas (while there is still some updates happening in the background related to the property edit operation), it is triggering a dropping of node1 with the same key as the existing one and eventually fails to get added.
The call stack shows Array.concat.xf.doSimulatedDrop as the initiator of the call.
Could some one explain why/what scenarios would cause this?

Thanks!

Posts: 2

Participants: 2

Read full topic


Disabling UndoManager causes tx in modelChange to return null

$
0
0

@swang92 wrote:

Hello!

After spending some time debugging, I have finally figured out why my tx is returning null.

Here is a snippet of the tx code for modelChange

    function modelChanged(evt: any): void {
      if (!evt.isTransactionFinished) return
      const tx: any = evt.object
      console.log('tx', tx)
      if (!tx) return

Why is it if I set undoManager to false, tx returns null? Is there a way to have undoManager turned off but still have transaction events fire?

Posts: 6

Participants: 2

Read full topic

Calling makeSvg on Diagram returned null

$
0
0

@ironwill1023 wrote:

Thanks. Your answer helped me a lot!

var img;
function writeJson(coll) {  // assume COLL is a collection of Parts
    var tempDiag = new go.Diagram();
    tempDiag.model = myDiagram.model.copy();  // doesn't copy data
    myDiagram.copyParts(coll, tempDiag, false);
    img = tempDiag.makeSvg({
        scale: 1,
        background: "#E9E9E9",
        maxSize: new go.Size(Infinity, Infinity),
    });
    return tempDiag.model.toJson();
  }

But img returned null. Why is this null?
tempDiag.makeImage also returned null.

Posts: 12

Participants: 2

Read full topic

How to make zOrder work?

$
0
0

@Phoenixsxy wrote:

I have a nodeTemplate and a linkTemplate .NodeTemplate include a go.Picture and a go.TextBlock,I want nodeTemplate on top of linkTemplate. So I set nodeTemplate’s zOrder in 2,and linkTemplate’s zOrder in 1. But as a result, the textBlock of nodeTemplate is always in the lower level of the line. How can I make zOrder work? Is there any other method to solve this situation?

Posts: 3

Participants: 2

Read full topic

Utilizing Overview panel to show some node and links only

$
0
0

@kishangajjar wrote:

In my application all links are by default hidden by opacity. whichever node user selected based on that few links and Nodes gets full opacity and rest of the others opacity is reduced to 0.2.

In my overview panel, I want to show only the highlighted nodes and links (which have full opacity).
also if I can make it actionable it would be great.

Posts: 2

Participants: 2

Read full topic

TextBlock wrap is not work

$
0
0

@plusor wrote:

Sample text:

Test 杂志的资料收集相当齐全,尤其是他们的特辑。像第七二一期的“寻寻觅觅的家宴味道——最想念的年货”,更是精彩。以春卷开启正月的初一, 初二对应年糕,初三桂花小圆子,初四枣泥糕,初五八宝饭,初六火腿粽子,初七双浇面,初八豌豆黄,初九素馅饺子,初十腊味萝卜糕,十一干菜包,十二菜肉馄饨,十三芸豆卷,十四包子,而十五则以汤圆来结束。
这些食物满足了东南西北的读者,尤其是背井离乡的,一定会有一种慰藉你味觉上的乡愁。

Actual results:

Expected results:

Posts: 2

Participants: 2

Read full topic

Viewing all 6924 articles
Browse latest View live