MCPcopy
hub / github.com/plotly/dash / deleteColumn

Function deleteColumn

components/dash-table/src/dash-table/utils/actions.js:97–124  ·  view source on GitHub ↗
(
    column,
    columns,
    visibleColumns,
    headerRowIndex,
    mergeDuplicateHeaders,
    data
)

Source from the content-addressed store, hash-verified

95}
96
97export function deleteColumn(
98 column,
99 columns,
100 visibleColumns,
101 headerRowIndex,
102 mergeDuplicateHeaders,
103 data
104) {
105 const rejectedColumnIds = getAffectedColumns(
106 column,
107 visibleColumns,
108 headerRowIndex,
109 mergeDuplicateHeaders
110 );
111
112 return {
113 columns: R.filter(
114 col => rejectedColumnIds.indexOf(col.id) === -1,
115 columns
116 ),
117 data: R.map(R.omit(rejectedColumnIds), data),
118 // NOTE - We're just clearing these so that there aren't any
119 // inconsistencies. In an ideal world, we would probably only
120 // update them if they contained one of the columns that we're
121 // trying to delete
122 ...clearSelection
123 };
124}
125
126export function getColumnIds(
127 column,

Callers 1

clearColumnFunction · 0.85

Calls 3

getAffectedColumnsFunction · 0.85
filterMethod · 0.80
indexOfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…