michael-s-molina commented on code in PR #32358:
URL: https://github.com/apache/superset/pull/32358#discussion_r1972224010
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx:
##########
@@ -224,6 +225,31 @@ const config: ControlPanelConfig = {
['y_axis_format'],
['x_axis_time_format'],
['currency_format'],
+ [<ControlSubSectionHeader>Border</ControlSubSectionHeader>],
Review Comment:
```suggestion
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx:
##########
@@ -224,6 +225,31 @@ const config: ControlPanelConfig = {
['y_axis_format'],
['x_axis_time_format'],
['currency_format'],
+ [<ControlSubSectionHeader>Border</ControlSubSectionHeader>],
+ [
+ {
+ name: 'element_border',
+ config: {
+ type: 'ColorPickerControl',
+ label: t('Border color'),
+ renderTrigger: true,
+ description: t('Select border color for Heatmap elements'),
+ default: { r: 255, g: 255, b: 255, a: 1 },
+ },
+ },
+ {
+ name: 'borders_width',
+ config: {
+ type: 'SliderControl',
+ label: t('Border width'),
+ renderTrigger: true,
+ min: 0,
+ max: 1,
+ step: 0.1,
+ description: t('Select border width'),
+ },
Review Comment:
```suggestion
{
name: 'border_width',
config: {
type: 'SliderControl',
label: t('Border width'),
renderTrigger: true,
min: 0,
max: 2,
default: 0,
step: 0.1,
description: t('The width of the elements border'),
},
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts:
##########
@@ -86,6 +89,8 @@ export default function transformProps(
metric = '',
normalizeAcross,
normalized,
+ elementBorder = { r: 255, g: 255, b: 255, a: 1 },
+ bordersWidth = 0,
Review Comment:
```suggestion
borderColor,
borderWidth,
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts:
##########
@@ -33,6 +34,8 @@ export interface HeatmapFormData extends QueryFormData {
metric: QueryFormMetric;
normalizeAcross: 'heatmap' | 'x' | 'y';
normalized?: boolean;
+ elementBorder?: RgbaColor;
+ bordersWidth: number;
Review Comment:
```suggestion
borderColor: RgbaColor;
borderWidth: number;
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx:
##########
@@ -19,6 +19,7 @@
import { t, validateNonEmpty } from '@superset-ui/core';
import {
ControlPanelConfig,
+ ControlSubSectionHeader,
Review Comment:
```suggestion
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts:
##########
@@ -161,6 +166,20 @@ export default function transformProps(
return valueFormatter(paramsValue?.[2] as number | null | undefined);
},
},
+ itemStyle: {
+ borderColor: addAlpha(
+ rgbToHex(elementBorder.r, elementBorder.g, elementBorder.b),
+ elementBorder.a,
+ ),
+ borderWidth: bordersWidth,
+ },
Review Comment:
```suggestion
itemStyle: {
borderColor: addAlpha(
rgbToHex(borderColor.r, borderColor.g, borderColor.b),
borderColor.a,
),
borderWidth,
},
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx:
##########
@@ -224,6 +225,31 @@ const config: ControlPanelConfig = {
['y_axis_format'],
['x_axis_time_format'],
['currency_format'],
+ [<ControlSubSectionHeader>Border</ControlSubSectionHeader>],
+ [
+ {
+ name: 'element_border',
+ config: {
+ type: 'ColorPickerControl',
+ label: t('Border color'),
+ renderTrigger: true,
+ description: t('Select border color for Heatmap elements'),
+ default: { r: 255, g: 255, b: 255, a: 1 },
+ },
Review Comment:
Could you also move the configuration after `linear_color_scheme` as it
makes sense to be close to the color scheme?
```suggestion
{
name: 'border_color',
config: {
type: 'ColorPickerControl',
label: t('Border color'),
renderTrigger: true,
description: t('The color of the elements border'),
default: { r: 0, g: 0, b: 0, a: 1 },
},
```
--
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]