feat: add source-grounded evolution and Ollama assistant
This commit is contained in:
@@ -5,6 +5,7 @@ import { featureCollectionBounds } from '../../lib/geojsonBounds'
|
||||
import { useMapThemeSelectionInsights } from '../../hooks/useMapThemeSelectionInsights'
|
||||
import { useTemporalComparison } from '../../hooks/useTemporalComparison'
|
||||
import { getDatasetDisplayName, getDatasetSourceDisplayName } from '../../lib/datasetDisplay'
|
||||
import { TemporalTrendChart } from './TemporalTrendChart'
|
||||
|
||||
const DEFAULT_SELECTED_FEATURE_FILENAME = 'selected-feature.geojson'
|
||||
const DEFAULT_AREA_SELECTION_FILENAME = 'area-selection.geojson'
|
||||
@@ -860,7 +861,7 @@ export function MapWorkspace({
|
||||
setSelectionBbox(bbox)
|
||||
const tasks: Array<Promise<unknown>> = [onRunMapSelectionExtract(bbox, areaId), loadAllThemeResults(bbox, areaId)]
|
||||
if (analysisMode === 'evolution' && earlierDatasetId && laterDatasetId) {
|
||||
tasks.push(compareTemporalSnapshots(earlierDatasetId, laterDatasetId, bbox))
|
||||
tasks.push(compareTemporalSnapshots(earlierDatasetId, laterDatasetId, bbox, areaId))
|
||||
}
|
||||
await Promise.all(tasks)
|
||||
}
|
||||
@@ -869,7 +870,8 @@ export function MapWorkspace({
|
||||
if (!mapSelectionBbox || !earlierDatasetId || !laterDatasetId) {
|
||||
return
|
||||
}
|
||||
void compareTemporalSnapshots(earlierDatasetId, laterDatasetId, mapSelectionBbox)
|
||||
const areaId = selectedAreaBbox && bboxesEqual(mapSelectionBbox, selectedAreaBbox) ? selectedMapAreaId : undefined
|
||||
void compareTemporalSnapshots(earlierDatasetId, laterDatasetId, mapSelectionBbox, areaId)
|
||||
}
|
||||
|
||||
const handleMapBboxPreview = (bbox: VectorSelectionBBox) => {
|
||||
@@ -1324,6 +1326,25 @@ export function MapWorkspace({
|
||||
<strong>{temporalComparison.metric.is_estimate ? 'Ruimtelijke schatting' : 'Exact'}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<TemporalTrendChart
|
||||
timeline={temporalComparison.timeline ?? []}
|
||||
metricKey={temporalComparison.metric.metric_key}
|
||||
/>
|
||||
{(temporalComparison.metrics ?? []).filter((metric) => metric.metric_key !== temporalComparison.metric.metric_key).length > 0 ? (
|
||||
<div className="geo-supporting-metrics" aria-label="Aanvullende historische metingen">
|
||||
{(temporalComparison.metrics ?? [])
|
||||
.filter((metric) => metric.metric_key !== temporalComparison.metric.metric_key)
|
||||
.map((metric) => (
|
||||
<div key={metric.metric_key}>
|
||||
<span>{metric.label}</span>
|
||||
<strong>
|
||||
{metric.absolute_change >= 0 ? '+' : ''}
|
||||
{formatTemporalMetric(metric.absolute_change, metric.unit)}
|
||||
</strong>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
{temporalComparison.object_changes.available ? (
|
||||
<div className="geo-change-counts" aria-label="Objectwijzigingen">
|
||||
<span><strong>{temporalComparison.object_changes.added_count ?? 0}</strong> nieuw</span>
|
||||
|
||||
Reference in New Issue
Block a user