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

How to delete and redraw tree layout

$
0
0

@rkaren wrote:

on something similar to your treeview sample, what is proper way to delete and redraw the tree?
I am getting the tree twice when I re-call the init code. Thanks for your help:

  var tree = {
myDiagram: null,
nodeDataArray : null,
init:function () {
//if (window.goSamples) goSamples();  // init for these samples -- you don't need to call this
var $ = go.GraphObject.make;  // for conciseness in defining templates

tree.myDiagram =
  $(go.Diagram, "treeDiv",
    {
      allowMove: false,
      allowCopy: false,
      allowDelete: false,
      allowHorizontalScroll: false,
      maxSelectionCount: 1,
      layout:
        $(go.TreeLayout,
          {
            alignment: go.TreeLayout.AlignmentStart,
            angle: 0,
            compaction: go.TreeLayout.CompactionNone,
            layerSpacing: 16,
            layerSpacingParentOverlap: 1,
            nodeIndent: 2,
            nodeIndentPastParent: 0.88,
            nodeSpacing: 0,
            setsPortSpot: false,
            setsChildPortSpot: false
          })
  });

tree.myDiagram.nodeTemplate =
  $(go.Node,
    { // no Adornment: instead change panel background color by binding to Node.isSelected
      selectionAdorned: false,
      isTreeExpanded: false,
      // a custom function to allow expanding/collapsing on double-click
      // this uses similar logic to a TreeExpanderButton
      doubleClick: function(e, node) {
        var cmd = tree.myDiagram.commandHandler;
        if (node.isTreeExpanded) {
          if (!cmd.canCollapseTree(node)) return;
        } else {
          if (!cmd.canExpandTree(node)) return;
        }
        e.handled = true;
        if (node.isTreeExpanded) {
          cmd.collapseTree(node);
        } else {
          cmd.expandTree(node);
        }
      }
    },
    $("TreeExpanderButton",
      {
        width: 14,
        "ButtonBorder.fill": "whitesmoke",
        "ButtonBorder.stroke": null,
        "_buttonFillOver": "rgba(0,128,255,0.25)",
        "_buttonStrokeOver": null
      }),
    $(go.Panel, "Horizontal",
      { position: new go.Point(16, 0) },
      new go.Binding("background", "isSelected", function (s) { return (s ? "lightblue" : "white"); }).ofObject(),
      $(go.Picture,
        {
          width: 18, height: 18,
          margin: new go.Margin(0, 4, 0, 0),
          imageStretch: go.GraphObject.Uniform
        },
        // bind the picture source on two properties of the Node
        // to display open folder, closed folder, or document
        new go.Binding("source", "isTreeExpanded", tree.imageConverter).ofObject(),
        new go.Binding("source", "isTreeLeaf", tree.imageConverter).ofObject()),
      $(go.TextBlock,
        { font: '9pt Verdana, sans-serif' },
        new go.Binding("text", "title", function(s) { return s; }))
    ),  // end Horizontal Panel
  {
    toolTip:  // define a tooltip for each node that displays the color as text
      $(go.Adornment, "Auto",
        $(go.Shape, { fill: "#FFFFCC" }),
        $(go.TextBlock, { margin: 4, maxSize: new go.Size(300,80), wrap: go.TextBlock.WrapFit },
          new go.Binding("text", "title", function(s) {return s;}))
      )  // end of Adornment
  }
  );  // end Node

// without lines
tree.myDiagram.linkTemplate = $(go.Link);

// // with lines
// myDiagram.linkTemplate =
//   $(go.Link,
//     { selectable: false,
//       routing: go.Link.Orthogonal,
//       fromEndSegmentLength: 4,
//       toEndSegmentLength: 4,
//       fromSpot: new go.Spot(0.001, 1, 7, 0),
//       toSpot: go.Spot.Left },
//     $(go.Shape,
//       { stroke: 'gray', strokeDashArray: [1,2] }));


if (false) {
  // create a random tree
  //tree.nodeDataArray = [{ key: 0 }];
  var max = 30;
  var count = 0;
  while (count < max) {
    count = tree.makeTree(3, count, max, tree.nodeDataArray, tree.nodeDataArray[0]);
  }
 }
 // tree.myDiagram.model = new go.TreeModel(nodeDataArray);
 },

loadTreeArray: function(jsonObj) {
var arr = jsonObj.TargetsTree;
if (!arr) {
  alert('Cannot find array of tree data.');
  return false;
} else {
  if (tree.nodeDataArray) {
    tree.nodeDataArray.length = 0; // this clears the array.
  }
  tree.nodeDataArray = new Array();
  var i = 0;
  var len = arr.length;
  while (i < len) {
    var obj = arr[i];
    console.log('json: key: ' + obj.key + ' parent: ' + obj.parent + ' code: ' + obj.code   + ' title: ' + obj.title);
    tree.nodeDataArray.push(obj);
    i++;
  }
}
return true;
},
drawTree: function() {
tree.myDiagram.model = new go.TreeModel(tree.nodeDataArray);
 },
 selectedCode:function() {
 // assumes only 1 selected.
 // (tree.myDiagram.selection.each(function(part) {if (part instanceof go.Node) {return('selected ' + 
 part.data.key);}}));
 // or tree.myDiagram.iterator.each(function(part) {if (part instanceof go.Node) {console.log('selected ' + 
 part.data.key);}});
  var it = tree.myDiagram.selection.iterator;
  while (it.next()) {
  var part = it.value;
  var code = part.data.code;
  return code;
  }
 return null;
 },
