ANÁLISIS DE
MERCADO
Inicio
Retail Price
Retail
Precios por segmento
Precios
Comparativo Toyota
Comparativo
Bubble Chart
Bubble
‹
1 / 3
›
Explorar
01
Retail Price
Precio retail mínimo por modelo
→
02
Precios por segmento
Rangos FOB · CIF · Retail · FEXPO
→
03
Comparativo Toyota
Precio retail Toyota vs competencia
→
04
Bubble Chart
FOB vs Retail · tamaño por unidades RUAT
→
Usa
←
→
para cambiar de pestaña
{ const k = ORDEN.indexOf(s.dataset.vista); s.classList.toggle('activa', k === i); s.classList.toggle('antes', k < i); s.classList.toggle('despues', k > i); s.setAttribute('aria-hidden', k === i ? 'false' : 'true'); }); const tiraTabs = document.querySelector('.tabs'); document.querySelectorAll('.tabs [data-ir]').forEach(b => { b.setAttribute('aria-selected', b.dataset.ir === v); /* si las pestañas no entran, desplaza solo la tira para que la activa quede a la vista */ if (b.dataset.ir === v) tiraTabs.scrollLeft = b.offsetLeft - tiraTabs.offsetLeft - (tiraTabs.clientWidth - b.offsetWidth) / 2; }); document.body.dataset.vista = v; document.getElementById('posicion').textContent = (i + 1) + ' / ' + ORDEN.length; document.getElementById('anterior').disabled = i === 0; document.getElementById('siguiente').disabled = i === ORDEN.length - 1; actual = v; } const ir = v => { if (location.hash.slice(1) !== v) location.hash = v; else mostrar(v); }; const paso = d => ir(ORDEN[Math.max(0, Math.min(ORDEN.length - 1, ORDEN.indexOf(actual) + d))]); document.querySelectorAll('[data-ir]').forEach(b => b.addEventListener('click', () => ir(b.dataset.ir))); document.getElementById('anterior').onclick = () => paso(-1); document.getElementById('siguiente').onclick = () => paso(1); window.addEventListener('hashchange', () => mostrar(location.hash.slice(1))); /* flechas del teclado: solo fuera de los gráficos, para no quitarles el desplazamiento horizontal */ document.addEventListener('keydown', e => { if (e.altKey || e.ctrlKey || e.metaKey || e.target.closest('input,select,textarea')) return; if (e.key === 'ArrowRight' || e.key === 'PageDown') { e.preventDefault(); paso(1); } else if (e.key === 'ArrowLeft' || e.key === 'PageUp') { e.preventDefault(); paso(-1); } else if (e.key === 'Home') { e.preventDefault(); ir('portada'); } }); mostrar(location.hash.slice(1) || 'portada'); })();