Browse Source

- Added labelHighlightBold option to edges and nodes.

flowchartTest
Alex de Mulder 9 years ago
parent
commit
78c5f38568
9 changed files with 26174 additions and 26146 deletions
  1. +1
    -0
      HISTORY.md
  2. +26150
    -26144
      dist/vis.js
  3. +7
    -0
      docs/network/edges.html
  4. +7
    -0
      docs/network/nodes.html
  5. +1
    -0
      lib/network/modules/EdgesHandler.js
  6. +1
    -0
      lib/network/modules/NodesHandler.js
  7. +1
    -0
      lib/network/modules/components/Edge.js
  8. +2
    -2
      lib/network/modules/components/shared/Label.js
  9. +4
    -0
      lib/network/options.js

+ 1
- 0
HISTORY.md View File

@ -26,6 +26,7 @@ http://visjs.org
- Added getDataset to all manipulation functions. Thanks @ericvandever!
- Fixed #1039, icon now returns correct distance to border
- Added blurEdge and hoverEdge events.
- Added labelHighlightBold option to edges and nodes.
### Graph2d

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


+ 7
- 0
docs/network/edges.html View File

@ -125,6 +125,7 @@ var options = {
hidden: false,
hoverWidth: 1.5,
label: undefined,
labelHighlightBold: true,
length: undefined,
physics: true,
scaling:{
@ -407,6 +408,12 @@ var options: {
<td><code>undefined</code></td>
<td>The label of the edge. HTML does not work in here because the network uses HTML5 Canvas.</td>
</tr>
<tr>
<td>labelHighlightBold</td>
<td>Boolean</td>
<td><code>true</code></td>
<td>Determines whether or not the label becomes bold when the edge is selected.</td>
</tr>
<tr>
<td>length</td>
<td>Number</td>

+ 7
- 0
docs/network/nodes.html View File

@ -129,6 +129,7 @@ var options = {
},
image: undefined,
label: undefined,
labelHighlightBold: true,
level: undefined,
mass: 1,
physics: true,
@ -414,6 +415,12 @@ network.setOptions(options);
<td><code>undefined</code></td>
<td>The label is the piece of text shown in or under the node, depending on the shape.</td>
</tr>
<tr>
<td>labelHighlightBold</td>
<td>Boolean</td>
<td><code>true</code></td>
<td>Determines whether or not the label becomes bold when the node is selected.</td>
</tr>
<tr>
<td>level</td>
<td>Number</td>

+ 1
- 0
lib/network/modules/EdgesHandler.js View File

@ -47,6 +47,7 @@ class EdgesHandler {
hidden: false,
hoverWidth: 1.5,
label: undefined,
labelHighlightBold: true,
length: undefined,
physics: true,
scaling:{

+ 1
- 0
lib/network/modules/NodesHandler.js View File

@ -61,6 +61,7 @@ class NodesHandler {
},
image: undefined, // --> URL
label: undefined,
labelHighlightBold: true,
level: undefined,
mass: 1,
physics: true,

+ 1
- 0
lib/network/modules/components/Edge.js View File

@ -98,6 +98,7 @@ class Edge {
'hidden',
'hoverWidth',
'label',
'labelHighlightBold',
'length',
'line',
'opacity',

+ 2
- 2
lib/network/modules/components/shared/Label.js View File

@ -120,7 +120,7 @@ class Label {
[x, yLine] = this._setAlignment(ctx, x, yLine, baseline);
// configure context for drawing the text
ctx.font = (selected ? 'bold ' : '') + fontSize + "px " + this.options.font.face;
ctx.font = (selected && this.options.labelHighlightBold ? 'bold ' : '') + fontSize + "px " + this.options.font.face;
ctx.fillStyle = fontColor;
ctx.textAlign = 'center';
@ -244,7 +244,7 @@ class Label {
if (this.options.label !== undefined) {
lines = String(this.options.label).split('\n');
lineCount = lines.length;
ctx.font = (selected ? 'bold ' : '') + this.options.font.size + "px " + this.options.font.face;
ctx.font = (selected && this.options.labelHighlightBold ? 'bold ' : '') + this.options.font.size + "px " + this.options.font.face;
width = ctx.measureText(lines[0]).width;
for (let i = 1; i < lineCount; i++) {
let lineWidth = ctx.measureText(lines[i]).width;

+ 4
- 0
lib/network/options.js View File

@ -51,6 +51,7 @@ let allOptions = {
hidden: {boolean},
hoverWidth: {'function': 'function',number},
label: {string,'undefined': 'undefined'},
labelHighlightBold: {boolean},
length: {number,'undefined': 'undefined'},
physics: {boolean},
scaling: {
@ -181,6 +182,7 @@ let allOptions = {
id: {string, number},
image: {string,'undefined': 'undefined'}, // --> URL
label: {string,'undefined': 'undefined'},
labelHighlightBold: {boolean},
level: {number,'undefined': 'undefined'},
mass: {number},
physics: {boolean},
@ -311,6 +313,7 @@ let configureOptions = {
},
//group: 'string',
hidden: false,
labelHighlightBold: true,
//icon: {
// face: 'string', //'FontAwesome',
// code: 'string', //'\uf007',
@ -364,6 +367,7 @@ let configureOptions = {
},
hidden: false,
hoverWidth: [1.5, 0, 5, 0.1],
labelHighlightBold: true,
physics: true,
scaling: {
min: [1, 0, 100, 1],

Loading…
Cancel
Save