> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# layout_coordinates

> Create x, y positions for nodes from their geographical coordinates. 

Used to create a Graph view in which rows/nodes are placed geographically, rather than according to
their (non-geographical) similarity.

## Usage

The following example shows how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      The following configuration transforms geographical coordinates into x and y points in the graph:

      ```stan theme={null}
      layout_coordinates(ds.latitude, ds.longitude) -> (ds.x, ds.y)
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      layout_coordinates(latitude: number, longitude: number, {
          "param": value,
          ...
      }) -> (x: column, y: column)
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="latitude" type="column[number]" required>
    Numerical column with the latitude value.
  </ParamField>

  <ParamField path="longitude" type="column[number]" required>
    Numerical column with the longitude value.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="x" type="column" required>
    Numerical column with the x position in the graph.
  </ParamField>

  <ParamField path="y" type="column" required>
    Numerical column with the y position in the graph.
  </ParamField>
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="method" type="string" default="webmercator">
    A method to use to convert the coordinates to x, y positions.

    Values must be one of the following:

    * `webmercator`
    * `spherical`
    * `wgs84`
  </ParamField>
</Accordion>
