Skip to content

Commit 98ea954

Browse files
committed
Update all thumbnails to have illustrations instead of summary bullet points.
1 parent 7fa9861 commit 98ea954

18 files changed

Lines changed: 305 additions & 106 deletions

File tree

Chapter0/Thumb.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,41 @@
22
sys.path.insert(0, '..')
33

44
from manim import *
5-
from scene_utils import create_logo_grid
5+
from scene_utils import create_sparse_matrix, create_small_graph_from_matrix, CHAPTER0_MATRIX_DATA
66

77

88
class Thumb(Scene):
99
def construct(self):
10-
logos_group = create_logo_grid()
11-
1210
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
1311

14-
self.play(Write(title), FadeIn(logos_group))
15-
self.wait(1)
16-
footer = Text(
17-
"The GraphBLAS Forum"
18-
).scale(0.75).to_edge(DOWN)
12+
subtitle = Text("Introduction to GraphBLAS", font_size=36, color=YELLOW)
13+
subtitle.next_to(title, DOWN, buff=0.5)
14+
15+
# Sparse matrix on the left
16+
matrix = create_sparse_matrix(CHAPTER0_MATRIX_DATA, scale=0.45)
17+
18+
# Bidirectional arrow in the center
19+
arrow = MathTex(r"\Leftrightarrow").scale(1.2)
20+
21+
# Directed graph on the right
22+
graph = create_small_graph_from_matrix(CHAPTER0_MATRIX_DATA, scale=0.5, directed=True)
23+
24+
illustration = VGroup(matrix, arrow, graph).arrange(RIGHT, buff=0.5)
25+
illustration.move_to(ORIGIN)
26+
27+
# Labels below matrix and graph
28+
mat_label = MathTex("A").next_to(matrix, DOWN, buff=0.2)
29+
graph_label = MathTex("G").next_to(graph, DOWN, buff=0.2)
30+
labels = VGroup(mat_label, graph_label)
31+
32+
concept = Text("Graphs as Sparse Matrices", font_size=28, color=GREEN)
33+
concept.next_to(illustration, DOWN, buff=0.8)
34+
35+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
36+
37+
self.play(Write(title))
38+
self.play(Write(subtitle))
39+
self.play(Write(matrix), Create(graph), Write(labels))
40+
self.play(Write(concept))
1941
self.play(Write(footer))
2042
self.wait(1)

Chapter1/Thumb.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
from manim import *
2-
import os
2+
33

44
class Thumb(Scene):
55
def construct(self):
66
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Install Python library",
9-
"Also reference Julia and Postgres Library.",
10-
"Give examples to create matrix from Introduction.",
11-
"Show how to print, plot and draw basic graphs.",
12-
font_size=36
13-
)
14-
bullet_points.next_to(title, DOWN, buff=0.5)
7+
8+
subtitle = Text("Python-GraphBLAS", font_size=36, color=YELLOW)
9+
subtitle.next_to(title, DOWN, buff=0.5)
10+
11+
code = Code(
12+
code_string="""import graphblas as gb
13+
from graphblas import Matrix, Vector, binary
14+
15+
A = Matrix.from_coo(
16+
[0, 0, 1, 3, 3, 4, 5],
17+
[1, 3, 2, 4, 5, 2, 4],
18+
[1, 2, 5, 2, 9, 5, 2],
19+
)""",
20+
language="python",
21+
background="window",
22+
).scale(0.7)
23+
code.move_to(ORIGIN)
24+
25+
concept = Text("Creating and Exploring Sparse Graphs", font_size=28, color=GREEN)
26+
concept.next_to(code, DOWN, buff=0.6)
27+
28+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1529

1630
self.play(Write(title))
17-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
18-
footer = Text(
19-
"The GraphBLAS Forum"
20-
).scale(0.75).to_edge(DOWN)
31+
self.play(Write(subtitle))
32+
self.play(FadeIn(code))
33+
self.play(Write(concept))
2134
self.play(Write(footer))
2235
self.wait(1)

Chapter2/Thumb.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
11
from manim import *
2-
import os
2+
33

