Public
Edited
Jun 6
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
data = require('vega-datasets')
Insert cell
vegaLite = require("vega-lite@5")
Insert cell
vega = require("vega@5")
Insert cell
vegaEmbed = require("vega-embed@6")
Insert cell
dadosUrl = "https://raw.githubusercontent.com/Aphrody1/TrabalhoDePandas/refs/heads/main/Reservatorios_processado_virgula.csv"
Insert cell
reservatorios = d3.csv(dadosUrl, d3.autoType)
Insert cell
vlmarkCirle = require("vega-markCircle@5")
Insert cell
reservatorios
Insert cell
Insert cell
vl.markBar()
.data(reservatorios)
.encode(
vl.x().fieldN("nom_subsistema").title("Subsistema"),
vl.y().count().title("Número de Reservatórios"))
.width(400)
.height(300)
.title("Número de Reservatórios por Subsistema")
.render()
Insert cell
vl.markBar()
.data(reservatorios)
.encode(
vl.x().fieldN("nom_bacia").title("Bacia Hidrográfica").sort("-y"),
vl.y().count().title("Número de Reservatórios"),
vl.color().fieldN("nom_bacia").legend(null)
)
.width(600)
.height(300)
.title("Número de Reservatórios por Bacia Hidrográfica")
.render()
Insert cell
vl.markCircle({ size: 80 })
.data(reservatorios)
.encode(
vl.longitude().fieldQ("val_longitude"),
vl.latitude().fieldQ("val_latitude"),
vl.tooltip(["nom_reservatorio", "nom_bacia", "val_volutiltot"]),
vl.color().fieldN("nom_subsistema").title("Subsistema")
)
.width(600)
.height(400)
.title("Distribuição Geográfica dos Reservatórios")
.config({
projection: { type: "mercator" }
})
.render()

Insert cell
vl.markCircle({size: 60})
.data(reservatorios)
.encode(
vl.x().fieldQ("val_volmax").title("Volume Máximo (hm³)").scale({zero: false}),
vl.y().fieldQ("val_volutiltot").title("Volume Útil Total (hm³)").scale({zero: false}),
vl.tooltip(["nom_reservatorio", "val_volmax", "val_volutiltot"]),
vl.color().fieldN("nom_subsistema").title("Subsistema")
)
.width(500)
.height(400)
.title("Volume Útil Total vs Volume Máximo por Reservatório")
.render()
Insert cell
vl.markCircle({size: 80})
.data(reservatorios)
.encode(
vl.longitude().fieldQ("val_longitude"),
vl.latitude().fieldQ("val_latitude"),
vl.color().fieldN("tip_reservatorio").title("Tipo de Reservatório"),
vl.tooltip(["nom_reservatorio", "tip_reservatorio", "val_latitude", "val_longitude"])
)
.width(600)
.height(400)
.title("Distribuição Geográfica dos Reservatórios por Tipo")
.render()
Insert cell
vl.markBar()
.data(reservatorios)
.encode(
vl.x().fieldN("nom_bacia").title("Bacia Hidrográfica").sort("-y"),
vl.y().sum("val_volutiltot").title("Volume Útil Total"),
vl.color().fieldN("nom_bacia").legend(null)
)
.width(500)
.height(300)
.title("Volume Útil Total por Bacia Hidrográfica")
.render()
Insert cell
vl.markBoxplot()
.data(reservatorios)
.encode(
vl.x().fieldN("tip_reservatorio").title("Tipo de Reservatório"),
vl.y().fieldQ("val_volmax").title("Volume Máximo"),
vl.color().fieldN("tip_reservatorio").legend(null)
)
.width(500)
.height(300)
.title("Distribuição de Volume Máximo por Tipo de Reservatório")
.render()
Insert cell
reservatorios

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more