Browse Source

Renamed Graph2D to Graph2d in the docs/examples

css_transitions
jos 10 years ago
parent
commit
7d41dd3074
10 changed files with 57 additions and 57 deletions
  1. +35
    -35
      docs/graph2d.html
  2. +5
    -5
      examples/graph2d/01_basic.html
  3. +1
    -1
      examples/graph2d/02_bars.html
  4. +4
    -4
      examples/graph2d/03_groups.html
  5. +1
    -1
      examples/graph2d/04_rightAxis.html
  6. +1
    -1
      examples/graph2d/05_bothAxis.html
  7. +2
    -2
      examples/graph2d/06_interpolation.html
  8. +2
    -2
      examples/graph2d/07_scrollingAndSorting.html
  9. +5
    -5
      examples/graph2d/08_performance.html
  10. +1
    -1
      examples/graph2d/index.html

+ 35
- 35
docs/graph2d.html View File

@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<title>vis.js | Graph2D documentation</title>
<title>vis.js | Graph2d documentation</title>
<style> <style>
td.greenField { td.greenField {
background-color: #c9ffc7; background-color: #c9ffc7;
@ -16,11 +16,11 @@
<body onload="prettyPrint();"> <body onload="prettyPrint();">
<div id="container"> <div id="container">
<h1>Graph2D documentation</h1>
<h1>Graph2d documentation</h1>
<h2 id="Overview">Overview</h2> <h2 id="Overview">Overview</h2>
<p> <p>
Graph2D is an interactive visualization chart to draw data in a 2D graph.
Graph2d is an interactive visualization chart to draw data in a 2D graph.
You can freely move and zoom in the graph by dragging and scrolling in the You can freely move and zoom in the graph by dragging and scrolling in the
window. window.
</p> </p>
@ -41,7 +41,7 @@
</li> </li>
<li><a href="#Configuration_Options">Configuration Options</a> <li><a href="#Configuration_Options">Configuration Options</a>
<ul> <ul>
<li><a href="#graph2dOptions">Graph2D options</a></li>
<li><a href="#graph2dOptions">Graph2d options</a></li>
<li><a href="#timelineOptions">Timeline options</a></li> <li><a href="#timelineOptions">Timeline options</a></li>
</ul> </ul>
</li> </li>
@ -52,7 +52,7 @@
<h2 id="Example">Example</h2> <h2 id="Example">Example</h2>
<p> <p>
The following code shows how to create a Graph2D and provide it with data.
The following code shows how to create a Graph2d and provide it with data.
More examples can be found in the <a href="../examples">examples</a> directory. More examples can be found in the <a href="../examples">examples</a> directory.
</p> </p>
@ -60,7 +60,7 @@
&lt;!DOCTYPE HTML&gt; &lt;!DOCTYPE HTML&gt;
&lt;html&gt; &lt;html&gt;
&lt;head&gt; &lt;head&gt;
&lt;title&gt;Graph2D | Basic Example&lt;/title&gt;
&lt;title&gt;Graph2d | Basic Example&lt;/title&gt;
&lt;style type="text/css"&gt; &lt;style type="text/css"&gt;
body, html { body, html {
@ -90,7 +90,7 @@
start: '2014-06-10', start: '2014-06-10',
end: '2014-06-18' end: '2014-06-18'
}; };
var graph2d = new vis.Graph2D(container, dataset, options);
var graph2d = new vis.Graph2d(container, dataset, options);
&lt;/script&gt; &lt;/script&gt;
&lt;/body&gt; &lt;/body&gt;
&lt;/html&gt; &lt;/html&gt;
@ -101,8 +101,8 @@
<h2 id="Loading">Loading</h2> <h2 id="Loading">Loading</h2>
<p> <p>
The class name of the Graph2D is <code>vis.Graph2D</code>.
When constructing a Graph2D, an HTML DOM container must be provided to attach
The class name of the Graph2d is <code>vis.Graph2d</code>.
When constructing a Graph2d, an HTML DOM container must be provided to attach
the graph to. Optionally, data an options can be provided. the graph to. Optionally, data an options can be provided.
Data is a vis <code>DataSet</code> or an <code>Array</code>, described in Data is a vis <code>DataSet</code> or an <code>Array</code>, described in
section <a href="#Data_Format">Data Format</a>. section <a href="#Data_Format">Data Format</a>.
@ -111,21 +111,21 @@
Groups is a vis <code>DataSet</code> containing groups. The available options and the method of construction Groups is a vis <code>DataSet</code> containing groups. The available options and the method of construction
are described in section <a href="#Group_Options">Data Format</a>. are described in section <a href="#Group_Options">Data Format</a>.
</p> </p>
<pre class="prettyprint lang-js">var graph = new vis.Graph2D(container [, data] [, options] [,groups]);</pre>
<pre class="prettyprint lang-js">var graph = new vis.Graph2d(container [, data] [, options] [,groups]);</pre>
<p> <p>
Data, options and groups can be set or changed later on using the functions Data, options and groups can be set or changed later on using the functions
<code>Graph2D.setData(data)</code>, <code>Graph2D.setOptions(options)</code> and <code>Graph2D.setGroups(groups)</code>.
<code>Graph2d.setData(data)</code>, <code>Graph2d.setOptions(options)</code> and <code>Graph2d.setGroups(groups)</code>.
</p> </p>
<h2 id="Data_Format">Data Format</h2> <h2 id="Data_Format">Data Format</h2>
<p> <p>
Graph2D can load data from an <code>Array</code>, a <code>DataSet</code> or a <code>DataView</code>.
Graph2d can load data from an <code>Array</code>, a <code>DataSet</code> or a <code>DataView</code>.
JSON objects are added to this DataSet by using the <code>add()</code> function. JSON objects are added to this DataSet by using the <code>add()</code> function.
Data points must have properties <code>x</code>, <code>y</code>, and <code>z</code>, Data points must have properties <code>x</code>, <code>y</code>, and <code>z</code>,
and can optionally have a property <code>style</code> and <code>filter</code>. and can optionally have a property <code>style</code> and <code>filter</code>.
<p> <p>
Graph2D can be provided with two types of data:
Graph2d can be provided with two types of data:
</p> </p>
<ul> <ul>
<li><a href="#items">Items</a> containing a set of points to be displayed.</li> <li><a href="#items">Items</a> containing a set of points to be displayed.</li>
@ -245,9 +245,9 @@ groups.add({
<h2 id="Configuration_Options">Configuration Options</h2> <h2 id="Configuration_Options">Configuration Options</h2>
<h3 id="graph2dOptions">Graph2D Options</h3>
<h3 id="graph2dOptions">Graph2d Options</h3>
Options can be used to customize the Graph2D to your purposes. These options can be passed to the Graph2D object either in
Options can be used to customize the Graph2d to your purposes. These options can be passed to the Graph2d object either in
the constructor, or by the <code>setOptions</code> function. the constructor, or by the <code>setOptions</code> function.
<pre class="prettyprint lang-js"> <pre class="prettyprint lang-js">
@ -458,7 +458,7 @@ The options colored in green can also be used as options for the groups. All opt
<h3 id="timelineOptions">Timeline Options</h3> <h3 id="timelineOptions">Timeline Options</h3>
<p> <p>
Graph2D is built upon the framework of the timeline. These options from the timeline can be used with graph2D.
Graph2d is built upon the framework of the timeline. These options from the timeline can be used with graph2D.
All options are optional. All options are optional.
</p> </p>
@ -630,7 +630,7 @@ The options colored in green can also be used as options for the groups. All opt
<h2 id="Methods">Methods</h2> <h2 id="Methods">Methods</h2>
<p> <p>
The Graph2D supports the following methods.
The Graph2d supports the following methods.
</p> </p>
<table> <table>
@ -644,11 +644,11 @@ The options colored in green can also be used as options for the groups. All opt
<td>clear([what])</td> <td>clear([what])</td>
<td>none</td> <td>none</td>
<td> <td>
Clear the Graph2D. An object can be passed specifying which sections to clear: items, groups,
Clear the Graph2d. An object can be passed specifying which sections to clear: items, groups,
and/or options. By Default, items, groups and options are cleared, i.e. <code>what = {items: true, groups: true, options: true}</code>. Example usage: and/or options. By Default, items, groups and options are cleared, i.e. <code>what = {items: true, groups: true, options: true}</code>. Example usage:
<pre class="prettyprint lang-js">Graph2D.clear(); // clear items, groups, and options
Graph2D.clear({options: true}); // clear options only
<pre class="prettyprint lang-js">Graph2d.clear(); // clear items, groups, and options
Graph2d.clear({options: true}); // clear options only
</pre> </pre>
</td> </td>
</tr> </tr>
@ -656,7 +656,7 @@ Graph2D.clear({options: true}); // clear options only
<tr> <tr>
<td>destroy()</td> <td>destroy()</td>
<td>none</td> <td>none</td>
<td>Destroy the Graph2D. The Graph2D is removed from memory. all DOM elements and event listeners are cleaned up.
<td>Destroy the Graph2d. The Graph2d is removed from memory. all DOM elements and event listeners are cleaned up.
</td> </td>
</tr> </tr>
@ -695,17 +695,17 @@ Graph2D.clear({options: true}); // clear options only
<tr> <tr>
<td>redraw()</td> <td>redraw()</td>
<td>none</td> <td>none</td>
<td>Force a redraw of the Graph2D. Can be useful to manually redraw when option autoResize=false.
<td>Force a redraw of the Graph2d. Can be useful to manually redraw when option autoResize=false.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>setGroups(groups)</td> <td>setGroups(groups)</td>
<td>none</td> <td>none</td>
<td>Set a data set with groups for the Graph2D.
<td>Set a data set with groups for the Graph2d.
<code>groups</code> can be an Array with Objects, <code>groups</code> can be an Array with Objects,
a DataSet, or a DataView. For each of the groups, the items of the a DataSet, or a DataView. For each of the groups, the items of the
Graph2D are filtered on the property <code>group</code>, which
Graph2d are filtered on the property <code>group</code>, which
must correspond with the id of the group. must correspond with the id of the group.
</td> </td>
</tr> </tr>
@ -713,7 +713,7 @@ Graph2D.clear({options: true}); // clear options only
<tr> <tr>
<td>setItems(items)</td> <td>setItems(items)</td>
<td>none</td> <td>none</td>
<td>Set a data set with items for the Graph2D.
<td>Set a data set with items for the Graph2d.
<code>items</code> can be an Array with Objects, <code>items</code> can be an Array with Objects,
a DataSet, or a DataView. a DataSet, or a DataView.
</td> </td>
@ -722,7 +722,7 @@ Graph2D.clear({options: true}); // clear options only
<tr> <tr>
<td>setOptions(options)</td> <td>setOptions(options)</td>
<td>none</td> <td>none</td>
<td>Set or update options. It is possible to change any option of the Graph2D at any time. You can for example switch orientation on the fly.
<td>Set or update options. It is possible to change any option of the Graph2d at any time. You can for example switch orientation on the fly.
</td> </td>
</tr> </tr>
@ -737,7 +737,7 @@ Graph2D.clear({options: true}); // clear options only
<h2 id="Events">Events</h2> <h2 id="Events">Events</h2>
<p> <p>
Graph2D fires events when changing the visible window by dragging, when
Graph2d fires events when changing the visible window by dragging, when
selecting items, and when dragging the custom time bar. selecting items, and when dragging the custom time bar.
</p> </p>
@ -746,7 +746,7 @@ Graph2D.clear({options: true}); // clear options only
</p> </p>
<pre class="prettyprint lang-js"> <pre class="prettyprint lang-js">
Graph2D.on('select', function (properties) {
Graph2d.on('select', function (properties) {
alert('selected items: ' + properties.nodes); alert('selected items: ' + properties.nodes);
}); });
</pre> </pre>
@ -761,12 +761,12 @@ function onChange (properties) {
} }
// add event listener // add event listener
Graph2D.on('rangechanged', onChange);
Graph2d.on('rangechanged', onChange);
// do stuff... // do stuff...
// remove event listener // remove event listener
Graph2D.off('rangechanged', onChange);
Graph2d.off('rangechanged', onChange);
</pre> </pre>
@ -789,7 +789,7 @@ Graph2D.off('rangechanged', onChange);
<tr> <tr>
<td>rangechange</td> <td>rangechange</td>
<td>Fired repeatedly when the user is dragging the Graph2D window.
<td>Fired repeatedly when the user is dragging the Graph2d window.
</td> </td>
<td> <td>
<ul> <ul>
@ -801,7 +801,7 @@ Graph2D.off('rangechanged', onChange);
<tr> <tr>
<td>rangechanged</td> <td>rangechanged</td>
<td>Fired once after the user has dragged the Graph2D window.
<td>Fired once after the user has dragged the Graph2d window.
</td> </td>
<td> <td>
<ul> <ul>
@ -838,12 +838,12 @@ Graph2D.off('rangechanged', onChange);
<h2 id="Styles">Styles</h2> <h2 id="Styles">Styles</h2>
<p> <p>
All parts of the Graph2D have a class name and a default css style just like the Timeline.
All parts of the Graph2d have a class name and a default css style just like the Timeline.
The styles can be overwritten, which enables full customization of the layout The styles can be overwritten, which enables full customization of the layout
of the Graph2D.
of the Graph2d.
</p> </p>
<p> <p>
Additionally, Graph2D has 10 preset styles for graphs, which are cycled through when loading groups. These styles can be overwritten
Additionally, Graph2d has 10 preset styles for graphs, which are cycled through when loading groups. These styles can be overwritten
as well, along with defining your own classes to style the graphs! <a href="../examples/graph2d/04_rightAxis.html">Example 4</a> and as well, along with defining your own classes to style the graphs! <a href="../examples/graph2d/04_rightAxis.html">Example 4</a> and
<a href="../examples/graph2d/05_bothAxis.html">example 5</a> show the usage of custom styles. <a href="../examples/graph2d/05_bothAxis.html">example 5</a> show the usage of custom styles.
</p> </p>

+ 5
- 5
examples/graph2d/01_basic.html View File

@ -16,15 +16,15 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Basic Example</h2>
<h2>Graph2d | Basic Example</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example shows the most basic functionality of the vis.js Graph2D module. An array or a vis.Dataset can be used as input.
In the following examples we'll explore the options Graph2D offest for customization. This example uses all default settings.
This example shows the most basic functionality of the vis.js Graph2d module. An array or a vis.Dataset can be used as input.
In the following examples we'll explore the options Graph2d offest for customization. This example uses all default settings.
There are 10 predefined styles that will be cycled through automatically when you add different groups. Alternatively you can There are 10 predefined styles that will be cycled through automatically when you add different groups. Alternatively you can
create your own styling. create your own styling.
<br /><br /> <br /><br />
Graph2D is built upon the framework of the newly refactored timeline. A lot of the timeline options will also apply to Graph2D.
In these examples however, we will focus on what's new in Graph2D!
Graph2d is built upon the framework of the newly refactored timeline. A lot of the timeline options will also apply to Graph2d.
In these examples however, we will focus on what's new in Graph2d!
</div> </div>
<br /> <br />
<div id="visualization"></div> <div id="visualization"></div>

+ 1
- 1
examples/graph2d/02_bars.html View File

@ -13,7 +13,7 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Bar Graph Example</h2>
<h2>Graph2d | Bar Graph Example</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example shows the most the same data as the first example, except we plot the data as bars! The This example shows the most the same data as the first example, except we plot the data as bars! The
dataAxis (y-axis) icons have been enabled as well. These icons are generated automatically from the CSS dataAxis (y-axis) icons have been enabled as well. These icons are generated automatically from the CSS

+ 4
- 4
examples/graph2d/03_groups.html View File

@ -14,12 +14,12 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Groups Example</h2>
<h2>Graph2d | Groups Example</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example shows the groups functionality within Graph2D. This works in the same way as it does in Timeline,
This example shows the groups functionality within Graph2d. This works in the same way as it does in Timeline,
We have however simplified the constructor to accept groups as well to shorten the code. These groups are the We have however simplified the constructor to accept groups as well to shorten the code. These groups are the
method used in Graph2D to define individual graphs. These groups can be given an individual class as well as all the
styling options you can supply to Graph2D! This example, as well as the ones that follow will showcase a few different usages
method used in Graph2d to define individual graphs. These groups can be given an individual class as well as all the
styling options you can supply to Graph2d! This example, as well as the ones that follow will showcase a few different usages
of these options. <br /> <br /> of these options. <br /> <br />
This example also introduces the automatically generated legend. The icons are automatically generated and the label is the This example also introduces the automatically generated legend. The icons are automatically generated and the label is the

+ 1
- 1
examples/graph2d/04_rightAxis.html View File

@ -27,7 +27,7 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Right Axis Example</h2>
<h2>Graph2d | Right Axis Example</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example shows the all of the graphs outlined on the right side using the <code>yAxisOrientation</code> option. This example shows the all of the graphs outlined on the right side using the <code>yAxisOrientation</code> option.
We also show a few custom styles for the graph and show icons on the axis, which are adhering to the custom styling. We also show a few custom styles for the graph and show icons on the axis, which are adhering to the custom styling.

+ 1
- 1
examples/graph2d/05_bothAxis.html View File

@ -38,7 +38,7 @@
</head> </head>
<body> <body>
<h2>Graph2D | Both Axis Example</h2>
<h2>Graph2d | Both Axis Example</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example shows the some of the graphs outlined on the right side using the <code>yAxisOrientation</code> option within the groups. This example shows the some of the graphs outlined on the right side using the <code>yAxisOrientation</code> option within the groups.
We also show a few more custom styles for the graphs. Finally, the legend is manually positioned. Both the left and right axis We also show a few more custom styles for the graphs. Finally, the legend is manually positioned. Both the left and right axis

+ 2
- 2
examples/graph2d/06_interpolation.html View File

@ -13,9 +13,9 @@
</head> </head>
<body> <body>
<h2>Graph2D | Interpolation</h2>
<h2>Graph2d | Interpolation</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
The Graph2D makes use of <a href="http://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline" target="_blank">Catmull-Rom spline interpolation</a>.
The Graph2d makes use of <a href="http://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline" target="_blank">Catmull-Rom spline interpolation</a>.
The user can configure these per group, or globally. In this example we show all 4 possiblities. The differences are in the parametrization of The user can configure these per group, or globally. In this example we show all 4 possiblities. The differences are in the parametrization of
the curves. The options are <code>uniform</code>, <code>chordal</code> and <code>centripetal</code>. Alternatively you can disable the Catmull-Rom interpolation and the curves. The options are <code>uniform</code>, <code>chordal</code> and <code>centripetal</code>. Alternatively you can disable the Catmull-Rom interpolation and
a linear interpolation will be used. The <code>centripetal</code> parametrization produces the best result (no self intersection, yet follows the line closely) and is therefore the default setting. a linear interpolation will be used. The <code>centripetal</code> parametrization produces the best result (no self intersection, yet follows the line closely) and is therefore the default setting.

+ 2
- 2
examples/graph2d/07_scrollingAndSorting.html View File

@ -13,9 +13,9 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Scrolling and Sorting</h2>
<h2>Graph2d | Scrolling and Sorting</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
You can determine the height of the Graph2D seperately from the height of the frame. If the <code>graphHeight</code>
You can determine the height of the Graph2d seperately from the height of the frame. If the <code>graphHeight</code>
is defined, and the <code>height</code> is not, the frame will auto-scale to accommodate the graphHeight. If the <code>height</code> is defined, and the <code>height</code> is not, the frame will auto-scale to accommodate the graphHeight. If the <code>height</code>
is defined as well, the user can scroll up and down vertically as well as horizontally to view the graph. is defined as well, the user can scroll up and down vertically as well as horizontally to view the graph.
<br /><br /> <br /><br />

+ 5
- 5
examples/graph2d/08_performance.html View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<head> <head>
<title>Graph2D | Performance</title>
<title>Graph2d | Performance</title>
<style> <style>
body, html { body, html {
@ -21,13 +21,13 @@
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<h2>Graph2D | Performance</h2>
<h2>Graph2d | Performance</h2>
<div style="width:700px; font-size:14px; text-align: justify;"> <div style="width:700px; font-size:14px; text-align: justify;">
This example is a test of the performance of the Graph2D. Select the amount of datapoints you want to plot and press draw.
This example is a test of the performance of the Graph2d. Select the amount of datapoints you want to plot and press draw.
You can choose between the style of the points as well as the interpolation method. This can only be toggled with the buttons. You can choose between the style of the points as well as the interpolation method. This can only be toggled with the buttons.
The interpolation options may not look different for this dataset but you can see their effects clearly in example 7. The interpolation options may not look different for this dataset but you can see their effects clearly in example 7.
<br /><br /> <br /><br />
Linear interpolation and no points are the settings that will render quickest. By default, graph2D will downsample when there are more
Linear interpolation and no points are the settings that will render quickest. By default, Graph2d will downsample when there are more
than 1 point per pixel. This can be manually disabled at the cost of performance by using the <code>sampling</code> option. than 1 point per pixel. This can be manually disabled at the cost of performance by using the <code>sampling</code> option.
</div> </div>
<br /> <br />
@ -119,7 +119,7 @@
var yval = Math.sin(i/100) * Math.cos(i/50) * 50 + Math.sin(i/1000) * 50; var yval = Math.sin(i/100) * Math.cos(i/50) * 50 + Math.sin(i/1000) * 50;
newData.push({id: i, x: start + 3600000 * i, y: yval}); newData.push({id: i, x: start + 3600000 * i, y: yval});
} }
span.innerHTML = 'Loading data into Graph2D...';
span.innerHTML = 'Loading data into Graph2d...';
setTimeout(function() {loadDataIntoVis(newData);},10); setTimeout(function() {loadDataIntoVis(newData);},10);
} }

+ 1
- 1
examples/graph2d/index.html View File

@ -5,7 +5,7 @@
<body> <body>
<div id="container"> <div id="container">
<h1>Graph2D Examples</h1>
<h1>Graph2d Examples</h1>
<p><a href="01_basic.html">01_basic.html</a></p> <p><a href="01_basic.html">01_basic.html</a></p>
<p><a href="02_bars.html">02_bars.html</a></p> <p><a href="02_bars.html">02_bars.html</a></p>

Loading…
Cancel
Save