selectedTitle:function() {
 // assumes only 1 selected.
 // (tree.myDiagram.selection.each(function(part) {if (part instanceof go.Node) {return('selected ' + 
part.data.key);}}));
// or tree.myDiagram.iterator.each(function(part) {if (part instanceof go.Node) {console.log('selected ' + 
part.data.key);}});
var it = tree.myDiagram.selection.iterator;
while (it.next()) {
  var part = it.value;
  var ttl = part.data.title;
  return ttl;
}
return null;
},
numSelected: function() {
return tree.myDiagram.selection.iterator.count;
},
makeTree:function (level, count, max, nodeDataArray, parentdata) {
var numchildren = Math.floor(Math.random() * 10);
for (var i = 0; i < numchildren; i++) {
  if (count >= max) return count;
  count++;
  var childdata = { key: count, parent: parentdata.key , code: 'code for ' + count};
  nodeDataArray.push(childdata);
  if (level > 0 && Math.random() > 0.5) {
    count = tree.makeTree(level - 1, count, max, nodeDataArray, childdata);
  }
}
return count;
},

// takes a property change on either isTreeLeaf or isTreeExpanded and selects the correct image to use
imageConverter:function (prop, picture) {
var node = picture.part;
if (node.isTreeLeaf) {
  return "/gojs/samples/images/document.png";
} else {
  if (node.isTreeExpanded) {
    return "/gojs/samples/images/openFolder.png";
  } else {
    return "/gojs/samples/images/closedFolder.png";
  }
 }
}
};

Posts: 7

Participants: 2

Read full topic


Help with Group Subprocess

$
0
0

@aples wrote:

I am trying to implement a group template similar to the Subprocess node available in the BPMN example with some custom behavior. I have a few issues that I need help with.

  1. Is there a way to set the padding in the Placeholder to provide a larger drop space when the group is expanded and less padding when the group is collapsed? For example I was trying to bind the placeholder padding property dynamically with a function instead of statically.

