Skip to content

Commit

Permalink
fix layout on FF
Browse files Browse the repository at this point in the history
  • Loading branch information
ara4n committed Nov 25, 2024
1 parent 3f824e1 commit b11be5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ const redraw = (vis: HTMLDivElement, events: MatrixEvent[]) => {
const laneEnd: Array<number> = []; // the height at which this lane was terminated

// for balanced layout:
const balanced = false;
const laneWidth = 100;
lanes.length = laneWidth;
laneEnd.length = laneWidth;
if (balanced) {
lanes.length = laneWidth;
laneEnd.length = laneWidth;
}

function getNextLane(after: number | null = null) {
const balanced = false;
if (balanced) {
// biome-ignore lint/style/noParameterAssign:
if (after == null) after = 0;
Expand Down Expand Up @@ -229,8 +231,7 @@ const redraw = (vis: HTMLDivElement, events: MatrixEvent[]) => {
.attr("transform", `translate(${[margin.left, margin.top]})`);

const node = svg
.append("g")
.selectAll("circle")
.selectAll("g")
.data(data)
.enter()
.append("g")
Expand Down Expand Up @@ -314,6 +315,7 @@ const redraw = (vis: HTMLDivElement, events: MatrixEvent[]) => {
let childIndex = 0;
for (const child of d.next_events) {
const c = eventsById.get(child);
if (!c) continue;

const path = d3.path();

Expand Down
8 changes: 6 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ body {

#contents {
display: flex;
justify-content: space-around;
overflow: hidden;
/*
* this makes firefox center-justify the contents and hide it when the svg is wide
* and don't hide the overflow when the svg is wide
*/
/* justify-content: space-around; */
/* overflow: hidden; */
flex-grow: 1;
}

Expand Down

0 comments on commit b11be5c

Please sign in to comment.