Title: Multi-category sorting misbehaves with missing categories · Issue #3723 · plotly/plotly.js · GitHub
Open Graph Title: Multi-category sorting misbehaves with missing categories · Issue #3723 · plotly/plotly.js
X Title: Multi-category sorting misbehaves with missing categories · Issue #3723 · plotly/plotly.js
Description: Originally reported in plotly/plotly.py#1491. There seems to a multi-category sorting bug that wasn't fixed by #3362. CodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010 var fig = { "data": [ { "name": "Fruits", "type": "bar", ...
Open Graph Description: Originally reported in plotly/plotly.py#1491. There seems to a multi-category sorting bug that wasn't fixed by #3362. CodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010 var fig = { "data...
X Description: Originally reported in plotly/plotly.py#1491. There seems to a multi-category sorting bug that wasn't fixed by #3362. CodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010 var fig = { &...
Opengraph URL: https://github.com/plotly/plotly.js/issues/3723
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multi-category sorting misbehaves with missing categories","articleBody":"Originally reported in https://github.com/plotly/plotly.py/issues/1491.\r\n\r\nThere seems to a multi-category sorting bug that wasn't fixed by #3362.\r\n\r\nCodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010\r\n\r\n```javascript\r\nvar fig = {\r\n \"data\": [\r\n {\r\n \"name\": \"Fruits\",\r\n \"type\": \"bar\",\r\n \"x\": [\r\n [\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2018,\r\n 2018,\r\n 2018,\r\n 2018\r\n ],\r\n [\r\n 4,\r\n 5,\r\n 6,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n 12,\r\n 1,\r\n 2,\r\n 3,\r\n 4\r\n ]\r\n ],\r\n \"y\": [\r\n 57246.0,\r\n 1587.0,\r\n 63189.0,\r\n 30680.0,\r\n 26071.0,\r\n 117519.0,\r\n 27519.0,\r\n 42643.0,\r\n 8559.0,\r\n 22355.0,\r\n 59363.0,\r\n 62955.0\r\n ]\r\n },\r\n {\r\n \"name\": \"Price\",\r\n \"type\": \"scatter\",\r\n \"x\": [\r\n [\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2017,\r\n 2018,\r\n 2018,\r\n 2018,\r\n 2018\r\n ],\r\n [\r\n 4,\r\n 5,\r\n 6,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n 12,\r\n 1,\r\n 2,\r\n 3,\r\n 4\r\n ]\r\n ],\r\n \"y\": [\r\n 0.22991999,\r\n 0.27284184,\r\n 0.18438336,\r\n 0.24866362,\r\n 0.18280848,\r\n 0.19382398,\r\n 0.17268069,\r\n 0.18802617,\r\n 0.17560463,\r\n 0.13415343,\r\n 0.14773512,\r\n 0.31319196\r\n ],\r\n \"yaxis\": \"y2\"\r\n }\r\n ],\r\n \"layout\": {\r\n \"height\": 600,\r\n \"showlegend\": true,\r\n \"yaxis\": {\r\n \"showgrid\": true,\r\n \"title\": {\r\n \"text\": \"Fruits volume\"\r\n }\r\n },\r\n \"yaxis2\": {\r\n \"anchor\": \"x\",\r\n \"overlaying\": \"y\",\r\n \"showgrid\": false,\r\n \"side\": \"right\",\r\n \"title\": {\r\n \"text\": \"Price per unit\"\r\n }\r\n }\r\n }\r\n}\r\n\r\nPlotly.newPlot('myDiv', fig, {showSendToCloud: true});\r\n```\r\n\r\n\r\nThe problem is that in the second multi-category (2018), the 4 is sorted before 1, 2, 3 even though they are specified in ascending sorted order.\r\n\r\nAs noted in https://github.com/plotly/plotly.py/issues/1491, this seems to happen for categories that are not present in the first multi-category (2017).\r\n","author":{"url":"https://github.com/jonmmease","@type":"Person","name":"jonmmease"},"datePublished":"2019-04-04T10:00:32Z","url":"https://github.com/plotly/plotly.js/issues/3723"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d4a463f1-79aa-6799-4cf4-0c1f06553f0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAC0:38EE04:EB7F6B:13804E5:6B01D439 |
| html-safe-nonce | c07a7c76a2dbfe9154e8f2ae92b3e63e699c2ba2d16b9d87c179aca3c8ffc8a8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUMwOjM4RUUwNDpFQjdGNkI6MTM4MDRFNTo2QjAxRDQzOSIsInZpc2l0b3JfaWQiOiIyMTIyMTAwNjUwNzczOTU5NzM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d622158489d4b382fa5aacb5a6b4aa1802046062bbdb6b45cfb592c6769a5e2c |
| hovercard-subject-tag | issue:429189099 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/3723/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bd432545aac0c12eed9457c33d1d3654b178e464e36def839911f0826c8f72c2/plotly/plotly.js/issues/3723 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bd432545aac0c12eed9457c33d1d3654b178e464e36def839911f0826c8f72c2/plotly/plotly.js/issues/3723 |
| og:image:alt | Originally reported in plotly/plotly.py#1491. There seems to a multi-category sorting bug that wasn't fixed by #3362. CodePen: https://codepen.io/jonmmease/pen/VNeEqq?editors=1010 var fig = { "data... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jonmmease |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width