Browse Source

Merge pull request #90 from kannonboy/dynamic-tooltips

added Dynamic tooltips by Kannonboy
css_transitions
Alex 10 years ago
parent
commit
e054b9c509
6 changed files with 14 additions and 12 deletions
  1. +1
    -1
      README.md
  2. +2
    -2
      dist/vis.js
  3. +2
    -2
      dist/vis.min.js
  4. +7
    -5
      docs/graph.html
  5. +1
    -1
      src/graph/Edge.js
  6. +1
    -1
      src/graph/Node.js

+ 1
- 1
README.md View File

@ -143,7 +143,7 @@ Then, the project can be build running:
## Test ## Test
To test teh library, install the project dependencies once:
To test the library, install the project dependencies once:
npm install npm install

+ 2
- 2
dist/vis.js View File

@ -9728,7 +9728,7 @@ Node.prototype._reset = function() {
* has been set. * has been set.
*/ */
Node.prototype.getTitle = function() { Node.prototype.getTitle = function() {
return this.title;
return typeof this.title === "function" ? this.title() : this.title;
}; };
/** /**
@ -10611,7 +10611,7 @@ Edge.prototype.disconnect = function () {
* has been set. * has been set.
*/ */
Edge.prototype.getTitle = function() { Edge.prototype.getTitle = function() {
return this.title;
return typeof this.title === "function" ? this.title() : this.title;
}; };

+ 2
- 2
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 7
- 5
docs/graph.html View File

@ -417,10 +417,11 @@ var nodes = [
<tr> <tr>
<td>title</td> <td>title</td>
<td>string</td>
<td>string | function</td>
<td>no</td> <td>no</td>
<td>Title to be displayed when the user hovers over the node. <td>Title to be displayed when the user hovers over the node.
The title can contain HTML code.</td>
The title can contain HTML code. If using a function, returning <code>undefined</code>
will prevent the tooltip from being displayed.</td>
</tr> </tr>
<tr> <tr>
@ -615,10 +616,11 @@ var edges = [
</tr> </tr>
<tr> <tr>
<td>title</td> <td>title</td>
<td>string</td>
<td>string | function</td>
<td>no</td> <td>no</td>
<td>Title to be displayed when the user hovers over the edge. <td>Title to be displayed when the user hovers over the edge.
The title can contain HTML code.</td>
The title can contain HTML code. If using a function, returning <code>undefined</code>
will prevent the tooltip from being displayed.</td>
</tr> </tr>
<tr> <tr>
@ -1397,7 +1399,7 @@ var options = {
<td>This is the damping constant. It is used to dissipate energy from the system to have it settle in an equilibrium. More information is available <a href="http://en.wikipedia.org/wiki/Damping" target="_blank">here</a>.</td> <td>This is the damping constant. It is used to dissipate energy from the system to have it settle in an equilibrium. More information is available <a href="http://en.wikipedia.org/wiki/Damping" target="_blank">here</a>.</td>
</tr> </tr>
</table> </table>
<h4 id="PhysicsConfiguration">Configuration:</h5>
<h4 id="PhysicsConfiguration">Configuration:</h4>
Every dataset is different. Nodes can have different sizes based on content, interconnectivity can be high or low etc. Because of this, graph has a special option Every dataset is different. Nodes can have different sizes based on content, interconnectivity can be high or low etc. Because of this, graph has a special option
that the user can use to explore which settings may be good for him or her. This is ment to be used during the development phase when you are implementing vis.js. Once you have found that the user can use to explore which settings may be good for him or her. This is ment to be used during the development phase when you are implementing vis.js. Once you have found
settings you are happy with, you can supply them to graph using the physics options as described above. settings you are happy with, you can supply them to graph using the physics options as described above.

+ 1
- 1
src/graph/Edge.js View File

@ -177,7 +177,7 @@ Edge.prototype.disconnect = function () {
* has been set. * has been set.
*/ */
Edge.prototype.getTitle = function() { Edge.prototype.getTitle = function() {
return this.title;
return typeof this.title === "function" ? this.title() : this.title;
}; };

+ 1
- 1
src/graph/Node.js View File

@ -317,7 +317,7 @@ Node.prototype._reset = function() {
* has been set. * has been set.
*/ */
Node.prototype.getTitle = function() { Node.prototype.getTitle = function() {
return this.title;
return typeof this.title === "function" ? this.title() : this.title;
}; };
/** /**

Loading…
Cancel
Save