Skip to content

Commit 8212347

Browse files
committed
added gridmap doc
1 parent 2bf48de commit 8212347

4 files changed

Lines changed: 128 additions & 0 deletions

File tree

docs/assets/gridmap.png

1.88 MB
Loading

docs/intro-examples.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ These visualizations work with any dataset, generally using CSV text format or X
100100
#### Flow map
101101
[![Flow maps](assets/flow-map.jpg)](ref-flow-map.md)
102102

103+
</div>
104+
<div class="visualization">
105+
<!-- ----------------------- -->
106+
107+
#### Griadmap
108+
[![Gridmap](assets/gridmap.png)](ref-gridmap.md)
109+
110+
103111
</div>
104112
<div class="visualization">
105113
<!-- ----------------------- -->

docs/ref-gridmap.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
id: gridmap
3+
title: Gridmap
4+
---
5+
6+
![xy hexagon banner](assets/gridmap.png)
7+
_Gridmap plot over a period of time_
8+
9+
Gridmap Plots are excellent for plotting emissions or other data at a specific point in time or over a period of time.
10+
11+
## Creating this panel
12+
13+
Gridmap plots can be read in a dashboard file they go in the `layout:` section of a `dashboard-*.yaml` file. See the examples at the end of this document.
14+
15+
16+
**Embed in Dashboard:** Create a `dashboard-*.yaml` file and include a `type: gridmap` section as described below.
17+
18+
- Each area map panel is defined inside a **row** in a `dashboard-*.yaml` file.
19+
- Use panel `type: gridmap` in the dashboard configuration.
20+
- Standard title, description, and width fields define the frame.
21+
- See [Dashboard documentation](dashboards) for general tips on creating dashboard configurations.
22+
23+
24+
## Embed in Dashboard
25+
26+
In addition to the standard dashboard configurations, the following properties are available:
27+
28+
- **file:** *String*. The file path to the .avro file containing the data. ([Avro Schema](#avro-schema))
29+
30+
- **cellSize:** *Number*. Specifies the width/height of the grid elements (must be between 50 and 300). This value can be adjusted in the UI via the settings.
31+
32+
- **opacity:** *Float*. Defines the opacity of the grid map. The value must be between 0 and 1 and can also be changed in the UI via the settings.
33+
34+
- **maxHeight:** *Number*. Specifies the maximum height of the 3D grids. Must be a positive integer.
35+
36+
- **colorRamp/ramp:** *String*. Specifies the colorramp. Possible colorramps are: *Inferno*, *Magma*, *Viridis*, *Greens*, *Reds*, *RdYlGn*, *greenRed*. The default value is *Viridis*.
37+
38+
The `.yaml` file could then look like this (Here are both variants of how to define breakpoints. However, only one of the two variants may be used at most):
39+
40+
```yaml
41+
- type: gridmap
42+
title: Noise Immissions
43+
description: Noise Immissions per day
44+
height: 12.0
45+
file: analysis/noise/immission_per_day.avro
46+
cellSize: 250
47+
opacity: 0.2
48+
maxHeight: 20
49+
colorRamp:
50+
reverse: false
51+
ramp: greenRed
52+
steps: 10
53+
```
54+
55+
### Avro Schema
56+
57+
The Avro schema defines the structure of the data stored in the Avro format. It consists of a record with several fields containing different types of information. Below is an explanation of the key fields:
58+
59+
- **crs** (*string*): This field stores the Coordinate Reference System (CRS) used for the spatial data.
60+
61+
- **xCoords** (*array of floats*): A list of X coordinates representing the horizontal positions in a Cartesian coordinate system.
62+
63+
- **yCoords** (*array of floats*): A list of Y coordinates representing the vertical positions in a Cartesian coordinate system.
64+
65+
- **timestamps** (*array of integers*): A list of timestamps in seconds. Each timestamp corresponds to an X-Y coordinate pair and represents the time at which the position was recorded.
66+
67+
- **data** (*map of arrays of floats*): A mapping of keys to arrays of floating-point numbers. This field contains the XYT data, which are coordinates and associated values tied to the timestamps.
68+
69+
This structure is optimized for storing spatio-temporal data, useful for applications such as geospatial data processing or simulations that handle such information.
70+
71+
```json
72+
{
73+
"type" : "record",
74+
"name" : "XYTData",
75+
"namespace" : "org.matsim.application.avro",
76+
"fields" : [
77+
{
78+
"name" : "crs",
79+
"type" : "string",
80+
"doc" : "Coordinate reference system"
81+
},
82+
{
83+
"name" : "xCoords",
84+
"type" : {
85+
"type" : "array",
86+
"items" : "float"
87+
},
88+
"doc" : "List of x coordinates"
89+
},
90+
{
91+
"name" : "yCoords",
92+
"type" : {
93+
"type" : "array",
94+
"items" : "float"
95+
},
96+
"doc" : "List of y coordinates"
97+
},
98+
{
99+
"name" : "timestamps",
100+
"type" : {
101+
"type" : "array",
102+
"items" : "int"
103+
},
104+
"doc" : "List of timestamps in seconds"
105+
},
106+
{
107+
"name" : "data",
108+
"type" : {
109+
"type" : "map",
110+
"values" : {
111+
"type" : "array",
112+
"items" : "float"
113+
}
114+
},
115+
"doc" : "XYT data"
116+
}
117+
]
118+
}
119+
```

website/sidebars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"calculation-tables",
2121
"csv",
2222
"flow-map",
23+
"gridmap",
2324
"grid-layer",
2425
"heatmap-charts",
2526
"matrix",

0 commit comments

Comments
 (0)