network.html 11 KB
Newer Older
Tiago Peixoto's avatar
Tiago Peixoto committed
1 2 3 4 5 6 7 8 9 10
{% extends "base.html" %}
{% from 'macros.html' import fmt_int, fmt_float %}

{% block net_active %}
active
{% endblock %}

{% block content %}

<div class="column-group">
Tiago Peixoto's avatar
Tiago Peixoto committed
11
  <div class="xlarge-100 large-100 small-100 bottom-space">
Tiago Peixoto's avatar
Tiago Peixoto committed
12 13 14 15
    <div class="all-25" style="float:right; vertical-align:top; display:inline">
      <blockquote class="note">
        Problems with this dataset?  Open an
        <a href="/issues">issue</a>.<br/>
16
        You may also take a look at the <a href="https://git.skewed.de/count0/netzschleuder/-/blob/master/entries/{{entry.name}}/__init__.py">source code</a>.
Tiago Peixoto's avatar
Tiago Peixoto committed
17 18 19 20 21 22
      </blockquote>
    </div>
    <h1 style="margin-top: 0px"><a href="/net/{{entry.name}}" class="mono">{{entry.name}}</a> &mdash; {{entry.title}}
    </h1>
    <dl>
      <dt>Description</dt>
Tiago Peixoto's avatar
Tiago Peixoto committed
23
      <dd style="max-width: 80em">{{description | safe}}</dd>
Tiago Peixoto's avatar
Tiago Peixoto committed
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
      <dt>Tags</dt>
      <dd>
        {% for tag in entry.tags %}
            <a href="/?tags={{ tag }}"><span class="ink-label grey">{{tag}}</span></a>
        {% endfor %}
      </dd>
      <dt>Citation</dt>
      <dd>
        <ul class="unstyled">
        {% for cit in entry.citation %}
            <li>{{cit[0]}}, <a href="{{cit[1]}}">{{cit[1]}}</a></li>
        {% endfor %}
        </ul>
      </dd>
      <dt>Upstream URL</dt>
      <dd>
        <a href="{{entry.url}}">{{entry.url}}</a>
      </dd>
      {% if entry.upstream_license is not none or entry.restricted %}
          <dt>Upstream license</dt>
          <dd>
            {% if entry.restricted %}
                <span style="color:red">Restricted access.</span>
                Upstream does not permit data redistribution, hence the
                network files cannot be downloaded without
                authorization.
            {% else %}
                {{entry.upstream_license[0]}}, <a href="{{entry.upstream_license[1]}}">{{entry.upstream_license[1]}}</a>
            {% endif %}
          </dd>
      {% endif %}
      <dt>Networks</dt>
      <dd>
        {% if entry.files|length > page_size %}
            {% set last_page = (((entry.files|length) / page_size) | round(method='ceil') | int) %}
            <div style="text-align: right; margin-bottom: .2em">
              Page {{page}} of {{last_page}}
              {% if page > 1 %}
                  &nbsp;
                  <a href="/net/{{entry.name}}"><i class="fa fa-angle-double-left" aria-hidden="true"></i></a>
                  <a href="/net/{{entry.name}}?page={{page-1}}"><i class="fa fa-angle-left" aria-hidden="true"></i></a>
              {% endif %}
              {% if page < last_page %}
                  &nbsp;
                  <a href="/net/{{entry.name}}?page={{page+1}}"><i class="fa fa-angle-right" aria-hidden="true"></i></a>
                  <a href="/net/{{entry.name}}?page={{last_page}}"><i class="fa fa-angle-double-right" aria-hidden="true"></i></a>
              {% endif %}
              &nbsp;
              (<a href="/net/{{entry.name}}?full=True">full</a>)
            </div>
        {% endif %}
75
        <span style="font-size:x-small">Tip: click on the table header to sort the list. Hover your mouse over it to obtain a legend.</span>
