<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* analytic/explore.html.twig */
class __TwigTemplate_f05d055baa959720d7643e8266c8175b extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "Layouts/layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "analytic/explore.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "analytic/explore.html.twig"));
$this->parent = $this->loadTemplate("Layouts/layout.html.twig", "analytic/explore.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield " Retabit Platform ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 6
yield "
";
// line 7
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 7, $this->source); })()), "flashes", ["notice"], "method", false, false, false, 7));
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 8
yield " <div class=\"flash-notice\" id=\"flash_div\">
<div class=\"text-end\"><span class=\"material-symbols-outlined hover\" onclick=\"removeDiv('flash_div')\">close</span></div>
<div class=\"container\">
<p>";
// line 11
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($context["message"]), "html", null, true);
yield "</p>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['message'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 15
yield "
<div class=\"modal fade\" id=\"popUpIndicadores\" tabindex=\"-1\" >
<div class=\"modal-dialog modal-lg\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h1 class=\"modal-title fs-5\" id=\"exampleModalLabel\">";
// line 20
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Selecciona los indicadores para descargar en un fichero Excel", [], "messages");
yield "</h1>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<div class=\"row\">
<a id=\"selectAllBtn\" class=\"px-5 mb-2\" style=\"cursor: pointer; font-weight: 400; text-decoration:none;\">";
// line 25
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Seleccionar Todos", [], "messages");
yield "</a>
<div class=\"col-12 px-5\" id=\"project_actions_content\">
</div>
<div class=\"text-center\" id=\"popUpIndicadores_button\">
<button class=\"btn btn-primary\" onclick=\"getExcel()\">";
// line 30
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Descargar", [], "messages");
yield " selección</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"container-fluid project_explore_container\" id=\"container_in_content\">
<div class=\"row justify-content-center\">
<div id=\"infoview_content\" class=\"col-12\">
";
// line 44
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data"]) || array_key_exists("analytic_data", $context) ? $context["analytic_data"] : (function () { throw new RuntimeError('Variable "analytic_data" does not exist.', 44, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 45
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "slug", [], "any", false, false, false, 45) == (isset($context["slug"]) || array_key_exists("slug", $context) ? $context["slug"] : (function () { throw new RuntimeError('Variable "slug" does not exist.', 45, $this->source); })()))) {
// line 46
yield " ";
// line 47
yield " <div class=\"row justify-content-center\">
<!-- Textai box -->
<div class=\"col-12 p-3\" id=\"header_content_info_top\">
<div class=\"d-flex justify-content-between align-items-center\">
<h2 class=\"d-inline-block\" data-bs-toggle=\"collapse\" href=\"#textai_box\" role=\"button\" aria-expanded=\"false\" aria-controls=\"textai_box\" onclick=\"expandIcon('analytics_title_arrow')\" >
";
// line 53
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 53, $this->source); })()), "request", [], "any", false, false, false, 53), "locale", [], "any", false, false, false, 53) == "ca")) {
// line 54
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "name_ca", [], "any", false, false, false, 54), "html", null, true);
yield "
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, // line 55
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 55, $this->source); })()), "request", [], "any", false, false, false, 55), "locale", [], "any", false, false, false, 55) == "en")) {
// line 56
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "name_en", [], "any", false, false, false, 56), "html", null, true);
yield "
";
} else {
// line 58
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "name", [], "any", false, false, false, 58), "html", null, true);
yield "
";
}
// line 60
yield "
<span class=\"material-symbols-outlined hover\" id=\"analytics_title_arrow\">expand_more</span>
</h2>
<div class=\"d-flex\">
<div class=\"d-flex align-items-center\">
<button class=\"btn btn-primary btn-sm\" onclick=\"loadSelectorIndicators()\">";
// line 65
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Descargar datos", [], "messages");
yield "</button>
</div>
</div>
</div>
<div class=\"collapse\" id=\"textai_box\" style=\"max-width: 940px;\">
<p class=\"flex-fill mb-3\" style=\"font-size: 14px;\">";
// line 72
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "textai", [], "any", false, false, false, 72), "html", null, true);
yield "</p>
</div>
</div>
<div class=\"col-12 all_steps\" id=\"analytic_step\">
<div class=\"row justify-content-center align-items-top\">
<div id=\"infoview\" class=\"infoview_div col-12\">
<div class=\"row align-items-center justify-content-center\">
<div class=\"col-12 collapse show\" id=\"filter_div\">
<div class=\"row align-items-center justify-content-center\">
</div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"map_view\" >
<div class=\"col-12\">
<div class=\"map__container\" style=\"position:relative;\">
<div id=\"map\" class=\"map\"></div>
<div class=\"legend\"></div>
<div id=\"popup\" class=\"popup d-none\">
<a href=\"#\" id=\"popup-closer\" class=\"popup__closer\"></a>
<div id=\"popup-content\" class=\"popup__content\"></div>
</div>
<button id=\"centerbutton\" class=\"btn btn-light btn-sm pb-0\" onclick=\"centerViewMap()\">
<span class=\"material-symbols-outlined\">fit_screen</span>
<span class=\"material-symbols-outlined d-none\">collapse_content</span></button>
<button id=\"expand\" class=\"btn btn-light btn-sm pb-0\" onclick=\"infoviewToggle()\">
<span class=\"material-symbols-outlined\">expand_content</span></button>
</div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"data_view\">
<div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
<div id=\"wrapper\"></div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"card_view\" >
<div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
<form class=\"row row-cols-lg-auto g-2 align-items-center mb-2 d-none\">
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"via\">";
// line 123
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Tipo via", [], "messages");
yield "</label>
<select class=\"form-select\" id=\"via\">
<option value=\"1\">";
// line 125
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Calle", [], "messages");
yield "</option>
<option value=\"2\">";
// line 126
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Avenida", [], "messages");
yield "</option>
<option value=\"3\">";
// line 127
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Rambla", [], "messages");
yield "</option>
</select>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"street_name\">";
// line 132
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Nombre calle", [], "messages");
yield "</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"street\" placeholder=\"Nombre de calle\">
</div>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"flat\">";
// line 139
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Piso", [], "messages");
yield "</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"flat\" placeholder=\"Piso\">
</div>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"floor\">";
// line 146
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Planta", [], "messages");
yield "</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"floor\" placeholder=\"Pta.\">
</div>
</div>
<div class=\"col-12\">
<button type=\"submit\" class=\"btn btn-primary pb-0\"><span class=\"material-symbols-outlined\">search</span></button>
</div>
</form>
<div class=\"row\" style=\" padding: 20px; margin-bottom: 40px; box-sizing: border-box;\">
<div class=\"col-6 col-sm-3 overflow-hidden\" id=\"img_fachada\" style=\"background: #fbfbfb; padding: 20px;\"></div>
<div class=\"col-6 col-sm-3 overflow-hidden me-4\" id=\"img_catastro\" style=\"background: #fbfbfb; padding: 20px;\"></div>
<div class=\"col-12 col-sm-5\" id=\"txt_build\"></div>
</div>
<div class=\"row g-3\" id=\"build_indicators\">
</div>
</div>
</div>
</div>
<div id=\"infoview2\" class=\"infoview2_div collapse collapse-horizontal show\">
<!-- Selected box -->
<div class=\"col-12 selected_box p-3 mb-3 sticky-top d-none\">
<h4>";
// line 175
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Indicador seleccionado", [], "messages");
yield "</h4>
<div id=\"selected_box_content\" class=\"selected_box_item\" title=\"Header\" data-bs-toggle=\"popover_live_top\" data-bs-trigger=\"hover focus\" data-bs-title=\"Popover title\" data-bs-content=\"And here's some amazing content. It's very engaging. Right?\"></div>
</div>
<!-- Indicadores box -->
<div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
<div class=\"d-flex justify-content-between\">
<p class=\"fw-bold fs-5\">";
// line 182
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Indicadores relacionados", [], "messages");
yield "</p>
</div>
<div class=\"\" id=\"analytics_indicators\">
";
// line 186
$context["break"] = false;
// line 187
yield " ";
$context["array_used"] = [];
// line 188
yield " ";
$context["category"] = "";
// line 189
yield "
";
// line 191
yield " ";
// line 192
yield "
";
// line 193
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "relation", [], "any", false, false, false, 193));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
// line 194
yield " ";
if (((isset($context["break"]) || array_key_exists("break", $context) ? $context["break"] : (function () { throw new RuntimeError('Variable "break" does not exist.', 194, $this->source); })()) == false)) {
// line 195
yield "
";
// line 197
yield "
";
// line 198
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 198, $this->source); })()), "request", [], "any", false, false, false, 198), "locale", [], "any", false, false, false, 198) == "ca")) {
// line 199
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name_ca", [], "any", false, false, false, 199);
// line 200
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info_ca", [], "any", false, false, false, 200);
// line 201
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 201, $this->source); })()), "request", [], "any", false, false, false, 201), "locale", [], "any", false, false, false, 201) == "en")) {
// line 202
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name_en", [], "any", false, false, false, 202);
// line 203
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info_en", [], "any", false, false, false, 203);
// line 204
yield " ";
} else {
// line 205
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 205);
// line 206
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info", [], "any", false, false, false, 206);
// line 207
yield " ";
}
// line 208
yield "
";
// line 209
$context["array_used"] = Twig\Extension\CoreExtension::merge((isset($context["array_used"]) || array_key_exists("array_used", $context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.', 209, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 209)]);
// line 210
yield "
<div id=\"statline_id_";
// line 211
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 211), "html", null, true);
yield "\" onclick=\"updateMapFromDiv(";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 211), "html", null, true);
yield ")\" class=\"grayscale analytics_statsline_item\" data-kpi=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-slug=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "slug", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-bs-toggle=\"popover_live_";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-bs-trigger=\"hover focus\" data-bs-title=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 211, $this->source); })())), "html", null, true);
yield "\" data-bs-content=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["description"]) || array_key_exists("description", $context) ? $context["description"] : (function () { throw new RuntimeError('Variable "description" does not exist.', 211, $this->source); })()), "html", null, true);
yield "\" data-p=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "province", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-m=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "city", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-r=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "region", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-max=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "max_value", [], "any", false, false, false, 211), "html", null, true);
yield "\" data-min=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "min_value", [], "any", false, false, false, 211), "html", null, true);
yield "\">
<p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">";
// line 214
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 214, $this->source); })())), "html", null, true);
yield "</p>
<div class=\"statsline mb-3\" >
";
// line 217
$context["color"] = [];
// line 218
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["kpi_rank"]) || array_key_exists("kpi_rank", $context) ? $context["kpi_rank"] : (function () { throw new RuntimeError('Variable "kpi_rank" does not exist.', 218, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["rank"]) {
// line 219
yield "
";
// line 220
if ((CoreExtension::getAttribute($this->env, $this->source, $context["rank"], "kpi_id", [], "any", false, false, false, 220) == CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 220))) {
// line 221
yield " ";
$context["color"] = Twig\Extension\CoreExtension::merge((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 221, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["rank"], "bgcolor", [], "any", false, false, false, 221)]);
// line 222
yield " ";
}
// line 223
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rank'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 225
yield " ";
$context["counter"] = Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 225, $this->source); })()));
// line 226
yield " ";
$context["partsize"] = (100 / (isset($context["counter"]) || array_key_exists("counter", $context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.', 226, $this->source); })()));
// line 227
yield " ";
$context["stylestring"] = "";
// line 228
yield "
<div class=\"bk_line\">
";
// line 231
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 231, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["colorpart"]) {
// line 232
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 232)) {
// line 233
yield " ";
$context["dato"] = (99.9 - ((isset($context["partsize"]) || array_key_exists("partsize", $context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.', 233, $this->source); })()) * ((isset($context["counter"]) || array_key_exists("counter", $context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.', 233, $this->source); })()) - 1)));
// line 234
yield " <div class=\"analytic_color_bar\" style=\"width:";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["dato"]) || array_key_exists("dato", $context) ? $context["dato"] : (function () { throw new RuntimeError('Variable "dato" does not exist.', 234, $this->source); })()), "html", null, true);
yield "%; background-color: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html", null, true);
yield ";\"></div>
";
} else {
// line 236
yield " <div class=\"analytic_color_bar\" style=\"width:";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["partsize"]) || array_key_exists("partsize", $context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.', 236, $this->source); })()), 2, "."), "html", null, true);
yield "%; background-color: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html", null, true);
yield ";\"></div>
";
}
// line 238
yield "
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['colorpart'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 240
yield "
</div>
<span class=\"statsline_item statsline_";
// line 243
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 243), "html", null, true);
yield " item_tooltip\" style=\"left: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "theme_per", [], "any", false, false, false, 243), "html", null, true);
yield "%;margin-left: -6px;\" data-text=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "theme", [], "any", false, false, false, 243), "html", null, true);
yield "\" data-kpi=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 243), "html", null, true);
yield "\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
</div>
<div class=\"statsline_range d-flex justify-content-between d-none\">
<span>";
// line 247
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "min_value", [], "any", false, false, false, 247), "html", null, true);
yield "</span>
<span>";
// line 248
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "max_value", [], "any", false, false, false, 248), "html", null, true);
yield "</span>
</div>
";
// line 251
if ((CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 251) == 4)) {
// line 252
yield " ";
$context["break"] = true;
// line 253
yield " ";
}
// line 254
yield "
</div>
<script>
\$('[data-bs-toggle=\"popover_live_";
// line 258
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 258), "html", null, true);
yield "\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_";
// line 259
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 259), "html", null, true);
yield "\"]').popover();
})
</script>
";
}
// line 263
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 264
yield "
</div>
</div>
<!-- Otros Indicadores box -->
<div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
<div class=\"d-flex justify-content-between\">
<p class=\"fw-bold fs-5\" data-bs-toggle=\"collapse\" data-bs-target=\"#analytics_indicators\" aria-expanded=\"true\" aria-controls=\"analytics_statsline\" onclick=\"expandIcon('analytics_indicators_arrow')\" role=\"button\">";
// line 271
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Otros indicadores", [], "messages");
yield "</p>
</div>
<div class=\"\" id=\"analytics_indicators_others\">
";
// line 275
$context["category"] = "";
// line 276
yield "
";
// line 278
yield "
";
// line 280
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data_relation"]) || array_key_exists("analytic_data_relation", $context) ? $context["analytic_data_relation"] : (function () { throw new RuntimeError('Variable "analytic_data_relation" does not exist.', 280, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
// line 281
yield " ";
// line 282
yield " ";
if (!CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 282), (isset($context["array_used"]) || array_key_exists("array_used", $context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.', 282, $this->source); })()))) {
// line 283
yield "
";
// line 284
if (((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 284, $this->source); })()) != CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "category", [], "any", false, false, false, 284))) {
// line 285
yield " <p class=\"mt-2 fw-bold\" style=\"font-size: 12px; font-weight: 700;\">
";
// line 287
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 287, $this->source); })()), "request", [], "any", false, false, false, 287), "locale", [], "any", false, false, false, 287) == "ca")) {
// line 288
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "category_ca", [], "any", false, false, false, 288), "html", null, true);
yield "
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, // line 289
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 289, $this->source); })()), "request", [], "any", false, false, false, 289), "locale", [], "any", false, false, false, 289) == "en")) {
// line 290
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "category_en", [], "any", false, false, false, 290), "html", null, true);
yield "
";
} else {
// line 292
yield " ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "category", [], "any", false, false, false, 292), "html", null, true);
yield "
";
}
// line 294
yield " </p>
";
// line 295
$context["category"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "category", [], "any", false, false, false, 295);
// line 296
yield " ";
}
// line 297
yield "
";
// line 298
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 298, $this->source); })()), "request", [], "any", false, false, false, 298), "locale", [], "any", false, false, false, 298) == "ca")) {
// line 299
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name_ca", [], "any", false, false, false, 299);
// line 300
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info_ca", [], "any", false, false, false, 300);
// line 301
yield " ";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 301, $this->source); })()), "request", [], "any", false, false, false, 301), "locale", [], "any", false, false, false, 301) == "en")) {
// line 302
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name_en", [], "any", false, false, false, 302);
// line 303
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info_en", [], "any", false, false, false, 303);
// line 304
yield " ";
} else {
// line 305
yield " ";
$context["title"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 305);
// line 306
yield " ";
$context["description"] = CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "info", [], "any", false, false, false, 306);
// line 307
yield " ";
}
// line 308
yield "
<div id=\"statline_id_";
// line 309
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 309), "html", null, true);
yield "\" onclick=\"updateMapFromDiv(";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 309), "html", null, true);
yield ")\" class=\"grayscale analytics_statsline_item\" data-kpi=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-slug=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "slug", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-bs-toggle=\"popover_live_";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-bs-trigger=\"hover focus\" data-bs-title=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 309, $this->source); })())), "html", null, true);
yield "\" data-bs-content=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["description"]) || array_key_exists("description", $context) ? $context["description"] : (function () { throw new RuntimeError('Variable "description" does not exist.', 309, $this->source); })()), "html", null, true);
yield "\" data-p=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "province", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-m=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "city", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-r=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "region", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-max=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "max_value", [], "any", false, false, false, 309), "html", null, true);
yield "\" data-min=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "min_value", [], "any", false, false, false, 309), "html", null, true);
yield "\">
<script>
\$('[data-bs-toggle=\"popover_live_";
// line 312
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 312), "html", null, true);
yield "\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_";
// line 313
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 313), "html", null, true);
yield "\"]').popover();
})
</script>
<p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">";
// line 317
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 317, $this->source); })())), "html", null, true);
yield "</p>
<div class=\"statsline mb-3\" >
";
// line 320
$context["color"] = [];
// line 321
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["kpi_rank"]) || array_key_exists("kpi_rank", $context) ? $context["kpi_rank"] : (function () { throw new RuntimeError('Variable "kpi_rank" does not exist.', 321, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["rank"]) {
// line 322
yield "
";
// line 323
if ((CoreExtension::getAttribute($this->env, $this->source, $context["rank"], "kpi_id", [], "any", false, false, false, 323) == CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 323))) {
// line 324
yield " ";
$context["color"] = Twig\Extension\CoreExtension::merge((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 324, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["rank"], "bgcolor", [], "any", false, false, false, 324)]);
// line 325
yield " ";
}
// line 326
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rank'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 328
yield " ";
$context["counter"] = Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 328, $this->source); })()));
// line 329
yield " ";
$context["partsize"] = (100 / (isset($context["counter"]) || array_key_exists("counter", $context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.', 329, $this->source); })()));
// line 330
yield " ";
$context["stylestring"] = "";
// line 331
yield "
<div class=\"bk_line\">
";
// line 334
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 334, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["colorpart"]) {
// line 335
yield " ";
if (CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 335)) {
// line 336
yield " ";
$context["dato"] = (99.9 - ((isset($context["partsize"]) || array_key_exists("partsize", $context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.', 336, $this->source); })()) * ((isset($context["counter"]) || array_key_exists("counter", $context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.', 336, $this->source); })()) - 1)));
// line 337
yield " <div class=\"analytic_color_bar\" style=\"width:";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["dato"]) || array_key_exists("dato", $context) ? $context["dato"] : (function () { throw new RuntimeError('Variable "dato" does not exist.', 337, $this->source); })()), "html", null, true);
yield "%; background-color: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html", null, true);
yield ";\"></div>
";
} else {
// line 339
yield " <div class=\"analytic_color_bar\" style=\"width:";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["partsize"]) || array_key_exists("partsize", $context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.', 339, $this->source); })()), 2, "."), "html", null, true);
yield "%; background-color: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html", null, true);
yield ";\"></div>
";
}
// line 341
yield "
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['colorpart'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 343
yield "
</div>
<span class=\"statsline_item statsline_";
// line 346
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 346), "html", null, true);
yield " item_tooltip\" style=\"left: ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "theme_per", [], "any", false, false, false, 346), "html", null, true);
yield "%; margin-left: -6px;\" data-text=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "theme", [], "any", false, false, false, 346), "html", null, true);
yield "\" data-kpi=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 346), "html", null, true);
yield "\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
</div>
<div class=\"statsline_range d-flex justify-content-between d-none\">
<span>";
// line 350
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "min_value", [], "any", false, false, false, 350), "html", null, true);
yield "</span>
<span>";
// line 351
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "max_value", [], "any", false, false, false, 351), "html", null, true);
yield "</span>
</div>
</div>
";
}
// line 358
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
yield "
</div>
</div>
</div>
";
// line 390
yield "
</div>
</div>
</div>
";
}
// line 397
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 398
yield "
</div>
</div>
</div>
</div>
<style>
td.gridjs-td{
//padding: 2px 24px !important;
}
</style>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 417
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 418
yield "<script src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/js/calls.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 420
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("bundles/fosjsrouting/js/router.min.js"), "html", null, true);
yield "\"></script>
<script src=\"";
// line 421
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("fos_js_routing_js", ["callback" => "fos.Router.setData"]);
yield "\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/gridjs/6.0.6/gridjs.production.min.js\" integrity=\"sha512-wpiJjuL800CTEBA0QFs+RFw0tFtpXnQGea1p9S16WcYNXC1F3U0l1L7FQrDC3ihkYRtOj4Td7lKR3mYKxrwMMA==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/gridjs/dist/theme/mermaid.min.css\" />
<script type=\"text/javascript\">
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
var Routes = Routing; // loaded from router.min.js
// because ES5 doesn't support require syntax,
// we use jquery getJSON function in order to set
// routing data to our Routing object
\$.getJSON(\"";
// line 436
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/js/fos_js_routes.json"), "html", null, true);
yield "\", function (routes) {
Routes.setRoutingData(routes);
});
";
// line 440
yield "</script>
<script type=\"text/javascript\">
//let explore_baseUrl = '";
// line 443
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url", $context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.', 443, $this->source); })()), "html", null, true);
yield "';
\$(document).ready(function(){
\$('.viewfindergroup').hide();
\$('#map_view').show();
\$('.build_bar').css('width','100%');
\$('.people_bar').css('width','100%');
/*setTimeout(()=>{
\$('#info_div').collapse('hide');
},10000);*/
let arrayData = document.querySelectorAll('.analytics_statsline_item');
let arraySlugs = [];
for(let i=0; arrayData.length > i; i++){
arraySlugs.push(arrayData[i].getAttribute('data-slug'));
}
// console.log(arraySlugs);
buttonsToHeaderBar();
\$('#left_bar_button_map').addClass('active');
});
document.getElementById(\"selectAllBtn\").addEventListener(\"click\", function() {
let checkboxes = document.querySelectorAll(\".form-check-input\");
let allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked);
checkboxes.forEach(checkbox => {
checkbox.checked = !allChecked; // Alterna selección
});
this.textContent = allChecked ? \"Seleccionar Todos\" : \"Deseleccionar Todos\";
});
function buttonsToHeaderBar(){
// <span class=\"material-symbols-outlined\">bar_chart_4_bars</span>
document.getElementById('new_header_map').innerHTML = '<div id=\"left_bar_button_map\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'map\\')\"><span class=\"material-symbols-outlined\">map</span><br>";
// line 481
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Mapa"), "html", null, true);
yield "</div>';
document.getElementById('new_header_table').innerHTML = '<div id=\"left_bar_button_data\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'data\\')\"><span class=\"material-symbols-outlined\">table</span><br>";
// line 482
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Tabla"), "html", null, true);
yield "</div>';
document.getElementById('new_header_card').innerHTML = '<div id=\"left_bar_button_card\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'card\\')\"><span class=\"material-symbols-outlined\">grid_view</span><br>";
// line 483
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Ficha"), "html", null, true);
yield "</div>';
}
\$('.item_tooltip').on('mouseover',function (){
let name = this.getAttribute('data-text');
let kpi = this.getAttribute('data-kpi');
// console.log(name,kpi);
\$('.item_tooltip[data-kpi='+kpi+']').tooltip({title: name, delay: {show: 100, hide: 100}});
})
const { Grid, html } = gridjs;
var rPlatform = map;
var caller = call;
let layers = ";
// line 500
yield (isset($context["layers"]) || array_key_exists("layers", $context) ? $context["layers"] : (function () { throw new RuntimeError('Variable "layers" does not exist.', 500, $this->source); })());
yield ";
let configLayers = ";
// line 502
yield (isset($context["configLayers"]) || array_key_exists("configLayers", $context) ? $context["configLayers"] : (function () { throw new RuntimeError('Variable "configLayers" does not exist.', 502, $this->source); })());
yield ";
let explore_baseUrl = '";
// line 503
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url", $context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.', 503, $this->source); })()), "html", null, true);
yield "';
caller.vars.explore_baseUrl = '";
// line 504
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url", $context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.', 504, $this->source); })()), "html", null, true);
yield "';
let explore_mun = '";
// line 506
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["mun"]) || array_key_exists("mun", $context) ? $context["mun"] : (function () { throw new RuntimeError('Variable "mun" does not exist.', 506, $this->source); })()), "html", null, true);
yield "';
let explore_kpi = 3;
let explore_slug = '';
let explore_colors = ";
// line 509
yield (isset($context["kpi_colors"]) || array_key_exists("kpi_colors", $context) ? $context["kpi_colors"] : (function () { throw new RuntimeError('Variable "kpi_colors" does not exist.', 509, $this->source); })());
yield ";
let explore_insight = [];
let explore_extrakpi = [];
let explore_layer_data = [];
let explore_url = window.location.href;
let explore_filter_url = '';
let filtered_data_array = ";
// line 516
yield (isset($context["filtered_data"]) || array_key_exists("filtered_data", $context) ? $context["filtered_data"] : (function () { throw new RuntimeError('Variable "filtered_data" does not exist.', 516, $this->source); })());
yield ";
let kpi_list = ";
// line 518
yield (isset($context["kpi_list"]) || array_key_exists("kpi_list", $context) ? $context["kpi_list"] : (function () { throw new RuntimeError('Variable "kpi_list" does not exist.', 518, $this->source); })());
yield ";
let kpi_list_complete = document.querySelectorAll('#kpi_list_data li');
for(i=0; kpi_list_complete.length > i; i++){
let name = kpi_list_complete[i].innerText;
let kpi = kpi_list_complete[i].getAttribute('data-kpi');
let slug = kpi_list_complete[i].getAttribute('data-slug');
kpi_list.push({'name':name,'kpi':kpi,'slug':slug});
}
// use stats data and print graphic
let useStat = ";
// line 528
yield (isset($context["useStatData"]) || array_key_exists("useStatData", $context) ? $context["useStatData"] : (function () { throw new RuntimeError('Variable "useStatData" does not exist.', 528, $this->source); })());
yield ";
let useStatData = analyticOrganizeData(useStat);
var useStatTotalData = analyticOrganizeTotalData(useStat);
";
// line 532
yield "
// year stats data and print graphic
let yearStat = ";
// line 534
yield (isset($context["yearStatData"]) || array_key_exists("yearStatData", $context) ? $context["yearStatData"] : (function () { throw new RuntimeError('Variable "yearStatData" does not exist.', 534, $this->source); })());
yield ";
let yearStatData = analyticOrganizeData(yearStat);
var yearStatTotalData = analyticOrganizeTotalData(yearStat);
";
// line 538
yield "
// area stats data and print graphic
let areaStat = ";
// line 540
yield (isset($context["areaStatData"]) || array_key_exists("areaStatData", $context) ? $context["areaStatData"] : (function () { throw new RuntimeError('Variable "areaStatData" does not exist.', 540, $this->source); })());
yield ";
let areaStatData = analyticOrganizeData(areaStat);
var areaStatTotalData = analyticOrganizeTotalData(areaStat);
";
// line 544
yield "
// occupation stats data and print graphic
let occupationStat = ";
// line 546
yield (isset($context["occupationStatData"]) || array_key_exists("occupationStatData", $context) ? $context["occupationStatData"] : (function () { throw new RuntimeError('Variable "occupationStatData" does not exist.', 546, $this->source); })());
yield ";
let occupationStatData = analyticOrganizeData(occupationStat);
var occupationStatTotalData = analyticOrganizeTotalData(occupationStat);
";
// line 550
yield "
let explore_mun_name = '";
// line 552
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["municipioname"]) || array_key_exists("municipioname", $context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.', 552, $this->source); })()), "adminunitname", [], "any", false, false, false, 552)), "html", null, true);
yield "';
let allgeodataUrl = explore_baseUrl + \"/get-allgeodata?mun=\" + explore_mun ;
let munPolygon = '";
// line 555
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["municipioname"]) || array_key_exists("municipioname", $context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.', 555, $this->source); })()), "geom", [], "any", false, false, false, 555), "html", null, true);
yield "';
let initGeo = '";
// line 556
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["municipioname"]) || array_key_exists("municipioname", $context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.', 556, $this->source); })()), "envelope", [], "any", false, false, false, 556), "html", null, true);
yield "';
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
let filterStart = urlParams.get('fs');
let filterEnd = urlParams.get('fe');
window.appLocale = '";
// line 562
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 562, $this->source); })()), "request", [], "any", false, false, false, 562), "locale", [], "any", false, false, false, 562), "js"), "html", null, true);
yield "';
if(filterStart == null){
filterStart = 0;
}
if(filterEnd == null){
filterEnd = 0;
}
rPlatform.setInpireidList(filtered_data_array);
rPlatform.setMun(explore_mun);
rPlatform.setBaseUrl(explore_baseUrl);
rPlatform.setLayers(layers);
rPlatform.setColorsStyle(explore_colors);
rPlatform.setLayerData(explore_layer_data);
// ----------------------- Map ------------------------ //
async function init() { // Cargar mapa de inicio
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
// Crear indArr con el primer kpi del listado
let alldivi = document.getElementsByClassName('grayscale');
let kpi_init = alldivi[0].getAttribute('data-kpi');
let slug_init = alldivi[0].getAttribute('data-slug');
explore_kpi = kpi_init;
explore_slug = slug_init;
alldivi[0].classList.add('kpi_selected');
alldivi[0].classList.add('disabled');
// Colocar primer alldivi como seleccionado
selectedIndicator(alldivi[0]);
// Recibir parametros ind desde url
let indArr = [parseInt(kpi_init)];
let frArr = [filterStart, filterEnd];
await rPlatform.setiActive(indArr);
await rPlatform.initMapExplore(layers, explore_baseUrl, initGeo, explore_mun, frArr, indArr);
await rPlatform.getSimpleStyleDistrict();
await rPlatform.getSimpleStyleSection();
rPlatform.updateMap();
}
init();
// ----------------------- Table Map ------------------------ //
function tableData(){
let wrapper = document.getElementById(\"wrapper\");
wrapper.innerHTML = '';
let tabla = null; // Variable global para almacenar la instancia de la tabla
function renderizarTabla(data) {
// Eliminar la tabla anterior si existe
if (tabla !== null) {
tabla.destroy();
}
// Crear una nueva instancia de Grid.js con los nuevos datos y renderizarla
tabla = new gridjs.Grid({
columns: [{
id: 'year',
name: \"";
// line 634
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Año"), "html", null, true);
yield "\"
},
{
id: 'currentuse',
name: \"";
// line 638
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Uso"), "html", null, true);
yield "\",
formatter: (cell, row) => {
if (cell == '1_residential' ){
return gridjs.html(`<span style=\"color: blue; cursor:pointer;\" onclick=\" viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Residential</span>`)
}else if(cell == '2_agriculture'){
return gridjs.html(`<span style=\"color: green; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Agriculture</span>`)
}else if(cell == '3_industrial'){
return gridjs.html(`<span style=\"color: gray; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Industrial</span>`)
}else if(cell == '4_3_publicServices'){
return gridjs.html(`<span style=\"color: orange; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Public services</span>`)
}else{
return gridjs.html(`<span style=\"color: black\">\${cell}</span>`)
}
}
},
{
id: 'grossfloorarea',
name: \"";
// line 655
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Grossfloorarea"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell} m<sup>2</sup>`)
},
{
id: 'habitantes',
name: \"";
// line 660
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Habitantes"), "html", null, true);
yield "\",
formatter: (cell) => {
return gridjs.html(`<div class=\"mt-2\"><i class=\"fa-solid fa-users\"></i> \${cell}</div>`)
}
},
{
id: 'numberofdwellings',
name: \"";
// line 667
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Viviendas"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_1_energy_renovated_residential_buildings',
name: \"";
// line 672
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy renovated residential buildings"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_2_final_energy_consumption',
name: \"";
// line 677
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Final energy consumption"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_3_renewable_energy_consumption',
name: \"";
// line 682
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Renewable energy consumption"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_4_pv_potential_generation',
name: \"";
// line 687
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Pv potential generation"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_7_heating_energy_consumption',
name: \"";
// line 692
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Heating energy consumption"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_8_ghg_emissions',
name: \"";
// line 697
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("GhG emissions"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_19_population_income_below_60_average',
name: \"";
// line 702
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Population income below 60 average"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_20_median_household_income',
name: \"";
// line 707
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Median household income"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_21_average_price_renting_compared_family_income',
name: \"";
// line 712
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Average price renting compared family income"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_22_house_price',
name: \"";
// line 717
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("House price"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_27_urban_equipment_at_15_min',
name: \"";
// line 722
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Urban equipment at 15 min"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_28_accessibility_to_bike_lane',
name: \"";
// line 727
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Accessibility to bike lane"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},{
id: 'kpi_30_green_area_surfaces',
name: \"";
// line 731
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Green area surfaces"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_31_vulnerability_heatwaves_temperature_rise',
name: \"";
// line 736
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Vulnerability heatwaves temperature rise"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_36_charging_outlets',
name: \"";
// line 741
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Charging outlets"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_6_1_energy_efficient_and_energy_recovering_homes',
name: \"";
// line 746
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy efficient and energy recovering_homes"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_6_2_energy_efficient_and_energy_recovering_homes',
name: \"";
// line 751
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy efficient and energy recovering homes"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'inspireid',
name: \"";
// line 756
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("inspireid"), "html", null, true);
yield "\",
formatter: (cell) => html(`\${cell}`)
}],
data: data,
pagination: {
limit: 50,
summary: true,
},
resizable: true,
search: false,
sort: true,
fixedHeader: true,
height: \$(\"#infoview\").height(),
}).render(wrapper);
}
// Llamar a la función obtenerDatos() para obtener los datos inicialmente y renderizar la tabla
caller.obtenerDatos(explore_kpi, explore_mun, explore_slug)
.then((data) => {
console.log(data);
renderizarTabla(data);
})
.then(()=>{
setTimeout(()=>{
updateTable(explore_slug);
},2000)
});
}
//------------------------ Descargar Datos ------------------- //
function loadSelectorIndicators()
{
\$(\"#project_actions_content\").html('');
";
// line 790
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data"]) || array_key_exists("analytic_data", $context) ? $context["analytic_data"] : (function () { throw new RuntimeError('Variable "analytic_data" does not exist.', 790, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 791
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["item"], "slug", [], "any", false, false, false, 791) == (isset($context["slug"]) || array_key_exists("slug", $context) ? $context["slug"] : (function () { throw new RuntimeError('Variable "slug" does not exist.', 791, $this->source); })()))) {
// line 792
yield " ";
$context["break"] = false;
// line 793
yield " ";
$context["array_used"] = [];
// line 794
yield "
";
// line 795
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["item"], "relation", [], "any", false, false, false, 795));
foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
// line 796
yield " ";
if (((isset($context["break"]) || array_key_exists("break", $context) ? $context["break"] : (function () { throw new RuntimeError('Variable "break" does not exist.', 796, $this->source); })()) == false)) {
// line 797
yield " ";
$context["array_used"] = Twig\Extension\CoreExtension::merge((isset($context["array_used"]) || array_key_exists("array_used", $context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.', 797, $this->source); })()), [CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 797)]);
// line 798
yield " var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "slug", [], "any", false, false, false, 798), "html", null, true);
yield "' id='flexCheckDefault' data-name='";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 798), "html", null, true);
yield "'> <label class='form-check-label' for='flexCheckDefault'> ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 798), "html", null, true);
yield " </label></div>\";
\$(\"#project_actions_content\").append(check);
console.log('";
// line 801
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 801), "html", null, true);
yield "');
";
}
// line 803
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 804
yield "
";
// line 805
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data_relation"]) || array_key_exists("analytic_data_relation", $context) ? $context["analytic_data_relation"] : (function () { throw new RuntimeError('Variable "analytic_data_relation" does not exist.', 805, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
// line 806
yield " ";
if (!CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "kpi", [], "any", false, false, false, 806), (isset($context["array_used"]) || array_key_exists("array_used", $context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.', 806, $this->source); })()))) {
// line 807
yield " var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "slug", [], "any", false, false, false, 807), "html", null, true);
yield "' id='flexCheckDefault' data-name='";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 807), "html", null, true);
yield "'> <label class='form-check-label' for='flexCheckDefault'> ";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 807), "html", null, true);
yield " </label></div>\";
\$(\"#project_actions_content\").append(check);
console.log('";
// line 809
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["rel"], "name", [], "any", false, false, false, 809), "html", null, true);
yield "');
";
}
// line 810
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 811
yield "
";
}
// line 812
yield "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 813
yield "
\$(\"#popUpIndicadores\").modal('show');
}
function getExcel() {
const selectedNames = {};
const checkboxes = document.querySelectorAll('.form-check-input:checked');
const selectedValues = Array.from(checkboxes).map(checkbox => checkbox.value);
/*const selectedNames = Array.from(checkboxes).map(checkbox => ({
[checkbox.value]: checkbox.dataset.name
}));*/
checkboxes.forEach((checkbox) => selectedNames[checkbox.value] = checkbox.dataset.name);
console.log(selectedValues);
console.log(selectedNames);
caller.getExcel(explore_kpi, explore_mun, explore_slug, selectedValues, selectedNames)
.then((data) => {
console.log(data);
var bURL = \"";
// line 835
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 835, $this->source); })()), "request", [], "any", false, false, false, 835), "getBasePath", [], "method", false, false, false, 835), "html", null, true);
yield "\";
var href = bURL + \"/documents/\" + data;
location = href;
}).then(
//si hay que eliminar el archivo generado ---> here
);
}
// --------------------- Card ------------------------------- //
async function viewCard(id){
\$(\"#infoview2\").hide();
\$('.viewfindergroup').hide();
\$('#card_view').show();
let fachada = document.getElementById('img_fachada');
let catastro = document.getElementById('img_catastro');
let txt_build = document.getElementById('txt_build');
let build_indicators = document.getElementById('build_indicators');
let size = fachada.offsetWidth;
fachada.style.height = size + 'px';
catastro.style.height = size + 'px';
var imagenAlternativa = explore_baseUrl + '/img/img_bk_building.jpg';
let img_fachada = '<img class=\"img-fluid\" src=\"https://ovc.catastro.meh.es/OVCServWeb/OVCWcfLibres/OVCFotoFachada.svc/RecuperarFotoFachadaGet?ReferenciaCatastral=' + id + '\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
let img_catastro = '<img class=\"img-fluid\" src=\"https://www1.sedecatastro.gob.es/Cartografia/GeneraGraficoParcela.aspx?del=8&mun=279&refcat=' + id + '&AnchoPixels=500&AltoPixels=500\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
document.getElementById('img_fachada').innerHTML = img_fachada;
document.getElementById('img_catastro').innerHTML = img_catastro;
let buildData = await caller.getBuildData(id);
// console.log(buildData);
let UseValue = '';
let valuesContent = '';
if (buildData.use_numeric == 0) {
UseValue = 'SFH';
} else {
UseValue = 'MFH';
}
valuesContent += '<p style=\"font-size: 14px; \"><b>";
// line 885
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Referencia catastral"), "html", null, true);
yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.inspireid + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>";
// line 886
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Año de construcción"), "html", null, true);
yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.year + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>";
// line 887
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Uso"), "html", null, true);
yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + UseValue + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>";
// line 888
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Plantas"), "html", null, true);
yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.num_floors + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>";
// line 889
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Superficie"), "html", null, true);
yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.grossfloorarea + '</span></p>';
document.getElementById('txt_build').innerHTML = valuesContent;
// console.log(kpi_list);
build_indicators.innerHTML = '';
for(let i=0; kpi_list.length > i; i++){
// console.log(kpi_list[i].slug);
let buildDataFiltered = Object.keys(buildData).filter((key) => key === kpi_list[i].slug).map((key) => buildData[key]);
//console.log(kpi_list[i]);
if(kpi_list[i].name != 'Todos'){
var styleBox = \"\";
var grafica = \"\";
if (kpi_list[i].name == \"año de construcción\" || kpi_list[i].name == \"área\" || kpi_list[i].name == \"uso\")
styleBox = \"bk_box--color\";
if ( \$(\"#statline_id_\"+kpi_list[i].id) ){
let contenido = \$(\"#statline_id_\"+kpi_list[i].id).html(); // Obtiene el HTML
let tempDiv = \$(\"<div>\").html(contenido); // Lo convierte en un objeto jQuery
tempDiv.find(\"p\").hide();
tempDiv.find(\".statsline_range\").removeClass(\"d-none\");
tempDiv.find(\".statsline_range\").css({
\"position\": \"relative\",
\"font-size\": \"12px\",
\"color\": \"#7a7a7a\",
//\"top\": \"-10px\"
});
let maxValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"max\");
let minValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"min\");
let per = Math.ceil(((buildDataFiltered[0]) - minValue)/(maxValue - minValue) * 100);
tempDiv.find(\".statsline_item\").css(\"left\", per+\"%\");
grafica = tempDiv.html();
} else grafica = \"\";
let dataNumber = \"\";
if (buildDataFiltered[0] == null){
if (window.appLocale == 'ca') dataNumber = \"No hi han dades\";
else if (window.appLocale == 'en') dataNumber = \"No data\";
else dataNumber = \"No hay datos\";
}
else if (kpi_list[i].name != \"año de construcción\"){
numero = Number.parseFloat(buildDataFiltered[0]);
dataNumber = numero.toLocaleString(\"es-ES\");
}else dataNumber = buildDataFiltered[0];
if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 0){
if (window.appLocale == 'ca') dataNumber = \"Unifamiliar\";
else if (window.appLocale == 'en') dataNumber = \"Unifamiliar\";
else dataNumber = \"Unifamiliar\";
}
else if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 1){
if (window.appLocale == 'ca') dataNumber = \"Plurifamiliar\";
else if (window.appLocale == 'en') dataNumber = \"Plurifamiliar\";
else dataNumber = \"Plurifamiliar\";
}
if (window.appLocale == 'ca')
{
var kpiName = kpi_list[i].name_ca;
var KpiInfo = kpi_list[i].info_ca;
}else if (window.appLocale == 'en') {
var kpiName = kpi_list[i].name_en;
var KpiInfo = kpi_list[i].info_en;
}else{
var kpiName = kpi_list[i].name;
var KpiInfo = kpi_list[i].info;
}
build_indicators.innerHTML += '<div class=\"col-6 col-sm-3 d-flex\"><div class=\"bk_box '+styleBox+' p-3 w-100 d-flex flex-column\"><div class=\"mb-2 d-flex justify-content-between align-items-baseline\" style=\"height: 58px;\"><p class=\"fw-bold mb-2\" style=\"font-size: 14px; line-height: 18px; max-width: 70%;\">'+ capitalizeFirstLetter(kpiName) +'</p><p style=\"font-weight:600; \"><span style=\"font-size:16px; color:#6E93F6;\"> '+ dataNumber +'</span></p></div><div class=\"d-flex justify-content-between mb-2\"><div style=\"width: 100%;\">'+grafica+'</div></div><p class=\" mb-2 boxed_limited\" onclick=\"activeClass(this)\" >'+ KpiInfo +'</p></div></div>';
}
}
}
function formatearNumero(numero) {
//return numero;
if(typeof numero === 'number'){
numero = numero.toString();
numero = Number.parseFloat(numero);
return numero.toLocaleString(\"es-ES\");
// return numero.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");
}else if(numero === null){
return numero;
}else{
// console.log(numero);
numero = Number.parseFloat(numero);
return numero.toLocaleString(\"es-ES\");
}
}
function hideCardOnData(){
document.getElementById('info_window').innerHTML = '';
}
// --------------------- Fn OK ------------------------------- //
function updateMapFromDiv(a){
let indArr = [{'kpi': parseInt(a)}];
let divi = document.getElementById('statline_id_' + a);
let alldivi = document.getElementsByClassName('grayscale');
for(let i=0; alldivi.length > i; i++){
alldivi[i].classList.remove('kpi_selected');
alldivi[i].classList.remove('disabled');
}
divi.classList.add('kpi_selected');
divi.classList.add('disabled');
explore_kpi = divi.getAttribute('data-kpi');
explore_slug = divi.getAttribute('data-slug');
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
// console.log(indArr);
this.selectedIndicator(divi);
this.updateTable(explore_slug);
//this.selectedDiv();
}
function updateMapFromStat(a){
let indArr = [{'kpi': parseInt(a)}];
let slug = '';
let name = '';
if(a == 100){
slug = 'statYearBox';
name = 'Año de construcción';
}else if(a == 101){
slug = 'statAreaBox';
name = 'Área';
}else if(a == 104){
slug = 'statOccupationBox';
name = 'Porcentaje de ocupación';
}else if(a == 105){
slug = 'statUseBox';
name = 'Uso del edificio';
}
let divi = document.getElementById(slug);
var selectedBox = document.getElementById('selected_box_content');
// selectedBox.innerHTML = divi.outerHTML;
let html = '<h6>'+name+'</h6>';
// selectedBox.insertAdjacentHTML(\"afterbegin\", html);
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
}
function updateTable(slug){
let kpiArray = ['kpi_1_energy_renovated_residential_buildings', 'kpi_2_final_energy_consumption', 'kpi_3_renewable_energy_consumption', 'kpi_4_pv_potential_generation', 'kpi_7_heating_energy_consumption', 'kpi_8_ghg_emissions', 'kpi_19_population_income_below_60_average', 'kpi_20_median_household_income', 'kpi_21_average_price_renting_compared_family_income', 'kpi_22_house_price', 'kpi_27_urban_equipment_at_15_min', 'kpi_28_accessibility_to_bike_lane', 'kpi_30_green_area_surfaces', 'kpi_31_vulnerability_heatwaves_temperature_rise', 'kpi_36_charging_outlets', 'kpi_6_2_energy_efficient_and_energy_recovering_homes', 'kpi_6_1_energy_efficient_and_energy_recovering_homes', 'inspireid']
// Seleccionar todas las columnas con slug
for(let i=0; kpiArray.length > i;i++){
let celda = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+kpiArray[i]+']');
for(let j=0; celda.length > j;j++){
celda[j].classList.add('d-none');
}
}
// Seleccionar las celdas de nuestro slug
let celdaSlug = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+slug+']');
for(let j=0; celdaSlug.length > j;j++){
celdaSlug[j].classList.remove('d-none');
celdaSlug[j].classList.add('selected');
}
// console.log('updateTable',slug);
}
function selectedIndicator(a){
var dataDiv = '';
var selectedBox = document.getElementById('selected_box_content');
var linestat = a.getElementsByClassName('statsline');
var titlestat = a.getElementsByClassName('title');
var p = parseFloat(a.getAttribute('data-p')).toFixed(2);
var m = parseFloat(a.getAttribute('data-m')).toFixed(2);
var r = parseFloat(a.getAttribute('data-r')).toFixed(2);
var max = parseFloat(a.getAttribute('data-max'));
// Si hay datos completos pintamos los pins en el indicador seleccionado
if (p !== null && m !== null && r !== null){
var dato_p = detres(p,max);
var dato_m = detres(m,max);
var dato_r = detres(r,max);
var pinDiv = '<span class=\"statsline_item_extra\" style=\"left: '+dato_p+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Provincia '+p+'\"></i><span class=\"pindata\">P</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_m+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Municipio '+m+'\"></i><span class=\"pindata\">M</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_r+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Región '+r+'\"></i><span class=\"pindata\">R</span></span> ';
var elemento = linestat[0];
// elemento.insertAdjacentHTML('beforeend', pinDiv);
dataDiv = titlestat[0].outerHTML + elemento.outerHTML;
// selectedBox.innerHTML = dataDiv;
}else{
dataDiv = titlestat[0].outerHTML + linestat[0].outerHTML;
// selectedBox.innerHTML = dataDiv;
}
let titleAttribute = a.getAttribute('data-bs-title');
let descAttribute = a.getAttribute('data-bs-content');
// selectedBox.setAttribute(\"data-bs-title\", titleAttribute);
// selectedBox.setAttribute(\"data-bs-content\", descAttribute);
\$('[data-bs-toggle=\"popover_live_top\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_top\"]').popover();
});
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle=\"popover_live_top\"]')
const popovertipList = [...popoverTriggerList].map(item => new bootstrap.Popover(item));
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
}
function detres(value,max){
let dato = (value*100)/max;
return dato.toFixed(2);
}
function updateMap(){
var selectElement = document.querySelector('#kpi_selector');
var kpi_id = selectElement.value;
let indArr = [{'kpi': parseInt(kpi_id)}];
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
var iActive = rPlatform.getiActive();
updateSelector(iActive)
}
// --------------------- Simple Fn OK ------------------------------- //
function updateSelector(kpi){
var selector = document.getElementById('kpi_selector');
selector.value = kpi;
}
function loadUrlBack(){
let url = explore_baseUrl + \"/\" + explore_mun ;
window.location.href = url;
}
function gotoproject(){
let url = '';
url = explore_baseUrl + \"/\" + explore_mun + \"/plan\";
window.location.href = url;
}
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function viewFinder(a){
\$('.viewfindergroup').hide();
\$('#'+ a +'_view').show();
if(a == 'map' || a == 'data')
{
\$(\"#infoview2\").show();
}else{
\$(\"#infoview2\").hide();
}
if(a == 'data'){
tableData();
}
console.log(a);
[...document.querySelectorAll('.left_bar_button')].map(x => x.classList.remove('active'));
document.getElementById('left_bar_button_'+a).classList.add('active');
}
function centerViewMap(){
var zoom = rPlatform.getZoom();
rPlatform.setCenterView(initGeo);
}
function expandIcon(e){
var elemento = document.getElementById(e);
var textoExtraido = elemento.innerText;
if (textoExtraido == 'expand_more'){
elemento.innerText = 'expand_less';
}else{
elemento.innerText = 'expand_more';
}
}
function infoviewToggle(){
if(\$('#infoview2').hasClass('show')){
\$('#infoview2').collapse('hide');
\$('#infoview').addClass('w-100');
\$('#expand .material-symbols-outlined').text('collapse_content');
}else{
\$('#infoview2').collapse('show');
\$('#infoview').removeClass('w-100');
\$('#expand .material-symbols-outlined').text('expand_content');
}
}
function activeClass(elem){
var elemento = \$(elem);
elemento.toggleClass('active');
}
</script>
<script>
\$(document).ready(function(){
document.getElementById('big_container').classList.add('full');
var headerInTop = document.getElementById('header_in_top').offsetHeight;
var containerInContent = document.getElementById('container_in_content').offsetHeight;
var headerContentInfoTop = document.getElementById('header_content_info_top').offsetHeight;
var bigContainer = document.getElementById('big_container').offsetHeight;
var containerInContentTotal = bigContainer - headerInTop;
var containerSteps = bigContainer - headerInTop - headerContentInfoTop;
document.getElementById('container_in_content').style.height = containerInContentTotal + 'px';
document.getElementById('infoview_content').style.height = containerInContentTotal + 'px';
document.getElementById('analytic_step').style.height = containerInContentTotal + 'px';
var divs = document.querySelectorAll('.infoview_div');
for(let i=0; divs.length > i; i++){
divs[i].style.height = containerSteps + 'px';
}
var divs2 = document.querySelectorAll('.infoview2_div');
for(let i=0; divs2.length > i; i++){
divs2[i].style.height = containerSteps + 'px';
}
var divsIn = document.querySelectorAll('.viewfindergroup');
for(let i=0; divsIn.length > i; i++){
divsIn[i].style.height = containerSteps + 'px';
}
let flashDiv = document.querySelector('.flash-notice');
if(flashDiv){
setTimeout(()=>{
flashDiv.remove();
},10000);
}
});
function removeDiv(id){
let divi = document.getElementById(id);
divi.remove();
}
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "analytic/explore.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 1705 => 889, 1701 => 888, 1697 => 887, 1693 => 886, 1689 => 885, 1636 => 835, 1612 => 813, 1605 => 812, 1601 => 811, 1594 => 810, 1589 => 809, 1579 => 807, 1576 => 806, 1572 => 805, 1569 => 804, 1563 => 803, 1558 => 801, 1547 => 798, 1544 => 797, 1541 => 796, 1537 => 795, 1534 => 794, 1531 => 793, 1528 => 792, 1525 => 791, 1521 => 790, 1484 => 756, 1476 => 751, 1468 => 746, 1460 => 741, 1452 => 736, 1444 => 731, 1437 => 727, 1429 => 722, 1421 => 717, 1413 => 712, 1405 => 707, 1397 => 702, 1389 => 697, 1381 => 692, 1373 => 687, 1365 => 682, 1357 => 677, 1349 => 672, 1341 => 667, 1331 => 660, 1323 => 655, 1303 => 638, 1296 => 634, 1221 => 562, 1212 => 556, 1208 => 555, 1202 => 552, 1198 => 550, 1192 => 546, 1188 => 544, 1182 => 540, 1178 => 538, 1172 => 534, 1168 => 532, 1162 => 528, 1149 => 518, 1144 => 516, 1134 => 509, 1128 => 506, 1123 => 504, 1119 => 503, 1115 => 502, 1110 => 500, 1090 => 483, 1086 => 482, 1082 => 481, 1041 => 443, 1036 => 440, 1030 => 436, 1012 => 421, 1008 => 420, 1002 => 418, 989 => 417, 962 => 398, 956 => 397, 947 => 390, 925 => 358, 915 => 351, 911 => 350, 898 => 346, 893 => 343, 878 => 341, 870 => 339, 862 => 337, 859 => 336, 856 => 335, 839 => 334, 834 => 331, 831 => 330, 828 => 329, 825 => 328, 818 => 326, 815 => 325, 812 => 324, 810 => 323, 807 => 322, 802 => 321, 800 => 320, 794 => 317, 787 => 313, 783 => 312, 755 => 309, 752 => 308, 749 => 307, 746 => 306, 743 => 305, 740 => 304, 737 => 303, 734 => 302, 731 => 301, 728 => 300, 725 => 299, 723 => 298, 720 => 297, 717 => 296, 715 => 295, 712 => 294, 706 => 292, 700 => 290, 698 => 289, 693 => 288, 691 => 287, 687 => 285, 685 => 284, 682 => 283, 679 => 282, 677 => 281, 660 => 280, 656 => 278, 653 => 276, 651 => 275, 644 => 271, 635 => 264, 621 => 263, 614 => 259, 610 => 258, 604 => 254, 601 => 253, 598 => 252, 596 => 251, 590 => 248, 586 => 247, 573 => 243, 568 => 240, 553 => 238, 545 => 236, 537 => 234, 534 => 233, 531 => 232, 514 => 231, 509 => 228, 506 => 227, 503 => 226, 500 => 225, 493 => 223, 490 => 222, 487 => 221, 485 => 220, 482 => 219, 477 => 218, 475 => 217, 469 => 214, 441 => 211, 438 => 210, 436 => 209, 433 => 208, 430 => 207, 427 => 206, 424 => 205, 421 => 204, 418 => 203, 415 => 202, 412 => 201, 409 => 200, 406 => 199, 404 => 198, 401 => 197, 398 => 195, 395 => 194, 378 => 193, 375 => 192, 373 => 191, 370 => 189, 367 => 188, 364 => 187, 362 => 186, 355 => 182, 345 => 175, 313 => 146, 303 => 139, 293 => 132, 285 => 127, 281 => 126, 277 => 125, 272 => 123, 218 => 72, 208 => 65, 201 => 60, 195 => 58, 189 => 56, 187 => 55, 182 => 54, 180 => 53, 172 => 47, 170 => 46, 167 => 45, 162 => 44, 146 => 30, 138 => 25, 130 => 20, 123 => 15, 113 => 11, 108 => 8, 104 => 7, 101 => 6, 88 => 5, 65 => 3, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'Layouts/layout.html.twig' %}
{% block title %} Retabit Platform {% endblock %}
{% block content %}
{% for message in app.flashes('notice') %}
<div class=\"flash-notice\" id=\"flash_div\">
<div class=\"text-end\"><span class=\"material-symbols-outlined hover\" onclick=\"removeDiv('flash_div')\">close</span></div>
<div class=\"container\">
<p>{{ message | raw | trans}}</p>
</div>
</div>
{% endfor %}
<div class=\"modal fade\" id=\"popUpIndicadores\" tabindex=\"-1\" >
<div class=\"modal-dialog modal-lg\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h1 class=\"modal-title fs-5\" id=\"exampleModalLabel\">{% trans %}Selecciona los indicadores para descargar en un fichero Excel{% endtrans %}</h1>
<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
</div>
<div class=\"modal-body\">
<div class=\"row\">
<a id=\"selectAllBtn\" class=\"px-5 mb-2\" style=\"cursor: pointer; font-weight: 400; text-decoration:none;\">{% trans %}Seleccionar Todos{% endtrans %}</a>
<div class=\"col-12 px-5\" id=\"project_actions_content\">
</div>
<div class=\"text-center\" id=\"popUpIndicadores_button\">
<button class=\"btn btn-primary\" onclick=\"getExcel()\">{% trans %}Descargar{% endtrans %} selección</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class=\"container-fluid project_explore_container\" id=\"container_in_content\">
<div class=\"row justify-content-center\">
<div id=\"infoview_content\" class=\"col-12\">
{# {{dump(analytic_data)}} #}
{% for item in analytic_data %}
{% if item.slug == slug %}
{#% dump(item) %#}
<div class=\"row justify-content-center\">
<!-- Textai box -->
<div class=\"col-12 p-3\" id=\"header_content_info_top\">
<div class=\"d-flex justify-content-between align-items-center\">
<h2 class=\"d-inline-block\" data-bs-toggle=\"collapse\" href=\"#textai_box\" role=\"button\" aria-expanded=\"false\" aria-controls=\"textai_box\" onclick=\"expandIcon('analytics_title_arrow')\" >
{% if app.request.locale == \"ca\" %}
{{item.name_ca}}
{% elseif app.request.locale == \"en\" %}
{{item.name_en}}
{% else %}
{{item.name}}
{% endif %}
<span class=\"material-symbols-outlined hover\" id=\"analytics_title_arrow\">expand_more</span>
</h2>
<div class=\"d-flex\">
<div class=\"d-flex align-items-center\">
<button class=\"btn btn-primary btn-sm\" onclick=\"loadSelectorIndicators()\">{% trans %}Descargar datos{% endtrans %}</button>
</div>
</div>
</div>
<div class=\"collapse\" id=\"textai_box\" style=\"max-width: 940px;\">
<p class=\"flex-fill mb-3\" style=\"font-size: 14px;\">{{item.textai}}</p>
</div>
</div>
<div class=\"col-12 all_steps\" id=\"analytic_step\">
<div class=\"row justify-content-center align-items-top\">
<div id=\"infoview\" class=\"infoview_div col-12\">
<div class=\"row align-items-center justify-content-center\">
<div class=\"col-12 collapse show\" id=\"filter_div\">
<div class=\"row align-items-center justify-content-center\">
</div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"map_view\" >
<div class=\"col-12\">
<div class=\"map__container\" style=\"position:relative;\">
<div id=\"map\" class=\"map\"></div>
<div class=\"legend\"></div>
<div id=\"popup\" class=\"popup d-none\">
<a href=\"#\" id=\"popup-closer\" class=\"popup__closer\"></a>
<div id=\"popup-content\" class=\"popup__content\"></div>
</div>
<button id=\"centerbutton\" class=\"btn btn-light btn-sm pb-0\" onclick=\"centerViewMap()\">
<span class=\"material-symbols-outlined\">fit_screen</span>
<span class=\"material-symbols-outlined d-none\">collapse_content</span></button>
<button id=\"expand\" class=\"btn btn-light btn-sm pb-0\" onclick=\"infoviewToggle()\">
<span class=\"material-symbols-outlined\">expand_content</span></button>
</div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"data_view\">
<div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
<div id=\"wrapper\"></div>
</div>
</div>
<div class=\"row viewfindergroup\" id=\"card_view\" >
<div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
<form class=\"row row-cols-lg-auto g-2 align-items-center mb-2 d-none\">
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"via\">{% trans %}Tipo via{% endtrans %}</label>
<select class=\"form-select\" id=\"via\">
<option value=\"1\">{% trans %}Calle{% endtrans %}</option>
<option value=\"2\">{% trans %}Avenida{% endtrans %}</option>
<option value=\"3\">{% trans %}Rambla{% endtrans %}</option>
</select>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"street_name\">{% trans %}Nombre calle{% endtrans %}</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"street\" placeholder=\"Nombre de calle\">
</div>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"flat\">{% trans %}Piso{% endtrans %}</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"flat\" placeholder=\"Piso\">
</div>
</div>
<div class=\"col-12\">
<label class=\"visually-hidden\" for=\"floor\">{% trans %}Planta{% endtrans %}</label>
<div class=\"input-group\">
<input type=\"text\" class=\"form-control\" id=\"floor\" placeholder=\"Pta.\">
</div>
</div>
<div class=\"col-12\">
<button type=\"submit\" class=\"btn btn-primary pb-0\"><span class=\"material-symbols-outlined\">search</span></button>
</div>
</form>
<div class=\"row\" style=\" padding: 20px; margin-bottom: 40px; box-sizing: border-box;\">
<div class=\"col-6 col-sm-3 overflow-hidden\" id=\"img_fachada\" style=\"background: #fbfbfb; padding: 20px;\"></div>
<div class=\"col-6 col-sm-3 overflow-hidden me-4\" id=\"img_catastro\" style=\"background: #fbfbfb; padding: 20px;\"></div>
<div class=\"col-12 col-sm-5\" id=\"txt_build\"></div>
</div>
<div class=\"row g-3\" id=\"build_indicators\">
</div>
</div>
</div>
</div>
<div id=\"infoview2\" class=\"infoview2_div collapse collapse-horizontal show\">
<!-- Selected box -->
<div class=\"col-12 selected_box p-3 mb-3 sticky-top d-none\">
<h4>{% trans %}Indicador seleccionado{% endtrans %}</h4>
<div id=\"selected_box_content\" class=\"selected_box_item\" title=\"Header\" data-bs-toggle=\"popover_live_top\" data-bs-trigger=\"hover focus\" data-bs-title=\"Popover title\" data-bs-content=\"And here's some amazing content. It's very engaging. Right?\"></div>
</div>
<!-- Indicadores box -->
<div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
<div class=\"d-flex justify-content-between\">
<p class=\"fw-bold fs-5\">{% trans %}Indicadores relacionados{% endtrans %}</p>
</div>
<div class=\"\" id=\"analytics_indicators\">
{% set break = false %}
{% set array_used = [] %}
{% set category = '' %}
{#% dump(\"Item\") %#}
{#% dump(item) %#}
{% for rel in item.relation %}
{% if break == false %}
{#% dump(rel) %#}
{% if app.request.locale == \"ca\" %}
{% set title = rel.name_ca %}
{% set description = rel.info_ca %}
{% elseif app.request.locale == \"en\" %}
{% set title = rel.name_en %}
{% set description = rel.info_en %}
{% else %}
{% set title = rel.name %}
{% set description = rel.info %}
{% endif %}
{% set array_used = array_used|merge([rel.kpi]) %}
<div id=\"statline_id_{{rel.kpi}}\" onclick=\"updateMapFromDiv({{rel.kpi}})\" class=\"grayscale analytics_statsline_item\" data-kpi=\"{{rel.kpi}}\" data-slug=\"{{rel.slug}}\" data-bs-toggle=\"popover_live_{{loop.index}}\" data-bs-trigger=\"hover focus\" data-bs-title=\"{{title|capitalize}}\" data-bs-content=\"{{description}}\" data-p=\"{{ rel.province }}\" data-m=\"{{ rel.city }}\" data-r=\"{{ rel.region }}\" data-max=\"{{ rel.max_value }}\" data-min=\"{{ rel.min_value }}\">
<p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">{{title|capitalize}}</p>
<div class=\"statsline mb-3\" >
{% set color = [] %}
{% for rank in kpi_rank %}
{% if rank.kpi_id == rel.kpi %}
{% set color = color|merge([rank.bgcolor]) %}
{% endif %}
{% endfor %}
{% set counter = color|length %}
{% set partsize = 100/counter %}
{% set stylestring = '' %}
<div class=\"bk_line\">
{% for colorpart in color %}
{% if loop.last %}
{% set dato = 99.9-(partsize*(counter - 1)) %}
<div class=\"analytic_color_bar\" style=\"width:{{dato}}%; background-color: {{colorpart}};\"></div>
{% else %}
<div class=\"analytic_color_bar\" style=\"width:{{partsize|number_format(2, '.')}}%; background-color: {{colorpart}};\"></div>
{% endif %}
{% endfor %}
</div>
<span class=\"statsline_item statsline_{{loop.index}} item_tooltip\" style=\"left: {{rel.theme_per}}%;margin-left: -6px;\" data-text=\"{{rel.theme}}\" data-kpi=\"{{rel.kpi}}\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
</div>
<div class=\"statsline_range d-flex justify-content-between d-none\">
<span>{{rel.min_value}}</span>
<span>{{rel.max_value}}</span>
</div>
{% if loop.index == 4 %}
{% set break = true %}
{% endif %}
</div>
<script>
\$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').popover();
})
</script>
{% endif %}
{% endfor %}
</div>
</div>
<!-- Otros Indicadores box -->
<div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
<div class=\"d-flex justify-content-between\">
<p class=\"fw-bold fs-5\" data-bs-toggle=\"collapse\" data-bs-target=\"#analytics_indicators\" aria-expanded=\"true\" aria-controls=\"analytics_statsline\" onclick=\"expandIcon('analytics_indicators_arrow')\" role=\"button\">{% trans %}Otros indicadores{% endtrans %}</p>
</div>
<div class=\"\" id=\"analytics_indicators_others\">
{% set category = '' %}
{#% dump(\"Analytic\") %#}
{% for rel in analytic_data_relation %}
{#% dump(rel) %#}
{% if rel.kpi not in array_used %}
{% if category != rel.category %}
<p class=\"mt-2 fw-bold\" style=\"font-size: 12px; font-weight: 700;\">
{% if app.request.locale == \"ca\" %}
{{rel.category_ca}}
{% elseif app.request.locale == \"en\" %}
{{rel.category_en}}
{% else %}
{{rel.category}}
{% endif %}
</p>
{% set category = rel.category %}
{% endif %}
{% if app.request.locale == \"ca\" %}
{% set title = rel.name_ca %}
{% set description = rel.info_ca %}
{% elseif app.request.locale == \"en\" %}
{% set title = rel.name_en %}
{% set description = rel.info_en %}
{% else %}
{% set title = rel.name %}
{% set description = rel.info %}
{% endif %}
<div id=\"statline_id_{{rel.kpi}}\" onclick=\"updateMapFromDiv({{rel.kpi}})\" class=\"grayscale analytics_statsline_item\" data-kpi=\"{{rel.kpi}}\" data-slug=\"{{rel.slug}}\" data-bs-toggle=\"popover_live_{{loop.index}}\" data-bs-trigger=\"hover focus\" data-bs-title=\"{{title|capitalize}}\" data-bs-content=\"{{description}}\" data-p=\"{{ rel.province }}\" data-m=\"{{ rel.city }}\" data-r=\"{{ rel.region }}\" data-max=\"{{ rel.max_value }}\" data-min=\"{{ rel.min_value }}\">
<script>
\$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').popover();
})
</script>
<p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">{{title|capitalize}}</p>
<div class=\"statsline mb-3\" >
{% set color = [] %}
{% for rank in kpi_rank %}
{% if rank.kpi_id == rel.kpi %}
{% set color = color|merge([rank.bgcolor]) %}
{% endif %}
{% endfor %}
{% set counter = color|length %}
{% set partsize = 100/counter %}
{% set stylestring = '' %}
<div class=\"bk_line\">
{% for colorpart in color %}
{% if loop.last %}
{% set dato = 99.9-(partsize*(counter - 1)) %}
<div class=\"analytic_color_bar\" style=\"width:{{dato}}%; background-color: {{colorpart}};\"></div>
{% else %}
<div class=\"analytic_color_bar\" style=\"width:{{partsize|number_format(2, '.')}}%; background-color: {{colorpart}};\"></div>
{% endif %}
{% endfor %}
</div>
<span class=\"statsline_item statsline_{{loop.index}} item_tooltip\" style=\"left: {{rel.theme_per}}%; margin-left: -6px;\" data-text=\"{{rel.theme}}\" data-kpi=\"{{rel.kpi}}\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
</div>
<div class=\"statsline_range d-flex justify-content-between d-none\">
<span>{{rel.min_value}}</span>
<span>{{rel.max_value}}</span>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{# <div class=\"\" id=\"analytics_barplot_container\">
<div id=\"analytics_barplot\">
<div class=\"hover_window\">
<h5>Uso del edificio</h5>
<div class=\"mb-3\" id=\"statUseBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(105)\"></div>
</div>
<div class=\"hover_window\">
<h5>Año de construcción</h5>
<div class=\"mb-3\" id=\"statYearBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(100)\"></div>
</div>
<div class=\"hover_window\">
<h5>Área</h5>
<div class=\"mb-3\" id=\"statAreaBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(101)\"></div>
</div>
<div class=\"hover_window\">
<h5>Porcentaje de ocupación</h5>
<div class=\"mb-3\" id=\"statOccupationBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(104)\"></div>
</div>
</div>
</div> #}
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
<style>
td.gridjs-td{
//padding: 2px 24px !important;
}
</style>
{% endblock %}
{% block javascripts %}
<script src=\"{{ asset('build/js/calls.js') }}\"></script>
<script src=\"{{ asset('bundles/fosjsrouting/js/router.min.js') }}\"></script>
<script src=\"{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/gridjs/6.0.6/gridjs.production.min.js\" integrity=\"sha512-wpiJjuL800CTEBA0QFs+RFw0tFtpXnQGea1p9S16WcYNXC1F3U0l1L7FQrDC3ihkYRtOj4Td7lKR3mYKxrwMMA==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/gridjs/dist/theme/mermaid.min.css\" />
<script type=\"text/javascript\">
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
var Routes = Routing; // loaded from router.min.js
// because ES5 doesn't support require syntax,
// we use jquery getJSON function in order to set
// routing data to our Routing object
\$.getJSON(\"{{ asset('build/js/fos_js_routes.json') }}\", function (routes) {
Routes.setRoutingData(routes);
});
{# console.log(Routes); #}
</script>
<script type=\"text/javascript\">
//let explore_baseUrl = '{{ base_url }}';
\$(document).ready(function(){
\$('.viewfindergroup').hide();
\$('#map_view').show();
\$('.build_bar').css('width','100%');
\$('.people_bar').css('width','100%');
/*setTimeout(()=>{
\$('#info_div').collapse('hide');
},10000);*/
let arrayData = document.querySelectorAll('.analytics_statsline_item');
let arraySlugs = [];
for(let i=0; arrayData.length > i; i++){
arraySlugs.push(arrayData[i].getAttribute('data-slug'));
}
// console.log(arraySlugs);
buttonsToHeaderBar();
\$('#left_bar_button_map').addClass('active');
});
document.getElementById(\"selectAllBtn\").addEventListener(\"click\", function() {
let checkboxes = document.querySelectorAll(\".form-check-input\");
let allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked);
checkboxes.forEach(checkbox => {
checkbox.checked = !allChecked; // Alterna selección
});
this.textContent = allChecked ? \"Seleccionar Todos\" : \"Deseleccionar Todos\";
});
function buttonsToHeaderBar(){
// <span class=\"material-symbols-outlined\">bar_chart_4_bars</span>
document.getElementById('new_header_map').innerHTML = '<div id=\"left_bar_button_map\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'map\\')\"><span class=\"material-symbols-outlined\">map</span><br>{{\"Mapa\" |trans}}</div>';
document.getElementById('new_header_table').innerHTML = '<div id=\"left_bar_button_data\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'data\\')\"><span class=\"material-symbols-outlined\">table</span><br>{{\"Tabla\" |trans}}</div>';
document.getElementById('new_header_card').innerHTML = '<div id=\"left_bar_button_card\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'card\\')\"><span class=\"material-symbols-outlined\">grid_view</span><br>{{\"Ficha\" |trans}}</div>';
}
\$('.item_tooltip').on('mouseover',function (){
let name = this.getAttribute('data-text');
let kpi = this.getAttribute('data-kpi');
// console.log(name,kpi);
\$('.item_tooltip[data-kpi='+kpi+']').tooltip({title: name, delay: {show: 100, hide: 100}});
})
const { Grid, html } = gridjs;
var rPlatform = map;
var caller = call;
let layers = {{ layers |raw}};
let configLayers = {{ configLayers|raw }};
let explore_baseUrl = '{{ base_url }}';
caller.vars.explore_baseUrl = '{{ base_url }}';
let explore_mun = '{{ mun }}';
let explore_kpi = 3;
let explore_slug = '';
let explore_colors = {{ kpi_colors|raw }};
let explore_insight = [];
let explore_extrakpi = [];
let explore_layer_data = [];
let explore_url = window.location.href;
let explore_filter_url = '';
let filtered_data_array = {{ filtered_data|raw }};
let kpi_list = {{ kpi_list|raw }};
let kpi_list_complete = document.querySelectorAll('#kpi_list_data li');
for(i=0; kpi_list_complete.length > i; i++){
let name = kpi_list_complete[i].innerText;
let kpi = kpi_list_complete[i].getAttribute('data-kpi');
let slug = kpi_list_complete[i].getAttribute('data-slug');
kpi_list.push({'name':name,'kpi':kpi,'slug':slug});
}
// use stats data and print graphic
let useStat = {{ useStatData|raw }};
let useStatData = analyticOrganizeData(useStat);
var useStatTotalData = analyticOrganizeTotalData(useStat);
{# barplotDoubleDouble100('statUseBox',useStatData[0],useStatTotalData[1],useStatData[2], 'analytics_barplot_container',useStatTotalData[0]); #}
// year stats data and print graphic
let yearStat = {{ yearStatData|raw }};
let yearStatData = analyticOrganizeData(yearStat);
var yearStatTotalData = analyticOrganizeTotalData(yearStat);
{# barplotDoubleDouble100('statYearBox',yearStatData[0],yearStatTotalData[1],yearStatData[2], 'analytics_barplot_container',yearStatTotalData[0]); #}
// area stats data and print graphic
let areaStat = {{ areaStatData|raw }};
let areaStatData = analyticOrganizeData(areaStat);
var areaStatTotalData = analyticOrganizeTotalData(areaStat);
{# barplotDoubleDouble100('statAreaBox',areaStatData[0],areaStatTotalData[1],areaStatData[2], 'analytics_barplot_container',areaStatTotalData[0]); #}
// occupation stats data and print graphic
let occupationStat = {{ occupationStatData|raw }};
let occupationStatData = analyticOrganizeData(occupationStat);
var occupationStatTotalData = analyticOrganizeTotalData(occupationStat);
{# barplotDoubleDouble100('statOccupationBox',occupationStatData[0],occupationStatTotalData[1],occupationStatData[2], 'analytics_barplot_container',occupationStatTotalData[0]); #}
let explore_mun_name = '{{ municipioname.adminunitname|capitalize }}';
let allgeodataUrl = explore_baseUrl + \"/get-allgeodata?mun=\" + explore_mun ;
let munPolygon = '{{ municipioname.geom }}';
let initGeo = '{{ municipioname.envelope }}';
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
let filterStart = urlParams.get('fs');
let filterEnd = urlParams.get('fe');
window.appLocale = '{{ app.request.locale|e('js') }}';
if(filterStart == null){
filterStart = 0;
}
if(filterEnd == null){
filterEnd = 0;
}
rPlatform.setInpireidList(filtered_data_array);
rPlatform.setMun(explore_mun);
rPlatform.setBaseUrl(explore_baseUrl);
rPlatform.setLayers(layers);
rPlatform.setColorsStyle(explore_colors);
rPlatform.setLayerData(explore_layer_data);
// ----------------------- Map ------------------------ //
async function init() { // Cargar mapa de inicio
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
// Crear indArr con el primer kpi del listado
let alldivi = document.getElementsByClassName('grayscale');
let kpi_init = alldivi[0].getAttribute('data-kpi');
let slug_init = alldivi[0].getAttribute('data-slug');
explore_kpi = kpi_init;
explore_slug = slug_init;
alldivi[0].classList.add('kpi_selected');
alldivi[0].classList.add('disabled');
// Colocar primer alldivi como seleccionado
selectedIndicator(alldivi[0]);
// Recibir parametros ind desde url
let indArr = [parseInt(kpi_init)];
let frArr = [filterStart, filterEnd];
await rPlatform.setiActive(indArr);
await rPlatform.initMapExplore(layers, explore_baseUrl, initGeo, explore_mun, frArr, indArr);
await rPlatform.getSimpleStyleDistrict();
await rPlatform.getSimpleStyleSection();
rPlatform.updateMap();
}
init();
// ----------------------- Table Map ------------------------ //
function tableData(){
let wrapper = document.getElementById(\"wrapper\");
wrapper.innerHTML = '';
let tabla = null; // Variable global para almacenar la instancia de la tabla
function renderizarTabla(data) {
// Eliminar la tabla anterior si existe
if (tabla !== null) {
tabla.destroy();
}
// Crear una nueva instancia de Grid.js con los nuevos datos y renderizarla
tabla = new gridjs.Grid({
columns: [{
id: 'year',
name: \"{{'Año' |trans }}\"
},
{
id: 'currentuse',
name: \"{{'Uso' |trans }}\",
formatter: (cell, row) => {
if (cell == '1_residential' ){
return gridjs.html(`<span style=\"color: blue; cursor:pointer;\" onclick=\" viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Residential</span>`)
}else if(cell == '2_agriculture'){
return gridjs.html(`<span style=\"color: green; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Agriculture</span>`)
}else if(cell == '3_industrial'){
return gridjs.html(`<span style=\"color: gray; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Industrial</span>`)
}else if(cell == '4_3_publicServices'){
return gridjs.html(`<span style=\"color: orange; cursor:pointer;\" onclick=\"viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Public services</span>`)
}else{
return gridjs.html(`<span style=\"color: black\">\${cell}</span>`)
}
}
},
{
id: 'grossfloorarea',
name: \"{{'Grossfloorarea' |trans }}\",
formatter: (cell) => html(`\${cell} m<sup>2</sup>`)
},
{
id: 'habitantes',
name: \"{{'Habitantes' |trans }}\",
formatter: (cell) => {
return gridjs.html(`<div class=\"mt-2\"><i class=\"fa-solid fa-users\"></i> \${cell}</div>`)
}
},
{
id: 'numberofdwellings',
name: \"{{'Viviendas' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_1_energy_renovated_residential_buildings',
name: \"{{'Energy renovated residential buildings' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_2_final_energy_consumption',
name: \"{{'Final energy consumption' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_3_renewable_energy_consumption',
name: \"{{'Renewable energy consumption' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_4_pv_potential_generation',
name: \"{{'Pv potential generation' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_7_heating_energy_consumption',
name: \"{{'Heating energy consumption' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_8_ghg_emissions',
name: \"{{'GhG emissions' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_19_population_income_below_60_average',
name: \"{{'Population income below 60 average' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_20_median_household_income',
name: \"{{'Median household income' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_21_average_price_renting_compared_family_income',
name: \"{{'Average price renting compared family income' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_22_house_price',
name: \"{{'House price' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_27_urban_equipment_at_15_min',
name: \"{{'Urban equipment at 15 min' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_28_accessibility_to_bike_lane',
name: \"{{'Accessibility to bike lane' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},{
id: 'kpi_30_green_area_surfaces',
name: \"{{'Green area surfaces' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_31_vulnerability_heatwaves_temperature_rise',
name: \"{{'Vulnerability heatwaves temperature rise' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_36_charging_outlets',
name: \"{{'Charging outlets' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_6_1_energy_efficient_and_energy_recovering_homes',
name: \"{{'Energy efficient and energy recovering_homes' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'kpi_6_2_energy_efficient_and_energy_recovering_homes',
name: \"{{'Energy efficient and energy recovering homes' |trans }}\",
formatter: (cell) => html(`\${cell}`)
},
{
id: 'inspireid',
name: \"{{'inspireid' |trans }}\",
formatter: (cell) => html(`\${cell}`)
}],
data: data,
pagination: {
limit: 50,
summary: true,
},
resizable: true,
search: false,
sort: true,
fixedHeader: true,
height: \$(\"#infoview\").height(),
}).render(wrapper);
}
// Llamar a la función obtenerDatos() para obtener los datos inicialmente y renderizar la tabla
caller.obtenerDatos(explore_kpi, explore_mun, explore_slug)
.then((data) => {
console.log(data);
renderizarTabla(data);
})
.then(()=>{
setTimeout(()=>{
updateTable(explore_slug);
},2000)
});
}
//------------------------ Descargar Datos ------------------- //
function loadSelectorIndicators()
{
\$(\"#project_actions_content\").html('');
{% for item in analytic_data %}
{% if item.slug == slug %}
{% set break = false %}
{% set array_used = [] %}
{% for rel in item.relation %}
{% if break == false %}
{% set array_used = array_used|merge([rel.kpi]) %}
var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='{{rel.slug}}' id='flexCheckDefault' data-name='{{rel.name}}'> <label class='form-check-label' for='flexCheckDefault'> {{rel.name}} </label></div>\";
\$(\"#project_actions_content\").append(check);
console.log('{{rel.name}}');
{% endif %}
{% endfor %}
{% for rel in analytic_data_relation %}
{% if rel.kpi not in array_used %}
var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='{{rel.slug}}' id='flexCheckDefault' data-name='{{rel.name}}'> <label class='form-check-label' for='flexCheckDefault'> {{rel.name}} </label></div>\";
\$(\"#project_actions_content\").append(check);
console.log('{{rel.name}}');
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
\$(\"#popUpIndicadores\").modal('show');
}
function getExcel() {
const selectedNames = {};
const checkboxes = document.querySelectorAll('.form-check-input:checked');
const selectedValues = Array.from(checkboxes).map(checkbox => checkbox.value);
/*const selectedNames = Array.from(checkboxes).map(checkbox => ({
[checkbox.value]: checkbox.dataset.name
}));*/
checkboxes.forEach((checkbox) => selectedNames[checkbox.value] = checkbox.dataset.name);
console.log(selectedValues);
console.log(selectedNames);
caller.getExcel(explore_kpi, explore_mun, explore_slug, selectedValues, selectedNames)
.then((data) => {
console.log(data);
var bURL = \"{{app.request.getBasePath() }}\";
var href = bURL + \"/documents/\" + data;
location = href;
}).then(
//si hay que eliminar el archivo generado ---> here
);
}
// --------------------- Card ------------------------------- //
async function viewCard(id){
\$(\"#infoview2\").hide();
\$('.viewfindergroup').hide();
\$('#card_view').show();
let fachada = document.getElementById('img_fachada');
let catastro = document.getElementById('img_catastro');
let txt_build = document.getElementById('txt_build');
let build_indicators = document.getElementById('build_indicators');
let size = fachada.offsetWidth;
fachada.style.height = size + 'px';
catastro.style.height = size + 'px';
var imagenAlternativa = explore_baseUrl + '/img/img_bk_building.jpg';
let img_fachada = '<img class=\"img-fluid\" src=\"https://ovc.catastro.meh.es/OVCServWeb/OVCWcfLibres/OVCFotoFachada.svc/RecuperarFotoFachadaGet?ReferenciaCatastral=' + id + '\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
let img_catastro = '<img class=\"img-fluid\" src=\"https://www1.sedecatastro.gob.es/Cartografia/GeneraGraficoParcela.aspx?del=8&mun=279&refcat=' + id + '&AnchoPixels=500&AltoPixels=500\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
document.getElementById('img_fachada').innerHTML = img_fachada;
document.getElementById('img_catastro').innerHTML = img_catastro;
let buildData = await caller.getBuildData(id);
// console.log(buildData);
let UseValue = '';
let valuesContent = '';
if (buildData.use_numeric == 0) {
UseValue = 'SFH';
} else {
UseValue = 'MFH';
}
valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Referencia catastral\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.inspireid + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Año de construcción\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.year + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Uso\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + UseValue + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Plantas\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.num_floors + '</span></p>';
valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Superficie\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.grossfloorarea + '</span></p>';
document.getElementById('txt_build').innerHTML = valuesContent;
// console.log(kpi_list);
build_indicators.innerHTML = '';
for(let i=0; kpi_list.length > i; i++){
// console.log(kpi_list[i].slug);
let buildDataFiltered = Object.keys(buildData).filter((key) => key === kpi_list[i].slug).map((key) => buildData[key]);
//console.log(kpi_list[i]);
if(kpi_list[i].name != 'Todos'){
var styleBox = \"\";
var grafica = \"\";
if (kpi_list[i].name == \"año de construcción\" || kpi_list[i].name == \"área\" || kpi_list[i].name == \"uso\")
styleBox = \"bk_box--color\";
if ( \$(\"#statline_id_\"+kpi_list[i].id) ){
let contenido = \$(\"#statline_id_\"+kpi_list[i].id).html(); // Obtiene el HTML
let tempDiv = \$(\"<div>\").html(contenido); // Lo convierte en un objeto jQuery
tempDiv.find(\"p\").hide();
tempDiv.find(\".statsline_range\").removeClass(\"d-none\");
tempDiv.find(\".statsline_range\").css({
\"position\": \"relative\",
\"font-size\": \"12px\",
\"color\": \"#7a7a7a\",
//\"top\": \"-10px\"
});
let maxValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"max\");
let minValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"min\");
let per = Math.ceil(((buildDataFiltered[0]) - minValue)/(maxValue - minValue) * 100);
tempDiv.find(\".statsline_item\").css(\"left\", per+\"%\");
grafica = tempDiv.html();
} else grafica = \"\";
let dataNumber = \"\";
if (buildDataFiltered[0] == null){
if (window.appLocale == 'ca') dataNumber = \"No hi han dades\";
else if (window.appLocale == 'en') dataNumber = \"No data\";
else dataNumber = \"No hay datos\";
}
else if (kpi_list[i].name != \"año de construcción\"){
numero = Number.parseFloat(buildDataFiltered[0]);
dataNumber = numero.toLocaleString(\"es-ES\");
}else dataNumber = buildDataFiltered[0];
if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 0){
if (window.appLocale == 'ca') dataNumber = \"Unifamiliar\";
else if (window.appLocale == 'en') dataNumber = \"Unifamiliar\";
else dataNumber = \"Unifamiliar\";
}
else if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 1){
if (window.appLocale == 'ca') dataNumber = \"Plurifamiliar\";
else if (window.appLocale == 'en') dataNumber = \"Plurifamiliar\";
else dataNumber = \"Plurifamiliar\";
}
if (window.appLocale == 'ca')
{
var kpiName = kpi_list[i].name_ca;
var KpiInfo = kpi_list[i].info_ca;
}else if (window.appLocale == 'en') {
var kpiName = kpi_list[i].name_en;
var KpiInfo = kpi_list[i].info_en;
}else{
var kpiName = kpi_list[i].name;
var KpiInfo = kpi_list[i].info;
}
build_indicators.innerHTML += '<div class=\"col-6 col-sm-3 d-flex\"><div class=\"bk_box '+styleBox+' p-3 w-100 d-flex flex-column\"><div class=\"mb-2 d-flex justify-content-between align-items-baseline\" style=\"height: 58px;\"><p class=\"fw-bold mb-2\" style=\"font-size: 14px; line-height: 18px; max-width: 70%;\">'+ capitalizeFirstLetter(kpiName) +'</p><p style=\"font-weight:600; \"><span style=\"font-size:16px; color:#6E93F6;\"> '+ dataNumber +'</span></p></div><div class=\"d-flex justify-content-between mb-2\"><div style=\"width: 100%;\">'+grafica+'</div></div><p class=\" mb-2 boxed_limited\" onclick=\"activeClass(this)\" >'+ KpiInfo +'</p></div></div>';
}
}
}
function formatearNumero(numero) {
//return numero;
if(typeof numero === 'number'){
numero = numero.toString();
numero = Number.parseFloat(numero);
return numero.toLocaleString(\"es-ES\");
// return numero.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");
}else if(numero === null){
return numero;
}else{
// console.log(numero);
numero = Number.parseFloat(numero);
return numero.toLocaleString(\"es-ES\");
}
}
function hideCardOnData(){
document.getElementById('info_window').innerHTML = '';
}
// --------------------- Fn OK ------------------------------- //
function updateMapFromDiv(a){
let indArr = [{'kpi': parseInt(a)}];
let divi = document.getElementById('statline_id_' + a);
let alldivi = document.getElementsByClassName('grayscale');
for(let i=0; alldivi.length > i; i++){
alldivi[i].classList.remove('kpi_selected');
alldivi[i].classList.remove('disabled');
}
divi.classList.add('kpi_selected');
divi.classList.add('disabled');
explore_kpi = divi.getAttribute('data-kpi');
explore_slug = divi.getAttribute('data-slug');
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
// console.log(indArr);
this.selectedIndicator(divi);
this.updateTable(explore_slug);
//this.selectedDiv();
}
function updateMapFromStat(a){
let indArr = [{'kpi': parseInt(a)}];
let slug = '';
let name = '';
if(a == 100){
slug = 'statYearBox';
name = 'Año de construcción';
}else if(a == 101){
slug = 'statAreaBox';
name = 'Área';
}else if(a == 104){
slug = 'statOccupationBox';
name = 'Porcentaje de ocupación';
}else if(a == 105){
slug = 'statUseBox';
name = 'Uso del edificio';
}
let divi = document.getElementById(slug);
var selectedBox = document.getElementById('selected_box_content');
// selectedBox.innerHTML = divi.outerHTML;
let html = '<h6>'+name+'</h6>';
// selectedBox.insertAdjacentHTML(\"afterbegin\", html);
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
}
function updateTable(slug){
let kpiArray = ['kpi_1_energy_renovated_residential_buildings', 'kpi_2_final_energy_consumption', 'kpi_3_renewable_energy_consumption', 'kpi_4_pv_potential_generation', 'kpi_7_heating_energy_consumption', 'kpi_8_ghg_emissions', 'kpi_19_population_income_below_60_average', 'kpi_20_median_household_income', 'kpi_21_average_price_renting_compared_family_income', 'kpi_22_house_price', 'kpi_27_urban_equipment_at_15_min', 'kpi_28_accessibility_to_bike_lane', 'kpi_30_green_area_surfaces', 'kpi_31_vulnerability_heatwaves_temperature_rise', 'kpi_36_charging_outlets', 'kpi_6_2_energy_efficient_and_energy_recovering_homes', 'kpi_6_1_energy_efficient_and_energy_recovering_homes', 'inspireid']
// Seleccionar todas las columnas con slug
for(let i=0; kpiArray.length > i;i++){
let celda = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+kpiArray[i]+']');
for(let j=0; celda.length > j;j++){
celda[j].classList.add('d-none');
}
}
// Seleccionar las celdas de nuestro slug
let celdaSlug = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+slug+']');
for(let j=0; celdaSlug.length > j;j++){
celdaSlug[j].classList.remove('d-none');
celdaSlug[j].classList.add('selected');
}
// console.log('updateTable',slug);
}
function selectedIndicator(a){
var dataDiv = '';
var selectedBox = document.getElementById('selected_box_content');
var linestat = a.getElementsByClassName('statsline');
var titlestat = a.getElementsByClassName('title');
var p = parseFloat(a.getAttribute('data-p')).toFixed(2);
var m = parseFloat(a.getAttribute('data-m')).toFixed(2);
var r = parseFloat(a.getAttribute('data-r')).toFixed(2);
var max = parseFloat(a.getAttribute('data-max'));
// Si hay datos completos pintamos los pins en el indicador seleccionado
if (p !== null && m !== null && r !== null){
var dato_p = detres(p,max);
var dato_m = detres(m,max);
var dato_r = detres(r,max);
var pinDiv = '<span class=\"statsline_item_extra\" style=\"left: '+dato_p+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Provincia '+p+'\"></i><span class=\"pindata\">P</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_m+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Municipio '+m+'\"></i><span class=\"pindata\">M</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_r+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Región '+r+'\"></i><span class=\"pindata\">R</span></span> ';
var elemento = linestat[0];
// elemento.insertAdjacentHTML('beforeend', pinDiv);
dataDiv = titlestat[0].outerHTML + elemento.outerHTML;
// selectedBox.innerHTML = dataDiv;
}else{
dataDiv = titlestat[0].outerHTML + linestat[0].outerHTML;
// selectedBox.innerHTML = dataDiv;
}
let titleAttribute = a.getAttribute('data-bs-title');
let descAttribute = a.getAttribute('data-bs-content');
// selectedBox.setAttribute(\"data-bs-title\", titleAttribute);
// selectedBox.setAttribute(\"data-bs-content\", descAttribute);
\$('[data-bs-toggle=\"popover_live_top\"]').mouseover(function(){
\$('[data-bs-toggle=\"popover_live_top\"]').popover();
});
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle=\"popover_live_top\"]')
const popovertipList = [...popoverTriggerList].map(item => new bootstrap.Popover(item));
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
}
function detres(value,max){
let dato = (value*100)/max;
return dato.toFixed(2);
}
function updateMap(){
var selectElement = document.querySelector('#kpi_selector');
var kpi_id = selectElement.value;
let indArr = [{'kpi': parseInt(kpi_id)}];
rPlatform.setiSelected(indArr);
rPlatform.setiActive();
rPlatform.updateMap();
var iActive = rPlatform.getiActive();
updateSelector(iActive)
}
// --------------------- Simple Fn OK ------------------------------- //
function updateSelector(kpi){
var selector = document.getElementById('kpi_selector');
selector.value = kpi;
}
function loadUrlBack(){
let url = explore_baseUrl + \"/\" + explore_mun ;
window.location.href = url;
}
function gotoproject(){
let url = '';
url = explore_baseUrl + \"/\" + explore_mun + \"/plan\";
window.location.href = url;
}
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function viewFinder(a){
\$('.viewfindergroup').hide();
\$('#'+ a +'_view').show();
if(a == 'map' || a == 'data')
{
\$(\"#infoview2\").show();
}else{
\$(\"#infoview2\").hide();
}
if(a == 'data'){
tableData();
}
console.log(a);
[...document.querySelectorAll('.left_bar_button')].map(x => x.classList.remove('active'));
document.getElementById('left_bar_button_'+a).classList.add('active');
}
function centerViewMap(){
var zoom = rPlatform.getZoom();
rPlatform.setCenterView(initGeo);
}
function expandIcon(e){
var elemento = document.getElementById(e);
var textoExtraido = elemento.innerText;
if (textoExtraido == 'expand_more'){
elemento.innerText = 'expand_less';
}else{
elemento.innerText = 'expand_more';
}
}
function infoviewToggle(){
if(\$('#infoview2').hasClass('show')){
\$('#infoview2').collapse('hide');
\$('#infoview').addClass('w-100');
\$('#expand .material-symbols-outlined').text('collapse_content');
}else{
\$('#infoview2').collapse('show');
\$('#infoview').removeClass('w-100');
\$('#expand .material-symbols-outlined').text('expand_content');
}
}
function activeClass(elem){
var elemento = \$(elem);
elemento.toggleClass('active');
}
</script>
<script>
\$(document).ready(function(){
document.getElementById('big_container').classList.add('full');
var headerInTop = document.getElementById('header_in_top').offsetHeight;
var containerInContent = document.getElementById('container_in_content').offsetHeight;
var headerContentInfoTop = document.getElementById('header_content_info_top').offsetHeight;
var bigContainer = document.getElementById('big_container').offsetHeight;
var containerInContentTotal = bigContainer - headerInTop;
var containerSteps = bigContainer - headerInTop - headerContentInfoTop;
document.getElementById('container_in_content').style.height = containerInContentTotal + 'px';
document.getElementById('infoview_content').style.height = containerInContentTotal + 'px';
document.getElementById('analytic_step').style.height = containerInContentTotal + 'px';
var divs = document.querySelectorAll('.infoview_div');
for(let i=0; divs.length > i; i++){
divs[i].style.height = containerSteps + 'px';
}
var divs2 = document.querySelectorAll('.infoview2_div');
for(let i=0; divs2.length > i; i++){
divs2[i].style.height = containerSteps + 'px';
}
var divsIn = document.querySelectorAll('.viewfindergroup');
for(let i=0; divsIn.length > i; i++){
divsIn[i].style.height = containerSteps + 'px';
}
let flashDiv = document.querySelector('.flash-notice');
if(flashDiv){
setTimeout(()=>{
flashDiv.remove();
},10000);
}
});
function removeDiv(id){
let divi = document.getElementById(id);
divi.remove();
}
</script>
{% endblock %}
", "analytic/explore.html.twig", "/mnt/www/retabit_platform/templates/analytic/explore.html.twig");
}
}