Data Visualization Prompt Guide
2025-07-136 turns19,470 charsgpt-4o
Summary
User seeks guidance on creating Python-based data visualization prompts for supply chain Sankey diagrams.
Messages
Objective
IMPORTANT UPDATE AS OF JULY 12TH:
We are looking into the issues with the upload script. Please wait for further instructions. Thank you!
This is a Python evaluation focused on data visualization and storytelling: given a type of plot (dashboard, Sankey diagram, etc.), your task is to recreate a similar visual that tells the same story using a dummy dataset and Python scripts for data generation and visualization. You will also write an input prompt that would naturally produce the visual you created.
Walkthrough Video: [Evaluation Labeling Instructions] Python Visualization - Jul Update
Labeling Steps
1. Find and Analyze the Dashboard/Graph
The data row begins with searching the web for a reference image of a business-related dashboard or graph that matches the chart description you are given. For example, you may search for something such as “dashboard for business software”.
When you find a reference image, you will need to obtain the direct URL to the image itself. You can do this by right-clicking on the image and selecting “Copy Image Address”.
Carefully inspect your reference image. Your objective is to creatively expand on this reference image, capturing the core features while developing datasets and visualizations that reflect real-world situations.
2. Generate a Prompt
Write a simple user-style question or instruction that the reference image would answer. This prompt frames the data story and helps guide your synthetic data generation:
The prompt should not be very specific and can be open-ended.
The prompt should not specify a lot of formatting requirements.
The prompt must be natural and practical, reflecting the kind of questions a user might realistically ask in a real-world scenario.
Prompt Examples
Below are some examples of good prompts along with the story and visuals related to them. These are for inspiration only and you should not directly use them:
Prompt Topic
Story & Visuals
“Show how global electric-vehicle (EV) adoption has evolved since 2015 and predict the next five years.”
• Multi-line time-series of unit sales by region
• Stacked area of battery chemistries
• Sankey of supply-chain flows
• Heat-map of EV market-share by country
“Analyze hospital network capacity vs. infectious-disease outbreaks during winter seasons.”
• Dual-axis line (ICU beds vs. cases)
• Correlation heat-map of symptoms & test positivity
• Box-whisker of LOS by diagnosis group
“Contrast same-day vs. two-day e-commerce delivery performance during holiday peaks.”
• Violin plot of delivery times
• Pareto of top delay causes
• Time-series forecast of warehouse backlog
“Track sustainable-aviation-fuel (SAF) usage across the airline industry and project carbon savings.”
• Waterfall of CO₂ reductions
• Treemap of SAF feedstocks
• Monte Carlo projection of carbon offset targets
“Visualise smart-city energy flows between residential, commercial, and EV charging nodes.”
• Chord diagram of kWh transfers
• Area chart of renewables vs. grid demand
• Animated map of substation loads by hour
“Evaluate multi-modal public-transport punctuality and rider sentiment in megacities.”
• Box-plot of lateness by mode (bus, metro, rail)
• Word-cloud & sentiment drill-down
• Gantt of headways over 24 h
“Benchmark fintech fraud-detection algorithms across geographies and transaction types.”
• ROC curves for each model
• Confusion-matrix heat-maps
• KPI bullet charts for latency & cost
“Map food-delivery fleet efficiency vs. weather impacts in dense urban zones.”
• Scatter of drop-offs vs. travel km
• Histogram of idle minutes per driver
• Isochrone map overlaying rainfall intensity
“Identify semiconductor-fab yield losses and correlate with equipment maintenance logs.”
• Stacked bar of defect classes
• Control chart of daily yields
• Network graph of tool dependencies
“Forecast coastal-city real-estate risk under sea-level-rise scenarios to 2100.”
• Scenario fan-chart of property values
• Choropleth of flood exposure zones
• Animated slider of shoreline retreat
3. Generate Data To Tell the Business Story
Write a data creation script within the scripts folder (../scripts/data_gen.py) that:
Uses only pandas and numpy.
Generates at least two datasets (as DataFrames or Numpy arrays) into the data folder, such as (../data/sales_data.csv and ../data/local_sales_data.csv)
Tells a similar story based on your reference image, reflects real-world situations, and contains enough detail to fully recreate the image.
4. Recreate the Visualization
Write a visualization script within the scripts folder (../scripts/viz.py) that:
Uses only pandas, numpy, and plotly (library is known as dash)
You can use the pip install dash command to install Plotly Dash.
Reads the generated files from your data creation script.
Generates one HTML file of an interactive dashboard into the outputs folder (../outputs/golden_image.html) using Plotly's HTML export method.
Works and can be interacted with properly.
Contains visuals that adhere to the following style guidelines:
Typography: Titles MUST be bold, and properly formatted legends and labels.
Aesthetics: Organize layout using visual containers (e.g., cards, sections). Use depth thoughtfully via shadows or gradients to create visual hierarchy. We do not want flat images.
Storytelling: Establish a clear narrative flow: start with high-level KPIs, then drill into details. Data elements should feel connected and purposeful, not isolated or random.
Complexity: Dashboards must follow the level of complexity found here. Dashboard complexity should match the visual density and insight variety shown in the provided reference. Avoid oversimplification.
Layout: No overlapping elements or cut-off text. Ensure consistent padding, margin, and spacing between plots.
Legends: If a legend is present, ensure it is clearly displayed and boxed if appropriate. Use well-organized legend placement with appropriate spacing.
Color Palette: Use a professional and aesthetically pleasing color scheme. The color palette should complement the data and enhance readability.
Overall Quality: The final plot should be polished and suitable for a presentation or publication.
5. Upload Files
This step is very important to save your work.
Download this .zip file, which contains an updated version of the upload script, as of July 8th: https://drive.google.com/file/d/1MjOgZaXfzaIPfVXgwxtllmYH4rpOrqh8/view?usp=sharing
Open the file and enter the password, which is scatter.
Place the upload.py script into the root directory of your project.
Install the required libraries with pip install google-cloud-storage google-auth
Run the script and follow the instructions that it provides within your terminal.
IMPORTANT UPDATE: You will have to enter in a unique UUID instead of a data row ID. You can use https://www.uuidtools.com/v4 to generate a UUID. For example: a6dc08ba-b7f8-4964-af1b-5d6fc983b8ba
Please confirm that all files in your 'data', 'outputs', and 'scripts' folders are correct. Once uploaded, you will NOT be able to update or replace them.
Folder Structure Overview
<data_row_id>/
├── data/
│ ├── sample.npy
│ ├── dataframe2.csv
│ └── dataframe.csv # Generated .csv and/or npy files
│
├── scripts/
│ ├── data_gen.py # Data generation script
│ └── viz.py # Visualization script
│
├── outputs/
│ └── dashboard.html # Interactive html generated using viz.py
├── upload.py # Script to upload your work
Once uploaded, submit all the paths in the appropriate sections in the Labelbox editor.
Best Practices
Please refer to this section to see examples of the level of complexity that is required for dashboards.
Refer to this section for examples of the charts that you may encounter.
While searching for a reference image, here are some examples of charts you should be pursuing versus not:
✅Positive examples
❌Negative examples
A full example is available here.
Thanks for sharing the full evaluation brief. Here's how you can **systematically proceed** with this task:
---
## ✅ Step-by-Step Execution Plan
### **Step 1: Choose a Chart Type and Find a Reference Image**
1. **Pick a Story Theme** (e.g., *“Track retail sales trends across regions and product categories”*).
2. **Search**: Google Image search terms like:
```
“retail sales dashboard”
“Sankey diagram supply chain”
“logistics dashboard business intelligence”
```
3. **Copy Image URL**: Right-click the image → “Copy image address”.
---
### **Step 2: Write a Natural Prompt**
**Good Prompt Example** (for retail dashboard):
> “Show how monthly sales vary across regions and product categories.”
Make sure:
- It doesn’t over-specify chart types.
- It’s practical and open-ended.
- It reflects the content in the reference image.
---
### **Step 3: Generate Dummy Data — `scripts/data_gen.py`**
Structure the script like so:
```python
import pandas as pd
import numpy as np
from pathlib import Path
# Set seed for reproducibility
np.random.seed(42)
data_dir = Path(__file__).resolve().parent.parent / "data"
data_dir.mkdir(exist_ok=True)
# Example: sales data by region and category
regions = ['North America', 'Europe', 'Asia', 'South America']
categories = ['Electronics', 'Clothing', 'Furniture', 'Toys']
months = pd.date_range(start="2023-01-01", periods=12, freq='M')
data = []
for region in regions:
for category in categories:
sales = np.random.randint(10000, 50000, size=12)
for i, month in enumerate(months):
data.append([month, region, category, sales[i]])
df = pd.DataFrame(data, columns=['Month', 'Region', 'Category', 'Sales'])
df.to_csv(data_dir / "sales_data.csv", index=False)
# Optional: another dataset, e.g., category-level returns
returns = df.copy()
returns['Returns'] = (returns['Sales'] * np.random.uniform(0.01, 0.05, len(returns))).astype(int)
returns[['Month', 'Region', 'Category', 'Returns']].to_csv(data_dir / "returns_data.csv", index=False)
```
---
### **Step 4: Create the Visualization — `scripts/viz.py`**
Use **Dash by Plotly**:
```python
import pandas as pd
from dash import Dash, dcc, html
import plotly.express as px
# Load data
df = pd.read_csv("../data/sales_data.csv")
returns_df = pd.read_csv("../data/returns_data.csv")
# App initialization
app = Dash(__name__)
# Create charts
fig_sales = px.line(
df.groupby(['Month', 'Region'])['Sales'].sum().reset_index(),
x='Month', y='Sales', color='Region',
title="Monthly Sales by Region"
)
fig_category = px.bar(
df.groupby(['Category'])['Sales'].sum().reset_index(),
x='Category', y='Sales',
title="Total Sales by Category",
color='Category'
)
fig_returns = px.scatter(
returns_df,
x='Sales', y='Returns', color='Region',
title="Sales vs Returns by Region"
)
# Layout
app.layout = html.Div([
html.H1("Retail Sales Dashboard", style={'fontWeight': 'bold', 'textAlign': 'center'}),
dcc.Graph(figure=fig_sales),
dcc.Graph(figure=fig_category),
dcc.Graph(figure=fig_returns)
])
# Export as HTML
if __name__ == "__main__":
app.run_server(debug=True)
# Export to HTML file
from dash import DiskcacheManager
from dash._utils import create_index_string
import diskcache
cache = diskcache.Cache("./cache")
manager = DiskcacheManager(cache)
app.index_string = create_index_string(title="Retail Dashboard")
app.run_server(mode="inline")
# Save the interactive HTML
app._save_html("../outputs/golden_image.html", None)
```
> ⚠️ Plotly Dash doesn't natively have `.save_html()` like `plotly.graph_objects`. If needed, you can:
- Run the Dash app locally.
- Open the dashboard in the browser.
- Use `File > Save Page As` to download the HTML manually.
Or use `dash-bootstrap-components` for polish.
---
### **Step 5: Upload Files**
1. Place your generated files:
```
<uuid>/
├── data/
│ ├── sales_data.csv
│ └── returns_data.csv
├── scripts/
│ ├── data_gen.py
│ └── viz.py
├── outputs/
│ └── golden_image.html
└── upload.py
```
2. Install requirements:
```bash
pip install google-cloud-storage google-auth
```
3. Generate a UUID: [uuidtools.com/v4](https://www.uuidtools.com/v4)
4. Run:
```bash
python upload.py
```
---
## ✅ Checklist
- [x] Found a reference image & copied image address.
- [x] Wrote a user-style prompt.
- [x] Created at least 2 datasets using pandas/numpy.
- [x] Visualized with Dash using at least 2–3 charts.
- [x] Exported dashboard as HTML.
- [x] Structured project folders correctly.
- [x] Uploaded via `upload.py` using UUID.
---
## 📦 Optional: If You Need Example Reference Images
Let me know your desired theme (e.g. fintech, e-commerce logistics, energy, etc.), and I can help you:
- Find a sample image
- Write the prompt
- Generate the data stub
Would you like to pick a story now?
gpt-4o
https://www.google.com/imgres?q=Sankey%20diagram%20supply%20chain&imgurl=https%3A%2F%2Fethresear.ch%2Fuploads%2Fdefault%2Foriginal%2F2X%2F3%2F36514ecad8183ba48ae4b8ea1968dcf534814afa.jpeg&imgrefurl=https%3A%2F%2Fethresear.ch%2Ft%2Fwho-takes-the-tastiest-piece-of-the-mev-supply-chain-cake%2F15724&docid=xH4SNPU9GFo6LM&tbnid=gzqWJuEhKw7eMM&vet=12ahUKEwjbk8KGprqOAxX7nGoFHfA8KkMQM3oECCQQAA..i&w=1456&h=728&hcb=2&ved=2ahUKEwjbk8KGprqOAxX7nGoFHfA8KkMQM3oECCQQAA
Great — you've chosen a **Sankey diagram** representing the **MEV (Miner Extractable Value) supply chain**, visualizing how value flows through different actors in a blockchain transaction ecosystem.
Let’s now construct your project around this.
---
## ✅ Step 1: Reference Image
**Image URL**:
```
https://ethresear.ch/uploads/default/original/2X/3/36514ecad8183ba48ae4b8ea1968dcf534814afa.jpeg
```
---
## ✅ Step 2: Natural Language Prompt
Here’s a clean, user-style prompt inspired by the image:
> **“Visualize how value flows across different actors in the blockchain MEV supply chain.”**
This prompt is:
- Practical (a user might want this for MEV modeling or optimization)
- Open-ended (doesn't over-specify format)
- Reflective of the story in the reference image
---
## ✅ Step 3: Data Generation — `scripts/data_gen.py`
Create a dummy dataset that simulates value moving from **Searchers → Builders → Validators → Protocols** (plus losses, fees, and profits).
```python
import pandas as pd
from pathlib import Path
data_dir = Path(__file__).resolve().parent.parent / "data"
data_dir.mkdir(exist_ok=True)
# Define flow structure
flows = [
# Searcher to Builder
{"source": "Searcher", "target": "Builder", "value": 1000},
# Builder to Validator (base fee paid)
{"source": "Builder", "target": "Validator", "value": 900},
# Builder to Protocol (fee loss or protocol reward)
{"source": "Builder", "target": "Protocol", "value": 50},
# Validator extracts MEV profit
{"source": "Validator", "target": "Validator Profit", "value": 500},
# Validator forwards to protocol treasury
{"source": "Validator", "target": "Protocol", "value": 200},
# Rest is lost or burnt
{"source": "Validator", "target": "Burnt", "value": 200},
]
df = pd.DataFrame(flows)
df.to_csv(data_dir / "mev_flow_data.csv", index=False)
```
---
## ✅ Step 4: Visualization Script — `scripts/viz.py`
Use Plotly for an interactive Sankey diagram.
```python
import pandas as pd
import plotly.graph_objects as go
# Load data
df = pd.read_csv("../data/mev_flow_data.csv")
# Prepare node labels
labels = list(set(df["source"]).union(set(df["target"])))
label_to_index = {label: i for i, label in enumerate(labels)}
# Sankey input arrays
source_indices = df["source"].map(label_to_index)
target_indices = df["target"].map(label_to_index)
fig = go.Figure(data=[go.Sankey(
node=dict(
pad=15,
thickness=20,
line=dict(color="black", width=0.5),
label=labels,
color="lightblue"
),
link=dict(
source=source_indices,
target=target_indices,
value=df["value"],
color="rgba(100, 100, 255, 0.4)"
)
)])
fig.update_layout(
title_text="Blockchain MEV Supply Chain Flow",
font=dict(size=12, color='black'),
paper_bgcolor='white'
)
# Save to HTML
fig.write_html("../outputs/golden_image.html")
```
---
## ✅ Final Folder Structure
```
<your-uuid>/
├── data/
│ └── mev_flow_data.csv
├── scripts/
│ ├── data_gen.py
│ └── viz.py
├── outputs/
│ └── golden_image.html
├── upload.py # Use the latest version from the July 12 update
```
---
## ✅ Final Deliverables Summary
- **Prompt**:
> “Visualize how value flows across different actors in the blockchain MEV supply chain.”
- **Chart**: Sankey diagram showing value flow from Searchers → Builders → Validators → Protocols (mirroring the reference).
- **Data**: Dummy value flow data structured to resemble the source/target relationships in the reference.
- **Viz**: Interactive Sankey diagram generated with Plotly and exported to HTML.
- **Upload**: Use `upload.py` and a UUID from [uuidtools.com/v4](https://www.uuidtools.com/v4) to submit your work.
---
Would you like me to generate a zip folder of this structure or paste a copy/paste-friendly version of all files?
gpt-4o
now write a CLIne prompt to get that done
Here’s a **CLIne prompt** to automatically generate the **MEV supply chain Sankey diagram project** you described, following the Labelbox structure.
---
### ✅ CLine Prompt
```bash
cline \
"Create a Python project that visualizes the value flow in the blockchain MEV (Miner Extractable Value) supply chain using a Sankey diagram.
**Folder structure must follow Labelbox evaluation rules**:
- A root folder named with a UUID (e.g., `a6dc08ba-b7f8-4964-af1b-5d6fc983b8ba`)
- Inside that, a `data` folder with a file called `mev_flow_data.csv`
- A `scripts` folder with two files: `data_gen.py` and `viz.py`
- An `outputs` folder with `golden_image.html`
- Do not include any images or unrelated code.
**`data_gen.py` must:**
- Use only pandas and numpy
- Generate synthetic MEV value flow data showing transfers from Searchers to Builders, Builders to Validators, and to Protocols and other entities
- Output `mev_flow_data.csv` to the `data/` folder
**`viz.py` must:**
- Use only pandas, numpy, and plotly (Dash not required)
- Read `mev_flow_data.csv` and create a Sankey diagram in Plotly
- Save the interactive HTML output to `outputs/golden_image.html`
**Sankey chart should:**
- Have node labels: Searcher, Builder, Validator, Protocol, Validator Profit, Burnt
- Include links showing value transfers with dummy values (e.g., 1000, 900, 200, etc.)
- Be formatted with readable fonts, light blue node colors, and RGBA link colors
- Have a title: 'Blockchain MEV Supply Chain Flow'
**Also output a prompt as a string in the CLI:**
'Visualize how value flows across different actors in the blockchain MEV supply chain.'
Do not include any extraneous files or comments. Ensure all generated scripts are valid and ready to run."
```
---
### 🔧 What this does:
This prompt instructs CLine (or any capable LLM-based CLI generator) to:
- Build the exact folder structure
- Generate:
- A **realistic dummy CSV** file
- A **fully working Sankey chart script**
- A prompt that goes into the Labelbox interface
- Keep everything clean and compliant with the Labelbox July 12th update
---
Let me know if you'd like a bash script or shell command that wraps this into a zip and generates the UUID automatically.
gpt-4o