#34 added semi rule with "never" option

This commit is contained in:
Christian Lohmann
2016-12-21 13:51:42 +01:00
parent 8b6902be4d
commit db4e8b63c3
8 changed files with 130 additions and 122 deletions

View File

@@ -1,13 +1,13 @@
import {Pod} from './pod.js';
import {Pod} from './pod.js'
import Bars from './bars.js'
import {FACTORS} from './utils.js'
const PIXI = require('pixi.js');
const PIXI = require('pixi.js')
export default class Node extends PIXI.Graphics {
constructor(node, tooltip) {
super();
this.node = node;
this.tooltip = tooltip;
super()
this.node = node
this.tooltip = tooltip
}
isMaster() {
@@ -15,8 +15,8 @@ export default class Node extends PIXI.Graphics {
}
parseResource(v) {
const match = v.match(/^(\d*)(\D*)$/);
const factor = FACTORS[match[2]] || 1;
const match = v.match(/^(\d*)(\D*)$/)
const factor = FACTORS[match[2]] || 1
return parseInt(match[1]) * factor
}
@@ -65,30 +65,30 @@ export default class Node extends PIXI.Graphics {
text.y = 2
topHandle.addChild(text)
nodeBox.addChild(topHandle)
nodeBox.lineStyle(2, 0xaaaaff, 1);
nodeBox.beginFill(0x999999, 0.5);
nodeBox.drawRect(0, 0, 105, 115);
nodeBox.endFill();
nodeBox.lineStyle(2, 0xaaaaaa, 1);
topHandle.interactive = true;
nodeBox.lineStyle(2, 0xaaaaff, 1)
nodeBox.beginFill(0x999999, 0.5)
nodeBox.drawRect(0, 0, 105, 115)
nodeBox.endFill()
nodeBox.lineStyle(2, 0xaaaaaa, 1)
topHandle.interactive = true
topHandle.on('mouseover', function () {
var s = nodeBox.node.name;
var s = nodeBox.node.name
for (var key of Object.keys(nodeBox.node.labels)) {
s += '\n' + key + ': ' + nodeBox.node.labels[key]
}
nodeBox.tooltip.text.text = s;
nodeBox.tooltip.x = nodeBox.toGlobal(new PIXI.Point(0, 0)).x;
nodeBox.tooltip.y = nodeBox.toGlobal(new PIXI.Point(0, 0)).y;
nodeBox.tooltip.text.text = s
nodeBox.tooltip.x = nodeBox.toGlobal(new PIXI.Point(0, 0)).x
nodeBox.tooltip.y = nodeBox.toGlobal(new PIXI.Point(0, 0)).y
nodeBox.tooltip.visible = true
});
})
topHandle.on('mouseout', function () {
nodeBox.tooltip.visible = false
});
const resources = this.getResourceUsage();
const bars = new Bars(nodeBox, resources, nodeBox.tooltip);
})
const resources = this.getResourceUsage()
const bars = new Bars(nodeBox, resources, nodeBox.tooltip)
bars.x = 0
bars.y = 1
nodeBox.addChild(bars.draw());
nodeBox.addChild(bars.draw())
var px = 24
var py = 20
@@ -100,7 +100,7 @@ export default class Node extends PIXI.Graphics {
nodeBox.addChild(podBox.draw())
px += 13
if (px > 90) {
px = 24;
px = 24
py += 13
}
}
@@ -116,7 +116,7 @@ export default class Node extends PIXI.Graphics {
nodeBox.addChild(podBox.draw())
px += 13
if (px > 90) {
px = 24;
px = 24
py -= 13
}
}