Skip to content

Commit

Permalink
touchup: increase edge label width for layout
Browse files Browse the repository at this point in the history
Could use the average-width to try and balance using too much space vs
using too little space, but it doesn't seem like a big deal to use too
much space, whereas labels still overlapping basically
forfeits a lot of the value of trying to avoid overlap.
  • Loading branch information
keyserj committed Nov 25, 2024
1 parent e90da88 commit df79de8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/web/topic/utils/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ export type Orientation = "DOWN" | "UP" | "RIGHT" | "LEFT";
export const orientation: Orientation = "DOWN" as Orientation; // not constant to allow potential other orientations in the future, and keeping code that currently exists for handling "LEFT" orientation

/**
* Roughly accurate, using the average-length "addresses" label
* Using the highest-width of the common labels ("subproblem of"; excludes "contingency for" because
* that's rarely used).
*
* Could use the average-width to try and balance using too much space vs using too little space,
* but it doesn't seem like a big deal to use too much space, whereas labels still overlapping
* basically forfeits a lot of the value of trying to avoid overlap.
*/
export const labelWidthPx = 85;
export const labelWidthPx = 115;

const priorities = Object.fromEntries(nodeTypes.map((type, index) => [type, index.toString()])) as {
[type in NodeType]: string;
Expand Down

0 comments on commit df79de8

Please sign in to comment.