diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index 0f35dcfbb2..d5d50e704b 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -98,6 +98,9 @@ } if (result !== undefined) { + if (typeof result === 'string') { + return 'plain' + } try { let keys = result && typeof result == 'object' ? Object.keys(result) : [] is_render_all = @@ -238,12 +241,15 @@ {#if is_render_all} -
-
- as JSON  -
+
+ {#if !noControls} +
+ as JSON  +
+ {/if} {#each result['render_all'] as res} {:else} -
+
{#if result != undefined && length != undefined && largeObject != undefined}
@@ -497,7 +507,7 @@
{:else if !forceJson && resultKind == 'markdown'} -
+
{:else if !forceJson && isTableDisplay && richRender} @@ -557,12 +567,23 @@ code={toJsonStr(result).replace(/\\n/g, '\n')} /> {/if} + {:else if typeof result == 'string' && resultKind == 'plain'} +
+
{result}
+ {#if !noControls} +
+ +
+ {/if} +
{:else}
No result: {toJsonStr(result)}
{/if}
- {#if !disableExpand} + {#if !disableExpand && !noControls} @@ -590,6 +611,7 @@ import { Map, View, Feature } from 'ol' + import { Fill, Stroke, Style, Text } from 'ol/style.js' import { useGeographic } from 'ol/proj' import { OSM, Vector as VectorSource } from 'ol/source' import { Vector as VectorLayer, Tile as TileLayer } from 'ol/layer' import { Point } from 'ol/geom' import { defaults as defaultControls } from 'ol/control' + import CircleStyle from 'ol/style/Circle' interface Marker { lon: number @@ -62,16 +64,30 @@ features: [ new Feature({ geometry: new Point([+m.lon, +m.lat]), + label: m.title, name: m.title }) ] }), - style: { - 'circle-radius': m.radius ?? 7, - 'circle-fill-color': m.color ?? '#dc2626', - 'circle-stroke-width': m.strokeWidth ?? 3, - 'circle-stroke-color': m.strokeColor ?? '#fca5a5' - } + style: new Style({ + image: new CircleStyle({ + radius: m.radius ?? 5, + fill: new Fill({ + color: m.color ?? '#dc2626' + }), + stroke: new Stroke({ + color: m.strokeColor ?? '#fca5a5', + width: m.strokeWidth ?? 3 + }) + }), + text: new Text({ + text: m.title, + offsetY: -15, + fill: new Fill({ + color: '#000' + }) + }) + }) }) }) }