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

Support for importing & exporting BPMN in GOJS

$
0
0

@sharathchandramg wrote:

Hi,
I am evaluating drawing tools for one of my products. The main requirements for the drawing tool are

  1. Consume BPMN from external bpmn tools.
    Essentially, import a bpmn XML to GOJS and then work with the drawing.

  2. Allow to export the bpmn XML

Are there available as part of GOJS?

Posts: 1

Participants: 1

Read full topic


Default vs custom adornment

$
0
0

@jothibaskaran wrote:

Hi,

Previously I had a common selection adornment for all my nodes in my diagram. It was as given below:

let selad = new go.Adornment();
    selad.type = go.Panel.Auto;
    let seladhandle = new go.Shape();
    seladhandle.figure = 'RoundedRectangle';
    seladhandle.fill = null;
    seladhandle.stroke = '#00DFCC';
    seladhandle.strokeWidth = 3;
    selad.add(seladhandle);
    let selplace = new go.Placeholder();
    selad.add(selplace);
    diagram.nodeSelectionAdornmentTemplate = selad;
    diagram.groupSelectionAdornmentTemplate = selad;

On my nodes, I have a menu for Delete and Duplicate buttons. Duplicate functionality is achieved by copySelection() and pasteSelection().

Now, I changed the adornment to be specific to the different types of nodes in my application.

Now the adornment is a part of the node structure as follows:

