From 1603e2d6d58f6555cd97b50d7983c03a95214748 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sat, 14 Sep 2019 01:47:48 +0300 Subject: [PATCH] v1.0.33 --- modules/ui/provinces-editor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ui/provinces-editor.js b/modules/ui/provinces-editor.js index 1b0844da..a9e7f35e 100644 --- a/modules/ui/provinces-editor.js +++ b/modules/ui/provinces-editor.js @@ -291,7 +291,7 @@ function editProvinces() { const data = states.concat(provinces); const root = d3.stratify().parentId(d => d.state)(data).sum(d => d.area); - const width = 800, height = 300; + const width = 300 + 300 * uiSizeOutput.value, height = 90 + 90 * uiSizeOutput.value; const margin = {top: 10, right: 10, bottom: 0, left: 10}; const w = width - margin.left - margin.right; const h = height - margin.top - margin.bottom; @@ -357,7 +357,7 @@ function editProvinces() { let b = this.getBBox(); if (b.y + b.height > d.y1 + 1) this.innerHTML = ""; - while(b.width > 0 && b.x + b.width > d.x1) { + for(let i=0; i < 15 && b.width > 0 && b.x + b.width > d.x1; i++) { if (this.innerHTML.length < 3) {this.innerHTML = ""; break;} this.innerHTML = this.innerHTML.slice(0, -2) + "…"; b = this.getBBox(); @@ -386,8 +386,8 @@ function editProvinces() { } $("#alert").dialog({ - title: "Provinces chart", width: fitContent(), resizable: false, - position: {my: "left center", at: "left+10 center", of: "svg"}, buttons: {}, + title: "Provinces chart", width: fitContent(), + position: {my: "left bottom", at: "left+10 bottom-10", of: "svg"}, buttons: {}, close: () => {alertMessage.innerHTML = "";} });