sticknodes-js API Documentation - v1.0.10
    Preparing search index...

    Class Node

    Index

    Properties

    id: number
    stickfigure: Stickfigure
    draw_index: number
    node_type: NodeType
    color: Color
    gradient_color: Color
    circle_outline_color: Color
    is_static: boolean
    is_stretchy: boolean
    is_smart_stretch: boolean
    do_not_apply_smart_stretch: boolean
    use_segment_color: boolean
    use_circle_outline: boolean
    circle_is_hollow: boolean
    use_gradient: boolean
    reverse_gradient: boolean
    gradient_mode: number
    use_segment_scale: boolean
    local_x: number
    local_y: number
    scale: number
    default_length: number
    length: number
    default_thickness: number
    thickness: number
    segment_curve_radius_and_default_curve_radius: number
    curve_circulization: boolean
    segment_curve_polyfill_precision: number
    half_arc: boolean
    right_triangle_direction: number
    triangle_upside_down: boolean
    trapezoid_top_thickness_ratio: number
    num_polygon_vertices: number
    default_local_angle: number
    local_angle: number
    default_angle: number

    Methods

    • Returns void

    • Set the draw index of this node to a new draw index. Will increment all indices that are >= the desired draw index if the desired draw index is already occupied.

      Parameters

      • draw_index: number

      Returns void

    • Get the index of every node that is a direct child of this node.

      Returns Uint32Array

    • Get the reference of every node that is a direct child of this node.

      Returns Node[]

    • Get the index of every node that has the same parent as this node.

      Returns Uint32Array

    • Get the reference of every node that has the same parent as this node.

      Returns Node[]

    • Get the index of every node that is a child of this node, recursively. Includes child nodes of child nodes of child nodes and so on. Use get_child_indices() to get only direct children of this node. Use get_descendant_nodes() to get the reference of descendant nodes instead.

      Returns Uint32Array

    • Get the reference of every node that is a child of this node, recursively. Includes child nodes of child nodes of child nodes and so on. Use get_child_nodes() to get only direct children of this node. Use get_descendant_indices() to get the index of descendant nodes instead.

      Returns Node[]

    • Get the index of every node that is a parent of this node, recursively. Includes parent node of parent node of parent node and so on. Use get_parent_index() to get only the direct parent of this node. Use get_ancestor_nodes() to get the reference of ancestor nodes instead.

      Returns Uint32Array

    • Get the reference of every node that is a parent of this node, recursively. Includes parent node of parent node of parent node and so on. Use get_parent_node() to get only the direct parent of this node. Use get_ancestor_indices() to get the index of ancestor nodes instead.

      Returns Node[]

    • Get the index of the direct parent of this node. Use get_parent_node() to get the reference of the parent node instead.

      Returns number

    • Get the reference of the direct parent of this node. Use get_parent_index() to get the index of the parent node instead.

      Returns Node

    • Add a new node as a sibling of this node (a child of this node's parent).

      Parameters

      Returns Node

    • Add a new node as a child of this node.

      Parameters

      Returns Node

    • Delete this current node.

      Returns void