summaryrefslogtreecommitdiff
path: root/www/lib/vis/docs/network/groups.html
blob: caa8d178102248ea8e120e0c3730da09e5376bee (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
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" HREF="favicon.ico">
    <title>vis.js - Groups documentation.</title>

    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.css" rel="stylesheet">
    <!-- Tipue vendor css -->
    <link href="../css/tipuesearch.css" rel="stylesheet">

    <link href="../css/style.css" rel="stylesheet">

    <link href="../css/prettify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../js/toggleTable.js"></script>
    <script type="text/javascript" src="../js/googleAnalytics.js"></script>
    <script type="text/javascript" src="../js/prettify/prettify.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->


    <script src="../js/smooth-scroll.min.js"></script>
    <script language="JavaScript">
        smoothScroll.init();
    </script>

    <style>

    </style>
</head>

<body onload="prettyPrint();">

<div class="navbar-wrapper">
    <div class="container">
        <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                            aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="http://www.visjs.org/index.html#modules">Modules</a></li>
                        <li><a href="http://www.visjs.org/blog.html">Blog</a></li>
                        <li><a href="http://www.visjs.org/index.html#download_install">Download</a></li>
                        <li><a href="http://www.visjs.org/showcase/index.html">Showcase</a></li>
                        <li><a href="http://www.visjs.org/index.html#contribute">Contribute</a></li>
                        <li><a href="http://www.visjs.org/featureRequests.html">Feature requests</a></li>
                        <li><a href="http://www.visjs.org/index.html#licenses">License</a></li>
                    </ul>
                    <form class="navbar-form navbar-right" role="search">
                        <input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
                        <button type="button" class="btn btn-default" onclick="vis.initSiteSearch(true);">Go!</button>
                    </form>
                    <div id="search-results-wrapper" class="panel panel-default">
                      <div class="panel-body">
                        <div id="tipue_search_content"></div>
                      </div>
                    </div>
                    <div id="keyword-info" class="panel panel-success">
                      <div class="panel-body">
                          Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
                      </div>
                    </div>
                </div>
            </div>
        </nav>
    </div>
</div>

<a href="https://github.com/almende/vis" class="hidden-xs hidden-sm hidden-md"><img
        style="position: absolute; top: 0; right: 0; border: 0;"
        src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
        alt="Fork me on GitHub"
        data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>

<div class="container full">
    <h1>Network - groups</h1>

    <p>Handles the group styling.</p>
    <h3>Options</h3>

    <p>The options for the canvas have to be contained in an object titled 'groups'.</p>
    <p>Click on the options shown to show how these options are supposed to be used.</p>
    <ul class="nav nav-tabs">
        <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
        <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">options shown</a></li>
    </ul>
    <br>
<pre class="prettyprint lang-js options hidden" id="fullOptions">
var options = {
  groups:{
    useDefaultGroups: true,
    myGroupId:{
      /*node options*/
    }
  }
}

network.setOptions(options);
</pre>
    <p>All of the individual options are explained here:</p>
    <table class="options">
        <tr>
            <th>Name</th>
            <th>Type</th>
            <th>Default</th>
            <th>Description</th>
        </tr>
        <tr>
            <td>useDefaultGroups</td>
            <td>Boolean</td>
            <td><code>true</code></td>
            <td>If your nodes have groups defined that are not in the Groups module, the module loops over the groups it
                does have, allocating one for each unknown group. When all are used, it goes back to the first group. By
                setting this to false, the default groups will not be used in this cycle.
            </td>
        </tr>
        <tr>
            <td>group*</td>
            <td>Object</td>
            <td><code></code></td>
            <td>
                You can add multiple groups containing styling information that applies to a certain subset of groups.
                All options described in the <a href="./nodes.html">nodes module</a> that make sense can be used here
                (you're not going to set the same id or x,y position for a group of nodes).
                Example:
<pre class="prettyprint lang-js options">
var nodes = [
    {id:1, group:'myGroup', label:"I'm in a custom group called 'myGroup'!"}
]

var options = {
  groups: {
    myGroup: {color:{background:'red'}, borderWidth:3}
  }
}
</pre>
                *) the option is not called group, as shown by the example but can by any custom id, except for
                'useDefaultGroups'.
            </td>
        </tr>
    </table>

</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../js/ie10-viewport-bug-workaround.js"></script>
<!-- jquery extensions -->
<script src="../js/jquery.highlight.js"></script>
<script src="../js/jquery.url.min.js"></script>
<!-- Tipue vendor js -->
<script src="../js/tipuesearch.config.js"></script>
<script src="../js/tipuesearch.js"></script>
<!-- controller -->
<script src="../js/main.js"></script>