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

Function matrixMap3

components/dash-table/src/core/math/matrixZipMap.ts:98–132  ·  view source on GitHub ↗
(
    m1: Matrix<T1>,
    m2: Matrix<T2> | undefined,
    m3: Matrix<T3> | undefined,
    fn: (
        d1: T1,
        d2: T2 | undefined,
        d3: T3 | undefined,
        i: number,
        j: number
    ) => TR
)

Source from the content-addressed store, hash-verified

96}
97
98export function matrixMap3<T1, T2, T3, TR>(
99 m1: Matrix<T1>,
100 m2: Matrix<T2> | undefined,
101 m3: Matrix<T3> | undefined,
102 fn: (
103 d1: T1,
104 d2: T2 | undefined,
105 d3: T3 | undefined,
106 i: number,
107 j: number
108 ) => TR
109): Matrix<TR> {
110 const _m1_ = m1.length;
111
112 const res: Matrix<TR> = new Array<TR[]>(_m1_);
113
114 for (let i = 0; i < _m1_; ++i) {
115 const _row_ = m1[i].length;
116 const row = new Array<TR>(_row_);
117
118 for (let j = 0; j < _row_; ++j) {
119 row[j] = fn(
120 m1[i][j],
121 m2 ? m2[i][j] : undefined,
122 m3 ? m3[i][j] : undefined,
123 i,
124 j
125 );
126 }
127
128 res[i] = row;
129 }
130
131 return res;
132}
133
134export function matrixMap4<T1, T2, T3, T4, TR>(
135 m1: Matrix<T1>,

Callers 2

CellFactoryClass · 0.90
HeaderFactoryClass · 0.90

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…