Skip to content

Commit

Permalink
fix(ui): use color for log on custom charts
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 27, 2025
1 parent 4aa0a57 commit 5268c79
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ui/src/utils/charts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _merge from "lodash/merge";
import Utils from "./utils";
import {cssVariable, State} from "@kestra-io/ui-libs";
import {getScheme} from "./scheme.js";

export function tooltip(tooltipModel) {
const titleLines = tooltipModel.title || [];
Expand Down Expand Up @@ -166,9 +167,17 @@ export function getConsistentHEXColor(value) {
// return "#ffffff";
// }

const hex = State.color()[value];
let hex;

if (hex) return hex;
hex = getScheme(value, "executions");
if (hex) {
return hex;
}

hex = getScheme(value, "logs");
if (hex) {
return hex;
}

// FNV-1a Hash Algorithm
let hash = 0x811c9dc5; // FNV offset basis (32-bit)
Expand Down

0 comments on commit 5268c79

Please sign in to comment.