44
class Thumb(Scene):
55
def construct(self):
66
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Introduction to Breadth First Search",
9-
"Matrix Multiplication in a loop.",
10-
"Tease ideas of semirings and accumulation for next video.",
11-
font_size=36
12-
)
13-
bullet_points.next_to(title, DOWN, buff=0.5)
7+
8+
subtitle = Text("Semirings", font_size=36, color=YELLOW)
9+
subtitle.next_to(title, DOWN, buff=0.5)
10+
11+
# Generic semiring formula
12+
formula = MathTex(
13+
r"c_{ij} = \bigoplus_k a_{ik} \otimes b_{kj}"
14+
).scale(1.1)
15+
formula.move_to(ORIGIN).shift(UP * 0.3)
16+
17+
# Three example semiring names
18+
semirings = VGroup(
19+
Text("PLUS_TIMES", font_size=24, color=BLUE),
20+
Text("MIN_PLUS", font_size=24, color=RED),
21+
Text("ANY_PAIR", font_size=24, color=PURPLE),
22+
).arrange(RIGHT, buff=0.8)
23+
semirings.next_to(formula, DOWN, buff=0.6)
24+
25+
concept = Text("Customizing Matrix Multiplication", font_size=28, color=GREEN)
26+
concept.next_to(semirings, DOWN, buff=0.6)
27+
28+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1429

1530
self.play(Write(title))
16-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
17-
footer = Text(
18-
"The GraphBLAS Forum"
19-
).scale(0.75).to_edge(DOWN)
31+
self.play(Write(subtitle))
32+
self.play(Write(formula))
33+
self.play(Write(semirings))
34+
self.play(Write(concept))
2035
self.play(Write(footer))
2136
self.wait(1)

Chapter3/Thumb.py

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
1+
import sys
2+
sys.path.insert(0, '..')
3+
14
from manim import *
2-
import os
5+
from scene_utils import create_small_graph_from_matrix, CHAPTER3_MATRIX_DATA, set_vertex_fill_preserve_label
6+
37

48
class Thumb(Scene):
59
def construct(self):
610
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Introduction Semirings",
9-
"Illustrate concept of substituting multiplicative and additive operators.",
10-
"Introduce Accumulation and its operators.",
11-
font_size=36
12-
)
13-
bullet_points.next_to(title, DOWN, buff=0.5)
11+
12+
subtitle = Text("Breadth-First Search", font_size=36, color=YELLOW)
13+
subtitle.next_to(title, DOWN, buff=0.5)
14+
15+
# 6-node undirected graph colored by BFS level from node 0
16+
graph = create_small_graph_from_matrix(CHAPTER3_MATRIX_DATA, scale=0.6, directed=False)
17+
18+
# Color nodes by BFS level from source node 0
19+
# Level 0: node 0 (source)
20+
set_vertex_fill_preserve_label(graph.vertices[0], YELLOW)
21+
# Level 1: nodes 1, 3 (direct neighbors of 0)
22+
set_vertex_fill_preserve_label(graph.vertices[1], ORANGE)
23+
set_vertex_fill_preserve_label(graph.vertices[3], ORANGE)
24+
# Level 2: nodes 2, 4, 5
25+
set_vertex_fill_preserve_label(graph.vertices[2], RED_B)
26+
set_vertex_fill_preserve_label(graph.vertices[4], RED_B)
27+
set_vertex_fill_preserve_label(graph.vertices[5], RED_B)
28+
29+
# Small legend
30+
legend = VGroup(
31+
VGroup(Dot(color=YELLOW, radius=0.1), Text("Source", font_size=18)).arrange(RIGHT, buff=0.15),
32+
VGroup(Dot(color=ORANGE, radius=0.1), Text("Level 1", font_size=18)).arrange(RIGHT, buff=0.15),
33+
VGroup(Dot(color=RED_B, radius=0.1), Text("Level 2", font_size=18)).arrange(RIGHT, buff=0.15),
34+
).arrange(DOWN, buff=0.15, aligned_edge=LEFT)
35+
36+
illustration = VGroup(graph, legend).arrange(RIGHT, buff=0.8)
37+
illustration.move_to(ORIGIN)
38+
39+
concept = Text("Graph Traversal with Linear Algebra", font_size=28, color=GREEN)
40+
concept.next_to(illustration, DOWN, buff=0.8)
41+
42+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1443

