MCPcopy Index your code
hub / github.com/plotly/dash / doSort

Function doSort

components/dash-table/src/dash-table/derived/header/content.tsx:86–117  ·  view source on GitHub ↗
(
    columnId: ColumnId,
    sortBy: SortBy,
    mode: SortMode,
    setProps: SetProps
)

Source from the content-addressed store, hash-verified

84 };
85
86function doSort(
87 columnId: ColumnId,
88 sortBy: SortBy,
89 mode: SortMode,
90 setProps: SetProps
91) {
92 return () => {
93 let direction: SortDirection;
94 switch (getSorting(columnId, sortBy)) {
95 case SortDirection.Descending:
96 direction = SortDirection.None;
97 break;
98 case SortDirection.Ascending:
99 direction = SortDirection.Descending;
100 break;
101 case SortDirection.None:
102 direction = SortDirection.Ascending;
103 break;
104 default:
105 direction = SortDirection.Ascending;
106 break;
107 }
108
109 const sortingStrategy =
110 mode === SortMode.Single ? singleUpdate : multiUpdate;
111
112 setProps({
113 sort_by: sortingStrategy(sortBy, {column_id: columnId, direction}),
114 ...actions.clearSelection
115 });
116 };
117}
118
119function editColumnName(
120 column: IColumn,

Callers 1

getterFunction · 0.85

Calls 2

getSortingFunction · 0.85
setPropsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…