Skip to content

VECTOR_2_ORDERED_PAIR

Convert a Vector DataContainer to an OrderedPair DataContainer.Params:default : VectorThe input vector that will be the x axis of OrderedPair.y : VectorThe input vector that will be the y axis of OrderedPair.Returns:out : OrderedPairThe OrderedPair that is generated from the input vectors
Python Code
from flojoy import flojoy, Vector, OrderedPair


@flojoy
def VECTOR_2_ORDERED_PAIR(default: Vector, y: Vector) -> OrderedPair:
    """Convert a Vector DataContainer to an OrderedPair DataContainer.

    Parameters
    ----------
    default : Vector
        The input vector that will be the x axis of OrderedPair.
    y : Vector
        The input vector that will be the y axis of OrderedPair.

    Returns
    -------
    OrderedPair
        The OrderedPair that is generated from the input vectors
    """

    return OrderedPair(x=default.v, y=y.v)

Find this Flojoy Block on GitHub

Example

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, we generate two Vector nodes using Linspace node.

Using VECTOR_2_ORDERED_PAIR, let one of the Vector nodes to be x axis and the other to be y axis.

Visualize the OrderedPair type output using Scatter node