eclipse / elk

Eclipse Layout Kernel - Automatic layout for Java applications.
https://www.eclipse.org/elk/
Other
258 stars 86 forks source link

how do i set the minimum size for a node #1063

Closed ymolists closed 3 months ago

ymolists commented 3 months ago

Ask your questions

Hi Folks

Thank you so much for all your help and for this amazing tool !

I am trying to set minimum size for a particular node. unfortunately i am not able to do so

am also not able to link the graph the model might be too big here is a link

          "children": [
            {
              "id": "mur_364389292",
              "labels": [
                {
                  "text": "demo02_ingest_server"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 12.0
            },
            {
              "id": "mur_1246401472",
              "labels": [
                {
                  "text": "demo02_ingest_web"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 37.0
            },
            {
              "id": "mur_758764981",
              "labels": [
                {
                  "text": "demo02_ingest_mobile"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 62.0
            },
            {
              "id": "mur_3055755795",
              "labels": [
                {
                  "text": "demo02_ingest_rdbms"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 87.0
            },
            {
              "id": "mur_3573779915",
              "labels": [
                {
                  "text": "demo02_ingest_crm"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 112.0
            },
            {
              "id": "mur_3271830165",
              "labels": [
                {
                  "text": "demo02_ingest_erp"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 137.0
            },
            {
              "id": "mur_1159152644",
              "labels": [
                {
                  "text": "demo02_ingest_sensor"
                }
              ],
              "layoutOptions": {
                "spacing.edgeEdge": "20.0",
                "spacing.edgeNode": "25.0",
                "spacing.edgeNodeBetweenLayers": "20.0",
                "spacing.edgeEdgeBetweenLayers": "15.0",
                "spacing.nodeNode": "70.0",
                "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered",
                "elk.direction": "DOWN",
                "algorithm": "layered",
                "spacing.nodeNodeBetweenLayers": "25.0",
                "crossingMinimization.positionId": "-1",
                "nodeSize.constraints": "[]",
                "layering.layerId": "-1"
              },
              "x": 12.0,
              "y": 162.0
            }
          ],
          "layoutOptions": {
            "spacing.nodeNodeBetweenLayers": "25.0",
            "spacing.edgeNodeBetweenLayers": "20.0",
            "nodeLabels.placement": "[]",
            "algorithm": "layered",
            "spacing.edgeEdgeBetweenLayers": "15.0",
            "nodeSize.constraints": "[]",
            "nodeSize.minimum": "(300.0,300.0)",
            "layering.layerId": "-1",
            "nodeSize.options": "[DEFAULT_MINIMUM_SIZE]",
            "portLabels.placement": "[OUTSIDE]",
            "elk.direction": "DOWN",
            "hierarchyHandling": "SEPARATE_CHILDREN",
            "spacing.edgeNode": "25.0",
            "spacing.edgeEdge": "20.0",
            "crossingMinimization.positionId": "-1",
            "spacing.nodeNode": "70.0",
            "resolvedAlgorithm": "Layout Algorithm: org.eclipse.elk.layered"
          },
          "x": 12.0,
          "y": 49.5,
          "width": 24.0,
          "height": 174.0,
          "edges": [
            {

above is the json i am getting back from the engine

(Optional) Expected behavior the size of the node should be more than 300/300

(Optional) ELK Version snapshot

soerendomroes commented 3 months ago

Does this solve your problem?

ymolists commented 3 months ago

yes indeed it does thank you !

ymolists commented 3 months ago

sorry to bring this but is it possible to

1) restrict the maximum as well ? 2) only do it for one side ? meaning put a minimum/maximum on width only ?

soerendomroes commented 3 months ago

You cannot set a maximum width if you layout bottom-up. If you do it top-down, you can set an exact width and height and the inner content is scaled down.

You could set a very small minimum height to essentially only have a minimum width.