UNPKG

7.89 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <meta charset="utf-8">
7 <meta http-equiv="X-UA-Compatible" content="IE=edge">
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <meta name="description" content="">
10 <meta name="author" content="">
11 <link rel="icon" HREF="favicon.ico">
12 <title>vis.js - Configure documentation.</title>
13
14 <!-- Bootstrap core CSS -->
15 <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
16 <!-- Tipue vendor css -->
17 <link href="https://cdnjs.cloudflare.com/ajax/libs/Tipue-Search/5.0.0/tipuesearch.css" rel="stylesheet">
18
19 <link href="../css/style.css" rel="stylesheet">
20
21
22 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
23 <!--[if lt IE 9]>
24 <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
25 <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
26 <![endif]-->
27
28 <link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css" type="text/css" rel="stylesheet"/>
29 <script type="text/javascript" src="../js/toggleTable.js"></script>
30 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
31
32 <script src="https://cdnjs.cloudflare.com/ajax/libs/smooth-scroll/5.3.7/js/smooth-scroll.min.js"></script>
33 <script language="JavaScript">
34 smoothScroll.init();
35 </script>
36
37 <style>
38
39 </style>
40</head>
41
42<body onload="prettyPrint();">
43
44<div class="navbar-wrapper">
45 <div class="container">
46 <nav class="navbar-inverse navbar-static-top" role="navigation">
47 <div class="container">
48 <div class="navbar-header">
49 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
50 aria-expanded="false" aria-controls="navbar">
51 <span class="sr-only">Toggle navigation</span>
52 <span class="icon-bar"></span>
53 <span class="icon-bar"></span>
54 <span class="icon-bar"></span>
55 </button>
56 <a class="navbar-brand hidden-sm" href="./index.html">vis.js</a>
57 </div>
58 <div id="navbar" class="navbar-collapse collapse">
59 <ul class="nav navbar-nav">
60 </ul>
61 <form class="navbar-form navbar-right" role="search">
62 <input name="q" id="tipue_search_input" autocomplete="off" type="text" class="form-control" placeholder="Enter keywords">
63 <button type="button" class="btn btn-default" onclick="vis.initSiteSearch(true);">Go!</button>
64 </form>
65 <div id="search-results-wrapper" class="panel panel-default">
66 <div class="panel-body">
67 <div id="tipue_search_content"></div>
68 </div>
69 </div>
70 <div id="keyword-info" class="panel panel-success">
71 <div class="panel-body">
72 Found <span id="keyword-count"></span> results. Click <a id="keyword-jumper-button" href="">here</a> to jump to the first keyword occurence!
73 </div>
74 </div>
75 </div>
76 </div>
77 </nav>
78 </div>
79</div>
80
81<div class="container full">
82 <h1>Network - configure</h1>
83
84 <p>Handles the HTML part of the canvas.</p>
85 <h3>Options</h3>
86 <p>The options for the canvas have to be contained in an object titled 'configure'.</p>
87 <p>Click on the full options or shorthand options to show how these options are supposed to be used.</p>
88 <ul class="nav nav-tabs">
89 <li role="presentation" class="active" onclick="toggleTab(this)"><a href="#">options hidden</a></li>
90 <li role="presentation" onclick="toggleTab(this);" targetNode="fullOptions"><a href="#">full options</a></li>
91 <li role="presentation" onclick="toggleTab(this);" targetNode="shortOptions"><a href="#">shorthand options</a></li>
92 </ul>
93 <br>
94<pre class="prettyprint lang-js options top hidden" id="fullOptions">
95// these are all options in full.
96var options = {
97 configure: {
98 enabled: true,
99 filter: 'nodes,edges',
100 container: undefined,
101 showButton: true
102 }
103}
104
105network.setOptions(options);
106</pre>
107
108<pre class="prettyprint lang-js options top hidden" id="shortOptions">
109// only the options that have shorthand notations are shown.
110var options = {
111 configure: 'nodes,edges'
112}
113
114network.setOptions(options);
115</pre>
116
117 <p>As shown above, alternative to supplying an object, you can supply a <code>String</code>, <code>Array</code>, <code>Function</code> or
118 <code>Boolean</code>. These will do the same as the filter option described below.</p>
119 <table class="options">
120 <tr>
121 <th>Name</th>
122 <th>Type</th>
123 <th>Default</th>
124 <th>Description</th>
125 </tr>
126 <tr>
127 <td>enabled</td>
128 <td>Boolean</td>
129 <td><code>true</code></td>
130 <td>Toggle the configuration interface on or off. This is an optional parameter. If left undefined and any of the other properties of this object are defined, this will be set to true.
131 </td>
132 </tr>
133 <tr>
134 <td>filter</td>
135 <td>String, Array, Boolean, Function</td>
136 <td><code>true</code></td>
137 <td>When a boolean, true gives you all options, false will not show any. If a string is supplied, any
138 combination of the following is allowed: nodes, edges, layout, interaction, manipulation, physics,
139 selection, renderer. Feel free to come up with a fun seperating character. Finally, when supplied an
140 array of strings, any of the previously mentioned fields are accepted. <br><br>
141 When supplying a function, you receive two arguments. The option and the path of the option within the options object. If it returns true, the options will be shown in the configurator. Example:
142 <pre class="prettyprint lang-js">
143function (option, path) {
144 return path.indexOf('physics') !== -1;
145}</pre>
146 This only shows the physics options.
147 </td>
148 </tr>
149 <tr>
150 <td>container</td>
151 <td>DOM element</td>
152 <td><code>undefined</code></td>
153 <td>This allows you to put the configure list in another HTML container than below the network.</td>
154 </tr>
155 <tr>
156 <td>showButton</td>
157 <td>Boolean</td>
158 <td><code>true</code></td>
159 <td>Show the generate options button at the bottom of the configurator.</td>
160 </tr>
161 </table>
162
163</div>
164
165<!-- Bootstrap core JavaScript
166================================================== -->
167<!-- Placed at the end of the document so the pages load faster -->
168<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
169<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
170<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
171<script src="../js/ie10-viewport-bug-workaround.js"></script>
172<!-- jquery extensions -->
173<script src="../js/jquery.highlight.js"></script>
174<script src="../js/jquery.url.min.js"></script>
175<!-- Tipue vendor js -->
176<script src="../js/tipuesearch.config.js"></script>
177<script src="https://cdnjs.cloudflare.com/ajax/libs/Tipue-Search/5.0.0/tipuesearch.min.js"></script>
178<!-- controller -->
179<script src="../js/main.js"></script>