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));
Cournoyer 2019-05-05gnu: docker: Fix indentation....* gnu/packages/docker.scm (docker): Fix indentation using Emacs. Maxim Cournoyer 2019-05-05gnu: Add docker-libnetwork-cmd-proxy....* gnu/packages/docker.scm (docker-libnetwork-cmd-proxy): New variable. Maxim Cournoyer 2019-05-05gnu: Add docker-libnetwork....* gnu/packages/docker.scm (docker-libnetwork): New private variable. Maxim Cournoyer 2019-04-16gnu: docker, docker-cli: Update to 18.09.5....* gnu/packages/docker.scm (%docker-version): Update to 18.09.5. Tobias Geerinckx-Rice 2019-03-25gnu: docker: Use fewer modprobes....Fixes <https://bugs.gnu.org/34333>. Reported by Allan Adair <allan@adair.io>. * gnu/packages/patches/docker-use-fewer-modprobes.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/docker.scm (docker)[source]: Use it. Danny Milosavljevic 2019-03-14gnu: containerd: Update to 1.2.5....* gnu/packages/docker.scm (containerd): Update to 1.2.5. Tobias Geerinckx-Rice 2019-03-14gnu: docker, docker-cli: Update to 18.09.3....* gnu/packages/docker.scm (%docker-version): Update to 18.09.3. Tobias Geerinckx-Rice 2019-03-14build-system/go: Build with a filesystem union of Go dependencies....This basically changes (guix build-system go) so that instead of looking up its dependencies in a list of directories in $GOPATH, all the Go dependencies are symlinked into a single directory. Fixes <https://bugs.gnu.org/33620>. * guix/build/go-build-system.scm (setup-go-environment): New variable. (setup-environment, install-source): Remove variables. (unpack): Unpack the source relative to $GOPATH. (install): Do not install the compiled objects in the 'pkg' directory. Install the source code in this phase, and only install the source of the package named by IMPORT-PATH. * doc/guix.texi (Build Systems): Adjust accordingly. * gnu/packages/docker.scm (docker): Import (guix build union) on the build side and adjust to build phase name changes in (guix build-system go). * gnu/packages/shellutils.scm (direnv): Likewise. * gnu/packages/databases.scm (mongo-tools)[arguments]: Set '#:install-source #f'. * gnu/packages/music.scm (demlo)[arguments]: Move the 'install-scripts' phase after the 'install' phase. Leo Famulari 2019-02-19gnu: containerd: Update to 1.2.4....* gnu/packages/docker.scm (containerd): Update to 1.2.4. Tobias Geerinckx-Rice 2019-02-19gnu: docker: Fix build on btrfs....* gnu/packages/docker.scm (docker)[arguments]: Skip another test that requires root privileges. Tobias Geerinckx-Rice 2019-02-12gnu: Docker: Update to 18.09.2....* gnu/packages/docker.scm (%docker-version, docker, docker-cli): Update to 18.09.2. (docker)[arguments]: Adjust to the Debian-specific 'iptables-legacy' lookup in the 'patch-paths' phase. Leo Famulari 2019-02-05gnu: Add cqfd....* gnu/packages/docker.scm (cqfd): New variable. Maxim Cournoyer 2019-02-04gnu: containerd: Update to 1.2.2....* gnu/packages/docker.scm (containerd): Update to 1.2.2. Tobias Geerinckx-Rice 2019-02-04gnu: docker-cli: Use HTTPS home page....* gnu/packages/docker.scm (docker-cli)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2019-01-15gnu: Separate Python core packages from the rest....* gnu/packages/python.scm: Move hundreds of package definitions from here... * gnu/packages/python-xyz.scm: ...to this new module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/ada.scm, gnu/packages/admin.scm, gnu/packages/android.scm, gnu/packages/audio.scm, gnu/packages/backup.scm, gnu/packages/benchmark.scm, gnu/packages/bioinformatics.scm, gnu/packages/bittorrent.scm, gnu/packages/calendar.scm, gnu/packages/check.scm, gnu/packages/chemistry.scm, gnu/packages/cluster.scm, gnu/packages/compression.scm, gnu/packages/connman.scm, gnu/packages/crypto.scm, gnu/packages/cups.scm, gnu/packages/databases.scm, gnu/packages/dav.scm, gnu/packages/direct-connect.scm, gnu/packages/disk.scm, gnu/packages/django.scm, gnu/packages/dlang.scm, gnu/packages/docker.scm, gnu/packages/ebook.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/emulators.scm, gnu/packages/engineering.scm, gnu/packages/enlightenment.scm, gnu/packages/finance.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/freedesktop.scm, gnu/packages/game-development.scm, gnu/packages/games.scm, gnu/packages/geo.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/graph.scm, gnu/packages/graphics.scm, gnu/packages/graphviz.scm, gnu/packages/gtk.scm, gnu/packages/ham-radio.scm, gnu/packages/image-processing.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/jrnl.scm, gnu/packages/julia.scm, gnu/packages/kde-frameworks.scm, gnu/packages/key-mon.scm, gnu/packages/libffi.scm, gnu/packages/libreoffice.scm, gnu/packages/libusb.scm, gnu/packages/lirc.scm, gnu/packages/logging.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/medical.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/mpd.scm, gnu/packages/music.scm, gnu/packages/networking.scm, gnu/packages/nutrition.scm, gnu/packages/openldap.scm, gnu/packages/openstack.scm, gnu/packages/package-management.scm, gnu/packages/password-utils.scm, gnu/packages/patchutils.scm, gnu/packages/pdf.scm, gnu/packages/photo.scm, gnu/packages/polkit.scm, gnu/packages/protobuf.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/ruby.scm, gnu/packages/search.scm, gnu/packages/selinux.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/simulation.scm, gnu/packages/ssh.scm, gnu/packages/statistics.scm, gnu/packages/storage.scm, gnu/packages/sync.scm, gnu/packages/terminals.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/tryton.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/virtualization.scm, gnu/packages/vpn.scm, gnu/packages/web-browsers.scm, gnu/packages/web.scm, gnu/packages/wicd.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: Update module references. Ricardo Wurmus 2019-01-15gnu: docker-cli: Don't install the same executable twice....Reported by Meiyo Peng <meiyo.peng@gmail.com>. * gnu/packages/docker.scm (docker-cli)[arguments]<#:phases>[install]: Don't install the same executable twice. Danny Milosavljevic 2019-01-10gnu: docker: Booby-trap "Command" and "LookPath" calls....* gnu/packages/docker.scm (docker)[arguments]<#:phases>[patch-paths]: Booby-trap "Command" and "LookPath" calls. Danny Milosavljevic 2019-01-10gnu: docker: Fix more paths....* gnu/packages/docker.scm (docker)[inputs]: Add dbus, git. [arguments]<#:phases>[patch-paths]: Use them. Danny Milosavljevic 2019-01-10gnu: docker: Disable tests requiring elevated permissions....* gnu/packages/docker.scm (docker)[arguments]<#:phases>[delete-failing-tests]: Disable tests requiring elevated permissions. Danny Milosavljevic 2019-01-10gnu: containerd: Fix more paths....* gnu/packages/docker.scm (containerd)[inputs]: Add util-linux. [arguments]<#:phases>[patch-paths]: Fix more paths. Danny Milosavljevic 2019-01-10gnu: docker: Fix more paths....* gnu/packages/docker.scm (docker)[inputs]: Add util-linux. [arguments]<#:phases>[patch-paths]: Fix more paths. Danny Milosavljevic 2019-01-10gnu: docker: Substitute LookPath of literals generally....* gnu/packages/docker.scm (docker)[arguments]<#:phases>[patch-paths]: Substitute LookPath of literals generally. Danny Milosavljevic 2019-01-10gnu: Add docker-cli....* gnu/packages/docker.scm (docker-cli): New variable. Danny Milosavljevic 2019-01-10gnu: Add docker....* gnu/packages/docker.scm (docker): New variable. * gnu/packages/patches/docker-engine-test-noinstall.patch: New file. * gnu/packages/patches/docker-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. Danny Milosavljevic 2019-01-07gnu: containerd: Update synopsis....* gnu/packages/docker.scm (containerd)[synopsis]: Modify. Danny Milosavljevic 2019-01-07gnu: containerd: Enable tests....* gnu/packages/docker.scm (containerd)[arguments]: Remove #:tests?. Danny Milosavljevic 2019-01-07gnu: Add missing use-module clause....This is a follow-up to 4e5b8f7215b8e0ae864b954cd511404098fd2840. * gnu/packages/docker.scm: Add missing use-module clause. Ricardo Wurmus 2019-01-07gnu: Add containerd....* gnu/packages/docker.scm (containerd): New variable. Danny Milosavljevic 2018-07-29gnu: python-docker-py: Update to 1.10.6....* gnu/packages/docker.scm (python-docker-py): Update to 1.10.6. Efraim Flashner 2018-07-29gnu: Add python-docker-pycreds....* gnu/packages/docker.scm (python-docker-pycreds): New variable. Efraim Flashner