diff --git a/CHANGELOG.md b/CHANGELOG.md index ec8f132ba..6e8c66a42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # sigma.js - changelog: +## 2.3.1 + +### Bug fixes + +- [#1230](https://github.com/jacomyal/sigma.js/pull/1230) - Updates broken link to graphology in README.md (thanks to @alexduhem) +- [#1236](https://github.com/jacomyal/sigma.js/issues/1236) - Fixes `#preventSigmaDefault` scoping +- [#1237](https://github.com/jacomyal/sigma.js/issues/1237) - Updates `pixelRatio` on resize +- [#1240](https://github.com/jacomyal/sigma.js/issues/1240) - Fixes click events for touch devices +- [#1244](https://github.com/jacomyal/sigma.js/issues/1244) - Stops relying on graphology for types (issue only partially fixed yet) +- [#1249](https://github.com/jacomyal/sigma.js/issues/1249) - Fixes hovered nodes layer not being cleared + +### Feature + +- [#1239](https://github.com/jacomyal/sigma.js/pull/1239) - Adds `getContainer` method to public API (thanks to @stefanprobst) + ## 2.3.0 ### Features diff --git a/package-lock.json b/package-lock.json index 670f90870..35010b535 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sigma", - "version": "2.3.0", + "version": "2.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sigma", - "version": "2.3.0", + "version": "2.3.1", "license": "MIT", "dependencies": { "@yomguithereal/helpers": "^1.1.1", diff --git a/package.json b/package.json index f0c2c5b2a..febb5fb1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sigma", - "version": "2.3.0", + "version": "2.3.1", "description": "A JavaScript library aimed at visualizing graphs of thousands of nodes and edges.", "homepage": "https://www.sigmajs.org", "bugs": "http://github.com/jacomyal/sigma.js/issues", diff --git a/src/core/labels.ts b/src/core/labels.ts index c4f40246c..c117bb66f 100644 --- a/src/core/labels.ts +++ b/src/core/labels.ts @@ -5,7 +5,7 @@ * Miscelleneous heuristics related to label display. * @module */ -import Graph from "graphology"; +import Graph from "graphology-types"; import { Dimensions, Coordinates } from "../types"; diff --git a/src/sigma.ts b/src/sigma.ts index c50d40c88..95d9134e9 100644 --- a/src/sigma.ts +++ b/src/sigma.ts @@ -3,7 +3,7 @@ * ======== * @module */ -import Graph from "graphology"; +import Graph from "graphology-types"; import Camera from "./core/camera"; import MouseCaptor from "./core/captors/mouse"; @@ -468,7 +468,8 @@ export default class Sigma extends TypedEventEmitter { this.hoveredNode = null; this.emit("leaveNode", { ...baseEvent, node }); - return this.scheduleHighlightedNodesRender(); + this.scheduleHighlightedNodesRender(); + return; } } @@ -1130,7 +1131,9 @@ export default class Sigma extends TypedEventEmitter { const data = this.nodeDataCache[node]; this.hoverNodePrograms[data.type].process(data, data.hidden, nodesPerPrograms[data.type]++); }); - // 4. Render: + // 4. Clear hovered nodes layer: + this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT); + // 5. Render: for (const type in this.hoverNodePrograms) { const program = this.hoverNodePrograms[type]; @@ -1488,7 +1491,7 @@ export default class Sigma extends TypedEventEmitter { clear(): this { this.webGLContexts.nodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT); this.webGLContexts.edges.clear(this.webGLContexts.edges.COLOR_BUFFER_BIT); - this.webGLContexts.hoverNodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT); + this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT); this.canvasContexts.labels.clearRect(0, 0, this.width, this.height); this.canvasContexts.hovers.clearRect(0, 0, this.width, this.height); this.canvasContexts.edgeLabels.clearRect(0, 0, this.width, this.height); diff --git a/src/utils/animate.ts b/src/utils/animate.ts index 7ad837487..af6968353 100644 --- a/src/utils/animate.ts +++ b/src/utils/animate.ts @@ -5,7 +5,7 @@ * Handy helper functions dealing with nodes & edges attributes animation. * @module */ -import Graph from "graphology"; +import Graph from "graphology-types"; import { PlainObject } from "../types"; import { cancelFrame, requestFrame } from "./index"; import easings from "./easings"; diff --git a/src/utils/index.ts b/src/utils/index.ts index f6848a81e..76760058c 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -260,8 +260,9 @@ export function parseColor(val: string): RGBAColor { g = parseInt(val.charAt(3) + val.charAt(4), 16); b = parseInt(val.charAt(5) + val.charAt(6), 16); } - - // TODO: parse hex with alpha? + if (val.length === 9) { + a = parseInt(val.charAt(7) + val.charAt(8), 16) / 255; + } } // Handling rgb notation