From f92b80638e6fdf4c668d4ade275f70445077ef20 Mon Sep 17 00:00:00 2001 From: bcbernardo Date: Tue, 29 Jun 2021 07:32:30 -0300 Subject: [PATCH] Add acessibility evaluation --- .gitignore | 15 +- .../2021-06-20-bcbernardo-acessibility.ipynb | 13272 ++++++++++++++++ 2 files changed, 13285 insertions(+), 2 deletions(-) create mode 100644 notebooks/2021-06-20-bcbernardo-acessibility.ipynb diff --git a/.gitignore b/.gitignore index 65e9d1d..b4297a2 100644 --- a/.gitignore +++ b/.gitignore @@ -129,11 +129,22 @@ dmypy.json .pyre/ # Ignore -.vscode/ + censo/bin/ censo/include/ censo/share/ # Data notebooks/*.csv - +*.zip +cache + +# Azure stuff +.vscode +__azurite* +__blob* +local.settings.json + +# Geckodriver +geckodriver +geckodriver* diff --git a/notebooks/2021-06-20-bcbernardo-acessibility.ipynb b/notebooks/2021-06-20-bcbernardo-acessibility.ipynb new file mode 100644 index 0000000..2eb652d --- /dev/null +++ b/notebooks/2021-06-20-bcbernardo-acessibility.ipynb @@ -0,0 +1,13272 @@ +{ + "metadata": { + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.5-final" + }, + "orig_nbformat": 2, + "kernelspec": { + "name": "python39564bitvenvvenv179b6beaec7448debb0de2ed09d73fc8", + "display_name": "Python 3.9.5 64-bit ('.venv': venv)" + } + }, + "nbformat": 4, + "nbformat_minor": 2, + "cells": [ + { + "source": [ + "# Testes de acessibilidade" + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "source": [ + "## Introdução\n", + "\n", + "Este notebook conduz testes automatizados de acessibilidade nos portais mapeados no Censo Querido Diário.\n", + "\n", + "Segundo o último Censo Demográfico, há 46 milhões de pessoas no Brasil com algum tipo de deficiência - o equivalente a quase 24% da população[1](https://educa.ibge.gov.br/jovens/conheca-o-brasil/populacao/20551-pessoas-com-deficiencia.html). Desde 2000, a promoção de mecanismos para garantir o acesso à informação desse segmento da população é uma obrigação do poder público prevista em lei[2](http://www.planalto.gov.br/ccivil_03/leis/l10098.htm).\n", + "\n", + "O objetivo desta análise é verificar se essa obrigação tem sido cumprida pelos municípios brasileiros, no que se refere ao acesso a informações contidas nos diários oficiais. Para isso, buscamos verificar se os portais que dão acesso aos estão de acordo com os padrões da web para garantir o acesso por pessoas com deficiência.\n", + "\n", + "---\n", + "\n", + "1: *IBGE. Conheça o Brasil - População: Pessoas com Deficiência. S/D. Disponível em: .*\n", + "\n", + "2: *BRASIL. Lei Nº 10.098, de 19 de dezembro de 2000. 2000. Disponível em: .*" + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "source": [ + "## Dependências\n", + "\n", + "Esta análise utiliza um driver de navegador (*geckodrive*) para simular o comportamento de uma pessoa navegando pelos portais dos diários oficiais.\n", + "\n", + "Nas células a seguir, verificamos se o executável desse driver está localizado em algum lugar da raíz do repositório do Censo, no diretório `/notebooks` ou em algum lugar do seu caminho de busca padrão (`$PATH`). Caso não seja encontrado, o programa tentará baixar uma versão do Geckodriver adequada para o seu sistema.\n", + "\n", + "Também são instalados os pacotes [`selenium`](https://pypi.org/project/selenium/) e [`axe-selenium-python`](https://pypi.org/project/axe-selenium-python/) para realizar os testes automatizados. Recomenda-se rodar este notebook em um ambiente virtual para que a instalação desses pacotes não gere conflitos com as dependências instaladas nos sistema." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 173, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install -qq requests selenium axe-selenium-python wget \n", + "!pip install -qq pandas scipy plotly nbformat>=4.2.0" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import platform\n", + "import shutil\n", + "import sys\n", + "from pathlib import Path\n", + "\n", + "import wget\n", + "from selenium import webdriver\n", + "from selenium.common.exceptions import WebDriverException\n", + "from selenium.webdriver.firefox.options import Options as FirefoxOptions\n", + "\n", + "\n", + "def download_gecko(version=\"v0.29.1\") -> None:\n", + " # get Gecko executable\n", + " system = platform.system()\n", + " architecture = (int(sys.maxsize > 2**32) + 1) * 32\n", + " gecko_executable_url = (\n", + " f\"https://github.com/mozilla/geckodriver/releases/download/{version}/\"\n", + " f\"geckodriver-{version}-\"\n", + " )\n", + " if system == \"Windows\":\n", + " gecko_executable_url += f\"windows{architecture}.zip\"\n", + " elif system == \"Linux\":\n", + " gecko_executable_url += f\"linux{architecture}.tar.gz\"\n", + " elif system == \"Darwin\":\n", + " gecko_executable_url += \"macos\"\n", + " if system.architecture.startswith(\"arm\"):\n", + " gecko_executable_url += \"-aarch64\"\n", + " gecko_executable_url += \".tar.gz\"\n", + " else:\n", + " raise RuntimeError(\n", + " f\"No Geckodriver executable available for {system} {architecture}\"\n", + " )\n", + " gecko_compressed = wget.download(gecko_executable_url)\n", + " shutil.unpack_archive(gecko_compressed)\n", + "\n", + "\n", + "# check if geckodriver has been downloaded to the current working directory\n", + "driver_options = FirefoxOptions()\n", + "driver_options.headless = True\n", + "gecko_local_executable = os.path.join(os.getcwd(), \"geckodriver\")\n", + "if Path(gecko_local_executable).is_file():\n", + " executable_path = gecko_local_executable\n", + "else:\n", + " executable_path = None\n", + "\n", + "# test creating a new driver; download Gecko if needed\n", + "try:\n", + " driver = webdriver.Firefox(\n", + " options=driver_options,\n", + " executable_path=executable_path,\n", + " )\n", + "except WebDriverException:\n", + " download_gecko()\n", + " executable_path = gecko_local_executable\n", + " driver = webdriver.Firefox(\n", + " options=driver_options,\n", + " executable_path=executable_path,\n", + " )\n", + "finally:\n", + " driver.close()" + ] + }, + { + "source": [ + "## Requisitar dados do Censo Querido Diário\n", + "\n", + "Nesta seção, baixamos os dados mais recentes do mapeamento de portais de diários oficiais do Censo Querido Diário. Em seguida, transformamos as diversas colunas com as URLs das fontes em uma única coluna (formato *longo*)." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " municipio IBGE IBGE7 UF regiao \\\n", + "0 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "1 Abadia de Goiás (GO) 520005 5200050 GO Região Centro-Oeste \n", + "2 Abaetetuba (PA) 150010 1500107 PA Região Norte \n", + "3 Abaré (BA) 290020 2900207 BA Região Nordeste \n", + "4 Abaíra (BA) 290010 2900108 BA Região Nordeste \n", + ".. ... ... ... .. ... \n", + "592 Águas de Lindóia (SP) 350050 3500501 SP Região Sudeste \n", + "593 Álvares Florence (SP) 350120 3501202 SP Região Sudeste \n", + "594 Álvares Machado (SP) 350130 3501301 SP Região Sudeste \n", + "595 Álvaro de Carvalho (SP) 350140 3501400 SP Região Sudeste \n", + "596 Ângulo (PR) 410115 4101150 PR Região Sul \n", + "\n", + " populacao_2020 eh_capital \\\n", + "0 7006 False \n", + "1 8958 False \n", + "2 159080 False \n", + "3 20347 False \n", + "4 8710 False \n", + ".. ... ... \n", + "592 18808 False \n", + "593 3647 False \n", + "594 24998 False \n", + "595 5274 False \n", + "596 2930 False \n", + "\n", + " fonte_1 fonte_2 fonte_3 \\\n", + "0 https://abadiadosdourados.mg.gov.br/novo/index... None None \n", + "1 None None None \n", + "2 http://www.diariomunicipal.com.br/famep/pesqui... None None \n", + "3 https://sai.io.org.br/ba/abare/site/diariooficial None None \n", + "4 http://diariooficial.portalgov.net.br/ None None \n", + ".. ... ... ... \n", + "592 https://imprensaoficialmunicipal.com.br/aguas_... None None \n", + "593 https://imprensaoficialmunicipal.com.br/alvare... None None \n", + "594 http://www.alvaresmachado.sp.gov.br/diariooficial None None \n", + "595 https://imprensaoficialmunicipal.com.br/alvaro... None None \n", + "596 http://www.angulo.pr.gov.br/index.php?sessao=d... None None \n", + "\n", + " fonte_4 is_online data_inicial tipo_arquivo validacao navegacao \\\n", + "0 None 1 2013-12-30 PDF texto True None \n", + "1 None 2 None None True None \n", + "2 None 1 2016-06-30 HTML True None \n", + "3 None 1 2007-01-09 PDF texto True None \n", + "4 None 1 2017-01-06 PDF imagem True None \n", + ".. ... ... ... ... ... ... \n", + "592 None 1 2020-01-31 PDF texto True None \n", + "593 None 1 2013-03-13 PDF texto True None \n", + "594 None 1 2018-06-04 PDF texto True None \n", + "595 None 1 2018-04-04 PDF texto True None \n", + "596 None 1 2019-11-01 PDF texto True None \n", + "\n", + " observacoes \n", + "0 Desde outubro de 2017, passaram a ser publicad... \n", + "1 Atos publicados de forma avulsa no site da pre... \n", + "2 NaN \n", + "3 None \n", + "4 NaN \n", + ".. ... \n", + "592 NaN \n", + "593 NaN \n", + "594 NaN \n", + "595 NaN \n", + "596 NaN \n", + "\n", + "[597 rows x 17 columns]" + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
municipioIBGEIBGE7UFregiaopopulacao_2020eh_capitalfonte_1fonte_2fonte_3fonte_4is_onlinedata_inicialtipo_arquivovalidacaonavegacaoobservacoes
0Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006Falsehttps://abadiadosdourados.mg.gov.br/novo/index...NoneNoneNone12013-12-30PDF textoTrueNoneDesde outubro de 2017, passaram a ser publicad...
1Abadia de Goiás (GO)5200055200050GORegião Centro-Oeste8958FalseNoneNoneNoneNone2NoneNoneTrueNoneAtos publicados de forma avulsa no site da pre...
2Abaetetuba (PA)1500101500107PARegião Norte159080Falsehttp://www.diariomunicipal.com.br/famep/pesqui...NoneNoneNone12016-06-30HTMLTrueNoneNaN
3Abaré (BA)2900202900207BARegião Nordeste20347Falsehttps://sai.io.org.br/ba/abare/site/diariooficialNoneNoneNone12007-01-09PDF textoTrueNoneNone
4Abaíra (BA)2900102900108BARegião Nordeste8710Falsehttp://diariooficial.portalgov.net.br/NoneNoneNone12017-01-06PDF imagemTrueNoneNaN
......................................................
592Águas de Lindóia (SP)3500503500501SPRegião Sudeste18808Falsehttps://imprensaoficialmunicipal.com.br/aguas_...NoneNoneNone12020-01-31PDF textoTrueNoneNaN
593Álvares Florence (SP)3501203501202SPRegião Sudeste3647Falsehttps://imprensaoficialmunicipal.com.br/alvare...NoneNoneNone12013-03-13PDF textoTrueNoneNaN
594Álvares Machado (SP)3501303501301SPRegião Sudeste24998Falsehttp://www.alvaresmachado.sp.gov.br/diariooficialNoneNoneNone12018-06-04PDF textoTrueNoneNaN
595Álvaro de Carvalho (SP)3501403501400SPRegião Sudeste5274Falsehttps://imprensaoficialmunicipal.com.br/alvaro...NoneNoneNone12018-04-04PDF textoTrueNoneNaN
596Ângulo (PR)4101154101150PRRegião Sul2930Falsehttp://www.angulo.pr.gov.br/index.php?sessao=d...NoneNoneNone12019-11-01PDF textoTrueNoneNaN
\n

