aboutsummaryrefslogtreecommitdiff
path: root/graph.js
blob: ad8279395d8eb1fe5a836d54ec563a4577f4d135 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// GNU Guix --- Functional package management for GNU
// Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
//
// This file is part of GNU Guix.
//
// GNU Guix is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or (at
// your option) any later version.
//
// GNU Guix is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

var outerRadius = Math.max(nodeArray.length * 15, 500) / 2,
    innerRadius = outerRadius - Math.min(nodeArray.length * 5, 200),
    width = outerRadius * 2,
    height = outerRadius * 2,
    colors = d3.scale.category20c(),
    matrix = [];

function neighborsOf (node) {
    return links.filter(function (e) {
        return e.source === node;
    }).map(function (e) {
       return e.target;
    });
}

function zoomed () {
    zoomer.attr("transform",
                "translate(" + d3.event.translate + ")" +
                "scale(" + d3.event.scale + ")");
}

function fade (opacity, root) {
    return function (g, i) {
        root.selectAll("g path.chord")
            .filter(function (d) {
                return d.source.index != i && d.target.index != i;
            })
            .transition()
            .style("opacity", opacity);
    };
}

// Now that we have all nodes in an object we can replace each reference
// with the actual node object.
links.forEach(function (link) {
  link.target = nodes[link.target];
  link.source = nodes[link.source];
});

// Construct a square matrix for package dependencies
nodeArray.forEach(function (d, index, arr) {
    var source = index,
        row = matrix[source];
    if (!row) {
        row = matrix[source] = [];
        for (var i = -1; ++i < arr.length;) row[i] = 0;
    }
    neighborsOf(d).forEach(function (d) { row[d.index]++; });
});

// chord layout
var chord = d3.layout.chord()
    .padding(0.01)
    .sortSubgroups(d3.descending)
    .sortChords(d3.descending)
    .matrix(matrix);

var arc = d3.svg.arc()
    .innerRadius(innerRadius)
    .outerRadius(innerRadius + 20);

var zoom = d3.behavior.zoom()
    .scaleExtent([0.1, 10])
    .on("zoom", zoomed);

var svg = d3.select("body").append("svg")
    .attr("width", "100%")
    .attr("height", "100%")
    .attr('viewBox', '0 0 ' + Math.min(width, height) + ' ' + Math.min(width, height))
    .attr('preserveAspectRatio', 'xMinYMin')
    .call(zoom);

var zoomer = svg.append("g");

var container = zoomer.append("g")
    .attr("transform", "translate(" + outerRadius + "," + outerRadius + ")");

// Group for arcs and labels
var g = container.selectAll(".group")
    .data(chord.groups)
    .enter().append("g")
    .attr("class", "group")
    .on("mouseout", fade(1, container))
    .on("mouseover", fade(0.1, container));

// Draw one segment per package
g.append("path")
    .style("fill",   function (d) { return colors(d.index); })
    .style("stroke", function (d) { return colors(d.index); })
    .attr("d", arc);

// Add circular labels
g.append("text")
    .each(function (d) { d.angle = (d.startAngle + d.endAngle) / 2; })
    .attr("dy", ".35em")
    .attr("transform", function (d) {
      return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")"
          + "translate(" + (innerRadius + 26) + ")"
          + (d.angle > Math.PI ? "rotate(180)" : "");
    })
    .style("text-anchor", function (d) { return d.angle > Math.PI ? "end" : null; })
    .text(function (d) { return nodeArray[d.index].label; });

// Draw chords from source to target; color by source.
container.selectAll(".chord")
    .data(chord.chords)
    .enter().append("path")
    .attr("class", "chord")
    .style("stroke", function (d) { return d3.rgb(colors(d.source.index)).darker(); })
    .style("fill", function (d) { return colors(d.source.index); })
    .attr("d", d3.svg.chord().radius(innerRadius));
