Skip to content

Instantly share code, notes, and snippets.

@nathanmrtns
Last active November 9, 2017 02:04
Show Gist options
  • Select an option

  • Save nathanmrtns/19ff137d1235d95c7f54d138d84f3f90 to your computer and use it in GitHub Desktop.

Select an option

Save nathanmrtns/19ff137d1235d95c7f54d138d84f3f90 to your computer and use it in GitHub Desktop.

Revisions

  1. nathanmrtns renamed this gist Nov 9, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion README.Rmd
    Original file line number Diff line number Diff line change
    @@ -1 +1,8 @@
    Visualização na qual podemos ver o percentual de volume do açude de boqueirão ao longo dos anos
    Visualização na qual podemos ver o percentual de volume do açude de boqueirão ao longo dos anos.

    É possível perceber que a seca é algo que a seca atual é um fenomeno que está se repetindo, pois em 98 houve uma seca na qual o volume chegou aos 20% do seu volume total.

    Levando em consideração os dados do gráfico, pode-se considerar que:
    1 - Esta seca que começou em 2016, poderá durar cerca de 5 anos.
    2 - Ao recuperar seu volume, pode ser que o açude mantenha um volume estável num período de mais ou menos 10 anos.
    3 - Podemos observar que no ano 1990, 2004 e 2011 o açude estava com seu volume próximo a 100% do seu volume total.
  3. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions lab1.json
    Original file line number Diff line number Diff line change
    @@ -5,13 +5,15 @@
    "url":"https://api.insa.gov.br/reservatorios/12172/monitoramento",
    "format": {
    "type": "json",
    "property": "volumes"
    "property": "volumes",
    "parse": {
    "DataInformacao": "utc:'%d/%m/%Y'"
    }
    }
    },
    "mark":"area",
    "encoding": {
    "x": {
    "field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "x": {"field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "axis":{
    "title": "Ano"
    }
    @@ -21,6 +23,6 @@
    "axis":{
    "title": "Volume (%)"
    }
    }
    }
    }
    }
  4. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,6 @@

    <body>
    <div id="vis"></div>

    <script>
    const spec = "lab1.json";
    vegaEmbed('#vis', spec).catch(console.warn);
  5. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion lab1.json
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@
    "x": {
    "field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "axis":{
    "title": "Data(ano)"
    "title": "Ano"
    }
    },
    "y": {
  6. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions lab1.json
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,10 @@
    },
    "mark":"area",
    "encoding": {
    "x": {"field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "x": {
    "field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "axis":{
    "title": "Data"
    "title": "Data(ano)"
    }
    },
    "y": {
  7. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.Rmd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Visualização na qual podemos ver o percentual de volume do açude de boqueirão ao longo dos anos
  8. nathanmrtns revised this gist Nov 7, 2017. 1 changed file with 25 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions lab1.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    {
    "width":700,
    "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
    "data": {
    "url":"https://api.insa.gov.br/reservatorios/12172/monitoramento",
    "format": {
    "type": "json",
    "property": "volumes"
    }
    },
    "mark":"area",
    "encoding": {
    "x": {"field": "DataInformacao", "type": "temporal", "timeUnit": "year",
    "axis":{
    "title": "Data"
    }
    },
    "y": {
    "field": "VolumePercentual", "type": "quantitative",
    "axis":{
    "title": "Volume (%)"
    }
    }
    }
    }
  9. nathanmrtns renamed this gist Nov 7, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. nathanmrtns created this gist Nov 7, 2017.
    21 changes: 21 additions & 0 deletions lab1web.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <!DOCTYPE html>
    <head>
    <meta charset="utf-8">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.6/vega.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.0-rc5/vega-lite.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-rc6/vega-embed.js"></script>
    <style>
    body {
    font-family: sans-serif;
    }
    </style>
    </head>

    <body>
    <div id="vis"></div>

    <script>
    const spec = "lab1.json";
    vegaEmbed('#vis', spec).catch(console.warn);
    </script>
    </body>