1544
self.play(Write(title))
16-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
17-
footer = Text(
18-
"The GraphBLAS Forum"
19-
).scale(0.75).to_edge(DOWN)
45+
self.play(Write(subtitle))
46+
self.play(Create(graph), FadeIn(legend))
47+
self.play(Write(concept))
2048
self.play(Write(footer))
2149
self.wait(1)

Chapter5/Thumb.py

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1+
import sys
2+
sys.path.insert(0, '..')
3+
14
from manim import *
2-
import os
5+
from scene_utils import create_sparse_matrix
6+
37

48
class Thumb(Scene):
59
def construct(self):
610
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Element-wise operations",
9-
"Illustrate element-wise add.",
10-
"Illustrate element-wise multiplication.",
11-
"Illustrate element-wise union.",
12-
font_size=36
13-
)
14-
bullet_points.next_to(title, DOWN, buff=0.5)
11+
12+
subtitle = Text("Incidence Matrices", font_size=36, color=YELLOW)
13+
subtitle.next_to(title, DOWN, buff=0.5)
14+
15+
# S: source matrix (3 nodes x 3 edges)
16+
# Edges: e0: 0->1, e1: 1->2, e2: 0->2
17+
S_data = [[1, 0, 1], [0, 1, 0], [0, 0, 0]]
18+
S_mat = create_sparse_matrix(S_data, scale=0.5)
19+
20+
at_sym = MathTex("@").scale(1.2)
21+
22+
# D: destination matrix (3 edges x 3 nodes)
23+
D_data = [[0, 1, 0], [0, 0, 1], [0, 0, 1]]
24+
D_mat = create_sparse_matrix(D_data, scale=0.5)
25+
26+
equals_sym = MathTex("=").scale(1.2)
27+
28+
# A: adjacency matrix (3x3)
29+
A_data = [[0, 1, 1], [0, 0, 1], [0, 0, 0]]
30+
A_mat = create_sparse_matrix(A_data, scale=0.5)
31+
32+
equation = VGroup(S_mat, at_sym, D_mat, equals_sym, A_mat).arrange(RIGHT, buff=0.3)
33+
equation.move_to(ORIGIN)
34+
35+
# Labels positioned after arrange
36+
S_label = MathTex("S").next_to(S_mat, DOWN, buff=0.2)
37+
D_label = MathTex("D").next_to(D_mat, DOWN, buff=0.2)
38+
A_label = MathTex("A").next_to(A_mat, DOWN, buff=0.2)
39+
labels = VGroup(S_label, D_label, A_label)
40+
41+
concept = Text("Decomposing Graph Structure", font_size=28, color=GREEN)
42+
concept.next_to(equation, DOWN, buff=0.8)
43+
44+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1545

1646
self.play(Write(title))
17-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
18-
footer = Text(
19-
"The GraphBLAS Forum"
20-
).scale(0.75).to_edge(DOWN)
47+
self.play(Write(subtitle))
48+
self.play(Write(equation), Write(labels))
49+
self.play(Write(concept))
2150
self.play(Write(footer))
2251
self.wait(1)

Chapter6/Thumb.py

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,45 @@
1+
import sys
2+
sys.path.insert(0, '..')
3+
14
from manim import *
2-
import os
5+
from scene_utils import create_sparse_matrix
6+
37

