Compare commits

...

3 Commits

Author SHA1 Message Date
hainenber
f5c6081d6f chore: correct tinycolor2 equivalent for refactored code
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-05-02 13:42:51 +07:00
hainenber
881a62def4 Merge branch 'master' into chore/remove-direct-usage-of-d3-color
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-05-02 13:40:25 +07:00
hainenber
fe17bead62 chore(build): replace d3-color usage with existing tinycolor2
Signed-off-by: hainenber <dotronghai96@gmail.com>
2026-04-19 12:17:20 +07:00
6 changed files with 7 additions and 11 deletions

View File

@@ -79,7 +79,6 @@
"chrono-node": "^2.9.0",
"classnames": "^2.2.5",
"content-disposition": "^1.1.0",
"d3-color": "^3.1.0",
"d3-scale": "^4.0.2",
"dayjs": "^1.11.20",
"dom-to-image-more": "^3.7.2",
@@ -52758,9 +52757,9 @@
"dependencies": {
"d3": "^3.5.17",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"datamaps": "^0.5.10",
"prop-types": "^15.8.1"
"prop-types": "^15.8.1",
"tinycolor2": "^1.6.0"
},
"peerDependencies": {
"@apache-superset/core": "*",
@@ -53287,7 +53286,6 @@
"@types/geojson": "^7946.0.16",
"bootstrap-slider": "^11.0.2",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"d3-scale": "^4.0.2",
"handlebars": "^4.7.9",
"lodash": "^4.18.1",

View File

@@ -160,7 +160,6 @@
"chrono-node": "^2.9.0",
"classnames": "^2.2.5",
"content-disposition": "^1.1.0",
"d3-color": "^3.1.0",
"d3-scale": "^4.0.2",
"dayjs": "^1.11.20",
"dom-to-image-more": "^3.7.2",

View File

@@ -31,7 +31,7 @@
"dependencies": {
"d3": "^3.5.17",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"tinycolor2": "^1.6.0",
"datamaps": "^0.5.10",
"prop-types": "^15.8.1"
},

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { rgb } from 'd3-color';
import tinycolor from 'tinycolor2';
import { ChartProps, getValueFormatter } from '@superset-ui/core';
export default function transformProps(chartProps: ChartProps) {
@@ -75,7 +75,7 @@ export default function transformProps(chartProps: ChartProps) {
maxBubbleSize: parseInt(maxBubbleSize, 10),
showBubbles,
linearColorScheme,
color: rgb(r, g, b).hex(),
color: tinycolor({ r, g, b }).toHexString(),
colorBy,
colorScheme,
sliceId,

View File

@@ -42,7 +42,6 @@
"@types/geojson": "^7946.0.16",
"bootstrap-slider": "^11.0.2",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"d3-scale": "^4.0.2",
"handlebars": "^4.7.9",
"lodash": "^4.18.1",

View File

@@ -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];
}