$(go.Placeholder,
// { padding: new go.Margin(25, 25)},
new go.Binding(“padding”, “isSubGraphExpanded”, function (s) {
if(s) {
return new go.Margin(100, 100);
} else {
return new go.Margin(10, 10);
}
})
)

  1. I took code from the Regrouping example to handle drag and resize of the group and the highlight is a good cue for the user to resize, but the resize with that code demands the user hang near the border of the group to get the group to slowly resize. It’s pretty touchy and not nearly as flexible as resizing the group without computesBoundsAfterDrag set to true. With computesBoundsAfterDrag set to false, the container moves really fluidly, but you can’t drag a node out. I tried the drag with the shift key code, but that was not working for me and in addition that would not be desirable for my users. I would like a better fluidity of resize of the container near the border. Is there a way to achieve that?

  2. I was trying to add ports for creating links on dragEnter and dragLeave on the group, but the port always shows at center as if it has no knowledge of its bounds. For example, the ports would be added like:
    makeSubProcPort(“T”, go.Spot.Top, true, true),
    makeSubProcPort(“L”, go.Spot.Left, true, true),
    makeSubProcPort(“R”, go.Spot.Right, true, true),
    makeSubProcPort(“B”, go.Spot.Bottom, true, true)
    function makeSubProcPort(name, spot, output, input) {
    // the port is basically just a small transparent square
    return $(go.Shape, “Circle”,
    {
    fill: null, // not seen, by default; set to a translucent gray by showSmallPorts, defined below
    stroke: null,
    desiredSize: new go.Size(10, 10),
    alignment: spot, // align the port on the main Shape
    alignmentFocus: spot, // just inside the Shape
    portId: name, // declare this object to be a “port”
    fromSpot: spot, toSpot: spot, // declare where links may connect at this port
    fromLinkable: output, toLinkable: input, // declare whether the user may draw links to/from here
    cursor: “pointer” // show a different cursor to indicate potential link point
    });
    }

Thanks a lot for the help!!

Andrea

    
var subProcessGroupTemplate =
      $(go.Group, "Spot",
        {
          copyable: false,
          locationSpot: go.Spot.Center,
          locationObjectName: "PH",
          fromSpot: go.Spot.AllSides, toSpot: go.Spot.AllSides, portId: "",
          isSubGraphExpanded: true,
          memberValidation: function (group, part) {
            return !(part instanceof go.Group) ||
              (part.category !== "Pool" && part.category !== "Lane");
          },
          mouseDragEnter: function(e, grp, prev) { highlightGroup(e, grp, true); },
          mouseDragLeave: function(e, grp, next) { highlightGroup(e, grp, false); },
          computesBoundsAfterDrag: true,
          // when the selection is dropped into a Group, add the selected Parts into that Group;
          // if it fails, cancel the tool, rolling back any changes
          mouseDrop: finishDrop,
          handlesDragDropForMembers: true,  // don't need to define handlers on member Nodes and Links
          // Groups containing Groups lay out their members horizontally
          contextMenu: activityNodeMenu,
          itemTemplate: boundaryEventItemTemplate,
          selectionAdornmentTemplate:
        $(go.Adornment, "Auto",
          $(go.Shape, "RoundedRectangle",
          { fill: null, stroke: "#296796", strokeWidth: 1.5,
          strokeDashArray: [3,2] }),
          $(go.Placeholder)
        )
        },
       
        new go.Binding("background", "isHighlighted", function(h) {
          if(h) return "rgba(41,103,150)"; else return "transparent";}).ofObject(),
        new go.Binding("itemArray", "boundaryEventArray"),
        makeSubProcPort("T", go.Spot.Top, true, true),
        makeSubProcPort("L", go.Spot.Left, true, true),
        makeSubProcPort("R", go.Spot.Right, true, true),
        makeSubProcPort("B", go.Spot.Bottom, true, true),
        { // handle mouse enter/leave events to show/hide the ports
          mouseEnter: function (e, node) { showSmallPorts(node, true); },
          mouseLeave: function (e, node) { showSmallPorts(node, false); }
        },
      $(go.Panel, "Auto",
          $(go.Shape, "RoundedRectangle",
            {
              name: "PH", fill: "rgba(255,255,255, 0.8)", stroke: SubprocessNodeStroke,
              minSize: new go.Size(ActivityNodeWidth, ActivityNodeHeight),
              portId: "", fromLinkable: true, toLinkable: true, cursor: "pointer",
              fromSpot: go.Spot.RightSide, toSpot: go.Spot.LeftSide
            },
            new go.Binding("strokeWidth", "isCall", function (s) { return s ? ActivityNodeStrokeWidthIsCall : ActivityNodeStrokeWidth; })
          ),
          $(go.Panel, "Vertical",
            { defaultAlignment: go.Spot.Left },
            $(go.TextBlock,  // label
              { margin: 3, editable: true },
              new go.Binding("text", "label").makeTwoWay(),
              new go.Binding("alignment", "isSubGraphExpanded", function (s) { return s ? go.Spot.TopLeft : go.Spot.Center; })),
            // create a placeholder to represent the area where the contents of the group are
            $(go.Placeholder,
             // { padding: new go.Margin(25, 25)},
                new go.Binding("padding", "isSubGraphExpanded", function (s) {
                 if(s) {
                   return new go.Margin(100, 100);
                  } else {
                    return new go.Margin(10, 10);
                  }
                })
            ),
            makeMarkerPanel(true, 1)  // sub-process,  loop, parallel, sequential, ad doc and compensation markers
          )  // end Vertical Panel
        )
      );  // end Group

