Meteorite Landings Visualization with Preswald

Amrutha GujjarAmrutha Gujjarβ€’β€’3 min read

Category: Community


We're thrilled to feature Shrenik Borad in this edition of the Preswald Community Showcase! πŸŽ‰ Shrenik has crafted an educational and visually rich Preswald app that analyzes meteorite landings around the globe, uncovering patterns in mass, time, and geography.

🌟 Project Overview

πŸ“Š Preswald and Meteorite Analytics

This blog explores how Preswald is used to build an interactive dashboard around NASA's meteorite landings data, helping users explore thousands of meteorite records by mass, location, and year.

Project Name: Meteorite Landings Dashboard
Built by: Shrenik Borad
Dataset: NASA Meteorite Landings Dataset
Live App: Meteorite Dashboard

πŸ“Š Description

Shrenik's project allows users to:

  • β˜„οΈ Filter meteorites by minimum mass using a slider

  • 🌍 Explore global distribution with an interactive map

  • πŸ”’ View the top 10 heaviest meteorites

  • πŸ“… Analyze meteorite landings by year with a line chart

Using Preswald, Shrenik brings planetary science to life with stunning visuals and easy-to-use filtering tools, all powered by Python.


πŸš€ Code Snippets

Load and Preprocess Meteorite Data

from preswald import text, plotly, connect, get_df, table, slider, query
import pandas as pd
import plotly.express as px

text("# β˜„οΈ Meteorite Landings Analysis")
connect()
df = get_df('Meteorite_Landings_csv')

# Clean and preprocess
df["mass (g)"] = pd.to_numeric(df["mass (g)"], errors="coerce")
df["year"] = pd.to_datetime(df["year"], errors="coerce").dt.year
df = df.dropna(subset=["reclat", "reclong", "mass (g)", "year"])

Filter by Minimum Mass and Plot Locations

min_mass = slider("Select Minimum Meteorite Mass (grams)", min_val=0, max_val=50000, default=1000)
sql_query_filtered = f'SELECT * FROM Meteorite_Landings_csv WHERE "mass (g)" > {min_mass}'
filtered_df = query(sql_query_filtered, "Meteorite_Landings_csv")

fig = px.scatter_geo(
    filtered_df,
    lat="reclat",
    lon="reclong",
    size="mass (g)",
    color="mass (g)",
    hover_name="name",
    title="🌍 Meteorite Landings Across the Globe",
    projection="natural earth"
)
plotly(fig)

Top 10 Heaviest Meteorites

sql_query_top10 = 'SELECT name, "mass (g)" FROM Meteorite_Landings_csv ORDER BY "mass (g)" DESC LIMIT 10'
top_10_df = query(sql_query_top10, "Meteorite_Landings_csv")

fig_bar = px.bar(
    top_10_df,
    x="name",
    y="mass (g)",
    title="πŸ’₯ Top 10 Heaviest Meteorites"
)
plotly(fig_bar)

Yearly Trend of Meteorite Landings

sql_query_yearly = "SELECT year, COUNT(*) as count FROM Meteorite_Landings_csv GROUP BY year ORDER BY year"
yearly_df = query(sql_query_yearly, "Meteorite_Landings_csv")

fig_line = px.line(
    yearly_df,
    x="year",
    y="count",
    title="πŸ“† Meteorite Landings Over Time",
    markers=True
)
plotly(fig_line)

πŸ“Š Key Insights

  • β˜„οΈ Meteorites have landed all over the globe with variable frequency

  • 🌍 Heaviest landings tend to be well-documented and clustered

  • πŸ“Š A rise in observations appears post-20th century

  • βš–οΈ Most meteorites fall under 10,000g, with a few massive outliers


πŸ“Š What is Preswald?

Preswald is an open-source framework for building data apps, dashboards, and internal tools with just Python. It enables developers to turn any analysis script into a shareable app, with UI components like tables, charts, and forms.

Key Features

  • Visual apps from pure Python code

  • Automatic UI generation and interactivity

  • Simple one-line cloud deployment

  • Real-time filtering with dynamic updates


πŸš€ Getting Started

Installation

pip install preswald

Start a Project

preswald init my_project
cd my_project
preswald run

Deploy

preswald deploy --target structured

Huge Thanks to Shrenik Borad!

A huge thank you to Shrenik Borad for bringing space science down to Earth with this immersive meteorite dashboard. Check out more of Shrenik's work:

Want to Contribute?

Got a cool idea for a Preswald app? We'd love to see it! Get started here: https://github.com/StructuredLabs/preswald and get featured in our next Community Showcase.

Happy building! πŸš€