Opened 4 years ago

Closed 4 years ago

#27460 closed enhancement (fixed)

fix issue in graph_plot_js

Reported by: David Coudert Owned by:
Priority: major Milestone: sage-8.7
Component: graph theory Keywords:
Cc: Merged in:
Authors: David Coudert Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 8e5f238 (Commits, GitHub, GitLab) Commit: 8e5f238b49bd5a0393b5e2ffd5166fcc742cd40a
Dependencies: Stopgaps:

Status badges

Description

Fix issue reported in https://groups.google.com/forum/#!topic/sage-devel/oD1jQVirJBs

The mapping of vertices given to d3.js was incorrect

Change History (9)

comment:1 Changed 4 years ago by David Coudert

Branch: u/dcoudert/27460_graph_plot_js
Commit: 771b91e451985ba2476570915ba92ab0228b8b03
Status: newneeds_review

New commits:

771b91etrac #27460: fix ordering

comment:2 Changed 4 years ago by Frédéric Chapoton

Having a doctest would be good..

comment:3 Changed 4 years ago by git

Commit: 771b91e451985ba2476570915ba92ab0228b8b03ebddf9db0304488ab3f6fee747ec6131a1acfd94

Branch pushed to git repo; I updated commit sha1. New commits:

ebddf9dtrac #27460: add doctest

comment:4 Changed 4 years ago by David Coudert

I added a doctest but it's not good. It works on my laptop with py3, but not with py2. The order of the keys of the dictionaries is not the same in py2 and py3 :(

with py2, I get

..."links": [{"strength": 0, "target": 0, "color": "#aaa", "curve": 0, "source": 1, "name": ""}], "pos": [], "edge_thickness": 4, "loops": [], "edge_labels": false, "vertex_size": 7, "vertex_labels": true, "directed": true, "gravity": 0.04, "charge": -120, "nodes": [{"group": "0", "name": "10"}, {"group": "0", "name": "1"}]...

and with py3

..."nodes": [{"name": "10", ...}, {"name": "1", ...}], "links": [{"source": 1, "target": 0, ...}]...

Any suggestion is more than welcome.

comment:5 Changed 4 years ago by git

Commit: ebddf9db0304488ab3f6fee747ec6131a1acfd948e5f238b49bd5a0393b5e2ffd5166fcc742cd40a

Branch pushed to git repo; I updated commit sha1. New commits:

8e5f238trac #27460: a more robust doctest

comment:6 Changed 4 years ago by David Coudert

OK, I found a more robust doctest that is OK for py2 and py3. Hope you like it.

comment:7 Changed 4 years ago by Frédéric Chapoton

Reviewers: Frédéric Chapoton

ok, looks good. When patchbot is green, positive review

comment:8 Changed 4 years ago by Frédéric Chapoton

Status: needs_reviewpositive_review

comment:9 Changed 4 years ago by Volker Braun

Branch: u/dcoudert/27460_graph_plot_js8e5f238b49bd5a0393b5e2ffd5166fcc742cd40a
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.