graph_widget 0.1.6__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_widget
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Requires-Dist: anywidget
5
5
  Requires-Dist: marimo
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "graph_widget"
7
- version = "0.1.6"
7
+ version = "0.1.7"
8
8
  dependencies = ["anywidget","marimo"]
9
9
  readme = "README.md"
10
10
 
@@ -101,6 +101,15 @@ function render({ model, el }) {
101
101
  colour_scale = undefined
102
102
  }
103
103
 
104
+ if (colour_scale_type === "diverging") {
105
+ // Sort nodes by absolute distance from zero
106
+ data.nodes.sort((a, b) => {
107
+ const aVal = Math.abs(a[colour_feature]);
108
+ const bVal = Math.abs(b[colour_feature]);
109
+ return aVal - bVal;
110
+ });
111
+ }
112
+
104
113
  plot.nodeCanvasObject((node, ctx) => {
105
114
  const radius = node_size * node_scale;
106
115
  const isLocalSelected = local_selected_ids.includes(node.id);
@@ -99,7 +99,7 @@ wheels = [
99
99
 
100
100
  [[package]]
101
101
  name = "graph-widget"
102
- version = "0.1.5"
102
+ version = "0.1.6"
103
103
  source = { editable = "." }
104
104
  dependencies = [
105
105
  { name = "anywidget" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes