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

Template suggestion for a specific requirement

$
0
0

@ameyvgupte wrote:

Hi,
We have a requirement to draw such a flow diagram which will have looping like structure, Please refer the below image.
here from Node 3 link goes back to Node 1, similarly from Node 8 link goes back to Node 4.
But once condition Node is arrived, the below links should not go up, for example after 3 condition node is arrived so from node 4,5,6,7,8,9 can not go to node 1,2,3.
As well as from node 4,6,8 cannot go to node 5,7,9 and visa versa.

Can you suggest what will be the best suitable layout for this ?
Do we have any such structure or template through which we can achieve it?

Posts: 1

Participants: 1

Read full topic


Can we have separate delays for tooltip and mouseHover event handler on a node?

$
0
0

@console wrote:

Hi,

I have a node and on hover on the node, it either shows an adornment or a tooltip based on some condition.

$(
    go.Node,
    'Spot',
    {
        locationObjectName: 'SHAPE',
        locationSpot: go.Spot.Center,
        toolTip: tooltipTemplate,
        contextMenu,
        itemTemplate: boundaryEventItemTemplate(),
        resizable: true,
        resizeObjectName: 'PANEL',
        resizeAdornmentTemplate: nodeResizeAdornmentTemplate,
        selectionAdorned: true,
        selectionAdornmentTemplate: resizableSelectionAdornmentTemplate(),
        selectionChanged: onSelectionChanged,
        mouseHover: (e, obj) => {
            if (obj.part.findLinksOutOf().count === 1) {
                return;
            }
            const node = obj.part;
            const hoverAdornment = getHoverAdornment(node.data);
            hoverAdornment.adornedObject = node;
            node.addAdornment('mouseHover', hoverAdornment);
        },
    },

Showing the adornment is handled in a mouseHover handler. Currently, we’re setting the delay using following rule:
diagramInstance.toolManager.hoverDelay = 500;
But we’d like to have separate delays for showing the tooltip and adornment. Is it possible to achieve this ?

Posts: 1

Participants: 1

Read full topic

Diagram preview (angular)

$
0
0

@james1 wrote:

Hi,
I am using gojs library at my angular client.
I would like to show grid with preview diagrams (without any functionality).
There is way to print preview of existing diagrams?

thank you.

Posts: 2

Participants: 2

Read full topic

Additional link is created on addition of new node

$
0
0

@ameyvgupte wrote:

Hello,

I am trying to add a new node as suggested in StateChart sample. I made some modification as per my requirement. Additional link get added in the diagram after the code is executed. Also on undo the diagram does not work as expected. Please let me know if I have missed any thing in below code. I am using Angular for development.

Thanks
Amey

const addNodeAndLink = (e, obj) => {
const adornment = obj.part;
const diagram = e.diagram;
diagram.startTransaction(‘Add new node’);

const fromNode = adornment.adornedPart;
const fromData = fromNode.data;
nodeKey++;

const newData = { key: nodeKey, category: ‘DataNode’, node_name: ‘New Node’ };
const model = diagram.model;
model.addNodeData(newData);

const fromLinkdata = {
from: model.getKeyForNodeData(fromData),
to: nodeKey,
};
model.addLinkData(fromLinkdata);

const linkIt = fromNode.findLinksOutOf();
linkIt.next();
const link = linkIt.value;
const toLinkdata = {
from: nodeKey,
to: link.data.to,
};
model.addLinkData(toLinkdata);

model.removeLinkData(link.data);

const newNode = diagram.findNodeForData(newData);
diagram.select(newNode);

diagram.commitTransaction(‘Add new node’);

diagram.scrollToRect(newNode.actualBounds);
};

Posts: 2

Participants: 2

Read full topic

Problem with positioning title at the bottom of a layout

$
0
0

@useche_dev wrote:

Hi, I have a question about a layout.I have a group with your title and under it, a series of nodes. My idea is to position the nodes first and the title at the bottom. I have been modifying the GridLayout of the group and the alignment of the internal panel but it doesn’t work, any idea? Thanks in advance.

 diagram.groupTemplateMap.add("zones",
      $(go.Group, "Auto",
        {
          layout:
            $(go.GridLayout,
              {
                wrappingColumn: 2, alignment: go.GridLayout.Position,
                cellSize: new go.Size(1, 1), spacing: new go.Size(8, 8)
              })
        },
        new go.Binding("background", "isHighlighted", function(h) { return h ? "rgba(255,0,0,0.2)" : "transparent"; }).ofObject(),
        $(go.Shape, "RoundedRectangle", 
          new go.Binding("stroke", "stroke"),
          new go.Binding("fill", "background"),
          { strokeWidth: 1, parameter1: 10, alignment: go.Spot.Center}),
        $(go.Panel, "Vertical",
          $(go.Panel, "Vertical",
            { stretch: go.GraphObject.Horizontal},
            new go.Binding("width", "width"),
            new go.Binding("height", "height"),
        
            $(go.TextBlock,
              {
                alignment: go.Spot.TopCenter,
                editable: false,
                margin: 5,
              },
              new go.Binding("font", "font"),
              new go.Binding("stroke", "textColor"),
              new go.Binding("text", "text").makeTwoWay()), 
          ),
          $(go.Placeholder,
            { padding: 5, alignment: go.Spot.BottomCenter }),
            
        ) 
      ));

Posts: 3

Participants: 2

Read full topic

Template map problem

$
0
0

@sarvesh93 wrote:

I am generating components dynamically on user input and using template map.
Problem is, whenever I generate a new component, all the other resized components revert to their original sizes. Is there a way I can avoid this?
Thanks

Posts: 2

Participants: 2

Read full topic

SVG image is cut off when exporting diagram as SVG

$
0
0

@Dominic.Lerbs wrote:

Hi,

I have a diagram with a node containing an SVG icon. The diagram is displayed correctly.
However, when I export the diagram as an SVG, the icon is cut off at the borders.

Do you know why this gets cut off? Is there some configuration missing?

Posts: 3

Participants: 2

Read full topic

Angular, undo is not working when node data contains arrrays

$
0
0

@Hazzed wrote:

Hi,
I have an app that is using gojs-angular components and is based on gojs-angular-basic demo (https://github.com/NorthwoodsSoftware/gojs-angular-basic). I want my node data to contain arrays which would specify previous and next nodes that are linked to given node.

  public diagramNodeData = [
    {
      id: 1,
      key: "1",
      body: "Alpha",
      prev: [],
      next: [2],
    },
    {
      id: 2,
      key: "2",
      body: "Beta",
      prev: [1],
      next: [],
    },
  ];

The problem I have is that undo works only if I change position of node with mouse. It does not work in situations such as changing text in TextBlock, copying nodes or dropping external objects from palette. When I remove prev and next arrays from objects in diagramNodeData everything seems to work just fine. diagramNodeData is synchronized with diagram nodes by DataSyncService provided by gojs-angular.

Here is my node template:

dia.nodeTemplate = $(
      go.Node,
      "Spot",
      $(
        go.Panel,
        "Auto",
        $(go.Shape, "RoundedRectangle", { stroke: null, fill: "lightblue" }),
        $(
          go.TextBlock,
          { margin: 8, editable: true },
          new go.Binding("text", "body").makeTwoWay()
        )
      ),
      // Ports
      makePort("t", go.Spot.TopCenter),
      makePort("l", go.Spot.Left),
      makePort("r", go.Spot.Right),
      makePort("b", go.Spot.BottomCenter)
    );

Thank you in advance for your help.

Posts: 1

Participants: 1

Read full topic


groupTemplate position changes after adding nodes

$
0
0

@Krish wrote:

I am new to GoJS and looking for help. This is my default layout view

After adding nodeData the layout changes to something like

Here is my code:

‘’’
myDiagram.groupTemplate =
(go.Group, "Auto", { layout: (go.GridLayout, { spacing: new go.Size(15, 15)}),
movable: false, selectable: false },
new go.Binding(“position”, “pos”, go.Point.parse).makeTwoWay(go.Point.stringify),
(go.Shape, "RoundedRectangle", {strokeDashArray:[8,4] }, new go.Binding("stroke", "strokeColor"), new go.Binding("fill", "fillColor"), new go.Binding("desiredSize", "size", go.Size.parse) ), (go.Placeholder, { padding: 10 })
);

nodeDataArray: [
{“key”:“G1”, “isGroup”:true, “pos”:“0 50”, “size”:“405 100”, “fillColor”: “#ffffff”, “strokeColor”: “#cacecd” },
{“key”:“G2”, “isGroup”:true, “pos”:“0 155”, “size”:“250 200”, “fillColor”: “#f0f3fa”, “strokeColor”: “#57bdeb”},
{“key”:“G3”, “isGroup”:true, “pos”:“255 155”, “size”:“150 200”, “fillColor”: “#f0f3fa”, “strokeColor”: “#57bdeb”},
{“key”:“G4”, “isGroup”:true, “pos”:“0 360”, “size”:“405 100”, “fillColor”: “#ffffff”, “strokeColor”: “#cacecd”},
{ key: 1, group: “G1”},
{ key: 2, group: “G4”},
{ key: 3, group: “G2”},
{ key: 4, group: “G2”},
{ key: 5, group: “G2”},
{ key: 6, group: “G3”},
{ key: 7, group: “G3”},
{ key: 8, group: “G2”},
]
‘’’
How do I control the position change of the template group after adding nodes.

Posts: 2

Participants: 2

Read full topic

Can we change image src while change of Orientation

$
0
0

@ameyvgupte wrote:

Hi I have different Node templates, out of which one node template has image,
Now when i change diagrams orientation from angle 0 to 90 or visa-versa, need to toggle img src is there any method for the same…?

Posts: 2

Participants: 2

Read full topic

BPMN Boundary Event

$
0
0

@suprith_sa wrote:

Hi ,

I am using the BPMN workflow, whenever i add and boundary event and try to link the event with another node, it’s start from the actual node itself instead from the boundary event. like below

. Can you please let me know what am i missing?

Posts: 2

Participants: 2

Read full topic

Binding Does not Evaluate on Initial Load of Diagram

$
0
0

@wleung7 wrote:

I have created a context menu with a delete button as follows:

$ < go.Panel > (
	'ContextMenuButton', {
		'ButtonBorder.fill': '#F1F1F1'
	}, {
		click: (e, obj) => {
			const ad = obj.part as go.Adornment;
			const node = ad.adornedPart as go.Node;
			this.commentNode = node;
			this.commentDeleted.emit(node);
		}
	},
	new go.Binding('ButtonBorder.fill', '', () => {
		const commentAct = this.commentNode.data as Activity;
		console.log(
			'Delete comment button binding: ' +
			commentAct.comments
		);
		return commentAct && commentAct.comments && commentAct.comments !== '' ?
			'#F1F1F1' :
			'transparent';
	}),
	$(
		go.TextBlock,
		'Delete', {
			font: this.defaultFont,
			desiredSize: new go.Size(50, 25),
			alignmentFocus: go.Spot.Center,
			margin: new go.Margin(10, 0, 0, 18)
		},
		new go.Binding('stroke', '', () => {
			const commentAct = this.commentNode.data as Activity;
			console.log(
				'Delete button stroke binding: ' +
				commentAct.comments
			);
			return commentAct && commentAct.comments && commentAct.comments !== '' ?
				'black' :
				'lightgrey';
		})
	)
),

On initial load of diagram, when I opened the context menu for the first time, I did not even see the console.log() statements printing to the console.

Needless to say, commentAct.comments should be empty on initial load, I expected the delete button to be transparent with lightgrey stroke, but I saw #F1F1F1 background color and black stroke.

Once I set commentAct.comments to a non-empty string, then reset commentAct.comments to the empty string, then the Binding correctly sets the background color to transparent and the stroke to lightgrey.

Can you please advise on the reason and the fix?

Thanks.

Posts: 6

Participants: 2

Read full topic

Gantt Chart, nodes showing in the wrong position of grid

$
0
0

@RSilva wrote:

Hello,
I am developing a Gantt diagram, in which it will cover several “projects”.
I’ve been looking at your examples, namely:

and I find myself adapting them for my case.
My problem at this point is that somehow the dates that I enter aren’t appearing in the grid in their correct positions. Instead of each node advance in time, they are going back in time.

Example:
Origin Date = 2020/05/08 18:38
First node = 2020/05/08 18:38, so it should appear at the gradScaleHoriz1 = 2020/05/08 and gradScaleHoriz2=18(plus the minutes)

I noticed 2 things:

  • A comment that we should assume that x == 0 is the local midnight of some date
    // Assume x == 0 is OriginDate, local midnight of some date.
    var OriginDate = new Date();

  • This function that take in account the Origin date and the data value of the node I introduce, and subtracts.
    function convertDateToX(dt) { return (OriginDate.valueOf() - dt.valueOf()) / MillisPerPixel; }

And I have been “back in forth” trying to solve this for the past days… but still no solution for my problem.

Can you tell me what is causing this? And how to fix it?

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Gantt chart</title>
  <meta name="description" content="A Gantt chart that supports zooming into the timeline." />
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="go.js"></script>

 <script id="code">
  // Define Graduated Panels to show the days, to show the hours, and to separate the days and hours.

  // Assume x == 0 is OriginDate, local midnight of some date.
  var OriginDate = new Date(2020,04,08,17,40);

  // Assume 20 document units equals one hour.
  var HourLength = 20;
  var HoursPerDay = 24;
  var DayLength = HourLength * HoursPerDay;
  var MillisPerHour = 60 * 60 * 1000;
  var MillisPerPixel = MillisPerHour / HourLength;

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

    myDiagram =
      $(go.Diagram, "myDiagramDiv",  // create a Diagram for the DIV HTML element
        {
          isReadOnly: true,       // deny the user permission to alter the diagram or zoom in or out
          "animationManager.isEnabled": false,
          initialContentAlignment: go.Spot.TopLeft,
          grid:
            $(go.Panel, "Grid",
              { gridCellSize: new go.Size(HourLength, 30) },
              $(go.Shape, "LineH", { stroke: 'lightgray' }),
              $(go.Shape, "LineV", { stroke: 'lightgray' }),
            ),
          "draggingTool.isGridSnapEnabled": true,
          "resizingTool.isGridSnapEnabled": true,
          scrollMode: go.Diagram.InfiniteScroll,  // allow the diagram to be scrolled arbitrarily beyond content
          positionComputation: function(diag, pos) {  // but not too far vertically, or at all if fits in viewport
            var y = pos.y;
            if (diag.documentBounds.height < diag.viewportBounds.height) {
              y = 0;
            } else {
              y = Math.min(y, diag.documentBounds.bottom - diag.viewportBounds.height);
              if (y < 0) y = 0;  // don't show negative Y coordinates
            }
            return new go.Point(pos.x, y);
          },
          nodeTemplate:
            $(go.Node, "Auto",
              {
                height: 30,
                dragComputation: function(part, pt, gridpt) {
                  return new go.Point(gridpt.x, Math.max(0, gridpt.y));
                },
                resizable: true,
                resizeAdornmentTemplate:
                  $(go.Adornment, "Spot",
                    $(go.Placeholder)//, //Comentado permite com que ele faça resize às "caixas"
                    //$(go.Shape,  // only a right-side resize handle
                    //  { alignment: go.Spot.Right, cursor: "col-resize", desiredSize: new go.Size(8, 8), fill: "dodgerblue" })
                  ),
                toolTip:
                  $("ToolTip",
                    $(go.TextBlock,
                      new go.Binding("text", "", function(data) { return data.text + "\nstart: " + data.date + "\nhours: " + data.length; }))
                  )
              },
              new go.Binding("position", "", function(data) { return new go.Point(convertDateToX(data.date), convertRowToY(data.row)); })
                .makeTwoWay(function(pos, data) { data.row = convertYToRow(pos.y); data.date = convertDateToX(pos.x); }),
              new go.Binding("width", "length", function(l) { return l * HourLength; })
                .makeTwoWay(function(w) { return w / HourLength; }),
              $(go.Shape, { fill: "white" },
                new go.Binding("fill", "color")),
              $(go.TextBlock, { editable: false }, //editable = true, permite com que ele alterar o texto
                new go.Binding("text").makeTwoWay())
            ),
          "ModelChanged": function(e) {  // just for debugging
            if (e.isTransactionFinished) {
              document.getElementById("mySavedModel").value = e.model.toJson();
            }
          },
          "undoManager.isEnabled": false // Se for igual a true, faz as funcionalidades do CTRL-Z
        });

    myColumnHeaders =
      $(go.Diagram, "myColumnHeadersDiv",
        {
          isReadOnly: true,
          "animationManager.isEnabled": false,
          initialContentAlignment: go.Spot.TopLeft,
          allowHorizontalScroll: false,
          allowVerticalScroll: false,
          allowZoom: false,
          padding: 0
        });


    // Basic coordinate conversions, between Dates and X values, and between rows and Y values:

    function convertXToDate(x) { return new Date(OriginDate.valueOf() + x * MillisPerPixel); }

    function convertDateToX(dt) { return (OriginDate.valueOf() - dt.valueOf()) / MillisPerPixel; }

    function convertYToRow(y) { return Math.floor(y/30) + 1; }  // assume one-based row indexes

    function convertRowToY(i) { i = Math.max(i, 1); return (i-1) * 30; }


    function initColumnHeaders() {
      // Assume the Graduated Panels showing the days and hours are fixed in the document;
      // and by disallowing scrolling or zooming they will stay in the viewport.

      var gradScaleHoriz1 =
        $(go.Part, "Graduated",  // show days
          { layerName: "Grid", position: new go.Point(0, 0), graduatedTickUnit: HourLength },
          $(go.Shape, { geometryString: "M0 0 H3600" }),
          $(go.Shape, { geometryString: "M0 0 V20", interval: HoursPerDay }),  // once per day
          $(go.TextBlock,
            {
              font: "10pt sans-serif", interval: HoursPerDay,
              alignmentFocus: new go.Spot(0, 0, -2, -4),
              graduatedFunction: function(v) {
                var d = new Date(OriginDate);
                d.setDate(d.getDate() + v / DayLength);
                // format date output to string
                var options = { weekday: "short", month: "short", day: "2-digit", year: "numeric" };
                return d.toLocaleDateString("pt-PT", options);
              }
            })
        );

      var gradScaleHoriz2 =
        $(go.Part, "Graduated",  // show hour of day
          { layerName: "Grid", position: new go.Point(0, 20), graduatedTickUnit: HourLength },
          $(go.Shape, { geometryString: "M0 30 H3600" }),
          $(go.Shape, { geometryString: "M0 0 V20" }),  // every hour
          $(go.TextBlock,
            {
              font: "7pt sans-serif",
              segmentOffset: new go.Point(7, 7),
              graduatedFunction: function(v) {
                v = (v / HourLength) % HoursPerDay;  // convert document coordinates to hour of day
                if (v < 0) v += HoursPerDay;
                return Math.floor(v).toString();
              }
            }
          )
        );

      // Add each part to the diagram
      myColumnHeaders.add(gradScaleHoriz1);
      myColumnHeaders.add(gradScaleHoriz2);

      // Add listeners to keep the scales/indicators in sync with the viewport
      myDiagram.addDiagramListener("ViewportBoundsChanged", function(e) {
        var vb = myDiagram.viewportBounds;

        // Update properties of horizontal scale to reflect viewport
        gradScaleHoriz1.graduatedMin = vb.x;
        gradScaleHoriz1.graduatedMax = vb.x + vb.width;
        gradScaleHoriz1.elt(0).width = myColumnHeaders.viewportBounds.width;

        gradScaleHoriz2.graduatedMin = vb.x;
        gradScaleHoriz2.graduatedMax = vb.x + vb.width;
        gradScaleHoriz2.elt(0).width = myColumnHeaders.viewportBounds.width;
      });
    }

    function initRowHeaders() {
      myDiagram.addDiagramListener("ViewportBoundsChanged", function(e) {
        // Automatically synchronize this diagram's Y position with the Y position of the main diagram, and the scale too.
        myRowHeaders.scale = myDiagram.scale;
        myRowHeaders.position = new go.Point(0, myDiagram.position.y);
      });

      myDiagram.addDiagramListener("DocumentBoundsChanged", function(e) {
        // The row headers document bounds height needs to be the union of what's in this diagram itself and
        // the what's in the main diagram; but the width doesn't matter.
        myRowHeaders.fixedBounds = new go.Rect(0, myDiagram.documentBounds.y, 0, myDiagram.documentBounds.height)
          .unionRect(myRowHeaders.computePartsBounds(myRowHeaders.parts));
      });
    }

    function initRows() {


     
      myDiagram.groupTemplateMap.add("Project 1",
      $(go.Group, "Auto",
        $(go.Shape, { fill: "transparent", stroke: "black" }),
        $(go.Placeholder, { padding: 15 }),
        $(go.TextBlock,{
                alignment: go.Spot.Top,
                editable: false,
                margin: 1,
                font: "bold 15px sans-serif",
                opacity: 0.75,
              },
        new go.Binding("text", "GroupText")),
        {
          toolTip:
            $("ToolTip",
              $(go.TextBlock, { margin: 4 },
                new go.Binding("text", "GroupTextTooltip"))
            )
        }
      ));

      myDiagram.model = new go.GraphLinksModel(
        [
            { key: "Project 1", isGroup: true, category: "Project 1", GroupText:"Project 1", GroupTextTooltip:"Project 1" }, 
            { key: "a", group: "Project 1", row: 3, date: new Date(new Date(2020,04,08,17,40).valueOf()), length: 3, text: "1º Task", color: "lightgreen" },
            { key: "b", group: "Project 1", row: 5, date: new Date(new Date(2020,04,08,17,40).valueOf() + 3 * MillisPerHour), length: 1, text: "2º Task", color: "lightgreen" },
            { key: "c", group: "Project 1", row: 7, date: new Date(new Date(2020,04,08,17,40).valueOf() + 4 * MillisPerHour), length: 7.5, text: "3º Task", color: "yellow" },
            { key: "d", group: "Project 1", row: 9, date: new Date(new Date(2020,04,08,17,40).valueOf() + 16.5 * MillisPerHour), length: 10, text: "4º Task", color: "yellow" },
        ],
        [ // link data
          { from: "a", to: "b" },
          { from: "b", to: "c" },
          { from: "c", to: "d" },
        ]);
    }

    console.log(myDiagram.model);

    initColumnHeaders();
    initRows();
  }
</script>
</head>
<body onload="init()">
  <div id="myColumnHeadersDiv" style="flex-grow: 1; height: 40px; border: solid 1px black"></div>
  <div id="myDiagramDiv" style="flex-grow: 1; height: 400px; border: solid 1px black"></div>
  <textarea id="mySavedModel" style="width:100%;height:250px"></textarea>
</body>
</html>

Thank you in advance for your time, and for your attention.

Posts: 2

Participants: 2

Read full topic

Expand nodes into new graph

Get Nodes that have param isGroup to create a Side Panel(Overview of Gantt)

$
0
0

@RSilva wrote:

I am creating a Gantt Diagram where I will approach several projects. (Thanks in advance, to Walter for the answer to my last request)

My goal at this point is to create a side panel, where each of the projects is shown, and if the user clicks on one of them, they are redirected in the Grid to the Project, in order to make navigation in the Grid simpler. In order to know each project I have in my Grid, I am looking at the nodes that have the “isGroup” parameter.

I’ve been reading your library about node and groups, namely the functions that I can call. I have seen the findNodeForKey, findNodesByExample, but I think that is not the answer to my problem …

My doubts here are:

  • How do I search for all Nodes that have the isGroup parameter.
  • How do I show it on my Lateral panel (here I think I will have to create a new div and bind the result of the nodes (isGroup = true).
  • Redirect the Grid to the position of the Project.

If you already have examples, I am grateful. I have been searching here in the forum, and in Documentation to see if there was something similiar that I could use to accomplish my goal. In fact, I found your example of Overview, but I think it is not the best solution for me.

Posts: 2

Participants: 2

Read full topic


GoJS version 2.1.16

$
0
0

@walter wrote:

Changes for 2.1.16

  • Fixed Diagram.makeImage when a Picture has an SVG source that has a different size than its viewbox. In some browsers the SVGs had been drawn with the incorrect aspect ratio.
  • Fixed Diagram.delayInitialization incorrectly resetting the Diagram.position when animation is enabled.
  • Added the Animated Focus sample, which demonstrates how to scroll to a node and really make it obvious where the node is and what it looks like.
  • Added the Add To Palette sample, which allows the user to add items from the palette by selecting a node, customizing it, and then executing a command to copy it to the palette’s model. The user can also remove selected items from the palette via a command, even though Palette.isReadOnly is true.

For previous releases, see: GoJS version 2.1.15

Posts: 2

Participants: 1

Read full topic

Node Validation Show Error Message for Invalid Connection

Go.shape in tooltip

$
0
0

@Viswanatha wrote:

Dear Team,

I wanted to customize tooltip with go.shape when I put below code it is showing like in image but this not expected, how to remove the white background around the shape. We have bought this product and have active license. please help us.

var linktooltip =
$(“ToolTip”,

				$(go.Shape, "circle",
    { fill: "lightgreen" }),
				$(go.TextBlock,  // bound to node data
				  {font: "bold 8pt sans-serif",alignment: go.Spot.Bottom},
				  new go.Binding("text","influencetype"))
			 
			  
			);

image

Posts: 2

Participants: 2

Read full topic

Two views with different list for diagram

$
0
0

@k.johnasher wrote:

I would like to develop something like two design area with the same diagram.model. Both design area should have different list(source1 should be in list1, source 2 and source 3 in list 2).

Is this even possible? Kindly do guide.

desk

Posts: 2

Participants: 2

Read full topic

Is it possible to add a group to a TreeLayou?

$
0
0

@Enniob wrote:

I have a basic diagram that is using a TreeLayout, and I need to add a group box around some nodes. Is it possible to do that?

Right now when I define the groupTemplate it moves the parent node but it does not draw the box around the other nodes.

Here is the my current code I have. I get a Tree view how I want, but the Group is all the way up to the left side and there is no box around the rest of the nodes.

   let myDiagram = $(go.Diagram, "nodesList",
      {
        initialDocumentSpot: go.Spot.TopCenter,
        initialViewportSpot: go.Spot.TopCenter,
        layout:
          $(go.TreeLayout,
            {
              arrangement: go.TreeLayout.ArrangementVertical,
              angle: 90
            }
          )
      });


    myDiagram.nodeTemplate = $(go.Node, "Auto", {
      locationSpot: go.Spot.Center
    }, $(go.Shape, "RoundedRectangle", {
      fill: "white",
      portId: "",
      cursor: "pointer",
      fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
      toLinkable: true, toLinkableSelfNode: true, toLinkableDuplicates: true
    },
    new go.Binding("fill", "color")),
    new go.Binding("figure"),
    $(go.TextBlock, {
      font: "bold 14px sans-serif",
      stroke: "#333",
      margin: 6,
      isMultiline: true,
      editable: false
    },
    new go.Binding("text", "text")));

    // GROUP
    myDiagram.groupTemplate = $(go.Group, "Vertical", 
      {
        selectionObjectName: "PANEL",
        ungroupable: false,
      },
      $(go.TextBlock,
        {
          font: "bold 15px sans-serif",
          editable: false
        },
        new go.Binding("text", "text").makeTwoWay(),
        new go.Binding("stroke", "color")
      ),
      $(go.Panel, "Auto",
        {
          name: "PANEL",
        },
        $(go.Shape, "Rectangle", 
          {
            fill: null,
            stroke: "gray",
            strokeWidth: 3,
            portId: "",
            cursor: "pointer",
            fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
            toLinkable: true, toLinkableSelfNode: true, toLinkableDuplicates: true
          }
        ),
        $(go.Placeholder, { margin: 10, background: "transparent" })
      )
    );

    myDiagram.linkTemplate = 
      $(go.Link, {
        routing: go.Link.Orthogonal,
        corner: 0
      },
        $(go.Shape, { strokeWidth: 2, stroke: "white" })
      );

    myDiagram.model = new go.TreeModel(this.assetsObject);

Posts: 5

Participants: 2

Read full topic

Viewing all 6926 articles
Browse latest View live