Skip to content

Commit

Permalink
updated build
Browse files Browse the repository at this point in the history
  • Loading branch information
biomadeira committed Nov 4, 2024
1 parent 120eb85 commit 23e9f06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions bin/color-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export function getGradientSteps(minEvalue, maxEvalue, minEvalueNotZero, colorSc
* h, s, v
*/
export function HSVtoRGB(h, s, v) {
// Clamp input values to the expected range [0, 1]
h = Math.min(Math.max(h, 0), 1);
s = Math.min(Math.max(s, 0), 1);
v = Math.min(Math.max(v, 0), 1);
let r = 0;
let g = 0;
let b = 0;
Expand Down
2 changes: 1 addition & 1 deletion bin/drawing-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export function drawFooterText(renderOptions, topPadding) {
textObj.evented = true;
textObj.top = topPadding;
textObj.left = 225;
const copyright = `European Bioinformatics Institute 2006-2022. ` +
const copyright = `European Bioinformatics Institute 2006-2024. ` +
`EBI is an Outstation of the European Molecular Biology Laboratory.`;
const copyrightText = new fabric.Text(`${copyright}`, textObj);
return [copyrightText, textObj];
Expand Down
10 changes: 5 additions & 5 deletions bin/other-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ export class ObjectCache {
}
}
}
function countDecimals(n) {
export function countDecimals(n) {
if (Math.floor(n) === n)
return 0;
return n.toString().split('.')[1].length || 0;
}
export function numberToString(n) {
if (Number.isInteger(n)) {
return n + '.0';
}
else if (n < 0.0001 || n > 10000) {
if (n < 0.0001 || n > 10000) {
return n.toExponential(2);
}
else if (Number.isInteger(n)) {
return n + '.0';
}
else if (countDecimals(n) > 3) {
return n.toFixed(3).toString();
}
Expand Down

0 comments on commit 23e9f06

Please sign in to comment.