uix/commit/gnu/services/admin.scm?id=92c03a871559590f7f3b0640e3a6cfd83c8044e6'>services: Add rottlog....* gnu/services/admin.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Log Rotation): New node. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Jan Nieuwenhuizen lass='msg-avail'>...* gnu/systems.scm (swap-services): Filter them. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2021-11-23system: Warn about swap-devices format change...* gnu/system.scm (warn-swap-devices-change, %warn-swap-devices-change): Add them. * gnu/system.scm (operating-system) [swap-devices]: Use it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2021-11-23system: Rework swap space support, add dependencies....* gnu/system/file-systems.scm (swap-space): Add it. * gnu/system.scm (operating-system)[swap-devices]: Update comment. * gnu/services/base.scm (swap-space->shepherd-service-name, swap-deprecated->shepherd-service-name, swap->shepherd-service-name): Add them. * gnu/services/base.scm (swap-service-type, swap-service): Use the new records. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2021-11-17gnu: system: Improve location of some configuration warnings....* gnu/bootloader.scm (%warn-target-field-deprecation): Remove it. * gnu/bootloader.scm (warn-target-field-deprecation): Use define-with-syntax-properties. * gnu/system.scm (ensure-setuid-program-list): Ditto. Also rename the 'location' variable to 'properties'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe 2021-10-02system: Introduce the os-release file....* gnu/system.scm (os-release): New procedure. (operating-system-etc-service): Use it. Mathieu Othacehe 2021-10-02system: Add guix-icons to the base packages....* gnu/system.scm (%base-packages-artwork): New variable. (%base-packages): Add it. Mathieu Othacehe 2021-09-23system: Add xfsprogs to base packages....This makes them available in the Guix System installer. * gnu/system.scm (%base-packages-disk-utilities): Add xfsprogs. Tobias Geerinckx-Rice 2021-09-14system: Add trailing newline to /etc/timezone....Fixes <https://issues.guix.gnu.org/50523>. Reported by meedstrom@teknik.io. * gnu/system.scm (operating-system-etc-service): Add trailing newline to "timezone" contents. Ludovic Courtès 2021-08-12system: Accept gexps in 'setuid-programs'....Commit a7ac19851baab3fbcc40c4b2cf5b00a6ac9cd2f3 led configs such as the following one, which were previously valid, to be rejected: (operating-system ;; ... (setuid-programs (cons #~(string-append #$wireshark "/bin/dumpcap") %setuid-programs))) They are now accepted again. Reported by wonko on #guix. * gnu/system.scm (%ensure-setuid-program-list): Handle the case where PROGRAM is not a file-like. Ludovic Courtès 2021-08-12system: Handle 'setuid-programs' deprecation handling as a field sanitizer....Previously, evaluating an OS configuration with a childhurd (for instance) would produce tens of lines like: guix system: warning: representing setuid programs with '#<file-append #<package shadow@4.8.1 gnu/packages/admin.scm:798 7ff97f6f7640> "/bin/passwd">' is deprecated; use 'setuid-program' instead Now, it prints this one line: gnu/system/hurd.scm:105:2: warning: representing setuid programs with file-like objects is deprecated; use 'setuid-program' instead This change also means that extensions of 'setuid-program-service-type' now have to provide a list of <setuid-program>, so it's stricter in this sense. * gnu/services.scm (setuid-program-file-like-deprecated): Remove. (setuid-program-service-type)[extend]: Remove 'setuid-program-file-like-deprecated' call. Assume CONFIG and EXTENSIONS are already lists of <setuid-program> records. * gnu/system.scm (<operating-system>)[setuid-programs]: Add 'sanitize' property. Change accessor name from '%operating-system-setuid-programs' to 'operating-system-setuid-programs'. (operating-system-default-essential-services) (hurd-default-essential-services): Adjust accordingly. (ensure-setuid-program-list): New macro. (%ensure-setuid-program-list): New procedure, based on 'setuid-program-file-like-deprecated'. Ludovic Courtès 2021-07-29services: Migrate to <setuid-program>....* gnu/services/dbus.scm (dbus-setuid-programs, polkit-setuid-programs): Return setuid-programs. * gnu/services/desktop.scm (enlightenment-setuid-programs): Return setuid-programs. (%desktop-services)[mount-setuid-helpers]: Use setuid-programs. * gnu/services/docker.scm (singularity-setuid-programs): Return setuid-programs. * gnu/services/xorg.scm(screen-locker-setuid-programs): Return setuid-programs. * gnu/system.scm (%setuid-programs): Return setuid-programs. * doc/guix.texi (Setuid Programs, operating-system Reference): Replace 'list of G-expressions' with 'list of <setuid-program>'. Brice Waegeneire 2021-07-29services: setuid: More configurable setuid support....New record <setuid-program> with fields for setting the specific user and group, as well as specifically selecting the setuid and setgid bits, for a program within the setuid-program-service. * gnu/services.scm (setuid-program-file-like-deprecated): New function. (setuid-program-service-type): Make use of setuid-program->activation-gexp. Adjust the extend property to handle <setuid-program>. * gnu/build/activation.scm (activate-setuid-programs): Update to expect a <setuid-record> list for each program entry. * gnu/system.scm: (operating-system-setuid-programs): Renamed to %operating-system-setuid-programs and replace it with new procedure. (operating-system-default-essential-services, hurd-default-essential-services): Replace operating-system-setuid-programs with %operating-system-setuid-programs. * gnu/system/setuid.scm: New file. * doc/guix.texi (Setuid Programs): Document <setuid-program>. Co-authored-by: Brice Waegeneire <brice@waegenei.re> Chris Lemmer-Webber 2021-07-09system: Provide mg instead of zile....Since the update to the 2.6.2 release, the closure size of zile has increased. Switch to mg which is lighter. * gnu/system.scm (%base-packages-interactive): Replace zile by mg. * doc/guix.texi (Proceeding with the Installation, Using the Configuration System): Adapt those sections. Mathieu Othacehe 2021-05-11Merge branch 'version-1.3.0'Maxim Cournoyer 2021-05-11gnu: Allow services to install kernel-loadable modules....* gnu/system.scm (operating-system-directory-base-entries): Remove code to handle generation of "kernel" for linux-libre kernels. (operating-system-default-essential-services): Instantiate linux-builder-service-type. (package-for-kernel): Move ... * gnu/services.scm: ... to here. (linux-builder-service-type): New variable. (linux-builder-configuration): New type. (linux-loadable-module-service-type): New variable. * gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test): Move code to ... (run-loadable-kernel-modules-test-base): ... new procedure here. (run-loadable-kernel-modules-service-test): New procedure. (%test-loadable-kernel-modules-service-0): New variable. (%test-loadable-kernel-modules-service-1): New variable. (%test-loadable-kernel-modules-service-2): New variable. * doc/guix.texi: Document linux-loadable-module-service-type. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> raid5atemyhomework 2021-05-07system: Add wget to %base-packages-networking....Fixes <https://issues.guix.gnu.org/43530>. Wget is typically included with most GNU/Linux distributions. It adds about ~3 MiB to the system size. * gnu/system.scm (%base-packages-networking): Add the wget package. Maxim Cournoyer 2021-01-30services: shepherd: Allow custom 'shepherd' package....* gnu/services/shepherd.scm (<shepherd-configuration>): New record. (shepherd-boot-gexp, shepherd-root-service-type): Use it. (scm->go, shepherd-configuration-file): Allow passing custom shepherd package. * gnu/system.scm (operating-system-shepherd-service-names): Use the new record. * guix/scripts/system.scm (export-shepherd-graph): Adjust accordingly. * doc/guix.texi (Shepherd Services). Document it. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos 2021-01-22system: Fix typo in docstring....* gnu/system.scm (operating-system-etc-service): Fix typo. Ludovic Courtès 2020-12-21system: Allow separated /boot and encrypted root....* gnu/bootloader/grub.scm (grub-configuration-file): New parameter store-crypto-devices. [crypto-devices]: New helper function. [builder]: Use crypto-devices. * gnu/machine/ssh.scm (roll-back-managed-host): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * gnu/tests/install.scm (%encrypted-root-not-boot-os, %encrypted-root-not-boot-os): New os declaration. (%encrypted-root-not-boot-installation-script): New script, whose contents were initially taken from %encrypted-root-installation-script. (%test-encrypted-root-not-boot-os): New test. * gnu/system.scm (define-module): Export operating-system-bootoader-crypto-devices and boot-parameters-store-crypto-devices. (<boot-parameters>): Add field store-crypto-devices. (read-boot-parameters): Parse store-crypto-devices field. [uuid-sexp->uuid]: New helper function extracted from device-sexp->device. (operating-system-bootloader-crypto-devices): New function. (operating-system-bootcfg): Use operating-system-bootloader-crypto-devices to provide its contents to the bootloader configuration generation process. (operating-system-boot-parameters): Add store-crypto-devices to the generated boot-parameters. (operating-system-boot-parameters-file): Likewise to the file with the serialized structure. * guix/scripts/system.scm (reinstall-bootloader): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * tests/boot-parameters.scm (%default-store-crypto-devices): New variable. (%grub-boot-parameters, test-read-boot-parameters): Use %default-store-crypto-devices. (tests store-crypto-devices): New tests. Miguel Ángel Arruga Vivas 2020-11-26mapped-devices: Allow target to be list of strings....* gnu/system/mapped-devices.scm (<mapped-device>): Rename constructor to %mapped-device. [target]: Remove field. [targets]: New field. Adjust users. (mapped-device-compatibility-helper, mapped-device): New macros. (mapped-device-target): New deprecated procedure. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Mikhail Tsykalov