-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dashboard): adds resolution and aggregation to new proeprty in ga…
…uge widget
- Loading branch information
1 parent
b914c36
commit 2a210f0
Showing
12 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+113 Bytes
(100%)
.../tests/gauge/gauge.spec.ts-snapshots/gauge-default-settings-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+113 Bytes
(100%)
...e/tests/gauge/gauge.spec.ts-snapshots/gauge-default-settings-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+90 Bytes
(100%)
.../gauge.spec.ts-snapshots/gauge-with-thresholds-after-delete-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+90 Bytes
(100%)
...e/gauge.spec.ts-snapshots/gauge-with-thresholds-after-delete-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+123 Bytes
(100%)
...gauge.spec.ts-snapshots/gauge-with-thresholds-before-delete-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+123 Bytes
(100%)
.../gauge.spec.ts-snapshots/gauge-with-thresholds-before-delete-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+132 Bytes
(100%)
...e/tests/gauge/gauge.spec.ts-snapshots/gauge-with-thresholds-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+132 Bytes
(100%)
...2e/tests/gauge/gauge.spec.ts-snapshots/gauge-with-thresholds-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/react-components/src/components/gauge/utils/calculatePadding.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const calculatePadding = ({ | ||
fontSize = 0, | ||
unitFontSize = 0, | ||
}: { | ||
fontSize?: number; | ||
unitFontSize?: number; | ||
}) => { | ||
if (fontSize > unitFontSize) { | ||
return -1 * ((fontSize - unitFontSize) / 2); | ||
} else if (fontSize < unitFontSize) { | ||
return (unitFontSize - fontSize) / 2; | ||
} else { | ||
return 0; | ||
} | ||
}; |