Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions plots/alluvial-basic/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
INK = "#1A1A17" if THEME == "light" else "#F0EFE8"
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

# Data - Voter migration between political parties across 3 elections
# Format: [from_node, to_node, flow_count]
Expand Down Expand Up @@ -52,9 +52,9 @@

# Party colors using Okabe-Ito palette
party_colors = {
"Democratic": OKABE_ITO[0], # #009E73
"Independent": OKABE_ITO[1], # #D55E00
"Republican": OKABE_ITO[2], # #0072B2
"Democratic": IMPRINT[0], # #009E73
"Independent": IMPRINT[1], # #C475FD
"Republican": IMPRINT[2], # #4467A3
}

# Column positions for time ordering
Expand Down Expand Up @@ -212,15 +212,15 @@
<div id="custom-legend" style="position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%);
display: flex; gap: 60px; font-family: Arial, sans-serif; font-size: 18px; color: {INK_SOFT};">
<div style="display: flex; align-items: center; gap: 15px;">
<div style="width: 40px; height: 30px; background-color: {OKABE_ITO[0]};"></div>
<div style="width: 40px; height: 30px; background-color: {IMPRINT[0]};"></div>
<span>Democratic</span>
</div>
<div style="display: flex; align-items: center; gap: 15px;">
<div style="width: 40px; height: 30px; background-color: {OKABE_ITO[1]};"></div>
<div style="width: 40px; height: 30px; background-color: {IMPRINT[1]};"></div>
<span>Independent</span>
</div>
<div style="display: flex; align-items: center; gap: 15px;">
<div style="width: 40px; height: 30px; background-color: {OKABE_ITO[2]};"></div>
<div style="width: 40px; height: 30px; background-color: {IMPRINT[2]};"></div>
<span>Republican</span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions plots/andrews-curves/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

BRAND = "#009E73"
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

iris = load_iris()
X = StandardScaler().fit_transform(iris.data)
Expand Down Expand Up @@ -125,7 +125,7 @@ def andrews_curve(x, t):
series = SplineSeries()
series.data = data_points
series.name = species_names[species_idx]
series.color = OKABE_ITO[species_idx]
series.color = IMPRINT[species_idx]
series.opacity = 0.5
series.show_in_legend = i == 0
series.line_width = 2
Expand Down
12 changes: 6 additions & 6 deletions plots/area-cumulative-flow/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030"]

# Data — 90-day Kanban board with 5 workflow stages
np.random.seed(42)
Expand Down Expand Up @@ -131,11 +131,11 @@
# Highcharts reversedStacks=true (default): first added series = visual TOP.
# Add top→bottom so Done (green #009E73) is at the bottom and Backlog at the top.
stages = [
("Backlog", backlog_band, OKABE_ITO[4]),
("Analysis", analysis_band, OKABE_ITO[3]),
("Development", dev_band, OKABE_ITO[2]),
("Testing", testing_band, OKABE_ITO[1]),
("Done", done_band, OKABE_ITO[0]),
("Backlog", backlog_band, IMPRINT[4]),
("Analysis", analysis_band, IMPRINT[3]),
("Development", dev_band, IMPRINT[2]),
("Testing", testing_band, IMPRINT[1]),
("Done", done_band, IMPRINT[0]),
]

for name, data, color in stages:
Expand Down
10 changes: 5 additions & 5 deletions plots/area-stacked-percent/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

# Data - Market share evolution over time (2018-2025)
years = ["2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"]
Expand Down Expand Up @@ -115,25 +115,25 @@
}

# Color palette - Okabe-Ito
chart.options.colors = OKABE_ITO
chart.options.colors = IMPRINT

# Add series
series_a = AreaSeries()
series_a.name = "Product A"
series_a.data = product_a
series_a.color = OKABE_ITO[0]
series_a.color = IMPRINT[0]
chart.add_series(series_a)

series_b = AreaSeries()
series_b.name = "Product B"
series_b.data = product_b
series_b.color = OKABE_ITO[1]
series_b.color = IMPRINT[1]
chart.add_series(series_b)

series_c = AreaSeries()
series_c.name = "Product C"
series_c.data = product_c
series_c.color = OKABE_ITO[2]
series_c.color = IMPRINT[2]
chart.add_series(series_c)

# Download Highcharts JS for inline embedding
Expand Down
4 changes: 2 additions & 2 deletions plots/area-stacked/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette: first series always #009E73
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data: Monthly revenue by product category (in thousands $) over 2 years
months = [
Expand Down Expand Up @@ -196,7 +196,7 @@
}

# Set Okabe-Ito colors
chart.options.colors = OKABE_ITO
chart.options.colors = IMPRINT

