mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(deck.gl Multiple Layer Chart): Add Contour and Heatmap Layer as options (#25923)
This commit is contained in:
committed by
Michael S. Molina
parent
fb64100043
commit
c816142a5e
@@ -26,3 +26,5 @@ export { default as PathChartPlugin } from './layers/Path';
|
||||
export { default as PolygonChartPlugin } from './layers/Polygon';
|
||||
export { default as ScatterChartPlugin } from './layers/Scatter';
|
||||
export { default as ScreengridChartPlugin } from './layers/Screengrid';
|
||||
export { default as ContourChartPlugin } from './layers/Contour';
|
||||
export { default as HeatmapChartPlugin } from './layers/Heatmap';
|
||||
|
||||
@@ -38,16 +38,16 @@ function setTooltipContent(formData) {
|
||||
<div className="deckgl-tooltip">
|
||||
<TooltipRow
|
||||
label={t('Start (Longitude, Latitude): ')}
|
||||
value={`${o.object.sourcePosition[0]}, ${o.object.sourcePosition[1]}`}
|
||||
value={`${o.object?.sourcePosition?.[0]}, ${o.object?.sourcePosition?.[1]}`}
|
||||
/>
|
||||
<TooltipRow
|
||||
label={t('End (Longitude, Latitude): ')}
|
||||
value={`${o.object.targetPosition[0]}, ${o.object.targetPosition[1]}`}
|
||||
value={`${o.object?.targetPosition?.[0]}, ${o.object?.targetPosition?.[1]}`}
|
||||
/>
|
||||
{formData.dimension && (
|
||||
<TooltipRow
|
||||
label={`${formData.dimension}: `}
|
||||
value={`${o.object.cat_color}`}
|
||||
label={`${formData?.dimension}: `}
|
||||
value={`${o.object?.cat_color}`}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -80,13 +80,13 @@ const recurseGeoJson = (node, propOverrides, extraProps) => {
|
||||
|
||||
function setTooltipContent(o) {
|
||||
return (
|
||||
o.object.extraProps && (
|
||||
o.object?.extraProps && (
|
||||
<div className="deckgl-tooltip">
|
||||
{Object.keys(o.object.extraProps).map((prop, index) => (
|
||||
<TooltipRow
|
||||
key={`prop-${index}`}
|
||||
label={`${prop}: `}
|
||||
value={`${o.object.extraProps[prop]}`}
|
||||
value={`${o.object.extraProps?.[prop]}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,7 @@ function setTooltipContent(o: any) {
|
||||
<div className="deckgl-tooltip">
|
||||
<TooltipRow
|
||||
label={t('Centroid (Longitude and Latitude): ')}
|
||||
value={`(${o.coordinate[0]}, ${o.coordinate[1]})`}
|
||||
value={`(${o?.coordinate[0]}, ${o?.coordinate[1]})`}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ import TooltipRow from '../../TooltipRow';
|
||||
|
||||
function setTooltipContent(o) {
|
||||
return (
|
||||
o.object.extraProps && (
|
||||
o.object?.extraProps && (
|
||||
<div className="deckgl-tooltip">
|
||||
{Object.keys(o.object.extraProps).map((prop, index) => (
|
||||
<TooltipRow
|
||||
|
||||
@@ -53,27 +53,27 @@ function getElevation(d, colorScaler) {
|
||||
|
||||
function setTooltipContent(formData) {
|
||||
return o => {
|
||||
const metricLabel = formData.metric.label || formData.metric;
|
||||
const metricLabel = formData?.metric?.label || formData?.metric;
|
||||
|
||||
return (
|
||||
<div className="deckgl-tooltip">
|
||||
{o.object.name && (
|
||||
{o.object?.name && (
|
||||
<TooltipRow
|
||||
// eslint-disable-next-line prefer-template
|
||||
label={t('name') + ': '}
|
||||
value={`${o.object.name}`}
|
||||
/>
|
||||
)}
|
||||
{o.object[formData.line_column] && (
|
||||
{o.object?.[formData?.line_column] && (
|
||||
<TooltipRow
|
||||
label={`${formData.line_column}: `}
|
||||
value={`${o.object[formData.line_column]}`}
|
||||
/>
|
||||
)}
|
||||
{formData.metric && (
|
||||
{formData?.metric && (
|
||||
<TooltipRow
|
||||
label={`${metricLabel}: `}
|
||||
value={`${o.object[metricLabel]}`}
|
||||
value={`${o.object?.[metricLabel]}`}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -38,17 +38,17 @@ function setTooltipContent(formData, verboseMap) {
|
||||
<TooltipRow
|
||||
// eslint-disable-next-line prefer-template
|
||||
label={t('Longitude and Latitude') + ': '}
|
||||
value={`${o.object.position[0]}, ${o.object.position[1]}`}
|
||||
value={`${o.object?.position?.[0]}, ${o.object?.position?.[1]}`}
|
||||
/>
|
||||
{o.object.cat_color && (
|
||||
{o.object?.cat_color && (
|
||||
<TooltipRow
|
||||
// eslint-disable-next-line prefer-template
|
||||
label={t('Category') + ': '}
|
||||
value={`${o.object.cat_color}`}
|
||||
value={`${o.object?.cat_color}`}
|
||||
/>
|
||||
)}
|
||||
{o.object.metric && (
|
||||
<TooltipRow label={`${label}: `} value={`${o.object.metric}`} />
|
||||
{o.object?.metric && (
|
||||
<TooltipRow label={`${label}: `} value={`${o.object?.metric}`} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -42,12 +42,12 @@ function setTooltipContent(o) {
|
||||
<TooltipRow
|
||||
// eslint-disable-next-line prefer-template
|
||||
label={t('Longitude and Latitude') + ': '}
|
||||
value={`${o.coordinate[0]}, ${o.coordinate[1]}`}
|
||||
value={`${o?.coordinate?.[0]}, ${o?.coordinate?.[1]}`}
|
||||
/>
|
||||
<TooltipRow
|
||||
// eslint-disable-next-line prefer-template
|
||||
label={t('Weight') + ': '}
|
||||
value={`${o.object.cellWeight}`}
|
||||
value={`${o.object?.cellWeight}`}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -25,6 +25,8 @@ import { getLayer as deck_scatter } from './Scatter/Scatter';
|
||||
import { getLayer as deck_geojson } from './Geojson/Geojson';
|
||||
import { getLayer as deck_arc } from './Arc/Arc';
|
||||
import { getLayer as deck_polygon } from './Polygon/Polygon';
|
||||
import { getLayer as deck_heatmap } from './Heatmap/Heatmap';
|
||||
import { getLayer as deck_contour } from './Contour/Contour';
|
||||
|
||||
const layerGenerators = {
|
||||
deck_grid,
|
||||
@@ -35,6 +37,8 @@ const layerGenerators = {
|
||||
deck_geojson,
|
||||
deck_arc,
|
||||
deck_polygon,
|
||||
deck_heatmap,
|
||||
deck_contour,
|
||||
};
|
||||
|
||||
export default layerGenerators;
|
||||
|
||||
Reference in New Issue
Block a user