You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2023/04/11 08:53:09 UTC

[GitHub] [superset] villebro commented on a diff in pull request #23644: feat(plugin-chart-echarts): add x-axis sort to multi series

villebro commented on code in PR #23644:
URL: https://github.com/apache/superset/pull/23644#discussion_r1162501311


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -155,6 +151,84 @@ export function sortAndFilterSeries(
   ).map(({ name }) => name);
 }
 
+export function sortRows(
+  rows: DataRecord[],
+  xAxis: string,
+  xAxisSortSeries: SortSeriesType,
+  xAxisSortSeriesAscending: boolean,
+) {

Review Comment:
   I originally set out to implement this with `lodash`, similar to how `sortAndFilterSeries` was implemented, but in this case it felt clearer to write this out like this. But if this function looks too explicit I can rewrite this with the equivalent `lodash` functions (refactoring should be simple, as the tests should work as-is).



-- 
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