# Add series (ordered by average size, largest first per spec)
series_data = [
Expand Down
6 changes: 3 additions & 3 deletions plots/bar-3d-categorical/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data: quarterly revenue ($ thousands) for five product categories
categories = ["Electronics", "Clothing", "Food", "Sports", "Books"]
Expand Down Expand Up @@ -122,13 +122,13 @@
"layout": "vertical",
}

chart.options.colors = OKABE_ITO
chart.options.colors = IMPRINT

for i, quarter in enumerate(quarters):
series = ColumnSeries()
series.name = quarter
series.data = sales_data[quarter]
series.color = OKABE_ITO[i]
series.color = IMPRINT[i]
# Emphasize Q4 (peak quarter) with a prominent border to guide the viewer
if quarter == "Q4":
series.border_color = INK_SOFT
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-diverging/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Okabe-Ito palette
POSITIVE = "#009E73" # bluish green (brand, position 1)
NEGATIVE = "#D55E00" # vermillion (position 2)
NEGATIVE = "#AE3030" # imprint red — negative

# Data - Customer satisfaction survey results by department
categories = [
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-drilldown/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00", "#56B4E9", "#F0E442"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030", "#2ABCCD", "#954477"]

# Download Highcharts JS and drilldown module (inline required for headless Chrome)
highcharts_url = "https://unpkg.com/highcharts/highcharts.js"
Expand Down Expand Up @@ -78,7 +78,7 @@

chart.options.legend = {"enabled": False}
chart.options.credits = {"enabled": False}
chart.options.colors = OKABE_ITO
chart.options.colors = IMPRINT

chart.options.tooltip = {
"headerFormat": '<span style="font-size: 44px; font-weight: bold">{series.name}</span><br>',
Expand Down
4 changes: 2 additions & 2 deletions plots/bar-grouped/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette - first series is always #009E73
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00", "#56B4E9", "#F0E442"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030", "#2ABCCD", "#954477"]

# Data - Quarterly revenue by product line (realistic business scenario)
categories = ["Q1", "Q2", "Q3", "Q4"]
Expand Down Expand Up @@ -122,7 +122,7 @@
series = ColumnSeries()
series.name = product_name
series.data = values
series.color = OKABE_ITO[i]
series.color = IMPRINT[i]
chart.add_series(series)

# Download Highcharts JS for inline embedding (required for headless Chrome)
Expand Down
12 changes: 6 additions & 6 deletions plots/bar-race-animated/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
# Okabe-Ito palette (positions 1–7) + adaptive neutral for 8 entities
OI_COLORS = [
"#009E73", # position 1: bluish green
"#D55E00", # position 2: vermillion
"#0072B2", # position 3: blue
"#CC79A7", # position 4: reddish purple
"#E69F00", # position 5: orange
"#56B4E9", # position 6: sky blue
"#F0E442", # position 7: yellow
"#C475FD", # position 2: vermillion
"#4467A3", # position 3: blue
"#BD8233", # position 4: reddish purple
"#AE3030", # position 5: orange
"#2ABCCD", # position 6: sky blue
"#954477", # position 7: yellow
"#1A1A1A" if THEME == "light" else "#E8E8E0", # position 8: adaptive neutral
]

Expand Down
4 changes: 2 additions & 2 deletions plots/bar-spine/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Data: Annual customer satisfaction survey (n=5,000) across industry sectors
sectors = ["Technology", "Healthcare", "Finance", "Retail", "Manufacturing"]
Expand Down Expand Up @@ -162,7 +162,7 @@
}

# Add one series per satisfaction rating (stacked bottom-to-top: best first)
for i, (rating, color) in enumerate(zip(ratings, OKABE_ITO, strict=True)):
for i, (rating, color) in enumerate(zip(ratings, IMPRINT, strict=True)):
series = ColumnSeries()
series.name = rating
series.color = color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette - first series is always #009E73
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7", "#E69F00"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233", "#AE3030"]

# Data: Market share by quarter for different companies
categories = ["Q1 2024", "Q2 2024", "Q3 2024", "Q4 2024", "Q1 2025"]
Expand Down Expand Up @@ -127,7 +127,7 @@
series = ColumnSeries()
series.name = name
series.data = data
series.color = OKABE_ITO[i % len(OKABE_ITO)]
series.color = IMPRINT[i % len(IMPRINT)]
chart.add_series(series)

# Download Highcharts JS (required for headless Chrome)
Expand Down
2 changes: 1 addition & 1 deletion plots/bar-stacked/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

# Okabe-Ito palette: first series is always #009E73
colors = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
colors = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Create chart with container
chart = Chart(container="container")
Expand Down
6 changes: 3 additions & 3 deletions plots/biplot-pca/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
INK_SOFT = "#4A4A44" if THEME == "light" else "#B8B7B0"
RULE = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"
BRAND = "#009E73" # Okabe-Ito position 1
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"] # Positions 1-3 for species
IMPRINT = ["#009E73", "#C475FD", "#4467A3"] # Positions 1-3 for species

# Data - Iris dataset for PCA
np.random.seed(42)
Expand Down Expand Up @@ -129,7 +129,7 @@
series = ScatterSeries()
series.name = species.capitalize()
series.data = [{"x": float(scores[j, 0]), "y": float(scores[j, 1])} for j in range(len(y)) if mask[j]]
series.color = OKABE_ITO[i]
series.color = IMPRINT[i]
series.marker = {"radius": 8}
chart.add_series(series)

Expand All @@ -143,7 +143,7 @@
}

