Skip to content

Commit b270ab0

Browse files
committed
stuff
1 parent 9aea49a commit b270ab0

6 files changed

Lines changed: 130 additions & 146 deletions

File tree

packages/app/src/routes/app/(canvas)/+page.svelte

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,29 @@
4040
// epb.setEdgeWeightFactor(edgeWeightFactor).then(() => runGPU());
4141
// });
4242
43+
$effect(() => {
44+
if (!epb) return;
45+
46+
epb = new EdgePathBundlingGPUFloydWarshall({
47+
device,
48+
graph,
49+
maxDistortion,
50+
edgeWeightFactor,
51+
spannerAlgorithm: spannerAlgorithm === 'theta' ? ThetaSpanner : GreedySpanner,
52+
});
53+
});
54+
55+
$effect(() => {
56+
if (!epb) return;
57+
epb = new EdgePathBundlingGPUFloydWarshall({
58+
device,
59+
graph,
60+
maxDistortion,
61+
edgeWeightFactor,
62+
spannerAlgorithm: spannerAlgorithm === 'theta' ? ThetaSpanner : GreedySpanner,
63+
});
64+
});
65+
4366
onMount(async () => {
4467
graph = await loadGraph(selectedGraph);
4568
// const spannerControl = await loadSpanner(selectedGraph);
@@ -59,7 +82,7 @@
5982
graph,
6083
maxDistortion,
6184
edgeWeightFactor,
62-
spannerAlgorithm: GreedySpanner,
85+
spannerAlgorithm: spannerAlgorithm === 'theta' ? ThetaSpanner : GreedySpanner,
6386
});
6487
6588
runGPU();
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
__pycache__
2-
output
2+
output
3+
.venv
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13.5
1+
3.11.13

packages/experiments/quality/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "quality"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = "==3.13.5"
6+
requires-python = "==3.11.13"
77
dependencies = [
88
"cmcrameri==1.9",
99
"matplotlib==3.10.5",

packages/experiments/quality/src/abstractBundling.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
matplotlib.use('Agg')
1313

1414
### Plotting Parameters ###
15-
LINEWIDTH = 1.0
15+
LINEWIDTH = 1.5
1616
LINE_COLOR = 'darkgrey'
1717
ALPHA = 0.4
1818
CIRCLE = 4.0
@@ -123,21 +123,24 @@ def draw(self, path, color=True, plotIpe=False, saveFile=True):
123123
points = [(self.G.nodes[source]['X'], self.G.nodes[source]['Y'])] + data['Spline'].points + [(self.G.nodes[target]['X'], self.G.nodes[target]['Y'])]
124124

125125
X, Y = self.approxBezier(points, 50)
126+
data['X'] = X
127+
data['Y'] = Y
128+
ax.plot(X, Y, color=cmap(data['Angle']), alpha=ALPHA, lw = LINEWIDTH)
126129
else:
127130
X = [self.G.nodes[source]['X'], self.G.nodes[target]['X']]
128131
Y = [self.G.nodes[source]['Y'], self.G.nodes[target]['Y']]
129132

130133
data['X'] = X
131134
data['Y'] = Y
132-
ax.plot(X, Y, color=cmap(data['Angle']), alpha=ALPHA, lw = LINEWIDTH)
135+
# ax.plot(X, Y, color=cmap(data['Angle']), alpha=ALPHA, lw = LINEWIDTH)
133136

134137
X = []
135138
Y = []
136139
for id, data in self.G.nodes().data():
137140
X.append(data['X'])
138141
Y.append(data['Y'])
139142

140-
ax.plot(X, Y, linestyle="none", color=CIRCLE_COLOR_LIGHT, marker='.', markersize = CIRCLE)
143+
# ax.plot(X, Y, linestyle="none", color=CIRCLE_COLOR_LIGHT, marker='.', markersize = CIRCLE)
141144

142145
if saveFile:
143146
plt.savefig(f'{path}{self.name}.png')

0 commit comments

Comments
 (0)