This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch npm-audit-with-force in repository https://gitbox.apache.org/repos/asf/superset.git
commit 2b066577b979a8fd0af4e71b90655d4fa3a88752 Author: Maxime Beauchemin (aider) <[email protected]> AuthorDate: Tue Jan 28 23:07:39 2025 -0800 feat: Replace d3-color with tinycolor2 for color conversion --- superset-frontend/plugins/legacy-preset-chart-deckgl/package.json | 3 ++- .../plugins/legacy-preset-chart-deckgl/src/utils/colors.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json index 03ba0dc88c..16dfb88794 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json @@ -41,7 +41,8 @@ "prop-types": "^15.8.1", "underscore": "^1.13.7", "urijs": "^1.19.11", - "xss": "^1.0.15" + "xss": "^1.0.15", + "tinycolor2": "^1.4.2" }, "devDependencies": { "@types/mapbox__geojson-extent": "^1.0.3", diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/colors.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/colors.ts index 7f562dbca2..4673de4cfa 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/colors.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/colors.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { rgb } from 'd3-color'; +import tinycolor from 'tinycolor2'; // eslint-disable-next-line import/prefer-default-export export function hexToRGB( @@ -26,7 +26,7 @@ export function hexToRGB( if (!hex) { return [0, 0, 0, alpha]; } - const { r, g, b } = rgb(hex); + const { r, g, b } = tinycolor(hex).toRgb(); return [r, g, b, alpha]; }
