Skip to content

Commit

Permalink
kup-echart: improved heatmap.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafoscili committed Feb 18, 2022
1 parent 9a676b2 commit 6537fc4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/ketchup/src/components/kup-echart/kup-echart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ export class KupEchart {
#themeBorder: string = null;
#themeBackground: string = null;
#themeColors: string[] = null;
#themeColorBrighter: string = null;
#themeColorDarker: string = null;
#themeFont: string = null;
#themeText: string = null;

Expand Down Expand Up @@ -418,7 +420,13 @@ export class KupEchart {
? undefined
: colors.length > 0
? { inRange: { color: colors }, min: min, max: max }
: { inRange: { color: this.#themeColors[0] }, min: min, max: max };
: {
inRange: {
color: [this.#themeColorBrighter, this.#themeColorDarker],
},
min: min,
max: max,
};
if (colorRange) {
opts.visualMap = {
...opts.visualMap,
Expand Down Expand Up @@ -889,6 +897,14 @@ export class KupEchart {
this.#themeText =
this.#kupManager.theme.cssVars[KupThemeColorValues.TEXT];
this.#themeColors = colorArray;
const colorCheck = this.#kupManager.theme.colorCheck(colorArray[0]);
console.log(colorCheck);
this.#themeColorDarker = `hsl(${colorCheck.hue}, ${
colorCheck.saturation
}, ${(parseFloat(colorCheck.lightness) - 20).toString()}%)`;
this.#themeColorBrighter = `hsl(${colorCheck.hue}, ${
colorCheck.saturation
}, ${(parseFloat(colorCheck.lightness) + 20).toString()}%)`;
}

/*-------------------------------------------------*/
Expand Down

0 comments on commit 6537fc4

Please sign in to comment.