Determine Vertex Layout after computing edges

Hi,

I am building a usecase, where I would like to expand a graph based on a single object and then reformat the graph with the corresponding layout.

I am using these interfaces according to the docs:

export interface IGraphSearchAroundResultV1 {
    directEdges?: IGraphSearchAroundResultDirectEdgeV1[];
    intermediateEdges?: IGraphSearchAroundResultIntermediateEdgeV1[];
    orphanObjectRids?: string[];
    objectRidsToGroup?: string[][];
    layout?: string;
}

export interface IGraphSearchAroundResultDirectEdgeV1 {
    sourceObjectRid: string;
    targetObjectRid: string;
    linkTypeRid?: string;
    label?: string;
    direction?: string;
}

export interface IGraphSearchAroundResultIntermediateEdgeV1 {
    sourceObjectRid: string;
    sourceToIntermediateLinkTypeRid?: string;
    intermediateObjectRid: string;
    intermediateToTargetLinkTypeRid?: string;
    targetObjectRid: string;
    label?: string;
    direction?: string;
}

The searcharound result contains the “layout” parameter. However, I cant find anything in the docs. Does somebody know the exact string for a horizontal hierarchial layout?

Best,
Florian

Hi @Flackermann

Look at how the layout service works with these inputs, you should be able to specify the following:

  • dagre
  • d3-force
  • linear
  • circular
  • radial
  • d3-force-grid
  • cluster
  • cartesian

I tried it and unfortunately, it does not work with the vertex templates :frowning:

Oh, but aren’t the templates living up to their name – you can’t template this stuff? Or were you just curious about the variable?

Try these:

  • auto
  • auto-grid
  • grid
  • linear-row
  • linear-column
  • circular

My apologies Florian, this parameter does not seem supported in templates, only when the functions are used directly from the Search Around menu. I’ll update the documentation to clarify this.

The only current options for templates are those supported in the Template configuration:

We do have plans for using custom code-based layouts in templates, this should hopefully be available in the next couple of months.

1 Like

i also got it to work this way as you suggested. the root nodes selection was a bit confusing for me though since it only let you select one of the template parameters or “Auto”. the latter one worked, however, I would have expected to select more than one parameter or something like “all”

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.