From 7037c5c17c709afc139ac44230dbe1e5c67011bc Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Tue, 10 Oct 2023 16:27:24 -0400 Subject: [PATCH] Adjust DomainTileButton dimensions (#2683) --- .../TreeDepiction/DomainTileButton.tsx | 1 + .../TreeDepiction/TreeDepictionTypes.ts | 4 +- .../DomainTileButton.test.tsx.snap | 1 + .../tests/__snapshots__/index.test.tsx.snap | 980 ++++++++++++++++-- 4 files changed, 919 insertions(+), 67 deletions(-) diff --git a/src/components/TreeView/TreeDepiction/DomainTileButton.tsx b/src/components/TreeView/TreeDepiction/DomainTileButton.tsx index 02b115a53f..0555f4c40b 100644 --- a/src/components/TreeView/TreeDepiction/DomainTileButton.tsx +++ b/src/components/TreeView/TreeDepiction/DomainTileButton.tsx @@ -104,6 +104,7 @@ export default function DomainTileButton( width: "95%", height: "95%", margin: "2.5%", + padding: "5px", }} variant={"outlined"} > diff --git a/src/components/TreeView/TreeDepiction/TreeDepictionTypes.ts b/src/components/TreeView/TreeDepiction/TreeDepictionTypes.ts index d76ed4795a..d71b45874c 100644 --- a/src/components/TreeView/TreeDepiction/TreeDepictionTypes.ts +++ b/src/components/TreeView/TreeDepiction/TreeDepictionTypes.ts @@ -1,8 +1,8 @@ import { SemanticDomain, SemanticDomainTreeNode } from "api/models"; const MAX_COL_WIDTH = 50; // Max gap. -const MIN_COL_WIDTH = 30; // Multiply this by RATIO_TILE_TO_GAP for min tile width. -export const RATIO_TILE_TO_GAP = 3; // Must be odd. +const MIN_COL_WIDTH = 12; // Multiply this by RATIO_TILE_TO_GAP for min tile width. +export const RATIO_TILE_TO_GAP = 7; // Must be odd. export function getNumCols(numChildren: number) { return numChildren * (RATIO_TILE_TO_GAP + 1) - 1; diff --git a/src/components/TreeView/TreeDepiction/tests/__snapshots__/DomainTileButton.test.tsx.snap b/src/components/TreeView/TreeDepiction/tests/__snapshots__/DomainTileButton.test.tsx.snap index 218386f8b3..971cb6d2ee 100644 --- a/src/components/TreeView/TreeDepiction/tests/__snapshots__/DomainTileButton.test.tsx.snap +++ b/src/components/TreeView/TreeDepiction/tests/__snapshots__/DomainTileButton.test.tsx.snap @@ -24,6 +24,7 @@ exports[`DomainTileButton renders tile and matches the latest snapshot 1`] = ` "height": "95%", "left": 0, "margin": "2.5%", + "padding": "5px", "width": "95%", } } diff --git a/src/components/TreeView/TreeDepiction/tests/__snapshots__/index.test.tsx.snap b/src/components/TreeView/TreeDepiction/tests/__snapshots__/index.test.tsx.snap index 365a916bac..0648b0c075 100644 --- a/src/components/TreeView/TreeDepiction/tests/__snapshots__/index.test.tsx.snap +++ b/src/components/TreeView/TreeDepiction/tests/__snapshots__/index.test.tsx.snap @@ -49,6 +49,7 @@ Array [ "height": "95%", "left": 0, "margin": "2.5%", + "padding": "5px", "width": "95%", } } @@ -109,7 +110,7 @@ Array [ className="MuiImageListItem-img" height={60} src="parent.svg" - width={51} + width={45} /> @@ -221,11 +222,35 @@ Array [ style={ Object { "gap": 0, - "gridTemplateColumns": "repeat(11, 1fr)", - "width": 550, + "gridTemplateColumns": "repeat(23, 1fr)", + "width": 1012, } } > +
  • +
  • +
  • +
  • + span.svg +
  • +
  • + span.svg +
  • +
  • + span.svg +
  • +
  • + span.svg
  • +
  • +
  • + span.svg +
  • +
  • + span.svg +
  • +
  • + span.svg +
  • +
  • + span.svg
  • +
  • +
  • +
  • +
  • -