# Set colors for chart-level consistency
chart.options.colors = OKABE_ITO
chart.options.colors = IMPRINT

# Download Highcharts JS with retries and fallback CDN URLs
cdn_urls = [
Expand Down
12 changes: 6 additions & 6 deletions plots/box-grouped/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
GRID = "rgba(26,26,23,0.10)" if THEME == "light" else "rgba(240,239,232,0.10)"

# Okabe-Ito palette
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3"]

# Data - Employee performance scores by department and experience level
np.random.seed(42)
Expand Down Expand Up @@ -86,19 +86,19 @@
series = BoxPlotSeries()
series.name = subcat
series.data = box_data
series.color = OKABE_ITO[idx]
series.fill_color = OKABE_ITO[idx]
series.color = IMPRINT[idx]
series.fill_color = IMPRINT[idx]
series.median_color = INK
series.stem_color = OKABE_ITO[idx]
series.whisker_color = OKABE_ITO[idx]
series.stem_color = IMPRINT[idx]
series.whisker_color = IMPRINT[idx]
series_list.append(series)

# Add outliers as scatter points if any exist
if outliers_data:
scatter = ScatterSeries()
scatter.name = f"{subcat} (outliers)"
scatter.data = outliers_data
scatter.color = OKABE_ITO[idx]
scatter.color = IMPRINT[idx]
scatter.marker = {"radius": 6}
scatter.show_in_legend = False
series_list.append(scatter)
Expand Down
8 changes: 4 additions & 4 deletions plots/box-notched/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
data_dict["Medium Dose"] = np.append(data_dict["Medium Dose"], [30, 95])

# Okabe-Ito palette - first series is always #009E73
OKABE_ITO = ["#009E73", "#D55E00", "#0072B2", "#CC79A7"]
IMPRINT = ["#009E73", "#C475FD", "#4467A3", "#BD8233"]

# Calculate box plot statistics inline (KISS - no functions)
box_data = []
Expand Down Expand Up @@ -85,7 +85,7 @@
"median": round(median, 2),
"q3": round(q3, 2),
"high": round(upper_whisker, 2),
"color": OKABE_ITO[i],
"color": IMPRINT[i],
}
)

Expand Down Expand Up @@ -153,7 +153,7 @@
"medianWidth": 6,
"medianColor": INK,
"colorByPoint": True,
"colors": OKABE_ITO,
"colors": IMPRINT,
},
"errorbar": {"lineWidth": 8, "whiskerLength": "40%", "color": INK, "stemWidth": 0},
},
Expand Down Expand Up @@ -185,7 +185,7 @@
"marker": {
"symbol": "circle",
"radius": 14,
"fillColor": OKABE_ITO[0],
"fillColor": IMPRINT[0],
"lineColor": PAGE_BG,
"lineWidth": 2,
},
Expand Down
8 changes: 4 additions & 4 deletions plots/boxen-basic/implementations/python/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
"name": "Median",
"type": "scatter",
"data": median_data,
"color": "#E69F00",
"marker": {"symbol": "diamond", "radius": 12, "fillColor": "#E69F00", "lineColor": colors[0], "lineWidth": 3},
"color": "#AE3030",
"marker": {"symbol": "diamond", "radius": 12, "fillColor": "#AE3030", "lineColor": colors[0], "lineWidth": 3},
"zIndex": 10,
}
js_series.append(median_series)
Expand All @@ -151,8 +151,8 @@
"name": "Outliers",
"type": "scatter",
"data": outlier_data,
"color": "#D55E00",
"marker": {"radius": 8, "symbol": "circle", "fillColor": "#D55E00", "lineColor": colors[0], "lineWidth": 2},
"color": "#C475FD",
"marker": {"radius": 8, "symbol": "circle", "fillColor": "#C475FD", "lineColor": colors[0], "lineWidth": 2},
"tooltip": {"pointFormat": "Response time: {point.y:.1f} ms"},
}
js_series.append(outlier_series)
Expand Down
Loading
Loading