MCPcopy Index your code
hub / github.com/microsoft/SandDance / layoutTitle

Function layoutTitle

docs/app/js/sanddance-app.js:120589–120599  ·  view source on GitHub ↗
(view, g, offset, isX, bounds, band)

Source from the content-addressed store, hash-verified

120587 return edge;
120588}
120589function layoutTitle(view, g, offset, isX, bounds, band) {
120590 if (!g) return;
120591 view.dirty(g); // compute title coordinates
120592 var x = offset, y = offset;
120593 isX ? x = Math.round(bounds.x1 + band * bounds.width()) : y = Math.round(bounds.y1 + band * bounds.height()); // assign coordinates and update bounds
120594 g.bounds.translate(x - (g.x || 0), y - (g.y || 0));
120595 g.mark.bounds.clear().union(g.bounds);
120596 g.x = x;
120597 g.y = y; // queue title for redraw
120598 view.dirty(g);
120599}
120600function lookup$1(config, orient) {
120601 const opt = config[orient] || {};
120602 return (key, d)=>opt[key] != null ? opt[key] : config[key] != null ? config[key] : d;

Callers 1

trellisLayoutFunction · 0.70

Calls 2

clearMethod · 0.65
translateMethod · 0.45

Tested by

no test coverage detected