# -----------------------------
# Dhaka Hepatitis map — no CSV needed
# -----------------------------
library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
# ডেটা সরাসরি কোডের মধ্যে
data <- data.frame(
  Year = c(2025,2025,2025,2025,2025,2025,2025),
  Thana = c("Dhanmondi","Uttara","Mirpur","Mohammadpur","Badda","Tejgaon","Khilgaon"),
  Disease = c("Hepatitis A","Hepatitis A","Hepatitis A","Hepatitis B","Hepatitis B","Hepatitis A","Hepatitis B"),
  Cases = c(200,180,210,160,300,180,320),
  Latitude = c(23.738,23.875,23.810,23.760,23.780,23.755,23.750),
  Longitude = c(90.377,90.385,90.366,90.358,90.420,90.395,90.425)
)

# ggplot দিয়ে পয়েন্ট ম্যাপ
ggplot(data, aes(x = Longitude, y = Latitude)) +
  geom_point(aes(size = Cases, color = Disease), alpha = 0.75) +
  geom_text(aes(label = Thana), hjust = -0.05, vjust = -0.4, size = 3) +
  scale_color_manual(values = c("Hepatitis A" = "#1f77b4", "Hepatitis B" = "#d62728")) +
  theme_minimal() +
  coord_fixed() +
  labs(title = "Hepatitis A & B cases in Dhaka (2025)", x = "Longitude", y = "Latitude")

library(leaflet)

data <- data.frame(
  Thana = c("Dhanmondi","Uttara","Mirpur","Mohammadpur","Badda","Tejgaon","Khilgaon"),
  Disease = c("Hepatitis A","Hepatitis A","Hepatitis A","Hepatitis B","Hepatitis B","Hepatitis A","Hepatitis B"),
  Cases = c(200,180,210,160,300,180,320),
  Latitude = c(23.738,23.875,23.810,23.760,23.780,23.755,23.750),
  Longitude = c(90.377,90.385,90.366,90.358,90.420,90.395,90.425)
)

pal <- colorFactor(c("#1f77b4", "#d62728"), domain = c("Hepatitis A", "Hepatitis B"))

leaflet(data) %>%
  addTiles() %>%
  addCircleMarkers(
    ~Longitude, ~Latitude,
    radius = ~sqrt(Cases)/2,
    color = ~pal(Disease),
    popup = ~paste0("<b>", Thana, "</b><br>", Disease, "<br>Cases: ", Cases)
  ) %>%
  addLegend("bottomright", pal = pal, values = ~Disease, title = "Disease")