HeavyIQ visualization and Choropleth
I have a map for south Italy already loaded in a table in the heavyai instance that works fine in every dashboard and choropleth chart.
But when HeavyIQ shows a choropleth, no map is used:
How do I teach HeavyIQ which map to use ?
-
Official comment
Hi Gianfranco.
In 8.0 only certain types of geographies are renderable in choropleths using frontend Vega rendering, namely countries, states, and counties, but as of 8.1 targeted for later this summer, you'll be able to render arbitrary choropleths of any geometries, provided you have the geometries (polygons/multipolygons) in a table and are running on GPU.
Todd
Comment actions -
The query generated is:
SELECT
prov,
SUM(c) AS tot_c,
SUM(tb) AS tot_tb,
SUM(te) AS tot_te,
SUM(h) AS tot_h,
SUM(f) AS tot_f,
SUM(i_MM) AS tot_i_mm,
SUM(i_VET) AS tot_i_vet
FROM
fh2
WHERE
cau = '30'
AND mm = '3'
AND aa = '2023'
GROUP BY
prov;Backend rendering is enabled as far as I know, I'm running HeavyAI on GPU, and in my dashboard the Choropleth chart works fine.
-
So it looks HeavyIQ is not projecting out a geometry column for your provinces, can you try manually adding one to the SQL to see if triggers the correct backend choropleth render? Currently with the lack of a backend geometry, I think the names or abbreviations of your provinces must be overlapping with country codes, and hence we are getting a spurious frontend choropleth of countries.
You can also give hints to HeavyIQ that you want the geometry columns in your result, usually something like "Make a map of" will do the trick, but if not you can be explicit and ask it to return the geometry column along with the name/other requested stats. We're adding additional training to make the model better at picking up visualization intent.
-
Here some additional, hopefully useful details:
I want to use the geometry in the "province_centrosud" table.SIGLA FR CE NA BN BA CB TA BR MT CS IS CZ LT AV SA FG KR VV LE PZ RC BT Using this prompt:
Mostrami provincia, sigla della provincia, colli, peso totale, trasporto base e trasporto extra, handling fuel e immmobile mm e vet a Marzo 2023 solo causale 3010 per le provincie del centrosud italia
I get the ai writing a good query, joining the correct geometry table.
I still cannot get the auto select table source working, so I'm adding manually both the names of the tables involved, postponing the solution of this problem.This is the query generated:
SELECT
T2.PROVINCIA,
T2.SIGLA,
SUM(T1.colli) AS colli,
SUM(T1.peso) AS peso_totale,
SUM(T1.trasporto_base) AS trasporto_base,
SUM(T1.trasporto_extra) AS trasporto_extra,
SUM(T1.handling) AS handling,
SUM(T1.fuel) AS fuel,
SUM(T1.immobile_MM) AS immobile_mm,
SUM(T1.immobile_VET) AS immobile_vet
FROM
fh206 AS T1
JOIN province_centrosud AS T2 ON T1.prov = T2.SIGLA
WHERE
T1.mm = '3'
AND T1.aa = '2023'
AND T1.cau = '3010'
GROUP BY
T2.PROVINCIA,
T2.SIGLA;With this query I get the worldmap geometry, despite HeavyIQ already picked up in the query the correct geometry table:
I'm aware that a number of worldmap country codes overlap with my province_centrosud codes, but in this case I explicty gave the hint "per le province del centrosud italia" in the prompt, and added manually the correct geometry table as source, but still the province_centrosud geometry was not projected.
So, something else should occurs here.
-
Anyway, I got to project the correct south Italy map, by requesting explicity the geometry column in my prompt :
Mostrami geometria, colli, peso totale, trasporto base e trasporto extra, handling fuel e immmobile mm e vet a Marzo 2023 solo causale 3010
This just before HeavyIQ stopped working with the message in Immerse (https://support.heavy.ai/hc/en-us/community/posts/24411563560343):
You currently don't have HeavyIQ enabled, our new AI curator. Speak with your administrator to enable this feature.
That is a good news, being the first successfully attempt to show custom map in auto generated choropleth: unfortunately I cannot experimenting more because HeavyIQ not enabled anymore.
-
Hi Gianfranco Campana, good to hear you got the map working (and yes, have to explicitly request the geometry sometimes... working on more training to get the model to always include it if a map is requested).
Re the other issue, we need to troubleshoot that. I know Candido Dessanti is on vacation this week, but perhaps we can set up a call to walk through your install? I'll try to join if I can.
-
Just adding what I found in the /logs/iq/console log:
File "<frozen heavyiq.api>", line 155, in create_app File "<frozen heavyiq.config>", line 78, in get_config File "<frozen heavyiq.config>", line 60, in validate_config ValueError: Custom LLM type is set to 'API_VLLM', but API base URL is not set.
-
The issue about HeavyIQ not enabled is solved:
https://support.heavy.ai/hc/en-us/community/posts/24411563560343/comments/25796844212247
Please sign in to leave a comment.
Comments
14 comments