Skip to content

Commit 98601c7

Browse files
authored
(DOCSP-4936): Create geospatial heatmap and scatter chart tutorials (#561)
* Create geospatial heatmap and scatter chart tutorials * Fix build error - icon not found * Add new screenshots * copy review 1
1 parent ac30f44 commit 98601c7

File tree

5 files changed

+351
-34
lines changed

5 files changed

+351
-34
lines changed

source/chart-type-reference/geospatial-heatmap.txt

Lines changed: 179 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Geospatial Heatmap
1212
:depth: 1
1313
:class: singlecol
1414

15-
Geospatial heatmap charts are useful for displaying how
16-
geographical areas of a map compare to one another based on a given
15+
You can use geospatial heatmap charts to visualize how
16+
geographic areas of a map compare to one another based on a given
1717
criterion.
1818

1919
.. note::
@@ -24,14 +24,6 @@ criterion.
2424
:ref:`filter <charts-filter-documents>`. Otherwise, your chart may
2525
use incomplete or misleading data.
2626

27-
To create a geospatial heatmap chart:
28-
29-
1. On the chart editing screen, select :guilabel:`Geospatial` from
30-
the :guilabel:`Chart Type` dropdown menu.
31-
32-
#. Select :guilabel:`Heatmap` from the three available geospatial
33-
chart types.
34-
3527
Geospatial Heatmap Encoding Channels
3628
------------------------------------
3729

@@ -127,6 +119,183 @@ field, which contains arrays of latitude-longitude pairs. The
127119
:guilabel:`Intensity` field uses the ``monthly_price`` database field,
128120
which contains monthly rental rates for each property in the database.
129121

122+
Tutorials
123+
---------
124+
125+
See the following tutorials to build geospatial heatmap charts:
126+
127+
- :ref:`create-heatmap-chart-geojson`
128+
129+
- :ref:`create-heatmap-chart-numeric`
130+
131+
Prerequisites
132+
~~~~~~~~~~~~~
133+
134+
The tutorials on this page use the ``sample_airbnb.listingsAndReviews``
135+
and ``sample_geospatial.shipwrecks`` collections. Before starting,
136+
you must load the sample data on your cluster. To learn how to load
137+
the sample data provided by |service| into your
138+
cluster, see :atlas:`Load Sample Data </sample-data/>`.
139+
140+
.. _create-heatmap-chart-geojson:
141+
142+
Create a Geospatial Heatmap Chart Using GeoJSON Points
143+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
145+
This tutorial demonstrates how to create a geospatial heatmap chart
146+
with fields that are :manual:`GeoJSON Points </reference/geojson/>`.
147+
The final chart displays a heatmap of average AirBnB prices in New York.
148+
149+
.. note::
150+
151+
|charts-short| automatically determines if field types in your collection
152+
are :manual:`GeoJSON Points </reference/geojson/>` by displaying
153+
the :icon-charts:`geoglobe` icon. You can map these fields directly
154+
to a geopoint channel type in the Chart Builder. For more information,
155+
see :ref:`Geopoint Channel Type <geopoint-channel>`.
156+
157+
.. procedure::
158+
:style: normal
159+
160+
.. step:: Add a geospatial heatmap chart to your dashboard.
161+
162+
a. From the :guilabel:`Dashboards` page, select the dashboard
163+
where you want to add a new chart. For instructions on setting
164+
up a dashboard, see :doc:`Dashboards </dashboards>`.
165+
166+
#. Click :guilabel:`Add Chart`.
167+
168+
#. In the :guilabel:`Select Data Source` modal, click the
169+
:guilabel:`Project` tab.
170+
171+
#. In the cluster where you loaded the
172+
sample data, select the ``listingsAndReviews`` collection
173+
in the ``sample_airbnb`` database.
174+
175+
#. In the :guilabel:`Chart Type` dropdown, click :guilabel:`Geo Heatmap`.
176+
177+
For more details, see :ref:`create-new-chart`.
178+
179+
.. step:: Add fields to your chart.
180+
181+
a. Select the :guilabel:`Encode` tab.
182+
183+
#. Navigate to the :guilabel:`Fields` pane on the left side of the
184+
Chart Builder. This section lists all available fields in the
185+
``listingsAndReviews`` collection.
186+
187+
#. Drag the ``location`` geopoint field nested in the ``address``
188+
field to the :guilabel:`Coordinates` encoding channel.
189+
190+
#. Drag the ``price`` field to the :guilabel:`Intensity` encoding
191+
channel. Then, in the :guilabel:`Aggregate` dropdown that appears,
192+
set the aggregation method to :guilabel:`mean`.
193+
194+
|charts-short| displays the aggregated mean prices of
195+
AirBnB listings across the world. The color gradient to the right
196+
represents the range of prices in the heatmap. A more intense
197+
gradation reflects higher prices in the area.
198+
199+
.. note::
200+
201+
To customize colors, click the :guilabel:`Customize` tab.
202+
Under :guilabel:`General`, enable the
203+
:guilabel:`Custom Color Palette` and set your preferred
204+
colors. For more information, see
205+
:ref:`color-palette-customization`.
206+
207+
.. step:: Filter your results.
208+
209+
a. Select the :guilabel:`Filter` tab.
210+
211+
#. Drag the ``market`` field nested in the ``address`` field
212+
to the :guilabel:`Filter` encoding channel.
213+
214+
#. To filter your results to include only AirBnBs in New York,
215+
click :guilabel:`Deselect All` and then select ``New York``.
216+
217+
.. step:: Save the chart to your dashboard.
218+
219+
a. Optionally, :guilabel:`Enter a title`
220+
or :guilabel:`Enter a description` for your chart.
221+
222+
#. Click :guilabel:`Save and Close`
223+
at the upper right of the chart builder view.
224+
225+
.. _create-heatmap-chart-numeric:
226+
227+
Create a Geospatial Heatmap Chart Using Numeric or Numeric Array Fields
228+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
229+
230+
This tutorial demonstrates how to create a geospatial heatmap chart
231+
with numeric or numeric array fields. The final chart displays a
232+
heatmap of shipwrecks across the world.
233+
234+
.. procedure::
235+
:style: normal
236+
237+
.. step:: Add a geospatial heatmap chart to your dashboard.
238+
239+
a. From the :guilabel:`Dashboards` page, select the dashboard
240+
where you want to add a new chart. For instructions on setting
241+
up a dashboard, see :doc:`Dashboards </dashboards>`.
242+
243+
#. Click :guilabel:`Add Chart`.
244+
245+
#. In the :guilabel:`Select Data Source` modal, click the
246+
:guilabel:`Project` tab.
247+
248+
#. In the cluster where you loaded the
249+
sample data, select the ``shipwrecks`` collection
250+
in the ``sample_geospatial`` database.
251+
252+
#. In the :guilabel:`Chart Type` dropdown, click :guilabel:`Geo Heatmap`.
253+
254+
For more details, see :ref:`create-new-chart`.
255+
256+
.. step:: Add fields to your chart.
257+
258+
a. Select the :guilabel:`Encode` tab.
259+
260+
#. Navigate to the :guilabel:`Fields` pane on the left side of
261+
the Chart Builder. This section lists all available fields in
262+
the ``shipwrecks`` collection.
263+
264+
#. Drag the ``coordinates`` numeric array field to the
265+
:guilabel:`Coordinates` encoding channel.
266+
267+
.. note::
268+
269+
Alternatively, you can specify the latitude and longitude
270+
coordinates separately. First, drag the ``latdec`` numeric field
271+
to the :guilabel:`Coordinates` encoding channel. Once the
272+
:guilabel:`Longitude` channel appears, drag the ``londec``
273+
numeric field to the corresponding channel.
274+
275+
#. Drag the ``_id`` field to the :guilabel:`Intensity` encoding channel.
276+
The aggregation method is set to :guilabel:`count` by default.
277+
278+
|charts-short| displays the aggregated count of shipwrecks
279+
across the world. The color gradient to the right
280+
represents the range of count values in the heatmap. A more intense
281+
gradation suggests that more shipwrecks have occured in the area.
282+
283+
.. note::
284+
285+
To customize colors, click the :guilabel:`Customize` tab.
286+
Under :guilabel:`General`, enable the
287+
:guilabel:`Custom Color Palette` and set your preferred
288+
colors. For more information, see
289+
:ref:`color-palette-customization`.
290+
291+
.. step:: Save the chart to your dashboard.
292+
293+
a. Optionally, :guilabel:`Enter a title`
294+
or :guilabel:`Enter a description` for your chart.
295+
296+
#. Click :guilabel:`Save and Close`
297+
at the upper right of the chart builder view.
298+
130299
Limitations
131300
-----------
132301

0 commit comments

Comments
 (0)