Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into add-gpu-graph-to-ex…
Browse files Browse the repository at this point in the history
…ample
  • Loading branch information
thomcom committed Jun 3, 2022
2 parents a85ac5a + 1a76bc1 commit 01711a6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/core/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
11 changes: 7 additions & 4 deletions src/sigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -468,7 +468,8 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
this.hoveredNode = null;

this.emit("leaveNode", { ...baseEvent, node });
return this.scheduleHighlightedNodesRender();
this.scheduleHighlightedNodesRender();
return;
}
}

Expand Down Expand Up @@ -1130,7 +1131,9 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
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];

Expand Down Expand Up @@ -1488,7 +1491,7 @@ export default class Sigma extends TypedEventEmitter<SigmaEvents> {
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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 3 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01711a6

Please sign in to comment.