Skip to content

v12.44.0

Compare
Choose a tag to compare
@tomlyn tomlyn released this 19 Mar 22:26
· 243 commits to main since this release
c20f7e3

Feature Enhancements

Common-Canvas

#1744 Palette icon should show selected (blue underline) highlighting when displayed in wide state

Note: The implementation of this issue required a change to the Notifications icon in the toolbar. The class that specifies the severity of the notifications (info. success, warning or error) has moved from the toolbar-content-item to its ancestor class toolbar-item.

#1750 Setting input port positions for nodes with multiple inputs

Applications are now able to programmatically position either single or multiple input/output ports anywhere relative to the node boundary: either inside or outside the node. Previously, applications could only position single input/output nodes. Multiple nodes were always arranged by the common-canvas layout code.

The following layout fields have been introduced. They can be overridden in the config passed to <CommonCanvas>, by specifying them in the config.enableNodeLayout object, or in the layout object returned from the layoutHandler callback.

For input ports:

  • inputPortAutoPosition

    • This is a boolean. If set to true (the default) multiple input ports are automatically arranged by common-canvas also single input ports are automatically positioned by common-canvas when the node height is greater than the default height which it might be with resizable nodes. If set to false, the entries in the inputPortPositions array will be used to position single and multiple input ports.
  • inputPortPositions

    • This is an array. Each element of the array looks like this: { pos: “topLeft”, x_pos: 10, y_pos: 10 } The pos field can be one of the nine points around the node:

      "topLeft", "topCenter", "topRight",
      "middleLeft", "middleCenter", "middleRight",
      "bottomLeft", "bottomCenter", "bottomRight".

while x_pos and y_pos are additional offsets (in pixels) from that position. Specifying a position (pos) for a port ties that port to that position on the node which means, with resizable nodes, the port will move with the position it is attached to as the node is sized.

If a node has a single input port and the node is the default height, common-canvas will use the zeroth element from inputPortPositions to position it, regardless of what inputPortAutoPosition is set to. If the node is greater than the default height, the single port will be positioned by common-canvas automatically when inputPortAutoPosition is set to true and will use the position from the array when inputPortAutoPosition is set to false.

If a node has more than one input port and inputPortAutoPosition is false, common-canvas will use the elements from the inputPortPositions array to position the ports in the same order that they appear for the node’s inputs array in the pipeline flow. If inputPortAutoPosition is set to true, common-canvas will automatically position the ports vertically (in the y direction) however it will use the pos and x_pos from the zeroth element of the array to position the nodes horizontally (in the x direction) - this is to maintain historic behavior.

Note: the behavior described above is slightly different if config.enableLinkDirection is set to either TopBottom or BottomTop. With those settings the behaviors are transposed between vertical and horizontal as might be expected. So for example, a single port is positioned based on whether the width of the node is wider than the default width rather that it based on height.

For output ports:

These two fields have been added. These behave in the same way as their input port equivalents.

  • outputPortAutoPosition
  • ouputPortPositions

The following 12 node layout fields have been deprecated and support for them will be removed in a future major release. If you have overridden them in your application’s config (in config.enableNodeLayout) or in what is returned from the layoutHandler callback, they will continue to work as before but it is recommended that you convert to use the new approach now by specifying a single entry in the inputPortPositions and/or outputPortPositions array containing the appropriate pos, x_pos and y_pos values.

inputPortLeftPosX
inputPortLeftPosY

inputPortTopPosX
inputPortTopPosY

inputPortBottomPosX
inputPortBottomPosY

outputPortRightPosX
outputPortRightPosY

outputPortTopPosX
outputPortTopPosY

outputPortBottomPosX
outputPortBottomPosY

Common-Properties

Just bug fixes.

Issues Resolved

  • #1742 Overflow menu is not closed when canvas width is increased by @tomlyn in #1743
  • #1744 Palette icon should show selected (blue underline) highlighting… by @tomlyn in #1745
  • #1746 Refactor node preparation code in object model by @tomlyn in #1747
  • #1752 Common-canvas mapping relation adjusting port position performa… by @tomlyn in #1753
  • #1750 Setting input port positions for nodes with multiple inputs by @tomlyn in #1751
  • #1754 Tooltip information icon should use -02 color by @tomlyn in #1755
  • #1756 Switching between show and hide comments causes focus to move a… by @tomlyn in #1757

Full Changelog: v12.43.0...v12.44.0