kgabryje commented on code in PR #34322:
URL: https://github.com/apache/superset/pull/34322#discussion_r2236786712
##########
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx:
##########
@@ -98,7 +99,50 @@ export const getLayer: GetLayerType<ArcLayer> = function ({
filterState,
emitCrossFilters,
}),
+ opacity: filterState?.value ? 0.1 : 1,
});
};
-export default createCategoricalDeckGLComponent(getLayer, getPoints);
+export const getHighlightLayer: GetLayerType<ArcLayer> = function ({
+ formData,
+ payload,
+ filterState,
+}) {
+ const fd = formData;
+ const data = payload.data.features;
+
+ const getColor = (d: {
+ sourcePosition: [number, number];
+ targetPosition: [number, number];
+ }) => {
+ const sourcePosition = filterState?.value[0];
+ const targetPosition = filterState?.value[1];
+
+ if (
+ sourcePosition &&
+ targetPosition &&
+ d.sourcePosition[0] === sourcePosition[0] &&
+ d.sourcePosition[1] === sourcePosition[1] &&
+ d.targetPosition[0] === targetPosition[0] &&
+ d.targetPosition[1] === targetPosition[1]
+ ) {
+ return [255, 0, 0, 255] as Color;
+ }
+
+ return [0, 0, 0, 0] as Color;
Review Comment:
We use [255, 0, 0, 255] and [0, 0, 0, 0] a lot in this PR. Could we replace
them with a const? maybe sth like `const redColorArray` and
`transparentColorArray`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]