@@ -827,7 +827,7 @@ const sectionSankey = nodes.length > 0 && links.length > 0 ?
827827 let authorComp = d3 .descending (lookupIDTable .get (nodeA .author ), lookupIDTable .get (nodeB .author ));
828828 // Within authors, sort so that all work sections are in order by work
829829 let workComp = d3 .descending (lookupIDTable .get (nodeA .work ), lookupIDTable .get (nodeB .work ));
830- let workSegComp = d3 . descending ( lookupIDTable .get (a .id ).section , lookupIDTable .get (b .id ).section );
830+ let workSegComp = lookupIDTable .get (b .id ).section . localeCompare ( lookupIDTable .get (a .id ).section , undefined , {numeric : true } );
831831 if (authorComp !== 0 ) return authorComp; // if the authors aren't the same, don't go any further in sorting
832832 if (workComp !== 0 ) return workComp;
833833 return workSegComp; // sort by work section
@@ -859,7 +859,8 @@ const wordSankey = wordIntxtNodes.length > 0 && wordIntxtEdges.length > 0 ?
859859 let nodeB = lookupIDTable .get (b .id );
860860 let authorComp = d3 .descending (lookupIDTable .get (nodeA .authorID ),lookupIDTable .get (nodeB .authorID ));
861861 let workComp = d3 .descending (lookupIDTable .get (nodeA .workID ),lookupIDTable .get (nodeB .workID ));
862- let workSegComp = d3 .descending (lookupIDTable .get (nodeA .workSegID ),lookupIDTable .get (nodeB .workSegID ));
862+ let workSegComp = lookupIDTable .get (nodeB .workSegID ).section .localeCompare (lookupIDTable .get (nodeA .workSegID ).section , undefined , {numeric: true });
863+ // let workSegComp = d3.descending(lookupIDTable.get(nodeA.workSegID).section,lookupIDTable.get(nodeB.workSegID).section);
863864 let lineComp = d3 .descending (nodeA .lineNum ,nodeB .lineNum );
864865 if (authorComp !== 0 ) {return authorComp;}
865866 else if (workComp !== 0 ) {return workComp;}
0 commit comments