MCPcopy
hub / github.com/microsoft/SandDance / addRow

Function addRow

packages/vega-deck.gl/src/legend.tsx:15–30  ·  view source on GitHub ↗
(row: LegendRow, i: number)

Source from the content-addressed store, hash-verified

13 const rows: TableRow[] = [];
14
15 const addRow = (row: LegendRow, i: number) => {
16 const fn = symbolMap[row.symbol.shape];
17 let jsx: JSX.Element;
18 if (fn) {
19 jsx = fn(row.symbol);
20 } else {
21 jsx = <span>x</span>;
22 //console.log(`need to render ${row.symbol.shape} symbol shape`);
23 }
24 rows.push({
25 cells: [
26 { className: 'symbol', content: jsx },
27 { className: 'label', content: row.label, title: row.label },
28 ],
29 });
30 };
31
32 const sorted = Object.keys(props.legend.rows).sort((a, b) => +a - +b);
33 sorted.forEach(i => addRow(props.legend.rows[i], +i));

Callers 1

LegendViewFunction · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected