# Cartogram

A cartogram is a map type where the original layout of the areal unit is replaced by a geometric form (usually a circle, rectangle, or hexagon) that is proportional to the value of the variable for the location. This is in contrast to a standard choropleth map, where the size of the polygon corresponds to the area of the location in question.

jsgeoda implements a circular cartogram, in which the areal units are represented as circles, whose size (and color) is proportional to the value observed at that location. The changed shapes remove the misleading effect that the area of the unit might have on perception of magnitude. Please read: <https://geodacenter.github.io/workbook/3a_mapping/lab3a.html#cartogram>

## cartogram()

```sql
function cartogram(String map_uid, Array val)
```

**Parameters:**

| Name      | Type   | Description                                                                   |
| --------- | ------ | ----------------------------------------------------------------------------- |
| `map_uid` | String | A unique string represents the geojson map that has been read into GeoDaWasm. |
| `values`  | Array  | The values that the classify algorithm will be applied on.                    |

**Returns:**

| Type   | Description                                                                                                       |
| ------ | ----------------------------------------------------------------------------------------------------------------- |
| Object | an array of circles, which is defined as: { "properties": { "id" : 1}, "position": \[0.01, 0.01], "radius": 0.1 } |

## Example

see: <https://theuscovidatlas.org>

![](/files/-MbTLpmPZk_9heOsv36A)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xunli.gitbook.io/jsgeoda/choropleth_map/cartogram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
