Browse Source

Documented `configure` for Timeline and Graph2d. Some minor fixes in the options.

flowchartTest
jos 9 years ago
parent
commit
146ba57d28
5 changed files with 32 additions and 12 deletions
  1. +14
    -0
      docs/graph2d/index.html
  2. +2
    -3
      docs/network/configure.html
  3. +9
    -2
      docs/timeline/index.html
  4. +5
    -5
      lib/timeline/optionsGraph2d.js
  5. +2
    -2
      lib/timeline/optionsTimeline.js

+ 14
- 0
docs/graph2d/index.html View File

@ -731,6 +731,20 @@ function (value) {
<td>If true, the Timeline will automatically detect when its container is resized, and redraw itself accordingly. If false, the Timeline can be forced to repaint after its container has been resized using the function <code>redraw()</code>.</td>
</tr>
<tr>
<td>configure</td>
<td class="mid">boolean or function</td>
<td class="mid"><code>false</code></td>
<td>When true, a configurator is loaded where all configuration options of the Graph2d can be changed live.
The displayed options can be filtered by providing a filter function. This function is invoked with two arguments: the current <code>option</code> and the <code>path</code> (an Array) of the option within the options object. The option will be displayed when the filter function returns true. For example to only display format options:
<pre class="prettyprint lang-js">
function (option, path) {
return option === 'format' || path.indexOf('format') !== -1;
}</pre>
</td>
</tr>
<tr>
<td>clickToUse</td>
<td class="mid">Boolean</td>

+ 2
- 3
docs/network/configure.html View File

@ -141,11 +141,10 @@ network.setOptions(options);
selection, renderer. Feel free to come up with a fun seperating character. Finally, when supplied an
array of strings, any of the previously mentioned fields are accepted. <br><br>
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:
<pre class="code">
<pre class="prettyprint lang-js">
function (option, path) {
return path.indexOf('physics') !== -1;
}
</pre>
}</pre>
This only shows the physics options.
</td>
</tr>

+ 9
- 2
docs/timeline/index.html View File

@ -479,9 +479,16 @@ var options = {
<tr>
<td>configure</td>
<td class="mid">boolean</td>
<td class="mid">boolean or function</td>
<td class="mid"><code>false</code></td>
<td>When true, a configurator is loaded where all configuration options of the Timeline can be changed live.</td>
<td>When true, a configurator is loaded where all configuration options of the Timeline can be changed live.
The displayed options can be filtered by providing a filter function. This function is invoked with two arguments: the current <code>option</code> and the <code>path</code> (an Array) of the option within the options object. The option will be displayed when the filter function returns true. For example to only display format options:
<pre class="prettyprint lang-js">
function (option, path) {
return option === 'format' || path.indexOf('format') !== -1;
}</pre>
</td>
</tr>
<tr>

+ 5
- 5
lib/timeline/optionsGraph2d.js View File

@ -22,9 +22,9 @@ let any = 'any';
let allOptions = {
configure: {
enabled: {boolean},
filter: {boolean,string,array},
filter: {boolean,fn},
container: {dom},
__type__: {object,boolean,string,array}
__type__: {object,boolean,fn}
},
//globals :
@ -155,7 +155,7 @@ let allOptions = {
zoomMax: {number},
zoomMin: {number},
__type__: {object}
}
};
let configureOptions = {
global: {
@ -180,7 +180,7 @@ let configureOptions = {
drawPoints: {
enabled: true,
size: [6,2,30,1],
style: 'square' // square, circle
style: ['square', 'circle'] // square, circle
},
dataAxis: {
showMinorLabels: true,
@ -245,7 +245,7 @@ let configureOptions = {
maxHeight: '',
min: '',
minHeight: '',
movable:true,
moveable:true,
orientation: ['both', 'bottom', 'top'],
showCurrentTime: false,
showMajorLabels: true,

+ 2
- 2
lib/timeline/optionsTimeline.js View File

@ -22,9 +22,9 @@ let any = 'any';
let allOptions = {
configure: {
enabled: {boolean},
filter: {boolean,string,array},
filter: {boolean,fn},
container: {dom},
__type__: {object,boolean,string,array}
__type__: {object,boolean,fn}
},
//globals :

Loading…
Cancel
Save