$(go.Node, 'Table',

            { linkConnected: this.updatePort, linkDisconnected: this.updatePort,
                selectionObjectName: 'SHAPE',
                selectionAdornmentTemplate:
                $(go.Adornment, "Auto",
                    $(go.Shape,
                    {   fill: null, 
                        geometryString: 'F M30.36.5H196c9.113,0,17.621-2.612,16.5,16.5V78.042c0,.276,3.145,26.137-12.838,26.458H30.36C-6.553,93.241-8.643,41.97,6.227,17,13.681,4.482,30.36.5,30.36.5Z',                            
                        stroke: "#162789", 
                        strokeWidth: 4 },
                    ),
                    $(go.Placeholder)
                )  // end Adornment
            },

My duplicate functionality is currently not working as the node is not getting “selected” when i click on the button. Due to which copySelection is undefined.

Is this because of the difference in handling the selection adornment? How can this be resolved?

Posts: 1

Participants: 1

Read full topic

Non-real actualBounds has been set. Object Shape(None)#12794, actualBounds: Rect(NaN,NaN,45,30)

$
0
0

@catface wrote:

hi,

I have this weird problem where I’m getting this error for a link between two nodes that are slightly overlapping:

Uncaught Error: Non-real actualBounds has been set. Object Shape(None)#12794, actualBounds: Rect(NaN,NaN,45,30)
at s (gojs)
at it.l.arrange (gojs)
at dn.arrange (gojs)
at c.n.th (gojs)
at c.y.arrange (gojs)
at u.n.dw (gojs)
at wf (gojs)
at sp (gojs)
at u.n.hd (gojs)
at gojs

I only tried as high as goJS 2.0.18… didn’t test with goJS 2.1.

what I found so far is that the values of the waypoints sent to the link do matter…

BAD -> that’s the initial set of waypoints that is causing the crash
GOOD -> similar waypoints that work fine
FIXED -> whatever goJS sets for the BAD link if I sent an empty array of points as the initial bindings

as far as I can tell the link template is pretty standard… just a line and an arrow…

any ideas where to look next?.. or how to fix this?

Posts: 4

Participants: 2

Read full topic

Gojs如何通过外部按钮来动态开启和关闭自动布局?

$
0
0

@Meizhizhi wrote:

页面中,如何通过外部按钮,来控制gojs自动布局的开启或者关闭呢?
点击按钮开启自动布局,再次点击关闭自动布局。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

Posts: 2

Participants: 2

Read full topic

Can i help me. see

$
0
0

@luocong2016 wrote:

I would like to right-click on the expansion map.
9ab94e6e
Expand details near the original node.
8c147704
I hope the connecting line is not blocked.

I’m sorry. I didn’t describe it clearly
For example, right click to show some nodes.
I need to right-click to show details in the ring.
These detail nodes can automatically surround nearby.

I refer to it.
demo: https://github.com/NorthwoodsSoftware/GoJS/blob/28581a45554121905794a800434db2873ea25460/intro/templateMaps.html

‘itemArray’ is used in my project.
But I still don’t understand how to combine them

Posts: 1

Participants: 1

Read full topic

addNodeData then findNodeForData results in null

$
0
0

@mcowan wrote:

Given the following code, we get lots of inconsistent behavior:

diagram.model.addNodeData(data)
const node = diagram.findNodeForData(data)
// then we edit the node and also set some fields if the node is within the virtualized viewport

The problem is, the node variable is often null, sometimes it is not null.
How do we make this more reliable so that node is never null in this case.

Posts: 6

Participants: 3

Read full topic

HTML context menu retains on the screen

$
0
0

@Tany wrote:

Hi,
We use native HTML when implementing context menu for all elements including diagram.
If i user right click on the diagram, the context menu is show, but, then, if he moves the mouse OUTSIDE the diagram and click elsewhere on the screen, the context menu retains on the screen.
The context menu disappears only when:

  1. The user selects one of the options.
  2. The user clicks elsewhere on the diagram.

What can be done ?
Regards,
Tany

Posts: 3

Participants: 2

Read full topic

Stretch multiple nodes inside a group

$
0
0

@md wrote:

I have a diagram with groups that contain multiple child groups. I’m trying to get all the child groups to stretch horizontally to fill the parent group.

I can reproduce my issue using this example: https://gojs.net/latest/samples/regrouping.html
And this model data:
{ “class”: “go.GraphLinksModel”,
“nodeDataArray”: [
{“key”:2, “text”:“Main 2”, “isGroup”:true, “category”:“OfGroups”},
{“key”:6, “text”:“Group D”, “isGroup”:true, “category”:“OfNodes”, “group”:2},
{“key”:7, “text”:“Group E”, “isGroup”:true, “category”:“OfNodes”, “group”:6},
{“key”:8, “text”:“Group F Long Name”, “isGroup”:true, “category”:“OfNodes”, “group”:6},
{“text”:“first D”, “group”:7, “key”:-14},
{“text”:“first E”, “group”:8, “key”:-15}
],
“linkDataArray”: [ ]}

Note that “Group E” doesn’t stretch to fill the horizontal space even though stretch: go.GraphObject.Horizontal is specified in the template.

Capture

Is there a simple way to do this? I saw another post mentioning using the Swim Lane example to write a custom layout manager, is that the best approach here?

Posts: 3

Participants: 2

Read full topic


Is it ok to add licenseKey to our diagram which can be easily accessible through console?

$
0
0

@mithun wrote:

Hi,
Is it ok to add licenseKey to our diagram which can be easily accessible through console? Or do you suggest any other way to use the license key in production environment?

Thanks
Mithun

Posts: 1

Participants: 1

Read full topic

Just touched this thing..On grouping cases

$
0
0

@lutz wrote:

Just touched this thing.
I want to know how the deployment is triggered.For example, switch to a button or right-click.And the position of the figure, such as the average circle.
I’m referring to grouped cases.

Posts: 1

Participants: 1

Read full topic

Override default copy, paste, undo and redo behaviour

$
0
0

@kishangajjar wrote:

I have some additional data added on the Node without using the transaction manager.
This is the temporary data which i dont want gojs to remember. i mean when user is doing undo or redo or copy/paste gojs should not use such temporary data.

so lets say on the node i have added 1 property called as Roles. If user does undo and does redo again, then it should add the node without Roles property.

How can i achieve this ?

Posts: 6

Participants: 2

Read full topic

How to remove the group button

$
0
0

@lutz wrote:

How to remove the group button.Can it be triggered in other ways.

image

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="https://unpkg.com/gojs/release/go-debug.js"></script>
  </head>
  <body>
    <div id="myDiagramDiv" style="border: solid 1px blue; height:600px"></div>
    <script>
      var $ = go.GraphObject.make;

      var myDiagram = $(go.Diagram, 'myDiagramDiv', {
        'undoManager.isEnabled': true, // enable Ctrl-Z to undo and Ctrl-Y to redo
        layout: $(go.TreeLayout, {
          angle: 90,
          arrangement: go.TreeLayout.ArrangementHorizontal,
          isRealtime: false
        })
      });

      myDiagram.nodeTemplate = $(
        go.Node,
        'Auto',
        $(go.Shape, 'Rectangle', { stroke: null, strokeWidth: 0, fill: '#fff' }),
        $(go.TextBlock, { margin: 7, font: 'Bold 14px Sans-Serif' }, new go.Binding('text', 'key'))
      );

      myDiagram.linkTemplate = $(
        go.Link,
        { routing: go.Link.Orthogonal, corner: 10 },
        $(go.Shape, { strokeWidth: 2 }),
        $(go.Shape, { toArrow: 'OpenTriangle' })
      );

      myDiagram.groupTemplate = $(
        go.Group,
        'Auto',
        {
          layout: $(go.TreeLayout, { angle: 90, arrangement: go.TreeLayout.ArrangementHorizontal, isRealtime: false }),
          isSubGraphExpanded: false,
          subGraphExpandedChanged: function(group) {}
        },

        $(go.Shape, 'Circle', { fill: null, stroke: 'gray', strokeWidth: 2 }),

        $(
          go.Panel,
          'Vertical',
          { defaultAlignment: go.Spot.Left, margin: 4 },
          $(
            go.Panel,
            'Horizontal',
            { defaultAlignment: go.Spot.Top },
            // the SubGraphExpanderButton is a panel that functions as a button to expand or collapse the subGraph
            $('SubGraphExpanderButton'),
            $(go.TextBlock, { font: 'Bold 18px Sans-Serif', margin: 4 }, new go.Binding('text', 'key'))
          ),
          $(go.Placeholder, { padding: new go.Margin(0, 10) })
        )
      );

      myDiagram.model.nodeDataArray = [
        { key: 'Beta', isGroup: true },
        { key: 'Gamma' },
        { key: 'Delta' },
        { key: 'Coco', group: 'Beta' }
      ];

      myDiagram.model.linkDataArray = [
        { from: 'Beta', to: 'Gamma' },
        { from: 'Coco', to: 'Delta' }
      ];
    </script>
  </body>
</html>

Posts: 1

Participants: 1

Read full topic

nodeSelectionAdornmentTemplate auto Adornment

$
0
0

@ahmetgundogdu wrote:

How do I solve this problem that is getting overflow?

I want to center the line exactly

https://codepen.io/Sami61/pen/MWWONEr

const nodeSelectionAdornmentTemplate = $(go.Adornment, "Auto",
    					$(go.Shape, { fill: null, stroke: "#dbe9f9", strokeWidth: 1.5 }),
    					$(go.Shape, "XLine", { visible: false, alignment: new go.Spot(0, 0, -2, 0), cursor: "default", desiredSize: new go.Size(3, 3), fill: "#fff", strokeWidth: 0.35, stroke: "#72a8e8" },
    					 new go.Binding("visible", function(val){
    						return val.isLock ? true : false
    					 })
    					),
    					$(go.Shape, "XLine", { visible: false, alignment: go.Spot.TopRight, cursor: "default", desiredSize: new go.Size(3, 3), fill: "#fff", strokeWidth: 0.35, stroke: "#72a8e8" },
    					 new go.Binding("visible", function(val){
    						return val.isLock ? true : false
    					 })
    					),
    					$(go.Shape, "XLine", { visible: false, alignment: go.Spot.BottomLeft, cursor: "default", desiredSize: new go.Size(1.5, 1.5), fill: "#fff", strokeWidth: 0.35, stroke: "#72a8e8" },
    					 new go.Binding("visible", function(val){
    						return val.isLock ? true : false
    					 })
    					),
    					$(go.Shape, "XLine", { visible: false, alignment: go.Spot.BottomRight, cursor: "default", desiredSize: new go.Size(1.5, 1.5), fill: "#fff", strokeWidth: 0.35, stroke: "#72a8e8" },
    					 new go.Binding("visible", function(val){
    						return val.isLock ? true : false
    					 })
    					),
    					$(go.Placeholder, { padding: 1 })
				)

Posts: 1

Participants: 1

Read full topic

Using AvoidsNodes for links with many nodes creates phantom links

$
0
0

@meganmoore wrote:

When I use AvoidsNodes for links on a graph that contains many nodes/links, the graph renders with what appear to be phantom links (links not touching any nodes). However, if you then move nodes around, you can tell that the links really do belong to nodes and they will suddenly reconnect themselves.

I did read that there is a performance issue with AvoidsNodes so this might be related. Setting the link routing to Orthogonal seems to fix the issue and we are fine with this solution. But I thought you might want to know about this issue.

The attached examples actually do not contain a lot of links/nodes, but I thought it was easier to see the issue with these screen shots.

At first rendering:

Floating%20link%20at%20first%20rendering

After moving a node:

Floating%20link%20after%20moving%20node

Posts: 6

Participants: 3

Read full topic

Shadow spread-radius

$
0
0

@Itai wrote:

Hi,

is there a way to control the spread radius of a Node shadow like in CSS?
I find the default radius too small and I want to increase it…

Thanks,
Itai

Posts: 2

Participants: 2

Read full topic


Typescript definition for settings points on a link

$
0
0

@Dominic.Lerbs wrote:

I try to set some points on a link as described in the documentation:

The setter also accepts an Array of alternating X,Y point values [1, 2, 3, 4, 5, 6], or an Array of Objects each of which has (lowercase) ‘x’ and ‘y’ properties that are numbers [{“x”:1,“y”:2}, {“x”:3,“y”:4}, {“x”:5,“y”:6}].

link.points = [4, 5, 122, 44, 333, 44];

However, this doesn’t work:
Type 'number[]' is missing the following properties from type 'List<Point>': add, addAll, clear, contains, and 23 more.

I think the TypeScript definition could be improved here, couldn’t it?

Posts: 2

Participants: 2

Read full topic

Set initial points of link when using normal routing with reshapable set to true

$
0
0

@Dominic.Lerbs wrote:

Hi,
I am using normal routing with reshapable and resegmentable set to true.
When the user creates a new link, I want to set a custom shape to the link, let’s say not straight but having a 45° corner.

I thought I could modify the link and set custom points in the LinkDrawn event.
This works initially, the link is displayed with the new points but

  • No handle point is displayed at the corner even though reshapable is set to true
  • The link is reset to a straight line as soon as I move a node or something

How could I create such a custom link layout? I don’t think I should override computePoints as the points should only be set initially and the points shouldn’t be recalculated after the link as been drawn.

Posts: 2

Participants: 2

Read full topic

GoJS 2.0.19 Released

$
0
0

@simon wrote:

Changes for 2.0.19

Note: these bugfixes will be incorporated into the 2.1 branch as part of the upcoming 2.1.1 release.

Posts: 2

Participants: 1

Read full topic

Move 2 nodes simultaneously

Relinking an existing link

$
0
0

@jothibaskaran wrote:

Hi,

I have a scenario where I have to update the content of a node based on the nodes connected to it.

For Eg: In the picture below:

  • If I connect node “Sensor1” to port “Input1”, I want to update the name “Sensor1” next to the port name in the node

  • Similarly when I connect “Sensor2” to “Input2”. I want the name “Sensor2” to appear next to the port name.

I have achieved this by tapping into the linkDrawn diagram event.

But I am facing an issue when I try to update this when links are re-linked.

While re-linking, How can I get the “to” and “from” properties of the existing link?

Posts: 9

Participants: 2

Read full topic

Viewing all 6968 articles
Browse latest View live