Browse Source

implemented error notification when not giving an unicode for the icon

flowchartTest
Alex de Mulder 9 years ago
parent
commit
d600bf71c0
3 changed files with 3741 additions and 3738 deletions
  1. +3735
    -3735
      dist/vis.js
  2. +1
    -1
      lib/network/modules/PhysicsEngine.js
  3. +5
    -2
      lib/network/modules/components/nodes/shapes/Icon.js

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


+ 1
- 1
lib/network/modules/PhysicsEngine.js View File

@ -28,7 +28,7 @@ class PhysicsEngine {
this.options = {};
this.defaultOptions = {
barnesHut: {
theta: 0.5, // inverted to save time during calculation
theta: 0.5,
gravitationalConstant: -2000,
centralGravity: 0.3,
springLength: 95,

+ 5
- 2
lib/network/modules/components/nodes/shapes/Icon.js View File

@ -44,9 +44,8 @@ class Icon extends NodeBase {
_icon(ctx, x, y, selected) {
let iconSize = Number(this.options.icon.size);
let relativeIconSize = iconSize * this.body.view.scale;
if (this.options.icon.code && relativeIconSize > this.options.scaling.label.drawThreshold - 1) {
if (this.options.icon.code !== undefined) {
ctx.font = (selected ? "bold " : "") + iconSize + "px " + this.options.icon.face;
// draw icon
@ -62,6 +61,10 @@ class Icon extends NodeBase {
// disable shadows for other elements.
this.disableShadow(ctx);
}
else {
console.error('When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.')
}
}
distanceToBorder(ctx, angle) {

Loading…
Cancel
Save