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

Function getFormattingState

components/dash-table/demo/AppMode.ts:338–391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

336}
337
338function getFormattingState() {
339 const state = getDefaultState();
340
341 R.forEach((datum: any) => {
342 if (datum.eee % 2 === 0) {
343 datum.eee = undefined;
344 } else if (datum.eee % 10 === 5) {
345 datum.eee = `xx-${datum.eee}-xx`;
346 }
347 }, state.tableProps.data as any);
348
349 R.forEach((column: any) => {
350 if (column.id === 'rows') {
351 column.format = {
352 specifier: '.^5'
353 };
354 } else if (column.id === 'ccc') {
355 column.format = {
356 locale: {
357 separate_4digits: false
358 },
359 prefix: 1000,
360 specifier: '.3f'
361 };
362 } else if (column.id === 'ddd') {
363 column.format = {
364 locale: {
365 symbol: ['eq. $ ', ''],
366 separate_4digits: false
367 },
368 nully: 0,
369 specifier: '$,.2f'
370 };
371 column.on_change = {
372 action: 'coerce',
373 failure: 'default'
374 };
375 column.validation = {
376 allow_nully: true
377 };
378 } else if (column.id === 'eee') {
379 column.format = {
380 nully: 'N/A',
381 specifier: ''
382 };
383 column.on_change = {
384 action: 'coerce',
385 failure: 'default'
386 };
387 }
388 }, state.tableProps.columns as any);
389
390 return state;
391}
392
393function getModeState(mode: string | null) {
394 switch (mode) {

Callers 1

getModeStateFunction · 0.85

Calls 1

getDefaultStateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…