الدرس 1 · الوحدة 5: Making Dashboards Interactive
Map actions: filtering elements when the map extent changes
الفيديو قريبًا
Learn it with your tutor on the live board
أهم نقاط الفيديو
When the Map Should Drive the Numbers
- Storm night: 240 open outage reports citywide
- The supervisor zooms to the north district
- The counts and lists must follow the map
- Otherwise the screen shows the wrong picture
What You Will Learn
- What a map extent action is: source, trigger, target
- How to set one up on a map element
- Which elements to link, and which to leave alone
Source, Trigger, Target
- Source: the map element
- Trigger: the map extent changes (pan or zoom)
- The trigger fires a filter
- Targets: indicators, charts, lists, tables
Setting It Up in ArcGIS Dashboards
- Open the map element's settings
- Go to the Actions tab
- Under "When map extent changes", add Filter
- Tick the target elements, then Done
Watching the Extent Filter Work
- Water main breaks across Redlands, California
- Zoom in: the visible rectangle shrinks
- Linked elements count only what's inside
layout: side
style: positron
camera: {center: [-117.185, 34.052], zoom: 12}
layers:
- {id: breaks, type: points, color: red, labels: false, data: [{name: Break 1, at: [-117.182, 34.056]}, {name: Break 2, at: [-117.175, 34.060]}, {name: Break 3, at: [-117.190, 34.050]}, {name: Break 4, at: [-117.205, 34.070]}, {name: Break 5, at: [-117.150, 34.040]}, {name: Break 6, at: [-117.225, 34.035]}]}
steps:
- at: "six water main breaks"
show: breaks
- at: "zooms into downtown"
fly: {center: [-117.182, 34.056], zoom: 15, dur: 3}
- at: "zooms back out"
fly: {center: [-117.185, 34.052], zoom: 12, dur: 3} Worked Example: The Logic Behind It
import pandas as pd
breaks = pd.DataFrame({
"id": [101, 102, 103, 104, 105, 106],
"x": [2.1, 3.4, 7.8, 4.0, 8.9, 1.5],
"y": [5.0, 2.2, 6.1, 3.3, 1.0, 4.4],
"status": ["Open", "Fixed", "Open",
"Open", "Fixed", "Open"],
})
# visible extent: xmin, ymin, xmax, ymax
xmin, ymin, xmax, ymax = 1, 2, 5, 6
in_view = breaks[
breaks.x.between(xmin, xmax)
& breaks.y.between(ymin, ymax)
]
print("Citywide breaks:", len(breaks))
print("Breaks in view:", len(in_view))
print(in_view.status.value_counts()) What Makes a Good Target
- Target data must come from a layer with location
- Indicators, charts, lists and tables work well
- "Render only when filtered" hides until map filters
- Data with no location (e.g. a plain spreadsheet) cannot follow the map
Testing Your Linked Dashboard
- Zoom to one district and read every number
- Compare with a count you already know
- Pan to an empty area: targets should show zero
- Save bookmarks for the views crews use most
Common Mistake: Linking the Headline Number
- A citywide total that changes on zoom misleads people
- Executives read the big number, not the map
- Keep one headline indicator unlinked, and label it
- Link the local details, not the overall picture
Recap
- A map extent action filters targets to the visible area
- Set it up in the map's Actions tab, then tick targets
- Link local details; keep one citywide total fixed
Your Exercise
- Build a dashboard from a service request layer
- Add a map, one indicator, one chart, one list
- Link the indicator, chart and list to the map extent
- Add a second, unlinked citywide indicator
- Zoom to two areas and write down the numbers
النص المكتوب
When the Map Should Drive the Numbers. Picture a storm response room at two in the morning. The big screen shows a map of power outages, an indicator that says 240 open reports, and a list of crews. The operations supervisor zooms into the north district to plan the next shift. The map now shows about thirty outages, but the indicator still says 240 and the list still shows every crew in the city. At that moment the dashboard is working against the people using it. In this lesson you'll fix that with one setting in ArcGIS Dashboards, so the numbers, charts and lists always describe what's on the map right now.
What You Will Learn. Here's the plan for the next few minutes. First, you'll learn what a map action is, using three simple words: a source, a trigger and a target. Second, you'll set one up step by step on a map element, and you'll see the exact logic it applies to your data with a small worked example. Third, and this is the part people usually skip, you'll decide which elements should follow the map and which should stay fixed. That third decision is what separates a dashboard people trust from one that quietly misleads them during an incident.
Source, Trigger, Target. Every dashboard action has the same three parts. The source is the element where something happens, here the map. The trigger is what happens to it. For a map, the trigger is that the extent changes, and the extent simply means the rectangle of ground you can currently see, like the view through a window. Each time someone pans or zooms, that rectangle moves. The trigger fires a response, and for extent changes that response is a filter: keep only the features inside the rectangle. The targets are the elements that receive that filter, such as an indicator, a chart or a list.
Setting It Up in ArcGIS Dashboards. Now let's set it up. In edit mode, hover over the map element and open its configuration. You'll see a tab called Actions. Inside it there's a section called "When map extent changes". Add a filter action there, and the dashboard lists every element that could receive it. Tick the ones that should follow the map, for example the open outages indicator, the outages by cause chart and the crew list. Click Done and save the dashboard. That's the whole setup. There's no code and no expression to write; the dashboard builds the spatial filter for you every time the view moves.
Watching the Extent Filter Work. Here's a water utility map in Redlands, California, showing six water main breaks reported this week. With the map extent action in place, an indicator linked to this map would read six. Now watch what happens when the dispatcher zooms into downtown. The visible rectangle shrinks, several breaks fall outside it, and the indicator, the chart and the list recalculate using only the breaks still in view. When the dispatcher zooms back out, the rectangle grows again and the numbers return to the full count. Nobody clicked a filter button. The map itself is the filter.
Worked Example: The Logic Behind It. Let's slow down and see exactly what the dashboard computes. This small Python example is not something you paste into ArcGIS; it just mirrors the logic. We have six breaks, each with an x and y position and a status. The extent is four numbers: the smallest x, the smallest y, the largest x and the largest y. A break is in view when its x sits between the x limits and its y sits between the y limits. Run it, and six breaks citywide become four in view: three open and one fixed. That's precisely what your linked indicator and chart would show.
What Makes a Good Target. A target element can follow the map only if its data has a location. That makes sense: the filter asks "is this feature inside the rectangle", and a record with no point, line or polygon can't answer. So a service request layer works, while a plain spreadsheet of work order costs doesn't. Indicators, serial charts (that is, bar and line charts), pie charts, lists and tables all make good targets when they use a spatial layer. There's also a handy option on target elements called "Render only when filtered". Turn it on for a detail list, and it stays empty until someone zooms in, which keeps the screen quiet at city scale.
Testing Your Linked Dashboard. Before you share the dashboard, test it like an operator would. Zoom into one district and read every number on the screen. Compare at least one with a count you already trust, such as the outage reports your call center logged in that district today. Then pan to an empty area, like a lake or farmland. Linked indicators should drop to zero and linked lists should go blank. If anything stays unchanged, it isn't a target yet. Finally, add map bookmarks for the areas people check most, so a supervisor can jump straight to the north district instead of zooming by hand.
Common Mistake: Linking the Headline Number. Here's the mistake I see most often. A builder ticks every element as a target, including the big headline indicator at the top. Then someone zooms into one neighborhood, and the headline drops from 240 open outages to 12. An executive walks past, reads 12, and reports that the storm is nearly over. The fix is simple. Keep one citywide indicator unlinked and give it a clear title, such as "Open outages, whole service area". Link the local elements, like the cause chart and the crew list. That way the screen shows both the overall picture and the view in focus.
Recap. Let's recap. A map extent action takes the map as its source, fires whenever someone pans or zooms, and filters the target elements to the features inside the visible rectangle. You set it up in the map element's Actions tab, under "When map extent changes", by adding a filter and ticking the targets, which need data with a location. And you decide carefully what follows the map: local details like charts and lists should, while one clearly labeled citywide total should stay fixed. With that in place, your dashboard always tells the truth about the part of the map someone is looking at.
Your Exercise. Now it's your turn. Create a dashboard from a service request layer in your organization, or use a sample layer from Living Atlas, Esri's free library of ready-made map layers, if you don't have one. Add a map, an indicator of open requests, a chart of requests by type, and a list of the latest requests. Link the indicator, the chart and the list to the map extent. Then add a second indicator that stays unlinked and title it as the citywide total. Zoom to two different neighborhoods and note what each element shows. Bring those numbers to the next lesson, where charts will start filtering things too.
استكشف الرسم المتحرك
الرسوم المتحركة نفسها التي في الفيديو، دقيقة وتفاعلية: شغّلها أو أوقفها، أو اسحب المؤشر، أو انتقل إلى أي خطوة بالسرعة التي تناسبك.
Loading the animation...
ملخص الدرس
- مشاهدة الفيديو
- A map extent action filters targets to the visible area
- Set it up in the map's Actions tab, then tick targets
- Link local details; keep one citywide total fixed