Comparing version
{ | ||
"name": "sigma", | ||
"version": "2.0.0-alpha27", | ||
"version": "2.0.0-alpha28", | ||
"description": "A JavaScript library dedicated to graph drawing.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://sigmajs.org", |
@@ -28,6 +28,2 @@ "use strict"; | ||
var _label = _interopRequireDefault(require("../canvas/components/label")); | ||
var _hover = _interopRequireDefault(require("../canvas/components/hover")); | ||
var _utils = require("../../utils"); | ||
@@ -643,11 +639,6 @@ | ||
value: function clear() { | ||
// NOTE: don't need to clear with preserveDrawingBuffer to false | ||
// let context = this.contexts.nodes; | ||
// context.clear(context.COLOR_BUFFER_BIT); | ||
// context = this.contexts.edges; | ||
// context.clear(context.COLOR_BUFFER_BIT); | ||
var context = this.contexts.labels; | ||
context.clearRect(0, 0, this.width, this.height); // context = this.contexts.hovers; | ||
// context.clearRect(0, 0, this.width, this.height); | ||
this.contexts.nodes.clear(this.contexts.nodes.COLOR_BUFFER_BIT); | ||
this.contexts.edges.clear(this.contexts.edges.COLOR_BUFFER_BIT); | ||
this.contexts.labels.clearRect(0, 0, this.width, this.height); | ||
this.contexts.hovers.clearRect(0, 0, this.width, this.height); | ||
return this; | ||
@@ -670,12 +661,12 @@ } | ||
this.needToSoftProcess = false; | ||
} // If we have no nodes we can stop right there | ||
} // First we need to resize | ||
if (!this.graph.order) return this; // TODO: improve this heuristic or move to the captor itself? | ||
this.resize(); // Clearing the canvases | ||
var moving = this.camera.isAnimated() || this.captors.mouse.isMoving || this.captors.mouse.hasDragged || this.captors.mouse.wheelLock; // First we need to resize | ||
this.clear(); // If we have no nodes we can stop right there | ||
this.resize(); // Clearing the canvases | ||
if (!this.graph.order) return this; // TODO: improve this heuristic or move to the captor itself? | ||
this.clear(); // Then we need to extract a matrix from the camera | ||
var moving = this.camera.isAnimated() || this.captors.mouse.isMoving || this.captors.mouse.hasDragged || this.captors.mouse.wheelLock; // Then we need to extract a matrix from the camera | ||
@@ -754,3 +745,4 @@ var cameraState = this.camera.getState(), | ||
var size = data.size / sizeRatio; | ||
(0, _label["default"])(context, { | ||
this.settings.labelRenderer(context, { | ||
key: labelsToDisplay[i], | ||
label: data.label, | ||
@@ -794,3 +786,5 @@ size: size, | ||
var size = data.size / sizeRatio; | ||
(0, _hover["default"])(context, { | ||
_this5.settings.hoverRenderer(context, { | ||
key: node, | ||
label: data.label, | ||
@@ -797,0 +791,0 @@ color: data.color, |
@@ -9,2 +9,8 @@ "use strict"; | ||
var _label = _interopRequireDefault(require("../canvas/components/label")); | ||
var _hover = _interopRequireDefault(require("../canvas/components/hover")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -47,4 +53,7 @@ | ||
// Features | ||
zIndex: false | ||
zIndex: false, | ||
// Renderers | ||
labelRenderer: _label["default"], | ||
hoverRenderer: _hover["default"] | ||
}; | ||
exports.WEBGL_RENDERER_DEFAULT_SETTINGS = WEBGL_RENDERER_DEFAULT_SETTINGS; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
907975
0.14%58
1.75%3884
0.26%