diff --git a/addons/beyond_expense/static/src/gastos/gastos.js b/addons/beyond_expense/static/src/gastos/gastos.js index 01a3a39..ef072ed 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.js +++ b/addons/beyond_expense/static/src/gastos/gastos.js @@ -201,7 +201,6 @@ export class BeyondGastos extends Component { return []; } const cx = 500, cy = 150, radio = 120, grueso = 46; - const CODO = 148, COLUMNA = 250; let angulo = -Math.PI / 2; const arcos = partes.map((p) => { const barrido = (p.valor / total) * Math.PI * 2; @@ -218,31 +217,13 @@ export class BeyondGastos extends Component { "Z", ].join(" "); angulo = fin; - const derecha = Math.cos(medio) >= 0; - const porcentaje = (p.valor / total) * 100; return { ...p, d, color: this.color(p.clave), - porcentaje, + porcentaje: (p.valor / total) * 100, montoTexto: this.dinero(p.valor), - anclaje: derecha ? "start" : "end", - derecha, - sx: cx + Math.cos(medio) * (radio + 4), - sy: cy + Math.sin(medio) * (radio + 4), - ex: cx + Math.cos(medio) * CODO, - ey: cy + Math.sin(medio) * CODO, - tx: cx + (derecha ? COLUMNA : -COLUMNA), }; }); - for (const lado of [true, false]) { - const suyas = arcos.filter((a) => a.derecha === lado) - .sort((a, b) => a.ey - b.ey); - let minimo = -Infinity; - for (const arco of suyas) { - arco.ty = Math.max(arco.ey, minimo); - minimo = arco.ty + 30; - } - } return arcos; } diff --git a/addons/beyond_expense/static/src/gastos/gastos.scss b/addons/beyond_expense/static/src/gastos/gastos.scss index 066ac76..fd3dfd6 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.scss +++ b/addons/beyond_expense/static/src/gastos/gastos.scss @@ -342,3 +342,41 @@ $gastos-fondo: #FAF9F7; font-style: italic; } .beyond_gastos_sin_costo_celda { text-align: center; } + + + // La dona con su leyenda de texto al lado (7-sep): las rebanadas + // chicas no tienen dónde escribir su nombre en el lienzo. + .beyond_gastos_dona_fila { + display: flex; + align-items: center; + gap: 14px; + .beyond_gastos_dona { flex: 0 0 46%; } + } + .beyond_gastos_dona_lista { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 6px; + font-size: 13px; + } + .beyond_gastos_dona_item { + display: flex; + align-items: center; + gap: 8px; + i { + width: 10px; + height: 10px; + border-radius: 3px; + flex: none; + } + .beyond_gastos_dona_nombre { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: 700; + } + .beyond_gastos_dona_pct { color: $gastos-tinta-suave; } + } diff --git a/addons/beyond_expense/static/src/gastos/gastos.xml b/addons/beyond_expense/static/src/gastos/gastos.xml index 6fcd7c7..f70978e 100644 --- a/addons/beyond_expense/static/src/gastos/gastos.xml +++ b/addons/beyond_expense/static/src/gastos/gastos.xml @@ -116,30 +116,35 @@