Posts: 2

Participants: 2

Read full topic

Angular gojs problem

$
0
0

@no_one345 wrote:

i m working on an app that us angular and gojs, when ever i call a function from diagram of angular class it gives me error
TypeError: Cannot read property ‘service_call’ of undefined

the diagram is as follows

drillup

the error is as follows

drill

Posts: 1

Participants: 1

Read full topic

Layer layout based on node.data.order property

$
0
0

@brianc wrote:

Hi All,

I am creating a multiple layered chart and each layers has nodes with respective orders. For example, nodes with order 1 will stay at first layer and nodes with order 4 will stay at the last layer.

The problem is the layout function seems not working.

My codes are as follow:

 <script>
 function MultiLayerLayout() {
    go.LayeredDigraphLayout.call(this);
  }
  go.Diagram.inherit(MultiLayerLayout, go.LayeredDigraphLayout);
  MultiLayerLayout.prototype.assignLayers = function() {
    this.network.vertexes.each(function(v) {
      if (!v.node || !v.node.data) return;

      // decide whether to go in top row or bottom row based on the order of the data.order property
      if (v.node.data.order == "1") {
        v.layer = 0;
      } else if (v.node.data.order == "2") {
        v.layer = 1;
      } else if (v.node.data.order == "3") {
        v.layer = 2;
      } else if (v.node.data.order == "4") {
        v.layer = 3;
      } 
    })
  };

  function init() {
    var $ = go.GraphObject.make;

    myDiagram =
      $(go.Diagram, "myDiagramDiv",
        {
          initialContentAlignment: go.Spot.Center
        });

    myDiagram.nodeTemplate =
      $(go.Node, "Auto",
        $(go.Shape,
          { fill: "white" },
          new go.Binding("fill", "color")),
        $(go.TextBlock,
          { margin: 10 },
          new go.Binding("text"))
      );

    myDiagram.linkTemplate =
      $(go.Link,
        $(go.Shape, { strokeWidth: 2 }),
        $(go.Shape, { toArrow: "OpenTriangle" })
      );

    myDiagram.model = new go.GraphLinksModel(
    [
      { key: 1, text: "Alpha", color: "lightblue", order: "1" },
      { key: 2, text: "Beta", color: "orange", order: "1" },
      { key: 3, text: "Gamma", color: "lightgreen", order: "1" },
      { key: 4, text: "Delta", color: "pink", order: "1" },
      { key: 5, text: "Epsilon", color: "lightyellow", order: "2" },
      { key: 6, text: "Zeta", color: "lavender", order: "2" },
      { key: 7, text: "Eta", color: "beige", order: "2" },
      { key: 8, text: "Theta", color: "lightgray", order: "2" },
    ],
    [
      { from: 6, to: 2 },
      { from: 5, to: 1 },
      { from: 8, to: 4 }
    ]);
  }
 </script>

