aboutsummaryrefslogtreecommitdiff
path: root/tree-size-stats.gnuplot
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2025-09-19 12:47:44 +0200
committerW. Kosior <koszko@koszko.org>2025-09-19 13:09:45 +0200
commit7000b1f2bb2fca5b7707c9b1a9f58f43100212d3 (patch)
treecc5531b93b8e76c39e3c58d52574f68e86c3f05e /tree-size-stats.gnuplot
downloadAGH-msc-thesis-magister.tar.gz
AGH-msc-thesis-magister.zip
Initial commit.HEADmagister
Diffstat (limited to 'tree-size-stats.gnuplot')
-rw-r--r--tree-size-stats.gnuplot86
1 files changed, 86 insertions, 0 deletions
diff --git a/tree-size-stats.gnuplot b/tree-size-stats.gnuplot
new file mode 100644
index 0000000..9c36b65
--- /dev/null
+++ b/tree-size-stats.gnuplot
@@ -0,0 +1,86 @@
+#!/usr/bin/env gnuplot
+
+## SPDX-License-Identifier: CC0-1.0
+##
+## Copyright (C) 2025 Woj. Kosior <koszko@koszko.org>
+
+if (!exists("stats_filename")) stats_filename = "tree-size-stats.csv";
+if (!exists("omit_breaking_changes")) omit_breaking_changes = 0;
+if (!exists("out_filename")) out_filename = "tree-size-stats.svg";
+
+set terminal svg size 800,485 font "DejaVu,sans,14.5";
+set output out_filename;
+#set title "Dependency tree sizes of rebuilt npm Registry packages";
+set ylabel "Dependency count";
+set datafile separator ",";
+bw = 0.9; # box width
+bg = 0.6; # box gap
+bs = 2 * bw + bg; # box span
+psh = 0.15; # point shift
+set boxwidth bw;
+set style fill solid border -1;
+set key noautotitle invert;
+#set xtics rotate by 30 right;
+set xtics rotate by 11 right scale 0;
+set bmargin 4.5;
+set lmargin 11;
+set rmargin 3.5;
+set linetype 1 linecolor rgb "0x555555";
+set linetype 2 linecolor rgb "0x777777";
+set linetype 3 linecolor rgb "0x111111" pt 0;
+set linetype 4 linecolor rgb "0x111111";
+unset pointintervalbox;
+
+stats "tree-sizes.csv" using "TREE-VERS" nooutput;
+
+lbl_shift = -(STATS_max / 25);
+
+ytic_max = 200 * (1 + floor(STATS_max / 200));
+
+set ytics 0, 200;
+do for [i=1:ytic_max/200] {
+ set ytics add (i * 200);
+}
+
+set xrange [(-0.5 * (bg + bw)):(4 * bs - 0.5 * (bg + bw))];
+
+set yrange [2*lbl_shift:ytic_max];
+
+plot for [i=1:0:-1] stats_filename \
+ using (($0 - 1) * bs + i * bw):\
+ (column(i == 0 ? "VERS-AVG" : "DEPS-AVG")) \
+ with boxes \
+ title (i == 0 ? "All dependency package versions" : \
+ "All dependency packages (version-agnostic)"), \
+ for [i=0:1] "" \
+ using (($0 - 1) * bs + i * bw):\
+ (lbl_shift):\
+ (stringcolumn(i == 0 ? "VERS-AVG" : "DEPS-AVG")) \
+ with labels, \
+ for [i=0:1] "" \
+ using (($0 - 1) * bs + i * bw):\
+ (column(i == 0 ? "VERS-AVG" : "DEPS-AVG")):\
+ (column(i == 0 ? "VERS-STD_DEV" : "DEPS-STD_DEV")) \
+ with yerrorbars lt 3, \
+ "" \
+ using ($0 * bs + 0.5 * bw):\
+ "VERS-AVG":\
+ (""):\
+ xtic(stringcolumn("DESCRIPTION")) \
+ with labels, \
+ for [i=15:0:-1] "tree-sizes.csv" \
+ using (omit_breaking_changes && column("BREAKING-CHANGES") == 1 ? \
+ 1 / 0 : \
+ column("IN-DEBIAN") == i % 2 ? \
+ (i / 4) * bs + i % 4 / 2 * bw + (i % 2 * 2 - 1) * psh : \
+ 1 / 0):\
+ (column((i / 4 == 0 ? "TREE-" : \
+ i / 4 == 1 ? "TREE-MIN-" : \
+ i / 4 == 2 ? "TREE-DUMMY-" : \
+ "TREE-FLAT-") \
+ . \
+ (i % 4 / 2 == 0 ? "VERS" : "DEPS"))) \
+ with points lc 4 pt (i % 2 == 0 ? 6 : 7) ps 0.5 \
+ title (i == 0 ? "Absent in Debian" : \
+ i == 1 ? "Packaged in Debian" : \
+ "");