Store position information for a node
771430
function Position(start) {
    this.start = start;
    this.end = { line: lineno, column: column };
    this.source = options.source;
  }
837667
def setpos(self, location, text):
        """"""
        self.location = location
        self.text = text
651055
async def get_positions(self):
        """"""
        data = await self.api("positions")
        if self.connected and self.authenticated:
            self._positions = data
        else:
            self._positions = self._positions
        _LOGGER.debug(self._positions)
101117
private void saveDecryptedPositions() {
        for (int i = 0; i < decryptedNetPosInfo.length; i++) {
            decryptedNetPosInfo[i] = 0;
        }
        if (null != getBuffers()) {
            WsByteBuffer[] buffers = getBuffers();
            if (buffers.length > decryptedNetPosInfo.length) {
                decryptedNetPosInfo = new int[buffers.length];
            }
            for (int i = 0; i < buffers.length && null != buffers[i]; i++) {
                decryptedNetPosInfo[i] = buffers[i].position();
            }
        }
    }
814396
function Position(nodeWrapper, offset) {
        this.offset = offset;
        this.nodeWrapper = nodeWrapper;
        this.node = nodeWrapper.node;
        this.session = nodeWrapper.session;
        this.cache = new Cache();
    }
691783
function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
    if (rootRect) {
        return {x: rootRect.x, y: rootRect.y};
    }

    var defaultPosition = {x: 0, y: 0};
    if (!targetInfo) {
        return defaultPosition;
    }

    // If targetInfo is fetched by 'retrieveTargetInfo',
    // old tree and new tree are the same tree,
    // so the node still exists and we can visit it.

    var targetNode = targetInfo.node;
    var layout = targetNode.getLayout();

    if (!layout) {
        return defaultPosition;
    }

    // Transform coord from local to container.
    var targetCenter = [layout.width / 2, layout.height / 2];
    var node = targetNode;
    while (node) {
        var nodeLayout = node.getLayout();
        targetCenter[0] += nodeLayout.x;
        targetCenter[1] += nodeLayout.y;
        node = node.parentNode;
    }

    return {
        x: layoutInfo.width / 2 - targetCenter[0],
        y: layoutInfo.height / 2 - targetCenter[1]
    };
}
1193338
def place(self, part: str, val: Union['ApiNode', 'ApiEndpoint']):
        """"""
        if part.startswith(':'):
            if self.param and self.param != part:
                err = """Cannot place param '{}' as '{self.param_name}' exist on node already!"""
                raise ParamAlreadyExist(err.format(part, self=self))
            self.param = val
            self.param_name = part
            return val
        self.paths[part] = val
        return val
1170102
def coords_callback(self, data):
        
        for node_id, lon, lat in data:
            self.coords[node_id] = (lon, lat)
627448
def positions(self):
        
        # if accessing and stale - update first
        if self.root.stale:
            self.root.update(self.root.now, None)

        vals = pd.DataFrame({x.name: x.positions for x in self.members
                             if isinstance(x, SecurityBase)})
        self._positions = vals
        return vals
947627
def dposition(self, node, dcol=0):
        """"""
        nnode = self.dnode(node)
        return (nnode.lineno, nnode.col_offset + dcol)
177353
function Node(page, startPosition, endPosition) {
        this.parentNode = null;
        this.page = page;
        this.startPosition = startPosition;
        this.endPosition = endPosition;
        this.nodeName = null;
        this.previousSibling = null;
        this.nextSibling = null;
    }
1354893
function getPosition(element) {
        var pos = {'left': 0, 'top': 0};
        do {
            pos.top += element.offsetTop || 0;
            pos.left += element.offsetLeft || 0;
            element = element.offsetParent;
        }
        while (element);
        return pos;
    }
462256
def compute_node_positions(self):
        
        xs = [0] * len(self.nodes)
        ys = [0] * len(self.nodes)
        for i, _ in enumerate(self.nodes[1:], start=1):
            prev_r = self.node_sizes[i - 1] / 2
            curr_r = self.node_sizes[i] / 2
            xs[i] = xs[i - 1] + prev_r + curr_r

        self.node_coords = {"x": xs, "y": ys}
839150
function (nodeId) {
            var layer = getLayer(nodeId);
            var body = getInitializedBody(nodeId);
            body.pos.z = layer * interLayerDistance;
            return body.pos;
        }
719173
function(node) {
    if (node) {
        this.start = {
            line: node.start.line,
            column: node.start.column
        };
        this.end = {
            line: node.end.line,
            column: node.end.column
        };
        this.offset = {
            start: node.start.offset,
            end: node.end.offset
        };
    }
}
850632
function nodePosition(node) {
  let name = node.nodeName
  let position = 1
  while ((node = node.previousSibling)) {
    if (node.nodeName === name) position += 1
  }
  return position
}
1077937
def compute_node_positions(self):
        
        xs = []
        ys = []
        self.locs = dict()

        for node in self.nodes:
            x = self.graph.node[node][self.node_lon]
            y = self.graph.node[node][self.node_lat]
            xs.append(x)
            ys.append(y)
            self.locs[node] = (x, y)

        self.node_coords = {"x": xs, "y": ys}