and the chart is as follow:
Capture

Any help provided will be appreciated. Thanks.

Regards,
Brian

Posts: 1

Participants: 1

Read full topic

Inspecting item array values

$
0
0

@marin wrote:

Is it possible to attach data inspector to a table row?
Or make an editable adornment?

I want to be able to change some value using something like that… I know I could make a special node template and use this, but I was thinking if what I’m asking is possible.

Posts: 7

Participants: 2

Read full topic

How can i create this shapes in gojs

Switching between scrollModes

$
0
0

@maciej wrote:

Hi,

I got a couple questions.

  1. I am currently switching between scrollMods from diagram.scrollMode= go.Diagram.InfiniteScroll to diagram.scrollMode= go.Diagram.DocumentScroll. After doing so the scrollbar does not show up until I actively scroll. It looks like the child of the <div> that is a sibling of the <canvas> has a width of 1px until I scroll. I deal with this by programmatically running diagram.scroll(‘pixel’, ‘right’, 1) then diagram.scroll(‘pixel’, ‘left’, 1), but it would be nice if I did not have to do that.

  2. It seems like when I change from DocumentScroll to InfiniteScroll the viewport jumps to position (0,0). Is there any way to avoid this? I have some other things going on at the same time, so maybe it does not have to do with the scroll mode being changed, but it seems like it is.

  3. Have ya’ll given any thought to providing an ID to the <canvas> and the <div> elements that GoJS creates so that users can use getElementById on them?

Thanks!

Posts: 3

Participants: 3

Read full topic

Angular variable passing problem

$
0
0

@no_one345 wrote:

i m doing something like this on click-event
e=>this.nodeDoubleClick(this,e)
in js the click event could passed the obj as a parameter but in angular i cant seem to get the obj
this.nodeDoubleClick(e,obj)
i need to get the obj that clicked that called the function

Posts: 1

Participants: 1

Read full topic


How to create right-click menu after selecting mutiple nodes?

$
0
0

@aroel wrote:

Is it possible to create contextmenu or right-click menu after selecting multiple nodes or links?
if possible, how to do it?
I would like to trigger some events after selecting some nodes/links in my diagram.

thanks

Posts: 1

Participants: 1

Read full topic

Data inspector GoJS

$
0
0

@marin wrote:

I asked a question regarding data inspector yesterday, and a solution was provided. However, today I noticed that the data inspector doesn’t display 0 values (?). I’ve modified an example that I talked about in this post: Inspecting item array values
I’ve set a value of 0 to one of the items in the table and the values wasn’t displayed. When changed to 0.1, the value displays normally.
Seems like a bug?

The problem seems to be this line:
tbody.appendChild(this.buildPropertyRow(k, defaultValue || ‘’));

0 || ‘’ will result in an empty string

Posts: 3

Participants: 2

Read full topic

How to include and use datainspector in angular 6

$
0
0

@no_one345 wrote:

i m working on a diagram in angular i did it in js but i need to convert it to angular 6 but i cant seem to know how to use data inspector in my diagram is how to use it do in need to import it separately that go js or is it included in
import * as go from ‘gojs’;?
and how to initialize it

Posts: 2

Participants: 2

Read full topic

How to align all the node

$
0
0

@no_one345 wrote:

i m working on graphs i need to align all the node i.e each graph horizontally allignment

i need all 4 to be aligned on the x-axis

Posts: 4

Participants: 2

Read full topic

How to prevent diagram links from overlapping each other in ForceDirectedLayout

How shapes should be in fixed position in genogram?

$
0
0

@prameela.dara wrote:

Hi Walter,

My requirement is textlable should be displayed at above the links as shown below:

