useMaxWidth should make height 100% too.

This commit is contained in:
Yusuke Wada 2021-09-14 18:28:15 +09:00
parent 0d91eee5e0
commit 20aaf644fa
1 changed files with 2 additions and 1 deletions

View File

@ -778,12 +778,13 @@ const d3Attrs = function (d3Elem, attrs) {
export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {
let attrs = new Map();
attrs.set('height', height);
if (useMaxWidth) {
attrs.set('width', '100%');
attrs.set('height', '100%');
attrs.set('style', `max-width: ${width}px;`);
} else {
attrs.set('width', width);
attrs.set('height', height);
}
return attrs;
};