MCPcopy
hub / github.com/palantir/plottable / computeExpectedSymbolPosition

Function computeExpectedSymbolPosition

test/components/legendTests.ts:483–494  ·  view source on GitHub ↗
(rowIndex: number, entryIndexWithinRow: number)

Source from the content-addressed store, hash-verified

481 });
482
483 function computeExpectedSymbolPosition(rowIndex: number, entryIndexWithinRow: number) {
484 const row = d3.select(legend.content().selectAll<Element, any>(ROW_SELECTOR).nodes()[rowIndex]);
485 const entry = d3.select(row.selectAll<Element, any>(ENTRY_SELECTOR).nodes()[entryIndexWithinRow]);
486 const symbol = entry.select(SYMBOL_SELECTOR);
487 const rowTranslate = getTranslateValues(row);
488 const entryTranslate = getTranslateValues(entry);
489 const symbolTranslate = getTranslateValues(symbol);
490 return {
491 x: rowTranslate[0] + entryTranslate[0] + symbolTranslate[0],
492 y: rowTranslate[1] + entryTranslate[1] + symbolTranslate[1],
493 };
494 }
495
496 it("gets Entities representing the entry at a particular point", () => {
497 const domain = ["AA", "BB", "CC"];

Callers 1

legendTests.tsFile · 0.85

Calls 2

getTranslateValuesFunction · 0.90
contentMethod · 0.80

Tested by

no test coverage detected