You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "geotab-data-platform (via GitHub)" <gi...@apache.org> on 2024/10/25 13:49:35 UTC
[PR] Reordered echart props so confidence interval works [superset]
geotab-data-platform opened a new pull request, #30716:
URL: https://github.com/apache/superset/pull/30716
### fix(echarts): confidence interval does not display correctly for mixed time series charts with negative values
### SUMMARY
The root cause of this problem lies within the order of the arguments sent to the echarts library. When working with time-series data, Echarts enforces specific constraints on how the x-axis bounds are configured. These constraints include:
In other words, the Echarts Library accepts input in this specific format and will malfunction otherwise. Superset does not create the Echarts modal with the options in this order.
* The `xaxis.type` option must be explicitly set to `'time'`.
* The `upper` and `lower` bound values must be equal to the lower bound.
* The `upper` bound must be defined before the `lower` bound in the options object.
Currently, the code in Superset that generates the Echarts configuration does not adhere to this required format, leading to the observed malfunction. This pull request rectifies this issue by reordering the `upper` and `lower` bound arguments before they are passed to the Echarts library.
[What is currently being sent](https://echarts.apache.org/examples/en/editor.html?version=5.5.0&code=PYBwLglsB2AEC8sDeAoW7YCICuBnApgKoAqAwpgFyxgBO2-ANGhpgOY0QAmlyzGLAYxhgAhhGgAZEQCN8AGx616Tfv0xz8AMzA8AzAFYVq9Jg6sAFjqoAmAAxHjmMKB4AWe31WZpwMM4C2PHaeAL4OWAAeAIIRELg8qMYmYACeIPg8mABuInL0mOFq0CL--ADiIiA8AIyGnkUl-BLAAiKQMJn-XJwaBfUsIrG4UrIKVEhh_SZd0MA0xBACANYJk0lYMwCS0GD4NDljsB7rmDOZnG0iALLifSf-g-eXV4-h4ZgpMXE8ANpTvOs1J8hiN5AAlXxtKDQHjHQHJNIZKjZXL5QpJU7iOYLZardGOGZzADKIDkEDAEnESOQa3hWEGcVBhwm-K8xVKFSqVFqrIapWarXaMORXU4PQyvIGZNY0BxS3iVE0uQI_1pxkSdI-X2GMnBkKFsMlCPSmQOaP-akJ80WK3GasBmFwpPJlOg1I1dJYuHMwAA7jwlXIVZ77fcsTQSWSKVS8RaBiDdczQ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aw1tJELBXp2ac25qwXm_No6WxAXHCWSCZYoM9gbfwRsRAm0zAXTiQsracJipgO2nAHZOxLK7USwUPZ0hRrpb2ocSwBwIPTTRchw7UijqzGOoxJGgR3N2LMyd_ppwztCTI2clHwhUcYFGoivBF1oc5RoNcPKXAbjVPugU576B3hfYeB1e4RNqGEo-QTR7RNCYfNKQSypjySefOJESV7pNiSk7JnVcnJMbtk4aiS8klM3rNIpmT8mbxbq3GJxTAkRIfuUlKz9Wavyun_L
-mof69PuqzIBEizbx3AUDSB-goikGqJlSGiCNbSwRjfVxBDEQYJjPTHBci8E6NZoQvYxDqZkN7PTBhtAmG81wI0E2Mo6EmHERwsZXClnIMRqgzUhtjam3Fj5C2bpRl_PNjI3ZWBnaKPdinEZzzgXx24QjJGkUXGAjUV6DRfstG033OYvRBjI7R1ji8_5FjtFB3-bY8k9is4uFzmJfOwzuDIg0pXUC1dmUO1ZZqeuVBj6-SCQ0mKSLamVNbvFOeFSWnDyyhK5p_VUmypFVKveADgrCs7uEzehTomSvlaUxVGqslVINYPTVe9BWRXVaao1rc2nDytYtTpoFunv1ujUB62pBlvWGbsYBotQHjMBkxCCEE4oQVcK4B5XgEU1E-ZxdBx5BTISjY6HZjs9nkv7GYIhVISE03ITizUVDliMN2MwzINzSh3JhGwwFsL3EnBjdyONDpvlCN-Q2jETz_VmPjqC9N4KFFaWRS2k4FifaYsOGcyheLyKGMJaY4l5iuxkpTpSzOWBHF0tzAWIsuM5A-Feu4pwklvUnFkmQi1LBNBKzANgRWvbHCeQAFq40CEu_pnqP6vWzJmom5JVZ90wOuYA76sAgf8LABWSso0nGkNQzIisGZzHwLACDTifIorEqqHSLAX1vt-MdEIABuIAA)
[What should actually be sent](https://echarts.apache.org/examples/en/editor.html?version=5.5.0&code=PYBwLglsB2AEC8sDeAoWsCuBnApgVQBUBhALljACcMcAaNWAcwogBMzV10BjGMAQwjQAMnwBGOADZlK1Op1gScAMzBkAzAFY5nZgwAWq2ACYADNvRhQZACxn66UcD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wThNEjAQEiB8pPiGS8XkxSfpUkLzLF3TAql0zfKCowbPlsXHJl-y1Hc5X1Z80K_LUAKtdczQ1dcyLnOivF4smJLY2ytLrgyrKcuIzh8sK4rtR-8rZyw7Jjz8YyiCsprYAe9qchenV-xiS7BuG0auXGqVdBmuaFvrQwZAx-Qdo26Itp1XO9soQ7juLM7ZMu_7Pa0sOnqIyPHQoHA-GrkmaxAVrw6IgA6IxG-uN6Pq-wH0Crj326BkGwd-CGocZ65maZ7auyRlHQ3J7PdWx0NcZ-AmLuJ76tIRzfKepxFXhiemF7LPkkkB9n89k8khZ1EXLIVkKNBizgVL0kkP8_JGDlrkX-2klZgL1k5KBQUNb6SAXAnWiCVYG1gSrb-4DLJmzARbHUVtEpO3tkKE4mVbbOzyhMd2N0a5lQwj7SqGg_BEGyMZYOnk66XhMAPeQ0c-oojjiNUGZ8o4p0mGnRamdeyF3WsXA6Ewy6_CwAST6rJK5_Qnsfc0nCI5w1ei4d6fBPqclHr9LUbctFaWBiwYRs9Qzzxhp5N2FjTHNU7o9DqMMeG6lXjvFoWdtp-L3vjQmR9TGn0Tujc-NMr501ALfC099WbmifvRSSOpX6_DSfzd-KxRb2VUvpLB_8inANAcUxWpS4EwOKfAkktSda1LQbUkKxSzaOQDHg80BCb
YpRyHiR25DiGuyoS4iy3sYLHmPDpY81hrAhx0SSbxFhvgxCHKUe8giE4-i3hYMRs0UTpyWgEmRu19qlxOso-IqjoDqPMZo0xizOp6J1EPIxI8LLjxoZPeQ1jbHRDnoxLxLzVq-PXv46Rq0glAX3qE5oPyJxk0iRTCyVMYnlDiQzLqfJAzBhGhIRwOVIz02GaRQweR5BKBbmADAzdJ7yQAFojTcJYkhDQiHIt2ZwSAYAAYWXQK2YALLoiCpcFGZufAQ4OF2jEZua0ug4FgKKhJd84Y4rLNoRlzLzidM8AAbiAA)
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
create a mixed chart on the explore menu using confidence intervals where the names__yhat_lower bound is negative at least once.
Verify that confidence Intervals behave as Intended.
**names__yhat**: trend/point estimate
**names__yhat_lower**: lower confidence level
**names__yhat_upper**: upper confidence level
### ADDITIONAL INFORMATION
Fixes #30554
- [x] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2549790166
Sorry for the delay. I think we're still just agonizing over how this works and whether it's safe to merge, or might just cause some other edge case to appear. If it's possible to add some form of tests (unit tests or end to end tests) that would help immensely.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2549244627
> Running CI... 🤞
Seems like it passed? Failled to pull some images for 2 pipelines
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "geotab-data-platform (via GitHub)" <gi...@apache.org>.
geotab-data-platform commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2458103740
Hi @villebro,
Please see attached the current behaviour vs after the fix.
## Settings Used:
Chart Type: Mixed Chart
yhat = 1
yhat_lower = -10
yhat_upper = 5
query b = 10
<img width="200" alt="image" src="https://github.com/user-attachments/assets/bc4c5b2f-e9dd-463d-8579-20954bd684d5">
<img width="200" alt="image" src="https://github.com/user-attachments/assets/f8e00c17-c769-4cf4-984a-0c4daeaf3061">
<img width="200" alt="image" src="https://github.com/user-attachments/assets/332c7ae8-0cb4-4a3b-b6d1-4cb15251e048">
## Current Behaviour
<img width="626" alt="image" src="https://github.com/user-attachments/assets/20048db8-e12d-43cd-bd88-3cddab1f46f8">
As you can see, the confidence interval ranges between (0,15) instead of (-10,5).
## After the fix
Setting the same values we get the following response with correct confidence intervals (-10,5).
<img width="1190" alt="image" src="https://github.com/user-attachments/assets/b90d6e67-2ca2-43c7-95f2-120f9e3a834b">
When you do not reorder the props and send them to echarts as a json to generate the chart, the echarts package will default to an x axis that uses value and not time. Additionally, the props must be ordered in the that specific order as the behaviour will not be as expected otherwise and confidence bands will not be correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2551711187
I think the unit test would help... at least it would harden the feature against someone accidentally changing the code in a way that reverts the functionality.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati17 (via GitHub)" <gi...@apache.org>.
vedantprajapati17 commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2483765968
@villebro any updates?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2619910805
feel free to merge 🥳
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2551711872
@rusackas Processing your ephemeral environment request [here](https://github.com/apache/superset/actions/runs/12396737795).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2438414091
@geido I don't see this PR changing enforcing or updating the `xaxis.type = 'time'` issue, despite it being changed in the "after" example. Is this not changed here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2532094510
Running CI... 🤞
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2448669384
@vedantprajapati17 I am unable to properly review this PR due to the following:
- I'm unable to reproduce the issue without dedicating considerable time for this. For instance, the fact that the before/after payloads aren't diffable (one is JS, the other is JSON) doesn't help.
- I still don't understand how `xaxis.type` changes as a consequence of this PR, despite there being no such change in the PR.
Also, we would need a minimal unit test to validate that `reorderForecastSeries` works as expected. This both helps understand how the function works, and will help refactoring and protect against regressions going forward.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2619784840
> Looks great, thanks for the tests! Fingers crossed for CI..
had to do a quick lint fix. resolved
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2551711347
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2550056957
> Sorry for the delay. I think we're still just agonizing over how this works and whether it's safe to merge, or might just cause some other edge case to appear. If it's possible to add some form of tests (unit tests or end to end tests) that would help immensely.
It's difficult to validate whether or not a canvas html component looks one way compared to another. Especially when all this function just reorders the series that is being sent. ie no data is removed or added. I can add unit tests validating that the order is changed correctly? @rusackas
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "geotab-data-platform (via GitHub)" <gi...@apache.org>.
geotab-data-platform commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2448299162
@villebro any updates?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "geotab-data-platform (via GitHub)" <gi...@apache.org>.
geotab-data-platform commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2520538467
Any updates on this MR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #30716:
URL: https://github.com/apache/superset/pull/30716#discussion_r1876718841
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts:
##########
@@ -150,3 +150,34 @@ export function rebaseForecastDatum(
return newRow;
});
}
+
+// For Confidence Bands, forecast series on mixed charts require the series sent in the following sortOrder:
+export function reorderForecastSeries(row: any[]): any[] {
+ // Define the order for sorting using ForecastSeriesEnum
+ const sortOrder = {
+ [ForecastSeriesEnum.ForecastLower]: 1,
+ [ForecastSeriesEnum.ForecastUpper]: 2,
+ [ForecastSeriesEnum.ForecastTrend]: 3,
+ [ForecastSeriesEnum.Observation]: 4,
+ };
+
+ if (
+ !row.some(item => {
+ const context = extractForecastSeriesContext(item.id);
+ return context && sortOrder.hasOwnProperty(context.type);
+ })
+ ) {
+ return row;
+ }
+
+ return row.sort((a, b) => {
+ // Extract the forecast series context from the id to determine the order
+ const aContext = extractForecastSeriesContext(a.id);
+ const bContext = extractForecastSeriesContext(b.id);
+
+ const aOrder = sortOrder[aContext.type] || Number.MAX_SAFE_INTEGER; // Put other metrics at the end
Review Comment:
Not sure how guaranteed the context and type are, so you could add safeguards if you think it's warranted:
`const aOrder = (aContext?.type && sortOrder[aContext.type]) || Number.MAX_SAFE_INTEGER;`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati17 (via GitHub)" <gi...@apache.org>.
vedantprajapati17 commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2438703008
xaxis type defaults to "value" if not reordered and there are negative bound values. When its ordered properly, it uses "time".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2619804998
Restarted CI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #30716:
URL: https://github.com/apache/superset/pull/30716
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2618886368
are we good to merge this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2456005235
@geotab-data-platform please let me know if you need help with this. I'd love to pull this fix in, but in the absence of more clarity on how this fix works it will be difficult to merge this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #30716:
URL: https://github.com/apache/superset/pull/30716#discussion_r1876720066
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/forecast.ts:
##########
@@ -150,3 +150,34 @@ export function rebaseForecastDatum(
return newRow;
});
}
+
+// For Confidence Bands, forecast series on mixed charts require the series sent in the following sortOrder:
+export function reorderForecastSeries(row: any[]): any[] {
Review Comment:
Not sure how well-defined of a type we can have here, but it'd be nice to avoid "any"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix: Reordering echart props to fix confidence interval in Mixed Charts [superset]
Posted by "vedantprajapati (via GitHub)" <gi...@apache.org>.
vedantprajapati commented on PR #30716:
URL: https://github.com/apache/superset/pull/30716#issuecomment-2570016503
tests added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org