Skip to content

Commit

Permalink
fix: table produced invalid SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
skanaar committed Apr 12, 2022
1 parent 40294d3 commit a301fab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/nomnoml.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
cell.width = cellW;
}
}
clas.compartments = clas.compartments.filter((e) => !isRowBreak(e));
},
transceiver: box,
};
Expand Down Expand Up @@ -2110,6 +2111,9 @@
current.attr['text-align'] = a;
},
translate: function (dx, dy) {
if (Number.isNaN(dx) || Number.isNaN(dy)) {
throw new Error('dx and dy must be real numbers');
}
current.attr.transform = `translate(${dx}, ${dy})`;
},
serialize: function (size, desc, title) {
Expand Down
3 changes: 3 additions & 0 deletions src/GraphicsSvg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ export function GraphicsSvg(document?: HTMLDocument): ISvgGraphics {
current.attr['text-align'] = a
},
translate: function (dx, dy) {
if (Number.isNaN(dx) || Number.isNaN(dy)) {
throw new Error('dx and dy must be real numbers')
}
current.attr.transform = `translate(${dx}, ${dy})`
},
serialize: function (
Expand Down
1 change: 1 addition & 0 deletions src/visuals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export var layouters: { [key in Visual]: NodeLayouter } = {
cell.width = cellW
}
}
clas.compartments = clas.compartments.filter((e) => !isRowBreak(e))
},
transceiver: box,
}
Expand Down

0 comments on commit a301fab

Please sign in to comment.