GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: Allow fixing the vertical order of Sankey links, nodes by adamreeve · Pull Request #7873 · plotly/plotly.js Conversation
|
| right: d3Sankey.sankeyRight, | ||
| center: d3Sankey.sankeyCenter | ||
| }[trace.node.align]; | ||
| var input_sort = trace.node.sort === 'input'; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| var input_sort = trace.node.sort === 'input'; | |
| const inputNodeSort = trace.node.sort === 'input'; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if(circular && input_sort) { | ||
| Lib.error('Circular Sankey diagrams do not support the "input" node.sort mode; falling back to the default sort.'); | ||
| } | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| if(circular && input_sort) { | |
| Lib.error('Circular Sankey diagrams do not support the "input" node.sort mode; falling back to the default sort.'); | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // d3-sankey-circular does not support the nodeSort method | ||
| if(!circular) { | ||
| sankey.nodeSort(input_sort ? null : undefined); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| if (inputNodeSort) { | |
| if (circular) { | |
| Lib.warn('Circular Sankey diagrams do not support the "input" node.sort mode; falling back to the default sort.'); | |
| } else { | |
| // Passing null keeps nodes in their input order | |
| sankey.nodeSort(null); | |
| } | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 'If the value is `auto` (the default), the vertical order of nodes will be determined automatically', | ||
| 'by the layout.', | ||
| 'If the value is `input`, the vertical order is kept the same as the order in the input node array' |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| 'If the value is `auto` (the default), the vertical order of nodes will be determined automatically', | |
| 'by the layout.', | |
| 'If the value is `input`, the vertical order is kept the same as the order in the input node array' | |
| 'For `auto` (the default), the vertical order of nodes will be determined automatically by the layout.', | |
| 'For `input`, the vertical order of nodes is kept the same as the order in the input array.' |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this mock can be deleted since all of the other sankey mocks use the auto sort.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| ], | ||
| "layout": { | ||
| "title": { "text": "Sankey with fixed vertical node ordering" }, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| "title": { "text": "Sankey with fixed vertical node ordering" }, | |
| "title": { "text": "Sankey with vertical node ordering matching the input array" }, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| var errors = []; | ||
| spyOn(Lib, 'error').and.callFake(function (msg) { | ||
| errors.push(msg); | ||
| }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| var errors = []; | |
| spyOn(Lib, 'error').and.callFake(function (msg) { | |
| errors.push(msg); | |
| }); | |
| var warnings = []; | |
| spyOn(Lib, 'warn').and.callFake(function (msg) { | |
| warnings.push(msg); | |
| }); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| expect(d3SelectAll('.sankey .node-rect').size()).toBeGreaterThan(0); | ||
|
|
||
| // An error is logged about the fallback | ||
| expect(errors.length).toBe(1); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| expect(errors.length).toBe(1); | |
| expect(warnings.length).toBe(1); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FYI, we're tying to get an RC of v4.0 out this week, so I'm going to jump in and make some changes. I'd rather let you finish things up, but schedules, right? Your work has been very helpful and appreciated. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
OK thanks @camdecoster! Your changes all make sense to me but I've just been quite busy with work stuff lately. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.