image

In the above diagram, textlable is 12345678901234567890&12345678901234567890 which is displayed at above the links between two nodes.

Below code I am using for links and nodes display:

myDiagram.linkTemplate = 
		$(go.Link,
				{
			//fromEndSegmentLength: 20 ,
			routing: go.Link.AvoidsNodes,
			adjusting: go.Link.End,
			//curve: go.Link.JumpGap,
			 corner: 5,
		     toShortLength: 4,	
			relinkableFrom: true,
			relinkableTo: true,
			reshapable: false,
			resegmentable: true,
		//	isLayoutPositioned:true,
			//segmentFraction: 0.5,
			layerName: "Background"
			

				},
				$(go.Shape, { strokeWidth: 2 })
		);

										}
PathPatterns.add("DivorceCloseAndStrong", $(go.Shape,{geometryString: "M0 18 L1 18  M0 0 L0 0 M0 30 L1 33",fill: "transparent",stroke: "black",strokeWidth: 1,strokeCap: "square"}));

myDiagram.linkTemplateMap.add("DivorceLinkFormat",  
			$(go.Link,  { selectable: false, routing: go.Link.AvoidsNodes,isLayoutPositioned:true  },
					$(go.Shape, 
							{ strokeWidth: 2 },
							new go.Binding("stroke", "patt", function(f) { return (f === "") ? "black" : "transparent"; }),
							new go.Binding("pathPattern", "patt", convertPathPatternToShape)),
							$(go.Shape, {geometryString: "m 0,8 l 14,-8 m -2,8 l 14,-8", width: 20, height: 20, strokeWidth: 2, stroke: "black" }),
							$(go.TextBlock, { margin: -2,alignment: go.Spot.Top,segmentOffset: new go.Point(0, -20)}, new go.Binding("text", "relationText")),
							$(go.TextBlock, { margin: -2,alignment: go.Spot.Top,segmentOffset: new go.Point(0, -10)}, new go.Binding("text", "srelationText"))
			));

