aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-03-05 16:17:19 -0500
committersrichman333 <sarah_n_richman@brown.edu>2024-03-05 16:17:19 -0500
commitca60236766540ac1ce0c18d52416d982e91404cd (patch)
tree77cd6195293afdf4b13dde4553c92d305b0cf7a1 /src/Utils.ts
parentdfef33c3f1cde9a24d734e0bd47e7f377a3ae4c9 (diff)
parent11b6cb8344f26e5895bebc3dedef491675717e30 (diff)
Merge branch 'master' into dataviz-ai-sarah
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index e8bd35ac4..38325a463 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -902,6 +902,13 @@ export function setupMoveUpEvents(
document.addEventListener('click', _clickEvent, true);
}
+export function DivHeight(ele: HTMLElement): number {
+ return Number(getComputedStyle(ele).height.replace('px', ''));
+}
+export function DivWidth(ele: HTMLElement): number {
+ return Number(getComputedStyle(ele).width.replace('px', ''));
+}
+
export function dateRangeStrToDates(dateStr: string) {
// dateStr in yyyy-mm-dd format
const dateRangeParts = dateStr.split('|'); // splits into from and to date