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

Class EdgeFactory

components/dash-table/src/dash-table/components/EdgeFactory.tsx:42–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40type EdgesMatricesOp = EdgesMatrices | undefined;
41
42export default class EdgeFactory {
43 private readonly dataStyles = derivedRelevantCellStyles();
44 private readonly filterStyles = derivedRelevantFilterStyles();
45 private readonly headerStyles = derivedRelevantHeaderStyles();
46
47 private readonly getPartialDataEdges = derivedPartialDataEdges();
48 private readonly getDataEdges = derivedDataEdges();
49 private readonly getDataOpEdges = derivedDataOpEdges();
50 private readonly getFilterEdges = derivedFilterEdges();
51 private readonly getFilterOpEdges = derivedFilterOpEdges();
52 private readonly getHeaderEdges = derivedHeaderEdges();
53 private readonly getHeaderOpEdges = derivedHeaderOpEdges();
54
55 private static clone(target: EdgesMatricesOp) {
56 return target && target.clone();
57 }
58
59 private static hasPrecedence(
60 target: number,
61 other: number,
62 cutoff: number
63 ): boolean {
64 return (other <= cutoff || target === Infinity) && other <= target;
65 }
66
67 private hOverride(
68 previous: EdgesMatricesOp,
69 target: EdgesMatricesOp,
70 cutoffWeight: number
71 ) {
72 if (!previous || !target) {
73 return;
74 }
75
76 const hPrevious = previous.getMatrices().horizontal;
77 const hTarget = target.getMatrices().horizontal;
78
79 const iPrevious = hPrevious.rows - 1;
80 const iTarget = 0;
81
82 for (let j = 0; j < hPrevious.columns; j++) {
83 if (
84 EdgeFactory.hasPrecedence(
85 hPrevious.getWeight(iPrevious, j),
86 hTarget.getWeight(iTarget, j),
87 cutoffWeight
88 )
89 ) {
90 hTarget.setEdge(
91 iTarget,
92 j,
93 hPrevious.getEdge(iPrevious, j),
94 Infinity,
95 true
96 );
97 }
98 hPrevious.setEdge(iPrevious, j, 'none', -Infinity, true);
99 }

Callers

nothing calls this directly

Calls 6

hReconcileMethod · 0.95
vReconcileMethod · 0.95
hOverrideMethod · 0.95
vOverrideMethod · 0.95
memoizeOneFunction · 0.90
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…