Skip to content

Commit 1c1224e

Browse files
Added chart examples for left out chart types in issue apache#16707
1 parent 29633e7 commit 1c1224e

File tree

28 files changed

+43
-7
lines changed

28 files changed

+43
-7
lines changed
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import controlPanel from './controlPanel';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'Plot the distance (like flight paths) between origin and destination.',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Arc'),
3134
thumbnail,
3235
useLegacyApi: true,
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import transformProps from '../../transformProps';
2121
import controlPanel from './controlPanel';
2222
import thumbnail from './images/thumbnail.png';
23+
import example1 from './images/example1.png';
24+
import example2 from './images/example2.png';
2325

2426
const metadata = new ChartMetadata({
2527
category: t('Map'),
2628
credits: ['https://uber.github.io/deck.gl'],
2729
description: t(
2830
'Uses Gaussian Kernel Density Estimation to visualize spatial distribution of data',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Countour'),
3134
thumbnail,
3235
useLegacyApi: true,
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import controlPanel from './controlPanel';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'The GeoJsonLayer takes in GeoJSON formatted data and renders it as interactive polygons, lines and points (circles, icons and/or texts).',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Geojson'),
3134
thumbnail,
3235
useLegacyApi: true,
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
2223
import controlPanel from './controlPanel';
2324

2425
const metadata = new ChartMetadata({
@@ -27,6 +28,7 @@ const metadata = new ChartMetadata({
2728
description: t(
2829
'Visualize geospatial data like 3D buildings, landscapes, or objects in grid view.',
2930
),
31+
exampleGallery: [{ url: example1 }],
3032
name: t('deck.gl Grid'),
3133
thumbnail,
3234
useLegacyApi: true,
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import transformProps from '../../transformProps';
2121
import controlPanel from './controlPanel';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import thumbnail from './images/thumbnail.png';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'Uses Gaussian Kernel Density Estimation to visualize spatial distribution of data',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Heatmap'),
3134
thumbnail,
3235
useLegacyApi: true,
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import controlPanel from './controlPanel';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'Overlays a hexagonal grid on a map, and aggregates data within the boundary of each cell.',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl 3D Hexagon'),
3134
thumbnail,
3235
useLegacyApi: true,
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
2223
import controlPanel from './controlPanel';
2324

2425
const metadata = new ChartMetadata({
2526
category: t('Map'),
2627
credits: ['https://uber.github.io/deck.gl'],
2728
description: t('Visualizes connected points, which form a path, on a map.'),
29+
exampleGallery: [{ url: example1 }],
2830
name: t('deck.gl Path'),
2931
thumbnail,
3032
useLegacyApi: true,
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
2223
import controlPanel from './controlPanel';
2324

2425
const metadata = new ChartMetadata({
@@ -27,6 +28,7 @@ const metadata = new ChartMetadata({
2728
description: t(
2829
'Visualizes geographic areas from your data as polygons on a Mapbox rendered map. Polygons can be colored using a metric.',
2930
),
31+
exampleGallery: [{ url: example1 }],
3032
name: t('deck.gl Polygon'),
3133
thumbnail,
3234
useLegacyApi: true,
Loading
Loading

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import controlPanel from './controlPanel';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'A map that takes rendering circles with a variable radius at latitude/longitude coordinates',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Scatterplot'),
3134
thumbnail,
3235
useLegacyApi: true,

superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
2020
import thumbnail from './images/thumbnail.png';
2121
import transformProps from '../../transformProps';
22+
import example1 from './images/example1.png';
23+
import example2 from './images/example2.png';
2224
import controlPanel from './controlPanel';
2325

2426
const metadata = new ChartMetadata({
@@ -27,6 +29,7 @@ const metadata = new ChartMetadata({
2729
description: t(
2830
'Aggregates data within the boundary of grid cells and maps the aggregated values to a dynamic color scale',
2931
),
32+
exampleGallery: [{ url: example1 }, { url: example2 }],
3033
name: t('deck.gl Screen Grid'),
3134
thumbnail,
3235
useLegacyApi: true,

superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx

+16-7
Original file line numberDiff line numberDiff line change
@@ -849,17 +849,26 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) {
849849
grid-area: examples-header;
850850
`}
851851
>
852-
{!!selectedVizMetadata?.exampleGallery?.length && t('Examples')}
852+
Examples
853853
</SectionTitle>
854854
<Examples>
855-
{(selectedVizMetadata?.exampleGallery || []).map(example => (
855+
{selectedVizMetadata?.exampleGallery.length ? (
856+
(selectedVizMetadata?.exampleGallery || []).map(example => (
857+
<img
858+
key={example.url}
859+
src={example.url}
860+
alt={example.caption}
861+
title={example.caption}
862+
/>
863+
))
864+
) : (
856865
<img
857-
key={example.url}
858-
src={example.url}
859-
alt={example.caption}
860-
title={example.caption}
866+
key={selectedVizMetadata?.thumbnail}
867+
src={selectedVizMetadata?.thumbnail}
868+
alt={selectedVizMetadata?.name}
869+
title={selectedVizMetadata?.name}
861870
/>
862-
))}
871+
)}
863872
</Examples>
864873
</>
865874
</div>

0 commit comments

Comments
 (0)