Tiago Peixoto's avatar
Tiago Peixoto committed
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
        <table class="ink-table hover sortable" style="table-layout: auto">
          <thead>
            <tr>
              <th class="align-left">Name</th>
              <th class="align-right tight">Nodes</th>
              <th class="align-right">Edges</th>
              <th class="align-right" title="Mean degree">$\left&lt;k\right&gt;$</th>
              <th class="align-right" title="Standard deviation of the degrees">$\sigma_k$</th>
              <th class="align-right" title="Largest eigenvalue of Hashimoto (non-backtracking) matrix">$\lambda_h$</th>
              <th class="align-right" title="Random walk mixing time">$\tau$</th>
              <th class="align-right" title="Degree assortativity">$r$</th>
              <th class="align-right" title="Global clustering coefficient">$c$</th>
              <th class="align-right" title="(Pseudo-) diameter">$\oslash$</th>
              <th class="align-right" title="Relative size of the largest component">$S$</th>
              <th class="align-right">Kind</th>
              <th class="align-right">Mode</th>
              <th class="align-right" title="Node properties">NPs</th>
              <th class="align-right" title="Edge properties">EPs</th>

              <th class="align-center tight" style="width:1px;white-space:nowrap;"><a href="//graph-tool.skewed.de/static/doc/gt_format.html">gt</a></th>
              <th class="align-center tight" style="width:1px;white-space:nowrap;"><a href="https://en.wikipedia.org/wiki/GraphML">GraphML</a></th>
              <th class="align-center tight" style="width:1px;white-space:nowrap;"><a href="https://en.wikipedia.org/wiki/Graph_Modelling_Language">GML</a></th>
              <th class="align-center tight" style="width:1px;white-space:nowrap;"><a href="https://en.wikipedia.org/wiki/Comma-separated_values">csv</a></th>
            </tr>
          </thead>
          <tbody>
            {% for file in entry.files[(page-1) * page_size: page * page_size] %}
                {% set alt = file[1] %}
                {% if file[1] is none %}
                    {% set file = entry.name %}
                {% else %}
                    {% set file = file[1] %}
                {% endif %}
                <tr id="{{alt}}">
                  <td>
                    <a href="#{{alt}}_draw">{{file}}</a>
                  </td>
                  <td class="align-right">
                    {{ fmt_int(entry.analyses[alt]["num_vertices"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_int(entry.analyses[alt]["num_edges"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["average_degree"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["degree_std_dev"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["hashimoto_radius"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["mixing_time"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["degree_assortativity"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["global_clustering"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_int(entry.analyses[alt]["diameter"]) }}
                  </td>
                  <td class="align-right">
                    {{ fmt_float(entry.analyses[alt]["largest_component_fraction"]) }}
                  </td>
                  <td class="align-right">
                    {% if entry.analyses[alt]["is_directed"] is not none %}
                        {% if entry.analyses[alt]["is_directed"] %}
                            Directed
                        {% else %}
                            Undirected
                        {% endif %}
                    {% endif %}
                  </td>
                  <td class="align-right">
                    {% if entry.analyses[alt]["is_bipartite"] is not none %}
                        {% if entry.analyses[alt]["is_bipartite"] %}
                            Bipartite
                        {% else %}
                            Unipartite
                        {% endif %}
                    {% endif %}
                  </td>
                  <td class="align-right">
                    {% if entry.analyses[alt]["vertex_properties"] is not none %}
                        {% for prop in entry.analyses[alt]["vertex_properties"] %}
                            {% if not prop[0].startswith('_') %}
                                <span class="ink-label grey" title="{{prop[1]}}">{{prop[0]}}</span>
                            {% endif %}
                        {% endfor %}
                    {% endif %}
                  </td>
                  <td class="align-right">
                    {% if entry.analyses[alt]["edge_properties"] is not none %}
                        {% for prop in entry.analyses[alt]["edge_properties"] %}
                            {% if not prop[0].startswith('_') %}
                                <span class="ink-label grey" title="{{prop[1]}}">{{prop[0]}}</span>
                            {% endif %}
                        {% endfor %}
                    {% endif %}
                  </td>
                  <td class="align-center">
                    <a href="{{entry.name}}/files/{{file}}.gt.zst"><span class="ink-label grey">{{fsize(entry.name + "/" + file + ".gt.zst")}}</span></a>
                  </td>
                  <td class="align-center">
                    <a href="{{entry.name}}/files/{{file}}.xml.zst"><span class="ink-label grey">{{fsize(entry.name + "/" + file + ".xml.zst")}}</span></a>
                  </td>
                  <td class="align-center">
                    <a href="{{entry.name}}/files/{{file}}.gml.zst"><span class="ink-label grey">{{fsize(entry.name + "/" + file + ".gml.zst")}}</span></a>
                  </td>
                  <td class="align-center">
                    <a href="{{entry.name}}/files/{{file}}.csv.zip"><span class="ink-label grey">{{fsize(entry.name + "/" + file + ".csv.zip")}}</span></a>
                  </td>
            {% endfor %}
          </tbody>
        </table>
      </dd>
      {% set props = entry._analyses['vertex_properties'] %}
      {% set props = props | map('first') %}
      {% if '_pos' in props %}
          <dt>Ridiculograms</dt>
          <dd style="vertical-align: middle;">
          {% for file in entry.files[(page-1) * page_size: page * page_size] %}
              {% set alt = file[1] %}
              {% if alt is none %}
                  {% set props = entry._analyses['vertex_properties'] %}
              {% else %}
                  {% set props = entry.analyses[alt]['vertex_properties'] %}
              {% endif %}
              {% set props = props | map('first') %}
              {% if '_pos' in props %}
                    <figure style="width:24%; display: inline-block;">
                    {% if file[1] is none %}
211 212 213
                         <a href="/draw/{{entry.name}}">
                           <img src="/draw/{{entry.name}}?thumb=True" alt="{{alt}} drawing" style="width: 100%"/>
                         </a>
Tiago Peixoto's avatar
Tiago Peixoto committed
214
                    {% else %}
215 216 217 218 219 220
                         <a href="/draw/{{entry.name}}/{{alt}}">
                           <img src="/draw/{{entry.name}}/{{alt}}?thumb=True" alt="{{alt}} drawing" style="width: 100%"/>
                         </a>
                         <figcaption style="text-align: center">
                           <a href="#{{alt}}" id="{{alt}}_draw">{{ alt }}</a>
                         </figcaption>
Tiago Peixoto's avatar
Tiago Peixoto committed
221 222 223 224 225
                    {% endif %}
                    </figure>
                    </a>
              {% endif %}
          {% endfor %}
226
          </dd>
Tiago Peixoto's avatar
Tiago Peixoto committed
227 228 229 230 231 232
      {% endif %}
    </dl>
  </div>
</div>

{% endblock %}