Skip to content

Commit

Permalink
fine tuned error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongz committed Nov 6, 2024
1 parent ed46b8d commit 2611d5c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 59 deletions.
49 changes: 22 additions & 27 deletions packages/ui/core-components/src/lib/unsorted/viz/map/AreaMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,36 +74,31 @@
<QueryLoad {data} let:loaded>
<EmptyChart slot="empty" {emptyMessage} {emptySet} {chartType} {isInitial} />
<ErrorChart let:loaded slot="error" {chartType} error={error ?? loaded.error.message} />
<!-- Override default skeleton to match height of map -->
<div slot="skeleton" class="w-full" style="height: {height}px">
<Skeleton />
</div>
<!-- move dispatch error outside of areas to render error outisde leafletmaps -->
{#if !error}
<BaseMap
{startingLat}
{startingLong}
{startingZoom}
{height}
{basemap}
{title}
{legendPosition}
<BaseMap
{startingLat}
{startingLong}
{startingZoom}
{height}
{basemap}
{title}
{legendPosition}
{chartType}
>
<Areas
data={loaded}
{geoJsonUrl}
{geoId}
{areaCol}
{legendType}
{chartType}
>
<Areas
data={loaded}
{geoJsonUrl}
{geoId}
{areaCol}
{legendType}
{chartType}
{legend}
{...$$restProps}
on:error={(e) => (error = e.detail)}
/>
</BaseMap>
{:else}
<ErrorChart let:loaded slot="error" {chartType} error={error ?? loaded.error.message} />
{/if}
{legend}
{...$$restProps}
on:error={(e) => (error = e.detail)}
/>
</BaseMap>
</QueryLoad>
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,30 @@
<QueryLoad {data} let:loaded>
<EmptyChart slot="empty" {emptyMessage} {emptySet} {chartType} {isInitial} />
<ErrorChart let:loaded slot="error" {chartType} error={error ?? loaded.error.message} />
<!-- move dispatch error outside of points to render error outisde leafletmaps -->
{#if !error}
<div class="relative">
<BaseMap
{startingLat}
{startingLong}
{startingZoom}
{height}
{basemap}
{title}
{legendPosition}
<div class="relative">
<BaseMap
{startingLat}
{startingLong}
{startingZoom}
{height}
{basemap}
{title}
{legendPosition}
{chartType}
>
<Points
data={loaded}
{lat}
{long}
{colorPalette}
{legendType}
{chartType}
>
<Points
data={loaded}
{lat}
{long}
{colorPalette}
{legendType}
{chartType}
{...$$restProps}
{legend}
on:error={(e) => (error = e.detail)}
/>
</BaseMap>
</div>
{:else}
<ErrorChart let:loaded slot="error" {chartType} error={error ?? loaded.error.message} />
{/if}
{...$$restProps}
{legend}
on:error={(e) => (error = e.detail)}
/>
</BaseMap>
</div>
</QueryLoad>
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,19 @@
<Story name="error chart test">
{@const data2 = Query.create(`SELECT id as value, tag as label from hashtags`, query)}
<Dropdown name="test" {data2} value="value" label="label" />
{@const data = Query.create(`SELECT * from flight LIMIT 1000`, query)}
{@const data = Query.create(`SELECT * from flightsERROR LIMIT 1000`, query)}
<DataTable {data} />
<Dropdown name="test" {data2} value="value" label="label" />
{@const la_locations = Query.create(`select * from la_locati order by 1`, query)}
<PointMap data={la_locations} lat="lat" long="longg" value="sales" legend={false} />
{@const la_locations = Query.create(`select * from la_locations order by 1`, query)}
<h3>PointMap Error</h3>
<PointMap data={la_locations} lat="lat" long="longERROR" value="sales" legend={false} />
<Dropdown name="test" {data2} value="value" label="label" />
<h3>BaseMap Error</h3>
<BaseMap>
<Points
data={la_locations}
lat="lat"
long="longg"
long="longERROR"
value="sales"
legend={false}
tooltipType="hover"
Expand All @@ -361,5 +363,6 @@
`select * from la_zip_sales where zip_code <> 90704 order by 1`,
query
)}
<AreaMap data={la_zip_sales} geoId="ZCTA5CE10" value="sales" areaCol="zip_codesadasdasds" />
<h3>AreaMap Error</h3>
<AreaMap data={la_zip_sales} geoId="ZCTA5CE10" value="sales" areaCol="zip_codeERROR" />
</Story>

0 comments on commit 2611d5c

Please sign in to comment.