if (relationCode == "divh") {
	var remarks_dh = data.dh;
	mdata = { from: key, to: relationNumber, labelKeys: [mlab.key], category: "DivorceLinkFormat", 
        relationText:remarks(relationText,relationNumber,remarks_dh,key),patt: "DivorceHostile", 
        toArrow: "Standard" 
};
model.addLinkData(mdata);

DivorceCloseAndStrong code id ‘divh’.

{key: 0, name: "aaa",s:"FM",divh:1,age:"31",relationText:"1=12345678901234567890&12345678901234567890"},
{key: 1, name: "bbb",s:"F",age:"29",nodeRemarks:"222222222"},

If I will use divh:1 and relationText at key:1 as below :

{key: 0, name: "aaa",s:"FM",age:"31"},
{key: 1, name: "bbb",s:"F",divh:0,age:"29",nodeRemarks:"222222222",relationText:"0=12345678901234567890&12345678901234567890"},

then textlabel is displaying at below the link as shown as the below pic.

image

In the above pic, links are reversing. Hence textlabel is displaying at below the links.It should not happen. textlabel should be displayed at above the links between the nodes.
This is my requirement.Is it possible?
Please let me know if need more details.

Thanks,
Prameela.D

Posts: 2

Participants: 2

Read full topic

Legends and title positioning issue

$
0
0

@no_one345 wrote:

i m using this code to proguce a title
this.diagram.add(
$(go.Part, { location: new go.Point(0,-40) },
$(go.TextBlock, “A Title”, {alignment: go.Spot.Top,font: “bold 14pt sans-serif”, stroke: “green” })));

but the positioning is nor effected if i change the points in location of new.go.point(0,-40)
all the dives use same diagram


i need the legend to be on the top right corner always

Posts: 2

Participants: 2

Read full topic


Angular incremental json problem

$
0
0

@no_one345 wrote:

i m working on a diagram in angular i need incremental json the diagram is a tree model so there are no links but on running this

this.diagram.addModelChangedListener(
e=>{
if (e.isTransactionFinished) {
// this records each Transaction as a JSON-format string
this.showIncremental(this.diagram.model.toIncrementalJson(e));
}
})

i get error

Posts: 5

Participants: 2

Read full topic

How-To: Hover hyperlink node to display value of text as tooltip instead of link

$
0
0

@brianc wrote:

Hi all,

I am creating a node with hyperlink. Whenever I hover the text, the link specified is displayed as a tooltip. Is it possible for the tooltip to display the text value instead of link?

Here are my simplified codes:

var $ = go.GraphObject.make;

    myDiagram =
      $(go.Diagram, "myDiagramDiv",
        { initialContentAlignment: go.Spot.Center });

    myDiagram.nodeTemplate =
      $(go.Node, "Auto",
        $(go.Shape, "RoundedRectangle", { stroke: null }, new go.Binding("fill", "bgcolor")),
        $("HyperlinkText",
          function(node) { return "https://www.google.com"; },
          function(node) { return node.data.longtext; },
            { stroke: "white", font: "bold 30pt arial", maxSize: new go.Size(300, NaN), wrap: go.TextBlock.WrapFit }
        ), { toolTip:
          $(go.Adornment, "Auto",
            $(go.Shape, { fill: "#FFFFCC" }),
            $(go.TextBlock, { margin: 4 },
              new go.Binding("text", "tooltip"))
          ) }
      );

    myDiagram.model = new go.GraphLinksModel([
      { key: 1, bgcolor: "red", longtext: "Looooonnnngggg text here", tooltip: "<%=strName1%>" },
      { key: 2, bgcolor: "green", longtext: "Another looooooooooooooonnnnnnnggggg text here", tooltip: "<%=strName2%>" },
    ],[
      { from: 1, to: 2 }
    ]);

If you hover the text, “www.google.com” will be displayed as tooltip instead of the value of longtext. Need some help here.

Thank you.

Regards,
Brian

Posts: 1

Participants: 1

Read full topic

How to update link strokeDashArray by link text

$
0
0

@dxxzst wrote:

I want to set different line styles according to different line texts.
Below is my code

myDiagram.linkTemplate = $$(go.Link, {
                //curve: go.Link.Bezier,
                toShortLength: 8,
                toEndSegmentLength: 20
            },
            $$(go.Shape, {strokeWidth: 2, stroke: "grey", strokeDashArray: []}),
            $$(go.Shape, {toArrow: "Triangle", fill: "grey", stroke: null}),
            $$(go.TextBlock, "", {
                textAlign: "center",
                stroke: "#2F4F4F"
            }, new go.Binding("text", "text", function (text, link) {
                if(text === 'something'){
                   **//update  link strokeDashArray here**
                    console.log(link);
                }
            }))
        );

Posts: 2

Participants: 2

Read full topic

Not working findNodesByExample on 1.8.16

$
0
0

@Nimesh wrote:

Hi Team,

I have script which uses findNodesByExample on 1.8.6 and it returns nodes with regex as expected.

When I upgrade go js to 1.8.16 same script is not working as expected.

Used function as below

getNodesFromDialog = function (dialog, nodeText)
{
var out = undefined;
var regex = new RegExp(nodeText, “i”);
var results = dialog.findNodesByExample({name: regex});
if (results.count > 0)
{
out = [];
results.each(function (n) {
if (!n instanceof window.go.Node)
return;
out.push(n);
});
}
return out;
}

please, suggest how to resolve this ?

With Regards, NV

Posts: 2

Participants: 2

Read full topic

How to modify the width of node

$
0
0

@zhouhuan0910 wrote:

hello, if i want to set width of node while setDataProperty, what should i do
now,i can get the obj
image
What should I do to change the height and width of the custom using selectionCard?

Posts: 1

Participants: 1

Read full topic

Viewing all 6976 articles
Browse latest View live