48
class Thumb(Scene):
59
def construct(self):
610
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Selection and Application",
9-
"Illustrate choosing elements with Selection criteria.",
10-
"Illustrate Apply with unary ops.",
11-
font_size=36
12-
)
13-
bullet_points.next_to(title, DOWN, buff=0.5)
11+
12+
subtitle = Text("Element-wise Operations", font_size=36, color=YELLOW)
13+
subtitle.next_to(title, DOWN, buff=0.5)
14+
15+
# Two sparse matrices combined element-wise
16+
A_data = [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [0, 0, 0, 0]]
17+
B_data = [[0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0]]
18+
C_data = [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 2], [1, 0, 0, 0]]
19+
20+
A_mat = create_sparse_matrix(A_data, scale=0.45)
21+
oplus = MathTex(r"\oplus").scale(1.2)
22+
B_mat = create_sparse_matrix(B_data, scale=0.45)
23+
equals_sym = MathTex("=").scale(1.2)
24+
C_mat = create_sparse_matrix(C_data, scale=0.45)
25+
26+
equation = VGroup(A_mat, oplus, B_mat, equals_sym, C_mat).arrange(RIGHT, buff=0.3)
27+
equation.move_to(ORIGIN)
28+
29+
# Colored labels positioned after arrange
30+
A_label = MathTex("A", color=BLUE).next_to(A_mat, DOWN, buff=0.2)
31+
B_label = MathTex("B", color=GREEN).next_to(B_mat, DOWN, buff=0.2)
32+
C_label = MathTex("C").next_to(C_mat, DOWN, buff=0.2)
33+
labels = VGroup(A_label, B_label, C_label)
34+
35+
concept = Text("Combining and Transforming Graphs", font_size=28, color=GREEN)
36+
concept.next_to(equation, DOWN, buff=0.8)
37+
38+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1439

1540
self.play(Write(title))
16-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
17-
footer = Text(
18-
"The GraphBLAS Forum"
19-
).scale(0.75).to_edge(DOWN)
41+
self.play(Write(subtitle))
42+
self.play(Write(equation), Write(labels))
43+
self.play(Write(concept))
2044
self.play(Write(footer))
2145
self.wait(1)

Chapter7/Thumb.py

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
11
from manim import *
2-
import os
2+
33

44
class Thumb(Scene):
55
def construct(self):
66
title = Tex("The Illustrated GraphBLAS").scale(1.5).to_edge(UP)
7-
bullet_points = BulletedList(
8-
"Shortest Path Algorithms",
9-
"Basic Shortest Path.",
10-
"Sparse shortest path with no bounds.",
11-
"Shortest Path Link Tree.",
12-
font_size=36
13-
)
14-
bullet_points.next_to(title, DOWN, buff=0.5)
7+
8+
subtitle = Text("Shortest Paths", font_size=36, color=YELLOW)
9+
subtitle.next_to(title, DOWN, buff=0.5)
10+
11+
# Bellman-Ford relaxation equation
12+
formula = MathTex(
13+
r"d_j = \min_k \left( d_k + w_{kj} \right)"
14+
).scale(1.0)
15+
formula.move_to(ORIGIN).shift(UP * 0.3)
16+
17+
# Semiring name
18+
semiring_label = Text("MIN_PLUS Semiring", font_size=26, color=ORANGE)
19+
semiring_label.next_to(formula, DOWN, buff=0.4)
20+
21+
# Distance vector evolution example
22+
before = MathTex(r"d = [0, \cdot, \cdot, 2, \cdot, \cdot]").scale(0.7)
23+
arrow = MathTex(r"\rightarrow").scale(0.8)
24+
after = MathTex(r"d = [0, 1, \cdot, 2, 4, 3]").scale(0.7)
25+
iteration = VGroup(before, arrow, after).arrange(RIGHT, buff=0.3)
26+
iteration.next_to(semiring_label, DOWN, buff=0.4)
27+
28+
concept = Text("Tropical Semiring for Optimization", font_size=28, color=GREEN)
29+
concept.next_to(iteration, DOWN, buff=0.6)
30+
31+
footer = Text("The GraphBLAS Forum").scale(0.75).to_edge(DOWN)
1532

1633
self.play(Write(title))
17-
self.play(FadeIn(bullet_points, shift=UP, lag_ratio=0.1))
18-
footer = Text(
19-
"The GraphBLAS Forum"
20-
).scale(0.75).to_edge(DOWN)
34+
self.play(Write(subtitle))
35+
self.play(Write(formula))
36+
self.play(Write(semiring_label))
37+
self.play(Write(iteration))
38+
self.play(Write(concept))
2139
self.play(Write(footer))
2240
self.wait(1)

0 commit comments

Comments
 (0)