597 rows × 17 columns

\n
" + }, + "metadata": {}, + "execution_count": 3 + } + ], + "source": [ + "import pandas as pd\n", + "\n", + "census_data = pd.read_csv(\"https://censo.ok.org.br/get-data/\")\n", + "census_data" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " municipio IBGE IBGE7 UF regiao \\\n", + "0 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "2 Abaetetuba (PA) 150010 1500107 PA Região Norte \n", + "3 Abaré (BA) 290020 2900207 BA Região Nordeste \n", + "4 Abaíra (BA) 290010 2900108 BA Região Nordeste \n", + "5 Abreu e Lima (PE) 260005 2600054 PE Região Nordeste \n", + "... ... ... ... .. ... \n", + "1364 Cocal do Sul (SC) 420425 4204251 SC Região Sul \n", + "1385 Cuiabá (MT) 510340 5103403 MT Região Centro-Oeste \n", + "1440 Guarabira (PB) 250630 2506301 PB Região Nordeste \n", + "1611 Pará de Minas (MG) 314710 3147105 MG Região Sudeste \n", + "1646 Recife (PE) 261160 2611606 PE Região Nordeste \n", + "\n", + " populacao_2020 eh_capital fonte_prioridade \\\n", + "0 7006 False 1 \n", + "2 159080 False 1 \n", + "3 20347 False 1 \n", + "4 8710 False 1 \n", + "5 100346 False 1 \n", + "... ... ... ... \n", + "1364 16821 False 3 \n", + "1385 618124 True 3 \n", + "1440 59115 False 3 \n", + "1611 94808 False 3 \n", + "1646 1653461 True 3 \n", + "\n", + " fonte \n", + "0 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "2 http://www.diariomunicipal.com.br/famep/pesqui... \n", + "3 https://sai.io.org.br/ba/abare/site/diariooficial \n", + "4 http://diariooficial.portalgov.net.br/ \n", + "5 http://www.diariomunicipal.com.br/amupe/ \n", + "... ... \n", + "1364 https://www.diariomunicipal.sc.gov.br/site/?r=... \n", + "1385 https://diariooficial.cuiaba.mt.gov.br/ \n", + "1440 https://pmguarabira.wixsite.com/pmguarabira/di... \n", + "1611 https://transparencia.parademinas.mg.gov.br/ \n", + "1646 http://www.recife.pe.gov.br/diariooficial-acervo/ \n", + "\n", + "[659 rows x 9 columns]" + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
municipioIBGEIBGE7UFregiaopopulacao_2020eh_capitalfonte_prioridadefonte
0Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...
2Abaetetuba (PA)1500101500107PARegião Norte159080False1http://www.diariomunicipal.com.br/famep/pesqui...
3Abaré (BA)2900202900207BARegião Nordeste20347False1https://sai.io.org.br/ba/abare/site/diariooficial
4Abaíra (BA)2900102900108BARegião Nordeste8710False1http://diariooficial.portalgov.net.br/
5Abreu e Lima (PE)2600052600054PERegião Nordeste100346False1http://www.diariomunicipal.com.br/amupe/
..............................
1364Cocal do Sul (SC)4204254204251SCRegião Sul16821False3https://www.diariomunicipal.sc.gov.br/site/?r=...
1385Cuiabá (MT)5103405103403MTRegião Centro-Oeste618124True3https://diariooficial.cuiaba.mt.gov.br/
1440Guarabira (PB)2506302506301PBRegião Nordeste59115False3https://pmguarabira.wixsite.com/pmguarabira/di...
1611Pará de Minas (MG)3147103147105MGRegião Sudeste94808False3https://transparencia.parademinas.mg.gov.br/
1646Recife (PE)2611602611606PERegião Nordeste1653461True3http://www.recife.pe.gov.br/diariooficial-acervo/
\n

659 rows × 9 columns

\n
" + }, + "metadata": {}, + "execution_count": 2 + } + ], + "source": [ + "portals_info = (\n", + " census_data\n", + " .melt(\n", + " id_vars=[\n", + " \"municipio\",\n", + " \"IBGE\",\n", + " \"IBGE7\",\n", + " \"UF\",\n", + " \"regiao\",\n", + " \"populacao_2020\",\n", + " \"eh_capital\",\n", + " ],\n", + " value_vars=[\n", + " col for col in census_data.columns if col.startswith(\"fonte_\")\n", + " ],\n", + " value_name=\"fonte\",\n", + " var_name=\"fonte_prioridade\",\n", + " )\n", + " .assign(\n", + " fonte_prioridade=lambda _: pd.to_numeric(_.fonte_prioridade.str[-1])\n", + " )\n", + " .replace(to_replace='None', value=pd.NA)\n", + " .dropna(subset=[\"fonte\"])\n", + ")\n", + "\n", + "portals_info" + ] + }, + { + "source": [ + "## Executar a avaliação automatizada dos portais\n", + "\n", + "A seguir, iteramos sobre todos os portais mapeados no Censo Querido Diário, executando os testes automatizados disponibilizados pelo pacote [Axe](https://github.com/dequelabs/axe-core), e registrando as violações aos padrões web de acessibilidade detectadas.\n", + "\n", + "**ATENÇÃO**: Podem ser necessárias algumas horas para realizar a avaliação de todos os portais mapeados no Censo." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "tags": [ + "outputPrepend" + ] + }, + "outputs": [ + { + "output_type": "stream", + "name": "stderr", + "text": [ + "tarting evaluation 535 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 1 violations (1 critical; 0 serious; 0 moderate).\n", + "INFO:root:Starting evaluation 536 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 8 violations (3 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 537 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (1 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 538 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 539 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (2 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 540 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (2 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 541 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (3 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 542 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 8 violations (2 critical; 4 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 543 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 544 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 545 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 546 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 547 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (3 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 548 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 549 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 11 violations (3 critical; 4 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 550 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 551 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 11 violations (3 critical; 4 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 552 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 11 violations (3 critical; 4 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 553 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (3 critical; 3 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 554 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 11 violations (3 critical; 4 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 555 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (2 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 556 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 3 violations (1 critical; 0 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 557 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : Message: Reached error page: about:neterror?e=netTimeout&u=http%3A//174.142.65.52%3A16444/transparencia/angelim/prefeitura/legislacaomunicipal.faces&c=UTF-8&d=The%20server%20at%20174.142.65.52%20is%20taking%20too%20long%20to%20respond.\n", + "\n", + "INFO:root:Starting evaluation 558 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (1 critical; 0 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 559 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 560 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (0 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 561 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 6 violations (4 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 562 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 563 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 6 violations (0 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 564 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (2 critical; 3 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 565 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (0 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 566 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (3 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 567 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (1 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 568 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 569 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (2 critical; 1 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 570 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 6 violations (1 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 571 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 13 violations (4 critical; 2 serious; 6 moderate).\n", + "INFO:root:Starting evaluation 572 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 573 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (3 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 574 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : Message: Reached error page: about:neterror?e=nssFailure2&u=https%3A//www.dom.codo.ma.gov.br/&c=UTF-8&d=%20\n", + "\n", + "INFO:root:Starting evaluation 575 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 576 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (0 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 577 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 0 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 578 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (3 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 579 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 6 violations (1 critical; 3 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 580 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (2 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 581 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (0 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 582 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 3 violations (0 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 583 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 584 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 13 violations (3 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 585 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 13 violations (3 critical; 4 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 586 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 3 violations (0 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 587 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 588 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (2 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 589 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 8 violations (2 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 590 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 5 violations (0 critical; 3 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 591 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (1 critical; 4 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 592 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 593 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 594 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 8 violations (2 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 595 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 596 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 8 violations (1 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 597 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 598 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 599 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (3 critical; 3 serious; 4 moderate).\n", + "INFO:root:Starting evaluation 600 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 1 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 601 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 11 violations (3 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 602 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 603 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (3 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 604 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 9 violations (3 critical; 3 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 605 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (2 critical; 2 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 606 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 3 violations (0 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 607 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 608 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 3 violations (0 critical; 0 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 609 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 2 violations (0 critical; 1 serious; 1 moderate).\n", + "INFO:root:Starting evaluation 610 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 10 violations (3 critical; 4 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 611 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 612 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : Message: Reached error page: about:neterror?e=netTimeout&u=http%3A//174.142.65.52%3A16444/transparencia/angelim/prefeitura/outrosatos.faces&c=UTF-8&d=The%20server%20at%20174.142.65.52%20is%20taking%20too%20long%20to%20respond.\n", + "\n", + "INFO:root:Starting evaluation 613 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 4 violations (1 critical; 1 serious; 2 moderate).\n", + "INFO:root:Starting evaluation 614 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (2 critical; 2 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 615 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : Message: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//diariooficial.cuiaba.mt.gov.br/&c=UTF-8&d=We%20can%E2%80%99t%20connect%20to%20the%20server%20at%20diariooficial.cuiaba.mt.gov.br.\n", + "\n", + "INFO:root:Starting evaluation 616 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "INFO:root:Found 7 violations (1 critical; 3 serious; 3 moderate).\n", + "INFO:root:Starting evaluation 617 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : 'impact'\n", + "INFO:root:Starting evaluation 618 of 618.\n", + "INFO:root:Evaluating accessibility in portal ...\n", + "ERROR:root:Error while evaluating : 'impact'\n" + ] + } + ], + "source": [ + "import logging\n", + "\n", + "from axe_selenium_python import Axe\n", + "\n", + "\n", + "logger = logging.getLogger()\n", + "logger.setLevel(logging.INFO)\n", + "\n", + "\n", + "def evaluate_a11y(url: str, driver: webdriver.Firefox) -> pd.DataFrame:\n", + " \"\"\"Performs an automated acessibility test in the given URL.\"\"\"\n", + " logger.info(f\"Evaluating accessibility in portal <{url}>...\")\n", + " driver.get(url)\n", + " axe = Axe(driver)\n", + " # inject axe-core javascript into page.\n", + " axe.inject()\n", + " # run axe accessibility checks.\n", + " results = axe.run()\n", + " # convert into a DataFrame\n", + " df_violations = pd.DataFrame(results[\"violations\"])\n", + " num_violations = len(portal_violations.index)\n", + " num_violations_critical = sum(portal_violations[\"impact\"] == \"critical\")\n", + " num_violations_serious = sum(portal_violations[\"impact\"] == \"serious\")\n", + " num_violations_moderate = sum(portal_violations[\"impact\"] == \"moderate\")\n", + " num_violations_minor = sum(portal_violations[\"impact\"] == \"minor\")\n", + " logger.info(\n", + " f\"Found {num_violations} violations \"\n", + " f\"({num_violations_critical} critical; \"\n", + " f\"{num_violations_serious} serious; \"\n", + " f\"{num_violations_moderate} moderate; \"\n", + " f\"{num_violations_minor} minor).\"\n", + " )\n", + " return df_violations\n", + "\n", + "try:\n", + " # create a new driver\n", + " driver = webdriver.Firefox(\n", + " options=driver_options,\n", + " executable_path=executable_path,\n", + " )\n", + " # create a DataFrame to record violations across all portals\n", + " all_violations = pd.DataFrame()\n", + " # evaluate one portal at a time\n", + " num_evaluations = 0\n", + " portal_urls = portals_info[\"fonte\"].unique()\n", + " for url in portal_urls:\n", + " try:\n", + " num_evaluations += 1\n", + " logger.info(\n", + " f\"Starting evaluation {num_evaluations} of {len(portal_urls)}.\"\n", + " )\n", + " portal_violations = evaluate_a11y(url=url, driver=driver)\n", + " portal_violations[\"fonte\"] = url\n", + " all_violations = pd.concat(\n", + " [all_violations, portal_violations],\n", + " ignore_index=True,\n", + " )\n", + " except Exception as err:\n", + " logger.error(f\"Error while evaluating <{url}>: {err}\")\n", + "\n", + "finally:\n", + " # finish driver\n", + " driver.close()" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " municipio IBGE IBGE7 UF regiao \\\n", + "0 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "1 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "2 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "3 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "4 Abadia Dos Dourados (MG) 310010 3100104 MG Região Sudeste \n", + "... ... ... ... .. ... \n", + "4748 Cocal do Sul (SC) 420425 4204251 SC Região Sul \n", + "4749 Cuiabá (MT) 510340 5103403 MT Região Centro-Oeste \n", + "4750 Guarabira (PB) 250630 2506301 PB Região Nordeste \n", + "4751 Pará de Minas (MG) 314710 3147105 MG Região Sudeste \n", + "4752 Recife (PE) 261160 2611606 PE Região Nordeste \n", + "\n", + " populacao_2020 eh_capital fonte_prioridade \\\n", + "0 7006 False 1 \n", + "1 7006 False 1 \n", + "2 7006 False 1 \n", + "3 7006 False 1 \n", + "4 7006 False 1 \n", + "... ... ... ... \n", + "4748 16821 False 3 \n", + "4749 618124 True 3 \n", + "4750 59115 False 3 \n", + "4751 94808 False 3 \n", + "4752 1653461 True 3 \n", + "\n", + " fonte \\\n", + "0 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "1 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "2 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "3 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "4 https://abadiadosdourados.mg.gov.br/novo/index... \n", + "... ... \n", + "4748 https://www.diariomunicipal.sc.gov.br/site/?r=... \n", + "4749 https://diariooficial.cuiaba.mt.gov.br/ \n", + "4750 https://pmguarabira.wixsite.com/pmguarabira/di... \n", + "4751 https://transparencia.parademinas.mg.gov.br/ \n", + "4752 http://www.recife.pe.gov.br/diariooficial-acervo/ \n", + "\n", + " description \\\n", + "0 Ensures the contrast between foreground and ba... \n", + "1 Ensures every id attribute value of active ele... \n", + "2 Ensures the order of headings is semantically ... \n", + "3 Ensures every form element has a label \n", + "4 Ensures the page has only one main landmark an... \n", + "... ... \n", + "4748 Ensures all page content is contained by landm... \n", + "4749 NaN \n", + "4750 NaN \n", + "4751 NaN \n", + "4752 NaN \n", + "\n", + " help \\\n", + "0 Elements must have sufficient color contrast \n", + "1 IDs of active elements must be unique \n", + "2 Heading levels should only increase by one \n", + "3 Form elements must have labels \n", + "4 Page must have one main landmark \n", + "... ... \n", + "4748 All page content must be contained by landmarks \n", + "4749 NaN \n", + "4750 NaN \n", + "4751 NaN \n", + "4752 NaN \n", + "\n", + " helpUrl id \\\n", + "0 https://dequeuniversity.com/rules/axe/3.1/colo... color-contrast \n", + "1 https://dequeuniversity.com/rules/axe/3.1/dupl... duplicate-id-active \n", + "2 https://dequeuniversity.com/rules/axe/3.1/head... heading-order \n", + "3 https://dequeuniversity.com/rules/axe/3.1/labe... label \n", + "4 https://dequeuniversity.com/rules/axe/3.1/land... landmark-one-main \n", + "... ... ... \n", + "4748 https://dequeuniversity.com/rules/axe/3.1/regi... region \n", + "4749 NaN NaN \n", + "4750 NaN NaN \n", + "4751 NaN NaN \n", + "4752 NaN NaN \n", + "\n", + " impact nodes \\\n", + "0 serious [{'all': [], 'any': [{'data': {'bgColor': '#ff... \n", + "1 serious [{'all': [], 'any': [{'data': 'logo', 'id': 'd... \n", + "2 moderate [{'all': [], 'any': [{'data': 3, 'id': 'headin... \n", + "3 critical [{'all': [], 'any': [{'data': None, 'id': 'ari... \n", + "4 moderate [{'all': [{'data': None, 'id': 'page-has-main'... \n", + "... ... ... \n", + "4748 moderate [{'all': [], 'any': [{'data': None, 'id': 'reg... \n", + "4749 NaN NaN \n", + "4750 NaN NaN \n", + "4751 NaN NaN \n", + "4752 NaN NaN \n", + "\n", + " tags \n", + "0 [cat.color, wcag2aa, wcag143] \n", + "1 [cat.parsing, wcag2a, wcag411] \n", + "2 [cat.semantics, best-practice] \n", + "3 [cat.forms, wcag2a, wcag332, wcag131, section5... \n", + "4 [cat.semantics, best-practice] \n", + "... ... \n", + "4748 [cat.keyboard, best-practice] \n", + "4749 NaN \n", + "4750 NaN \n", + "4751 NaN \n", + "4752 NaN \n", + "\n", + "[4753 rows x 16 columns]" + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
municipioIBGEIBGE7UFregiaopopulacao_2020eh_capitalfonte_prioridadefontedescriptionhelphelpUrlidimpactnodestags
0Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...Ensures the contrast between foreground and ba...Elements must have sufficient color contrasthttps://dequeuniversity.com/rules/axe/3.1/colo...color-contrastserious[{'all': [], 'any': [{'data': {'bgColor': '#ff...[cat.color, wcag2aa, wcag143]
1Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...Ensures every id attribute value of active ele...IDs of active elements must be uniquehttps://dequeuniversity.com/rules/axe/3.1/dupl...duplicate-id-activeserious[{'all': [], 'any': [{'data': 'logo', 'id': 'd...[cat.parsing, wcag2a, wcag411]
2Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...Ensures the order of headings is semantically ...Heading levels should only increase by onehttps://dequeuniversity.com/rules/axe/3.1/head...heading-ordermoderate[{'all': [], 'any': [{'data': 3, 'id': 'headin...[cat.semantics, best-practice]
3Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...Ensures every form element has a labelForm elements must have labelshttps://dequeuniversity.com/rules/axe/3.1/labe...labelcritical[{'all': [], 'any': [{'data': None, 'id': 'ari...[cat.forms, wcag2a, wcag332, wcag131, section5...
4Abadia Dos Dourados (MG)3100103100104MGRegião Sudeste7006False1https://abadiadosdourados.mg.gov.br/novo/index...Ensures the page has only one main landmark an...Page must have one main landmarkhttps://dequeuniversity.com/rules/axe/3.1/land...landmark-one-mainmoderate[{'all': [{'data': None, 'id': 'page-has-main'...[cat.semantics, best-practice]
...................................................
4748Cocal do Sul (SC)4204254204251SCRegião Sul16821False3https://www.diariomunicipal.sc.gov.br/site/?r=...Ensures all page content is contained by landm...All page content must be contained by landmarkshttps://dequeuniversity.com/rules/axe/3.1/regi...regionmoderate[{'all': [], 'any': [{'data': None, 'id': 'reg...[cat.keyboard, best-practice]
4749Cuiabá (MT)5103405103403MTRegião Centro-Oeste618124True3https://diariooficial.cuiaba.mt.gov.br/NaNNaNNaNNaNNaNNaNNaN
4750Guarabira (PB)2506302506301PBRegião Nordeste59115False3https://pmguarabira.wixsite.com/pmguarabira/di...NaNNaNNaNNaNNaNNaNNaN
4751Pará de Minas (MG)3147103147105MGRegião Sudeste94808False3https://transparencia.parademinas.mg.gov.br/NaNNaNNaNNaNNaNNaNNaN
4752Recife (PE)2611602611606PERegião Nordeste1653461True3http://www.recife.pe.gov.br/diariooficial-acervo/NaNNaNNaNNaNNaNNaNNaN
\n

4753 rows × 16 columns

\n
" + }, + "metadata": {}, + "execution_count": 69 + } + ], + "source": [ + "portals_violations = portals_info.merge(\n", + " all_violations,\n", + " on=\"fonte\",\n", + " how=\"left\",\n", + ")\n", + "\n", + "portals_violations" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [], + "source": [ + "portals_violations.to_csv(\"a11y_analysis.csv\", index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "portals_violations = pd.read_csv(\"a11y_analysis.csv\")" + ] + }, + { + "source": [ + "## Analisar os resultados - Cidades acima de 100 mil habitantes\n", + "\n", + "Nesta seção, analisamos os resultados da avaliação de acessibilidade dos **portais principais** dos municípios com 100 mil habitantes ou mais, de acordo com a população estimada pelo IBGE para o ano de 2020.\n", + "\n", + "No total, foram encontradas **2230 violações às regras de acessibilidade** avaliadas, sendo **493 violações consideradas críticas** (22% das violações encontradas) e 729 graves (33% do total)." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Total de municípios com mais de 100 mil hab. com portais analisados: 323\nTotal de portais únicos: 306\nTotal de violações encontradas: 2217\n" + ] + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " num_violacoes percentual_violacoes\n", + "impact \n", + "critical 493 22.24\n", + "serious 729 32.88\n", + "moderate 827 37.30\n", + "minor 168 7.58" + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
num_violacoespercentual_violacoes
impact
critical49322.24
serious72932.88
moderate82737.30
minor1687.58
\n
" + }, + "metadata": {}, + "execution_count": 119 + } + ], + "source": [ + "violations_100k_main = (\n", + " portals_violations\n", + " .query(\"populacao_2020 >= 100000 & fonte_prioridade == 1\")\n", + " .reset_index(drop=True)\n", + ")\n", + "\n", + "print(\n", + " \"Total de municípios com mais de 100 mil hab. com portais analisados: \",\n", + " len(violations_100k_main[\"IBGE\"].unique()),\n", + ")\n", + "total_portals = len(violations_100k_main[\"fonte\"].unique())\n", + "print(\"Total de portais únicos: \", total_portals)\n", + "\n", + "total_violations = sum(violations_100k_main.groupby(\"fonte\")[\"id\"].count())\n", + "print(\"Total de violações encontradas: \", total_violations)\n", + "\n", + "(\n", + " violations_100k_main\n", + " .groupby([\"fonte\", \"impact\"])[\"id\"]\n", + " .count()\n", + " .groupby(\"impact\")\n", + " .sum()[[\"critical\", \"serious\", \"moderate\", \"minor\"]]\n", + " .rename(\"num_violacoes\")\n", + " .to_frame()\n", + " .assign(percentual_violacoes=lambda _: round(\n", + " 100*_[\"num_violacoes\"]/total_violations, 2\n", + " ))\n", + ")" + ] + }, + { + "source": [ + "Em média, foram encontradas, em média, 7,15 problemas de acessibilidade por município analisado. Dessas, havia, em média,:\n", + "\n", + "- 1,59 violações críticas;\n", + "- 2,35 violações graves;\n", + "- 2,67 violações moderadas;\n", + "- 0,54 violações leves.\n", + "\n", + "Isso significa que há uma média de 3,94 problemas críticos ou graves de acessibilidade por município cujo portal foi analisado no recorte considerado." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " IBGE municipio num_violacoes\n0 240810 Natal (RN) 16\n1 311940 Coronel Fabriciano (MG) 14\n2 351870 Guarujá (SP) 14\n3 251370 Santa Rita (PB) 14\n4 351640 Franco da Rocha (SP) 14\n5 210005 Açailândia (MA) 13\n6 410180 Araucária (PR) 13\n7 352390 Itu (SP) 13\n8 330190 Itaboraí (RJ) 13\n9 420460 Criciúma (SC) 13\n" + ] + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=critical
number of violations=%{x}
count=%{y}", + "legendgroup": "critical", + "marker": { + "color": "#c60a1c", + "pattern": { + "shape": "" + } + }, + "name": "critical", + "offsetgroup": "critical", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 1, + 2, + 2, + 2, + 1, + 2, + 3, + 1, + 0, + 2, + 0, + 2, + 3, + 2, + 3, + 1, + 2, + 5, + 2, + 1, + 1, + 0, + 0, + 0, + 0, + 3, + 2, + 3, + 3, + 4, + 3, + 0, + 3, + 3, + 1, + 2, + 1, + 0, + 3, + 1, + 3, + 1, + 1, + 0, + 4, + 1, + 2, + 0, + 2, + 0, + 0, + 1, + 1, + 2, + 0, + 2, + 0, + 3, + 3, + 4, + 0, + 2, + 1, + 3, + 2, + 1, + 1, + 0, + 5, + 0, + 3, + 3, + 1, + 4, + 3, + 1, + 0, + 1, + 2, + 0, + 1, + 2, + 1, + 0, + 2, + 3, + 2, + 2, + 3, + 2, + 1, + 4, + 1, + 3, + 0, + 2, + 3, + 3, + 0, + 3, + 3, + 3, + 1, + 4, + 3, + 0, + 0, + 3, + 1, + 1, + 3, + 5, + 4, + 0, + 0, + 2, + 0, + 2, + 0, + 0, + 3, + 1, + 3, + 0, + 1, + 3, + 5, + 3, + 0, + 1, + 0, + 2, + 1, + 1, + 2, + 1, + 1, + 2, + 0, + 1, + 1, + 2, + 3, + 1, + 2, + 2, + 3, + 0, + 3, + 3, + 1, + 2, + 1, + 1, + 2, + 0, + 0, + 4, + 2, + 2, + 0, + 2, + 1, + 0, + 0, + 2, + 3, + 1, + 0, + 5, + 0, + 0, + 2, + 2, + 2, + 1, + 3, + 1, + 0, + 2, + 1, + 1, + 2, + 0, + 0, + 1, + 0, + 1, + 1, + 2, + 5, + 3, + 3, + 1, + 0, + 2, + 0, + 1, + 1, + 0, + 3, + 3, + 0, + 1, + 3, + 0, + 1, + 2, + 2, + 2, + 2, + 1, + 3, + 2, + 2, + 0, + 4, + 2, + 1, + 1, + 1, + 2, + 3, + 2, + 2, + 5, + 3, + 2, + 3, + 1, + 0, + 1, + 2, + 3, + 0, + 0, + 1, + 0, + 3, + 1, + 1, + 1, + 2, + 3, + 0, + 1, + 2, + 2, + 0, + 1, + 3, + 2, + 3, + 3, + 2, + 1, + 1, + 2, + 4, + 0, + 0, + 0, + 0, + 0, + 3, + 3, + 1, + 3, + 3, + 3, + 3, + 0, + 1, + 2, + 1, + 3, + 0, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 1, + 3, + 2, + 1, + 3, + 3, + 2, + 0, + 2, + 1, + 0, + 3, + 1, + 0, + 2, + 2, + 3, + 2, + 3 + ], + "xaxis": "x", + "yaxis": "y" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Mean: 1.59", + "x": 1.5903225806451613, + "xanchor": "left", + "xref": "x", + "xshift": 5, + "y": 300, + "yref": "y" + } + ], + "barmode": "relative", + "legend": { + "title": { + "text": "impact" + }, + "tracegroupgap": 0 + }, + "shapes": [ + { + "line": { + "color": "black", + "dash": "dash", + "width": 3 + }, + "opacity": 1, + "type": "line", + "x0": 1.5903225806451613, + "x1": 1.5903225806451613, + "y0": 0, + "y1": 300 + } + ], + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "title": { + "text": "Violation frequency - Critical violations" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 6.99 + ], + "title": { + "text": "number of violations" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 300 + ], + "title": { + "text": "count" + } + } + } + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=serious
number of violations=%{x}
count=%{y}", + "legendgroup": "serious", + "marker": { + "color": "#ff684c", + "pattern": { + "shape": "" + } + }, + "name": "serious", + "offsetgroup": "serious", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 1, + 1, + 3, + 1, + 2, + 1, + 1, + 3, + 3, + 3, + 2, + 3, + 3, + 3, + 2, + 1, + 4, + 1, + 5, + 2, + 1, + 4, + 4, + 3, + 3, + 3, + 1, + 3, + 3, + 1, + 2, + 2, + 2, + 1, + 4, + 4, + 4, + 2, + 1, + 2, + 4, + 3, + 0, + 3, + 1, + 4, + 2, + 3, + 3, + 5, + 1, + 2, + 1, + 4, + 1, + 3, + 2, + 1, + 2, + 4, + 3, + 2, + 3, + 1, + 2, + 0, + 2, + 2, + 4, + 4, + 2, + 2, + 3, + 3, + 1, + 3, + 0, + 6, + 3, + 2, + 3, + 5, + 2, + 1, + 1, + 4, + 1, + 2, + 4, + 1, + 1, + 2, + 3, + 4, + 3, + 2, + 2, + 1, + 1, + 1, + 4, + 1, + 3, + 4, + 2, + 4, + 3, + 3, + 6, + 3, + 1, + 2, + 1, + 1, + 2, + 3, + 3, + 4, + 3, + 5, + 2, + 1, + 3, + 1, + 4, + 5, + 3, + 3, + 2, + 3, + 2, + 1, + 4, + 3, + 2, + 2, + 2, + 1, + 0, + 3, + 1, + 1, + 3, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 1, + 2, + 1, + 2, + 3, + 1, + 2, + 4, + 3, + 3, + 1, + 3, + 3, + 0, + 1, + 4, + 1, + 1, + 1, + 5, + 2, + 2, + 3, + 2, + 5, + 6, + 2, + 1, + 1, + 3, + 0, + 3, + 3, + 1, + 1, + 2, + 1, + 1, + 1, + 3, + 3, + 3, + 4, + 2, + 3, + 0, + 1, + 2, + 2, + 0, + 2, + 4, + 1, + 1, + 2, + 3, + 2, + 2, + 2, + 3, + 4, + 4, + 3, + 3, + 2, + 1, + 4, + 3, + 4, + 4, + 1, + 3, + 2, + 3, + 2, + 3, + 4, + 4, + 2, + 1, + 2, + 1, + 6, + 3, + 4, + 1, + 3, + 1, + 1, + 1, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 4, + 2, + 1, + 2, + 4, + 3, + 5, + 2, + 3, + 3, + 4, + 1, + 2, + 0, + 1, + 1, + 2, + 2, + 1, + 3, + 2, + 2, + 3, + 2, + 2, + 5, + 1, + 3, + 4, + 1, + 2, + 2, + 1, + 1, + 3, + 1, + 3, + 3, + 2, + 3, + 1, + 4, + 2, + 2, + 1, + 3, + 3, + 2, + 2, + 1, + 1, + 2, + 4, + 2, + 4, + 2 + ], + "xaxis": "x", + "yaxis": "y" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Mean: 2.35", + "x": 2.3516129032258064, + "xanchor": "left", + "xref": "x", + "xshift": 5, + "y": 300, + "yref": "y" + } + ], + "barmode": "relative", + "legend": { + "title": { + "text": "impact" + }, + "tracegroupgap": 0 + }, + "shapes": [ + { + "line": { + "color": "black", + "dash": "dash", + "width": 3 + }, + "opacity": 1, + "type": "line", + "x0": 2.3516129032258064, + "x1": 2.3516129032258064, + "y0": 0, + "y1": 300 + } + ], + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "title": { + "text": "Violation frequency - Serious violations" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 6.99 + ], + "title": { + "text": "number of violations" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 300 + ], + "title": { + "text": "count" + } + } + } + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=moderate
number of violations=%{x}
count=%{y}", + "legendgroup": "moderate", + "marker": { + "color": "#e39802", + "pattern": { + "shape": "" + } + }, + "name": "moderate", + "offsetgroup": "moderate", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 2, + 2, + 2, + 2, + 4, + 2, + 4, + 3, + 0, + 3, + 1, + 3, + 3, + 4, + 3, + 2, + 4, + 1, + 3, + 6, + 2, + 4, + 4, + 4, + 4, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 3, + 1, + 3, + 3, + 3, + 2, + 3, + 4, + 3, + 2, + 4, + 2, + 4, + 2, + 3, + 3, + 2, + 2, + 5, + 5, + 4, + 2, + 5, + 2, + 1, + 2, + 3, + 4, + 2, + 3, + 1, + 2, + 2, + 4, + 4, + 3, + 3, + 3, + 2, + 3, + 3, + 1, + 2, + 3, + 4, + 3, + 2, + 2, + 3, + 5, + 1, + 2, + 4, + 1, + 2, + 4, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 3, + 3, + 2, + 2, + 5, + 2, + 0, + 2, + 6, + 2, + 3, + 3, + 3, + 2, + 1, + 2, + 1, + 1, + 2, + 3, + 4, + 2, + 2, + 3, + 2, + 1, + 3, + 1, + 2, + 4, + 3, + 4, + 3, + 3, + 2, + 2, + 4, + 2, + 1, + 2, + 1, + 2, + 3, + 3, + 2, + 2, + 3, + 5, + 4, + 3, + 2, + 2, + 3, + 3, + 3, + 3, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 4, + 2, + 2, + 3, + 4, + 3, + 2, + 3, + 3, + 2, + 2, + 4, + 2, + 3, + 1, + 4, + 3, + 2, + 4, + 2, + 3, + 3, + 3, + 3, + 2, + 4, + 0, + 3, + 2, + 1, + 1, + 2, + 1, + 5, + 2, + 2, + 2, + 3, + 4, + 2, + 3, + 3, + 1, + 4, + 3, + 1, + 6, + 3, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 4, + 4, + 1, + 3, + 3, + 1, + 2, + 4, + 3, + 3, + 3, + 4, + 3, + 3, + 3, + 2, + 4, + 4, + 3, + 3, + 2, + 3, + 6, + 2, + 3, + 2, + 3, + 2, + 2, + 3, + 3, + 3, + 3, + 2, + 2, + 4, + 1, + 4, + 2, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 5, + 2, + 3, + 2, + 1, + 1, + 3, + 3, + 2, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 1, + 3, + 2, + 1, + 3, + 3, + 2, + 2, + 4, + 2, + 4, + 3, + 4, + 1, + 3, + 1, + 4, + 3, + 2, + 3, + 2, + 1, + 2, + 3, + 2, + 2, + 3 + ], + "xaxis": "x", + "yaxis": "y" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Mean: 2.67", + "x": 2.667741935483871, + "xanchor": "left", + "xref": "x", + "xshift": 5, + "y": 300, + "yref": "y" + } + ], + "barmode": "relative", + "legend": { + "title": { + "text": "impact" + }, + "tracegroupgap": 0 + }, + "shapes": [ + { + "line": { + "color": "black", + "dash": "dash", + "width": 3 + }, + "opacity": 1, + "type": "line", + "x0": 2.667741935483871, + "x1": 2.667741935483871, + "y0": 0, + "y1": 300 + } + ], + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "title": { + "text": "Violation frequency - Moderate violations" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 6.99 + ], + "title": { + "text": "number of violations" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 300 + ], + "title": { + "text": "count" + } + } + } + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=minor
number of violations=%{x}
count=%{y}", + "legendgroup": "minor", + "marker": { + "color": "#ffda66", + "pattern": { + "shape": "" + } + }, + "name": "minor", + "offsetgroup": "minor", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 2, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 2, + 1, + 0, + 2, + 0, + 1, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 2, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 2, + 1, + 1, + 2, + 1, + 0, + 0, + 0, + 0, + 2, + 0, + 1, + 1, + 2, + 0, + 1, + 2, + 2, + 0, + 0, + 1, + 0, + 0, + 2, + 2, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 1, + 2, + 0, + 2, + 2, + 1, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 3, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 2, + 0, + 0, + 2, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 1, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 2, + 1, + 0, + 3, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1 + ], + "xaxis": "x", + "yaxis": "y" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Mean: 0.54", + "x": 0.5419354838709678, + "xanchor": "left", + "xref": "x", + "xshift": 5, + "y": 300, + "yref": "y" + } + ], + "barmode": "relative", + "legend": { + "title": { + "text": "impact" + }, + "tracegroupgap": 0 + }, + "shapes": [ + { + "line": { + "color": "black", + "dash": "dash", + "width": 3 + }, + "opacity": 1, + "type": "line", + "x0": 0.5419354838709678, + "x1": 0.5419354838709678, + "y0": 0, + "y1": 300 + } + ], + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "title": { + "text": "Violation frequency - Minor violations" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 6.99 + ], + "title": { + "text": "number of violations" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 300 + ], + "title": { + "text": "count" + } + } + } + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=critical
number of violations=%{x}
count=%{y}", + "legendgroup": "critical", + "marker": { + "color": "#c60a1c", + "pattern": { + "shape": "" + } + }, + "name": "critical", + "offsetgroup": "critical", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 1, + 2, + 2, + 2, + 1, + 2, + 3, + 1, + 0, + 2, + 0, + 2, + 3, + 2, + 3, + 1, + 2, + 5, + 2, + 1, + 1, + 0, + 0, + 0, + 0, + 3, + 2, + 3, + 3, + 4, + 3, + 0, + 3, + 3, + 1, + 2, + 1, + 0, + 3, + 1, + 3, + 1, + 1, + 0, + 4, + 1, + 2, + 0, + 2, + 0, + 0, + 1, + 1, + 2, + 0, + 2, + 0, + 3, + 3, + 4, + 0, + 2, + 1, + 3, + 2, + 1, + 1, + 0, + 5, + 0, + 3, + 3, + 1, + 4, + 3, + 1, + 0, + 1, + 2, + 0, + 1, + 2, + 1, + 0, + 2, + 3, + 2, + 2, + 3, + 2, + 1, + 4, + 1, + 3, + 0, + 2, + 3, + 3, + 0, + 3, + 3, + 3, + 1, + 4, + 3, + 0, + 0, + 3, + 1, + 1, + 3, + 5, + 4, + 0, + 0, + 2, + 0, + 2, + 0, + 0, + 3, + 1, + 3, + 0, + 1, + 3, + 5, + 3, + 0, + 1, + 0, + 2, + 1, + 1, + 2, + 1, + 1, + 2, + 0, + 1, + 1, + 2, + 3, + 1, + 2, + 2, + 3, + 0, + 3, + 3, + 1, + 2, + 1, + 1, + 2, + 0, + 0, + 4, + 2, + 2, + 0, + 2, + 1, + 0, + 0, + 2, + 3, + 1, + 0, + 5, + 0, + 0, + 2, + 2, + 2, + 1, + 3, + 1, + 0, + 2, + 1, + 1, + 2, + 0, + 0, + 1, + 0, + 1, + 1, + 2, + 5, + 3, + 3, + 1, + 0, + 2, + 0, + 1, + 1, + 0, + 3, + 3, + 0, + 1, + 3, + 0, + 1, + 2, + 2, + 2, + 2, + 1, + 3, + 2, + 2, + 0, + 4, + 2, + 1, + 1, + 1, + 2, + 3, + 2, + 2, + 5, + 3, + 2, + 3, + 1, + 0, + 1, + 2, + 3, + 0, + 0, + 1, + 0, + 3, + 1, + 1, + 1, + 2, + 3, + 0, + 1, + 2, + 2, + 0, + 1, + 3, + 2, + 3, + 3, + 2, + 1, + 1, + 2, + 4, + 0, + 0, + 0, + 0, + 0, + 3, + 3, + 1, + 3, + 3, + 3, + 3, + 0, + 1, + 2, + 1, + 3, + 0, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 1, + 3, + 2, + 1, + 3, + 3, + 2, + 0, + 2, + 1, + 0, + 3, + 1, + 0, + 2, + 2, + 3, + 2, + 3 + ], + "xaxis": "x", + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=serious
number of violations=%{x}
count=%{y}", + "legendgroup": "serious", + "marker": { + "color": "#ff684c", + "pattern": { + "shape": "" + } + }, + "name": "serious", + "offsetgroup": "serious", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 1, + 1, + 3, + 1, + 2, + 1, + 1, + 3, + 3, + 3, + 2, + 3, + 3, + 3, + 2, + 1, + 4, + 1, + 5, + 2, + 1, + 4, + 4, + 3, + 3, + 3, + 1, + 3, + 3, + 1, + 2, + 2, + 2, + 1, + 4, + 4, + 4, + 2, + 1, + 2, + 4, + 3, + 0, + 3, + 1, + 4, + 2, + 3, + 3, + 5, + 1, + 2, + 1, + 4, + 1, + 3, + 2, + 1, + 2, + 4, + 3, + 2, + 3, + 1, + 2, + 0, + 2, + 2, + 4, + 4, + 2, + 2, + 3, + 3, + 1, + 3, + 0, + 6, + 3, + 2, + 3, + 5, + 2, + 1, + 1, + 4, + 1, + 2, + 4, + 1, + 1, + 2, + 3, + 4, + 3, + 2, + 2, + 1, + 1, + 1, + 4, + 1, + 3, + 4, + 2, + 4, + 3, + 3, + 6, + 3, + 1, + 2, + 1, + 1, + 2, + 3, + 3, + 4, + 3, + 5, + 2, + 1, + 3, + 1, + 4, + 5, + 3, + 3, + 2, + 3, + 2, + 1, + 4, + 3, + 2, + 2, + 2, + 1, + 0, + 3, + 1, + 1, + 3, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 1, + 2, + 1, + 2, + 3, + 1, + 2, + 4, + 3, + 3, + 1, + 3, + 3, + 0, + 1, + 4, + 1, + 1, + 1, + 5, + 2, + 2, + 3, + 2, + 5, + 6, + 2, + 1, + 1, + 3, + 0, + 3, + 3, + 1, + 1, + 2, + 1, + 1, + 1, + 3, + 3, + 3, + 4, + 2, + 3, + 0, + 1, + 2, + 2, + 0, + 2, + 4, + 1, + 1, + 2, + 3, + 2, + 2, + 2, + 3, + 4, + 4, + 3, + 3, + 2, + 1, + 4, + 3, + 4, + 4, + 1, + 3, + 2, + 3, + 2, + 3, + 4, + 4, + 2, + 1, + 2, + 1, + 6, + 3, + 4, + 1, + 3, + 1, + 1, + 1, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 4, + 2, + 1, + 2, + 4, + 3, + 5, + 2, + 3, + 3, + 4, + 1, + 2, + 0, + 1, + 1, + 2, + 2, + 1, + 3, + 2, + 2, + 3, + 2, + 2, + 5, + 1, + 3, + 4, + 1, + 2, + 2, + 1, + 1, + 3, + 1, + 3, + 3, + 2, + 3, + 1, + 4, + 2, + 2, + 1, + 3, + 3, + 2, + 2, + 1, + 1, + 2, + 4, + 2, + 4, + 2 + ], + "xaxis": "x", + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=moderate
number of violations=%{x}
count=%{y}", + "legendgroup": "moderate", + "marker": { + "color": "#e39802", + "pattern": { + "shape": "" + } + }, + "name": "moderate", + "offsetgroup": "moderate", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 2, + 2, + 2, + 2, + 4, + 2, + 4, + 3, + 0, + 3, + 1, + 3, + 3, + 4, + 3, + 2, + 4, + 1, + 3, + 6, + 2, + 4, + 4, + 4, + 4, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 3, + 1, + 3, + 3, + 3, + 2, + 3, + 4, + 3, + 2, + 4, + 2, + 4, + 2, + 3, + 3, + 2, + 2, + 5, + 5, + 4, + 2, + 5, + 2, + 1, + 2, + 3, + 4, + 2, + 3, + 1, + 2, + 2, + 4, + 4, + 3, + 3, + 3, + 2, + 3, + 3, + 1, + 2, + 3, + 4, + 3, + 2, + 2, + 3, + 5, + 1, + 2, + 4, + 1, + 2, + 4, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 3, + 3, + 2, + 2, + 5, + 2, + 0, + 2, + 6, + 2, + 3, + 3, + 3, + 2, + 1, + 2, + 1, + 1, + 2, + 3, + 4, + 2, + 2, + 3, + 2, + 1, + 3, + 1, + 2, + 4, + 3, + 4, + 3, + 3, + 2, + 2, + 4, + 2, + 1, + 2, + 1, + 2, + 3, + 3, + 2, + 2, + 3, + 5, + 4, + 3, + 2, + 2, + 3, + 3, + 3, + 3, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 4, + 2, + 2, + 3, + 4, + 3, + 2, + 3, + 3, + 2, + 2, + 4, + 2, + 3, + 1, + 4, + 3, + 2, + 4, + 2, + 3, + 3, + 3, + 3, + 2, + 4, + 0, + 3, + 2, + 1, + 1, + 2, + 1, + 5, + 2, + 2, + 2, + 3, + 4, + 2, + 3, + 3, + 1, + 4, + 3, + 1, + 6, + 3, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 4, + 4, + 1, + 3, + 3, + 1, + 2, + 4, + 3, + 3, + 3, + 4, + 3, + 3, + 3, + 2, + 4, + 4, + 3, + 3, + 2, + 3, + 6, + 2, + 3, + 2, + 3, + 2, + 2, + 3, + 3, + 3, + 3, + 2, + 2, + 4, + 1, + 4, + 2, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 5, + 2, + 3, + 2, + 1, + 1, + 3, + 3, + 2, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 2, + 3, + 3, + 1, + 3, + 2, + 1, + 3, + 3, + 2, + 2, + 4, + 2, + 4, + 3, + 4, + 1, + 3, + 1, + 4, + 3, + 2, + 3, + 2, + 1, + 2, + 3, + 2, + 2, + 3 + ], + "xaxis": "x", + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "bingroup": "x", + "hovertemplate": "impact=minor
number of violations=%{x}
count=%{y}", + "legendgroup": "minor", + "marker": { + "color": "#ffda66", + "pattern": { + "shape": "" + } + }, + "name": "minor", + "offsetgroup": "minor", + "orientation": "v", + "showlegend": true, + "type": "histogram", + "x": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 2, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 2, + 1, + 0, + 2, + 0, + 1, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 2, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 2, + 1, + 1, + 2, + 1, + 0, + 0, + 0, + 0, + 2, + 0, + 1, + 1, + 2, + 0, + 1, + 2, + 2, + 0, + 0, + 1, + 0, + 0, + 2, + 2, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 1, + 2, + 0, + 2, + 2, + 1, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 3, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 2, + 0, + 0, + 2, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 1, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 2, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 2, + 1, + 0, + 3, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + 1 + ], + "xaxis": "x", + "yaxis": "y" + } + ], + "layout": { + "annotations": [ + { + "font": { + "size": 16 + }, + "showarrow": false, + "text": "Mean: 7.15", + "x": 4, + "xanchor": "left", + "xref": "x", + "xshift": 5, + "y": 300, + "yref": "y" + } + ], + "barmode": "relative", + "legend": { + "title": { + "text": "impact" + }, + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "rgb(36,36,36)" + }, + "error_y": { + "color": "rgb(36,36,36)" + }, + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "baxis": { + "endlinecolor": "rgb(36,36,36)", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "rgb(36,36,36)" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "line": { + "color": "white", + "width": 0.6 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + }, + "colorscale": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "rgb(237,237,237)" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "rgb(217,217,217)" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 1, + "tickcolor": "rgb(36,36,36)", + "ticks": "outside" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "rgb(103,0,31)" + ], + [ + 0.1, + "rgb(178,24,43)" + ], + [ + 0.2, + "rgb(214,96,77)" + ], + [ + 0.3, + "rgb(244,165,130)" + ], + [ + 0.4, + "rgb(253,219,199)" + ], + [ + 0.5, + "rgb(247,247,247)" + ], + [ + 0.6, + "rgb(209,229,240)" + ], + [ + 0.7, + "rgb(146,197,222)" + ], + [ + 0.8, + "rgb(67,147,195)" + ], + [ + 0.9, + "rgb(33,102,172)" + ], + [ + 1, + "rgb(5,48,97)" + ] + ], + "sequential": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ], + "sequentialminus": [ + [ + 0, + "#440154" + ], + [ + 0.1111111111111111, + "#482878" + ], + [ + 0.2222222222222222, + "#3e4989" + ], + [ + 0.3333333333333333, + "#31688e" + ], + [ + 0.4444444444444444, + "#26828e" + ], + [ + 0.5555555555555556, + "#1f9e89" + ], + [ + 0.6666666666666666, + "#35b779" + ], + [ + 0.7777777777777778, + "#6ece58" + ], + [ + 0.8888888888888888, + "#b5de2b" + ], + [ + 1, + "#fde725" + ] + ] + }, + "colorway": [ + "#1F77B4", + "#FF7F0E", + "#2CA02C", + "#D62728", + "#9467BD", + "#8C564B", + "#E377C2", + "#7F7F7F", + "#BCBD22", + "#17BECF" + ], + "font": { + "color": "rgb(36,36,36)" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "white", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "white", + "polar": { + "angularaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "radialaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "zaxis": { + "backgroundcolor": "white", + "gridcolor": "rgb(232,232,232)", + "gridwidth": 2, + "linecolor": "rgb(36,36,36)", + "showbackground": true, + "showgrid": false, + "showline": true, + "ticks": "outside", + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + }, + "shapedefaults": { + "fillcolor": "black", + "line": { + "width": 0 + }, + "opacity": 0.3 + }, + "ternary": { + "aaxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "baxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + }, + "bgcolor": "white", + "caxis": { + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + }, + "yaxis": { + "automargin": true, + "gridcolor": "rgb(232,232,232)", + "linecolor": "rgb(36,36,36)", + "showgrid": false, + "showline": true, + "ticks": "outside", + "title": { + "standoff": 15 + }, + "zeroline": false, + "zerolinecolor": "rgb(36,36,36)" + } + } + }, + "title": { + "text": "Violation frequency - All violations" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 6.99 + ], + "title": { + "text": "number of violations" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "range": [ + 0, + 300 + ], + "title": { + "text": "count" + } + } + } + } + }, + "metadata": {} + } + ], + "source": [ + "import plotly.express as px\n", + "\n", + "\n", + "violations_impact = (\n", + " violations_100k_main\n", + " .groupby([\n", + " \"municipio\",\n", + " \"IBGE\",\n", + " \"IBGE7\",\n", + " \"UF\",\n", + " \"regiao\",\n", + " \"populacao_2020\",\n", + " \"eh_capital\",\n", + " \"impact\",\n", + " ])[\"id\"]\n", + " # CREDIT: https://stackoverflow.com/a/49128246/7733563\n", + " .count()\n", + " .unstack(fill_value=0)\n", + " .stack()\n", + " .rename(\"num_violacoes\")\n", + " .reset_index()\n", + ")\n", + "\n", + "\n", + "def plot_violations_hist(df: pd.DataFrame, impact_level: str=\"all\"):\n", + " if impact_level != \"all\":\n", + " df = df.copy().query(\"impact == @impact_level\")\n", + " fig = px.histogram(\n", + " df,\n", + " x=\"num_violacoes\",\n", + " color=\"impact\",\n", + " title=f\"Violation frequency - {impact_level.title()} violations\",\n", + " labels={\"num_violacoes\": \"number of violations\"},\n", + " color_discrete_sequence=[\"#c60a1c\", \"#ff684c\", \"#e39802\", \"#ffda66\"],\n", + " category_orders={\n", + " \"impact\": [\"critical\", \"serious\", \"moderate\", \"minor\"]\n", + " },\n", + " template=\"simple_white\",\n", + " range_x=(0, 6.99),\n", + " range_y=(0, 300),\n", + " )\n", + " violations_avg = sum(df[\"num_violacoes\"]) / len(df[\"IBGE\"].unique())\n", + " if impact_level != \"all\":\n", + " annotation_x = violations_avg\n", + " fig.add_shape(\n", + " type=\"line\",\n", + " x0=violations_avg,\n", + " x1=violations_avg,\n", + " y0=0,\n", + " y1=300,\n", + " opacity=1,\n", + " line={\"width\": 3, \"color\": \"black\", \"dash\": \"dash\"},\n", + " )\n", + " else:\n", + " annotation_x = 4\n", + " fig.add_annotation(\n", + " x=annotation_x,\n", + " y=300,\n", + " text=f\"Mean: {round(violations_avg,2)}\",\n", + " xref=\"x\",\n", + " yref=\"y\",\n", + " xanchor=\"left\",\n", + " xshift=5,\n", + " showarrow=False,\n", + " font={\"size\": 16}\n", + " )\n", + " return fig\n", + "\n", + "plot_violations_hist(violations_impact, \"critical\").show()\n", + "plot_violations_hist(violations_impact, \"serious\").show()\n", + "plot_violations_hist(violations_impact, \"moderate\").show()\n", + "plot_violations_hist(violations_impact, \"minor\").show()\n", + "plot_violations_hist(violations_impact, \"all\").show()" + ] + }, + { + "source": [ + "Os dez municípios com maior número de problemas encontrados nos respectivos portais principais são:\n", + "\n", + "1. Natal (RN)\n", + "2. Coronel Fabriciano (MG)\n", + "3. Guarujá (SP)\n", + "4. Franco da Rocha (SP)\n", + "5. Santa Rita (PB)\n", + "6. Açailândia (MA)\n", + "7. Itaboraí (RJ)\n", + "8. Criciúma (SC)\n", + "9. Itu (SP)\n", + "10. Teresópolis (RJ)" + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 159, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "posicao IBGE municipio critical serious moderate minor \\\n", + "0 240810 Natal (RN) 5 5 4 2 \n", + "1 311940 Coronel Fabriciano (MG) 3 6 4 1 \n", + "2 351870 Guarujá (SP) 3 6 3 2 \n", + "3 351640 Franco da Rocha (SP) 3 4 5 2 \n", + "4 251370 Santa Rita (PB) 2 6 6 0 \n", + "5 210005 Açailândia (MA) 5 3 4 1 \n", + "6 330190 Itaboraí (RJ) 4 5 3 1 \n", + "7 420460 Criciúma (SC) 3 5 3 2 \n", + "8 352390 Itu (SP) 3 4 4 2 \n", + "9 330580 Teresópolis (RJ) 3 4 3 3 \n", + "\n", + "posicao total \n", + "0 16 \n", + "1 14 \n", + "2 14 \n", + "3 14 \n", + "4 14 \n", + "5 13 \n", + "6 13 \n", + "7 13 \n", + "8 13 \n", + "9 13 " + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
posicaoIBGEmunicipiocriticalseriousmoderateminortotal
0240810Natal (RN)554216
1311940Coronel Fabriciano (MG)364114
2351870Guarujá (SP)363214
3351640Franco da Rocha (SP)345214
4251370Santa Rita (PB)266014
5210005Açailândia (MA)534113
6330190Itaboraí (RJ)453113
7420460Criciúma (SC)353213
8352390Itu (SP)344213
9330580Teresópolis (RJ)343313
\n
" + }, + "metadata": {}, + "execution_count": 159 + } + ], + "source": [ + "violations_rank = (\n", + " violations_impact\n", + " .pivot(\n", + " index=[\n", + " \"IBGE\",\n", + " \"regiao\",\n", + " \"UF\",\n", + " \"municipio\",\n", + " \"eh_capital\",\n", + " \"populacao_2020\",\n", + " ],\n", + " columns=\"impact\",\n", + " values=\"num_violacoes\",\n", + " )\n", + " .eval(\"total = critical + serious + moderate + minor\")\n", + " .sort_values(\n", + " [\"total\", \"critical\", \"serious\", \"moderate\", \"minor\"], ascending=False\n", + " )\n", + " .reset_index()\n", + " .rename_axis(columns={\"impact\": \"posicao\"})\n", + " .eval(\"critical_or_serious = critical + serious\")\n", + ")\n", + "\n", + "violations_rank.head(10)[[\n", + " \"IBGE\",\n", + " \"municipio\",\n", + " # \"populacao_2020\",\n", + " \"critical\",\n", + " \"serious\",\n", + " \"moderate\",\n", + " \"minor\",\n", + " \"total\",\n", + "]]" + ] + }, + { + "source": [ + "Não existe uma relação significativa entre número de violações sérias e críticas e o tamanho da população (correlação de postos de Spearman = 0,07; p=0,25)." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 191, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "A correlação de postos entre o número de violações sérias ou críticas e o tamanho da população residente é de 0.07 (p=0.25).\nNão é possível descartar que não haja correlação.\n" + ] + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "hovertemplate": "estimated population=%{x}
serious and critical violations=%{y}", + "legendgroup": "", + "marker": { + "color": "#636efa", + "symbol": "circle" + }, + "mode": "markers", + "name": "", + "orientation": "v", + "showlegend": false, + "type": "scatter", + "x": [ + 890480, + 110290, + 322750, + 156492, + 137349, + 113121, + 242543, + 217311, + 175568, + 184240, + 146214, + 133490, + 283620, + 2521564, + 131240, + 131210, + 103800, + 304302, + 699944, + 129606, + 120904, + 105255, + 115337, + 137125, + 130346, + 124159, + 1091737, + 334376, + 198129, + 124883, + 170533, + 119736, + 513118, + 122505, + 240961, + 823302, + 329058, + 102775, + 687357, + 124810, + 105520, + 317915, + 383917, + 407252, + 281046, + 265409, + 117825, + 619609, + 182644, + 123096, + 134293, + 426757, + 276535, + 450785, + 330845, + 194390, + 161957, + 123599, + 332333, + 185706, + 164504, + 144088, + 112500, + 211965, + 256302, + 906092, + 1653461, + 508826, + 391772, + 133031, + 103497, + 108969, + 108192, + 254484, + 112058, + 1499641, + 512902, + 109897, + 105221, + 176688, + 132642, + 217698, + 110983, + 123684, + 211508, + 117703, + 241518, + 159923, + 196500, + 2219580, + 711825, + 511168, + 240590, + 306296, + 817511, + 102004, + 105087, + 230371, + 203251, + 208008, + 699097, + 146005, + 123116, + 259337, + 131626, + 354317, + 103102, + 179028, + 379297, + 151335, + 444784, + 365855, + 293652, + 182153, + 241835, + 116797, + 123389, + 368355, + 1488252, + 123071, + 223112, + 104790, + 664908, + 104783, + 168641, + 134819, + 6747815, + 430157, + 204722, + 115969, + 103672, + 1025360, + 136602, + 132312, + 236042, + 230378, + 413418, + 1213792, + 148130, + 256223, + 729737, + 267036, + 210589, + 177662, + 355901, + 156975, + 105711, + 287526, + 844483, + 308482, + 2686612, + 152549, + 423006, + 118349, + 273988, + 130009, + 535547, + 868075, + 123400, + 527240, + 501325, + 106049, + 477552, + 721368, + 136234, + 145796, + 361855, + 137689, + 181173, + 157349, + 175272, + 250181, + 106422, + 118451, + 165526, + 411807, + 597658, + 142301, + 112003, + 365278, + 234259, + 105809, + 172135, + 413487, + 433656, + 12325232, + 403183, + 210711, + 207044, + 1536097, + 191158, + 122497, + 122833, + 127142, + 123281, + 156126, + 162438, + 107337, + 1392121, + 183381, + 306678, + 539354, + 573285, + 101937, + 300618, + 121335, + 106633, + 247032, + 131365, + 283677, + 141808, + 126866, + 375011, + 126701, + 138204, + 135783, + 122967, + 575377, + 706867, + 590146, + 123747, + 105548, + 213576, + 276264, + 118516, + 924624, + 253608, + 3055149, + 261501, + 246433, + 155193, + 258248, + 341128, + 300559, + 355336, + 152327, + 150658, + 337092, + 1108975, + 170222, + 218162, + 162693, + 464983, + 220444, + 100764, + 184833, + 107341, + 133865, + 242018, + 419652, + 235416, + 153482, + 177633, + 1948626, + 102065, + 102211, + 130539, + 229458, + 213685, + 515317, + 286211, + 142645, + 176569, + 472906, + 159080, + 127027, + 128914, + 283542, + 133685, + 306480, + 115144, + 100346, + 208944, + 158899, + 140577, + 393115, + 233047, + 114396, + 102380, + 126356, + 153033, + 120041, + 211352, + 121803, + 238339, + 668949, + 102701, + 115363, + 139364, + 101395, + 114503, + 103074, + 118370, + 114079, + 139583, + 240408, + 109392, + 338197, + 140937, + 129765, + 246540, + 156174, + 114970, + 348208, + 343132, + 238648, + 618124, + 129823, + 114352, + 170132 + ], + "xaxis": "x", + "y": [ + 10, + 9, + 9, + 7, + 8, + 8, + 9, + 8, + 7, + 7, + 5, + 5, + 5, + 8, + 6, + 7, + 6, + 5, + 5, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 7, + 7, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 7, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 3, + 3, + 5, + 5, + 7, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 6, + 5, + 5, + 4, + 4, + 4, + 2, + 2, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 3, + 3, + 2, + 4, + 3, + 2, + 5, + 5, + 5, + 4, + 4, + 4, + 3, + 5, + 5, + 5, + 4, + 4, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 3, + 3, + 2, + 2, + 2, + 4, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0 + ], + "yaxis": "y" + } + ], + "layout": { + "legend": { + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Number of serious and critical violations, versus city size" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "estimated population" + }, + "type": "log" + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "serious and critical violations" + } + } + } + } + }, + "metadata": {} + } + ], + "source": [ + "from scipy.stats import spearmanr\n", + "populationXviolations_corr = spearmanr(\n", + " violations_rank[[\"populacao_2020\", \"critical_or_serious\"]]\n", + ")\n", + "\n", + "print(\n", + " \"A correlação de postos entre o número de violações sérias ou críticas \"\n", + " \"e o tamanho da população residente é de \"\n", + " f\"{populationXviolations_corr.correlation:.2f} \"\n", + " f\"(p={populationXviolations_corr.pvalue:.2f}).\")\n", + "\n", + "if populationXviolations_corr.pvalue > 0.05:\n", + " print(\"Não é possível descartar que não haja correlação.\")\n", + "\n", + "px.scatter(\n", + " violations_rank,\n", + " x=\"populacao_2020\",\n", + " y=\"critical_or_serious\",\n", + " log_x=True,\n", + " title=\"Number of serious and critical violations, versus city size\",\n", + " labels={\n", + " \"critical_or_serious\": \"serious and critical violations\",\n", + " \"populacao_2020\": \"estimated population\",\n", + " },\n", + ")" + ] + }, + { + "source": [ + "As capitais analisadas possuem, em média, 4,46 erros sérios ou críticos em seus portais (mediana: 5). Os demais municípios possuem uma média um pouco menor - em média, 3,89 erros sérios ou críticos (mediana: 4) -, mas essa diferença não chega a ser estatisticamente significativa." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 193, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "A média de erros sérios ou críticos em capitais é de 4.46 (desvio-padrão: 1.82).\nA média de erros sérios ou críticos em municípios que não são capitais é de 3.89 (desvio-padrão: 2.11).\nNão é possível afirmar que as distribuições são diferentes (p=0.24).\n" + ] + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "boxpoints": "all", + "hovertemplate": "eh_capital=%{x}
serious and critical violations=%{y}", + "legendgroup": "", + "marker": { + "color": "#636efa" + }, + "name": "", + "notched": false, + "offsetgroup": "", + "orientation": "v", + "showlegend": false, + "type": "box", + "x": [ + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + true, + false, + false, + false, + true, + false, + false, + false, + false, + true, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + false, + false, + false + ], + "x0": " ", + "xaxis": "x", + "y": [ + 10, + 9, + 9, + 7, + 8, + 8, + 9, + 8, + 7, + 7, + 5, + 5, + 5, + 8, + 6, + 7, + 6, + 5, + 5, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 7, + 7, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 7, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 3, + 3, + 5, + 5, + 7, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 6, + 5, + 5, + 4, + 4, + 4, + 2, + 2, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 3, + 3, + 2, + 4, + 3, + 2, + 5, + 5, + 5, + 4, + 4, + 4, + 3, + 5, + 5, + 5, + 4, + 4, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 3, + 3, + 2, + 2, + 2, + 4, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0 + ], + "y0": " ", + "yaxis": "y" + } + ], + "layout": { + "boxmode": "group", + "legend": { + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Number of serious and critical violations - capitals versus non-capital cities" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "eh_capital" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "serious and critical violations" + } + } + } + } + }, + "metadata": {} + } + ], + "source": [ + "from scipy.stats import mannwhitneyu\n", + "\n", + "critical_or_serious_capitals = (\n", + " violations_rank.query(\"eh_capital\")[\"critical_or_serious\"]\n", + ")\n", + "critical_or_serious_noncapitals = (\n", + " violations_rank.query(\"not eh_capital\")[\"critical_or_serious\"]\n", + ")\n", + "\n", + "print(\n", + " \"A média de erros sérios ou críticos em capitais é de\",\n", + " f\"{critical_or_serious_capitals.mean().round(2)}\",\n", + " f\"(desvio-padrão: {critical_or_serious_capitals.std().round(2)}).\"\n", + ")\n", + "\n", + "print(\n", + " \"A média de erros sérios ou críticos em municípios que não são capitais\",\n", + " f\"é de {critical_or_serious_noncapitals.mean().round(2)}\",\n", + " f\"(desvio-padrão: {critical_or_serious_noncapitals.std().round(2)}).\"\n", + ")\n", + "\n", + "capitalsXnoncapitals_pvalue = (\n", + " mannwhitneyu(critical_or_serious_capitals, critical_or_serious_noncapitals)\n", + " .pvalue\n", + ")\n", + "\n", + "if capitalsXnoncapitals_pvalue > 0.05:\n", + " print(\n", + " \"Não é possível afirmar que as distribuições são diferentes\",\n", + " f\"(p={capitalsXnoncapitals_pvalue:.2f}).\"\n", + " )\n", + "\n", + "px.box(\n", + " violations_rank,\n", + " x=\"eh_capital\",\n", + " y=\"critical_or_serious\",\n", + " points=\"all\",\n", + " title=(\n", + " \"Number of serious and critical violations - capitals versus \"\n", + " \"non-capital cities\"\n", + " ),\n", + " labels={\n", + " \"critical_or_serious\": \"serious and critical violations\",\n", + " \"populacao_2020\": \"estimated population\",\n", + " },\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 199, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "0 Região Nordeste\n", + "1 Região Sudeste\n", + "2 Região Sudeste\n", + "3 Região Sudeste\n", + "4 Região Nordeste\n", + " ... \n", + "305 Região Sul\n", + "306 Região Centro-Oeste\n", + "307 Região Centro-Oeste\n", + "308 Região Sudeste\n", + "309 Região Sudeste\n", + "Name: regiao, Length: 310, dtype: object" + ] + }, + "metadata": {}, + "execution_count": 199 + } + ], + "source": [ + "violations_rank[\"regiao\"]" + ] + }, + { + "source": [ + "As regiões com as maiores médias e medianas de problemas críticos ou graves encontrados são Sudeste (média: 4.48; mediana: 5) e Centro-Oeste (média: 4.22; mediana: 5).\n", + "\n", + "Se destacam com as menores proporções de erros críticos ou graves as regiões Norte (média: 2,93; mediana: 3) e Nordeste (média: 3,47; mediana: 3)." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 225, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "A média de erros sérios ou críticos para a Região Norte é de 2.93 (mediana: 3).\nA média de erros sérios ou críticos para a Região Nordeste é de 3.47 (mediana: 3).\nA média de erros sérios ou críticos para a Região Centro-Oeste é de 4.22 (mediana: 5).\nA média de erros sérios ou críticos para a Região Sudeste é de 4.48 (mediana: 5).\nA média de erros sérios ou críticos para a Região Sul é de 3.39 (mediana: 4).\nÉ possível afirmar que pelo menos uma das regiões têm mediana distinta das demais (p=6.6e-05)\n" + ] + }, + { + "output_type": "display_data", + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "boxpoints": "all", + "hovertemplate": "regiao=%{x}
serious and critical violations=%{y}", + "legendgroup": "", + "marker": { + "color": "#636efa" + }, + "name": "", + "notched": false, + "offsetgroup": "", + "orientation": "v", + "showlegend": false, + "type": "box", + "x": [ + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sul", + "Região Norte", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Centro-Oeste", + "Região Nordeste", + "Região Sul", + "Região Centro-Oeste", + "Região Nordeste", + "Região Norte", + "Região Norte", + "Região Nordeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Norte", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Nordeste", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Nordeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sul", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Norte", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Centro-Oeste", + "Região Sudeste", + "Região Nordeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sul", + "Região Nordeste", + "Região Centro-Oeste", + "Região Nordeste", + "Região Sudeste", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Nordeste", + "Região Sudeste", + "Região Sul", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sudeste", + "Região Norte", + "Região Sudeste", + "Região Nordeste", + "Região Sudeste", + "Região Sul", + "Região Centro-Oeste", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sudeste", + "Região Sudeste", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Norte", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Nordeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sudeste", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Sul", + "Região Centro-Oeste", + "Região Centro-Oeste", + "Região Sudeste", + "Região Sudeste" + ], + "x0": " ", + "xaxis": "x", + "y": [ + 10, + 9, + 9, + 7, + 8, + 8, + 9, + 8, + 7, + 7, + 5, + 5, + 5, + 8, + 6, + 7, + 6, + 5, + 5, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 7, + 7, + 7, + 6, + 6, + 6, + 6, + 7, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 7, + 6, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 3, + 3, + 5, + 5, + 7, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 6, + 5, + 5, + 4, + 4, + 4, + 2, + 2, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 3, + 3, + 2, + 4, + 3, + 2, + 5, + 5, + 5, + 4, + 4, + 4, + 3, + 5, + 5, + 5, + 4, + 4, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 3, + 3, + 2, + 2, + 2, + 4, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0 + ], + "y0": " ", + "yaxis": "y" + } + ], + "layout": { + "boxmode": "group", + "legend": { + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Number of serious and critical violations per region" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "regiao" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "serious and critical violations" + } + } + } + } + }, + "metadata": {} + } + ], + "source": [ + "from scipy.stats import kruskal\n", + "\n", + "critical_or_serious_regions = list()\n", + "\n", + "for region in [\"Norte\", \"Nordeste\", \"Centro-Oeste\", \"Sudeste\", \"Sul\"]:\n", + " critical_or_serious_region = (\n", + " violations_rank\n", + " .query(\n", + " \"regiao.str.contains(@region)\", engine=\"python\"\n", + " )[\"critical_or_serious\"]\n", + " )\n", + " critical_or_serious_regions.append(critical_or_serious_region)\n", + " print(\n", + " f\"A média de erros sérios ou críticos para a Região {region} é de \"\n", + " f\"{critical_or_serious_region.mean():.2f} (mediana: \"\n", + " f\"{critical_or_serious_region.median():.0f}).\"\n", + " )\n", + "\n", + "regions_kruskal = kruskal(*critical_or_serious_regions)\n", + "\n", + "if regions_kruskal.pvalue <= 0.05:\n", + " print(\n", + " \"É possível afirmar que pelo menos uma das regiões têm mediana \"\n", + " f\"distinta das demais (p={regions_kruskal.pvalue:.1e})\"\n", + " )\n", + "\n", + "px.box(\n", + " violations_rank,\n", + " x=\"regiao\",\n", + " y=\"critical_or_serious\",\n", + " points=\"all\",\n", + " title=\"Number of serious and critical violations per region\",\n", + " labels={\n", + " \"critical_or_serious\": \"serious and critical violations\",\n", + " \"populacao_2020\": \"estimated population\",\n", + " },\n", + ")" + ] + }, + { + "source": [ + "### Análise das violações mais comuns no recorte\n", + "\n", + "As cinco violações mais comuns são:\n", + "\n", + "1. a falta de uso de seções para indicar as partes principais da página, dificultando o reconhecimento e navegação com leitor de telas;\n", + "2. a ausência de uma seção principal que indique a parte relevante do conteúdo na página, também dificultando o reconhecimento e navegação com leitor de telas;\n", + "3. o uso de combinações de cores com pouco contraste entre o texto e o fundo, dificultando a leitura por pessoas com baixa visão;\n", + "4. a ausência de legendas para elementos de formulário, dificultando fortemente o correto preenchimento por pessoas que utilizam leitores de tela;\n", + "5. links sem texto passível de visualização por leitores de tela, dificultando a navegação por usuários dessa tecnologia assistiva." + ], + "cell_type": "markdown", + "metadata": {} + }, + { + "cell_type": "code", + "execution_count": 227, + "metadata": {}, + "outputs": [], + "source": [ + "common_violations = (\n", + " violations_100k_main.value_counts([\"id\"])\n", + " .rename(\"num_occurences\")\n", + " .to_frame()\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 226, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " help \\\n", + "id \n", + "region All page content must be contained by landmarks \n", + "landmark-one-main Page must have one main landmark \n", + "color-contrast Elements must have sufficient color contrast \n", + "label Form elements must have labels \n", + "label Form elements must have labels \n", + "page-has-heading-one Page must contain a level-one heading \n", + "link-name Links must have discernible text \n", + "image-alt Images must have alternate text \n", + "html-has-lang element must have a lang attribute \n", + "aria-allowed-role ARIA role must be appropriate for the element \n", + "heading-order Heading levels should only increase by one \n", + "button-name Buttons must have discernible text \n", + "button-name Buttons must have discernible text \n", + "meta-viewport Zooming and scaling must not be disabled \n", + "duplicate-id id attribute value must be unique \n", + "\n", + " impact num_occurences \\\n", + "id \n", + "region moderate 270 \n", + "landmark-one-main moderate 263 \n", + "color-contrast serious 234 \n", + "label critical 165 \n", + "label serious 165 \n", + "page-has-heading-one moderate 141 \n", + "link-name serious 141 \n", + "image-alt critical 118 \n", + "html-has-lang serious 117 \n", + "aria-allowed-role minor 89 \n", + "heading-order moderate 76 \n", + "button-name critical 73 \n", + "button-name serious 73 \n", + "meta-viewport critical 63 \n", + "duplicate-id minor 58 \n", + "\n", + " helpUrl \n", + "id \n", + "region https://dequeuniversity.com/rules/axe/3.1/regi... \n", + "landmark-one-main https://dequeuniversity.com/rules/axe/3.1/land... \n", + "color-contrast https://dequeuniversity.com/rules/axe/3.1/colo... \n", + "label https://dequeuniversity.com/rules/axe/3.1/labe... \n", + "label https://dequeuniversity.com/rules/axe/3.1/labe... \n", + "page-has-heading-one https://dequeuniversity.com/rules/axe/3.1/page... \n", + "link-name https://dequeuniversity.com/rules/axe/3.1/link... \n", + "image-alt https://dequeuniversity.com/rules/axe/3.1/imag... \n", + "html-has-lang https://dequeuniversity.com/rules/axe/3.1/html... \n", + "aria-allowed-role https://dequeuniversity.com/rules/axe/3.1/aria... \n", + "heading-order https://dequeuniversity.com/rules/axe/3.1/head... \n", + "button-name https://dequeuniversity.com/rules/axe/3.1/butt... \n", + "button-name https://dequeuniversity.com/rules/axe/3.1/butt... \n", + "meta-viewport https://dequeuniversity.com/rules/axe/3.1/meta... \n", + "duplicate-id https://dequeuniversity.com/rules/axe/3.1/dupl... " + ], + "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
helpimpactnum_occurenceshelpUrl
id
regionAll page content must be contained by landmarksmoderate270https://dequeuniversity.com/rules/axe/3.1/regi...
landmark-one-mainPage must have one main landmarkmoderate263https://dequeuniversity.com/rules/axe/3.1/land...
color-contrastElements must have sufficient color contrastserious234https://dequeuniversity.com/rules/axe/3.1/colo...
labelForm elements must have labelscritical165https://dequeuniversity.com/rules/axe/3.1/labe...
labelForm elements must have labelsserious165https://dequeuniversity.com/rules/axe/3.1/labe...
page-has-heading-onePage must contain a level-one headingmoderate141https://dequeuniversity.com/rules/axe/3.1/page...
link-nameLinks must have discernible textserious141https://dequeuniversity.com/rules/axe/3.1/link...
image-altImages must have alternate textcritical118https://dequeuniversity.com/rules/axe/3.1/imag...
html-has-lang<html> element must have a lang attributeserious117https://dequeuniversity.com/rules/axe/3.1/html...
aria-allowed-roleARIA role must be appropriate for the elementminor89https://dequeuniversity.com/rules/axe/3.1/aria...
heading-orderHeading levels should only increase by onemoderate76https://dequeuniversity.com/rules/axe/3.1/head...
button-nameButtons must have discernible textcritical73https://dequeuniversity.com/rules/axe/3.1/butt...
button-nameButtons must have discernible textserious73https://dequeuniversity.com/rules/axe/3.1/butt...
meta-viewportZooming and scaling must not be disabledcritical63https://dequeuniversity.com/rules/axe/3.1/meta...
duplicate-idid attribute value must be uniqueminor58https://dequeuniversity.com/rules/axe/3.1/dupl...
\n
" + }, + "metadata": {}, + "execution_count": 226 + } + ], + "source": [ + "# separate descriptions for violations that occoured among the portals\n", + "violations_descr = (\n", + " violations_100k_main\n", + " .groupby([\"id\", \"help\", \"description\", \"impact\", \"helpUrl\", \"tags\"])\n", + " .first()\n", + " .reset_index([\"help\", \"description\", \"impact\", \"helpUrl\", \"tags\"])\n", + ")\n", + "\n", + "# list violations by frequency\n", + "(\n", + " violations_descr\n", + " .merge(common_violations, on=\"id\")\n", + " [[\"help\", \"impact\", \"num_occurences\"]]\n", + " .sort_values(\"num_occurences\", ascending=False)\n", + " .head(15)\n", + ")" + ] + } + ] +} \ No newline at end of file