pub struct Node {Show 37 fields
pub id: String,
pub name: String,
pub visible: Option<bool>,
pub type: NodeType,
pub children: Option<Vec<Node>>,
pub background_color: Option<Color>,
pub fills: Option<Vec<Paint>>,
pub strokes: Option<Vec<Paint>>,
pub stroke_weight: Option<f64>,
pub individual_stroke_weights: Option<StrokeWeights>,
pub stroke_align: Option<StrokeAlign>,
pub stroke_dashes: Option<Vec<f64>>,
pub corner_radius: Option<f64>,
pub rectangle_corner_radii: Option<[f64; 4]>,
pub transition_duration: Option<f64>,
pub transition_easing: Option<EasingType>,
pub opacity: Option<f64>,
pub absolute_bounding_box: Option<Rectangle>,
pub absolute_render_bounds: Option<Rectangle>,
pub primary_axis_sizing_mode: Option<AxisSizingMode>,
pub counter_axis_sizing_mode: Option<AxisSizingMode>,
pub primary_axis_align_items: Option<PrimaryAxisAlignItems>,
pub counter_axis_align_items: Option<CounterAxisAlignItems>,
pub item_spacing: Option<f64>,
pub layout_positioning: Option<LayoutPositioning>,
pub layout_mode: Option<LayoutMode>,
pub padding_left: Option<f64>,
pub padding_right: Option<f64>,
pub padding_top: Option<f64>,
pub padding_bottom: Option<f64>,
pub effects: Option<Vec<Effect>>,
pub styles: Option<Styles>,
pub characters: Option<String>,
pub style: Option<TypeStyle>,
pub constraints: Option<LayoutConstraint>,
pub layout_align: Option<LayoutAlign>,
pub layout_grow: Option<f64>,
}Expand description
Fields§
§id: StringA string uniquely identifying this node within the document.
name: StringThe name given to the node by the user in the tool.
visible: Option<bool>Whether or not the node is visible on the canvas.
type: NodeTypeThe type of the node
children: Option<Vec<Node>>An array of nodes that are direct children of this node
background_color: Option<Color>Background color of the canvas
fills: Option<Vec<Paint>>An array of fill paints applied to the node
strokes: Option<Vec<Paint>>An array of stroke paints applied to the node
stroke_weight: Option<f64>The weight of strokes on the node
individual_stroke_weights: Option<StrokeWeights>An object including the top, bottom, left, and right stroke weights. Only returned if individual stroke weights are used.
stroke_align: Option<StrokeAlign>Position of stroke relative to vector outline
stroke_dashes: Option<Vec<f64>>An array of floating point numbers describing the pattern of dash length and gap lengths that the vector path follows. For example a value of [1, 2] indicates that the path has a dash of length 1 followed by a gap of length 2, repeated.
corner_radius: Option<f64>Radius of each corner of the node if a single radius is set for all corners
rectangle_corner_radii: Option<[f64; 4]>Array of length 4 of the radius of each corner of the node, starting in the top left and proceeding clockwise
transition_duration: Option<f64>The duration of the prototyping transition on this node (in milliseconds)
transition_easing: Option<EasingType>The easing curve used in the prototyping transition on this node
opacity: Option<f64>Opacity of the node
absolute_bounding_box: Option<Rectangle>Bounding box of the node in absolute space coordinates
absolute_render_bounds: Option<Rectangle>The bounds of the rendered node in the file in absolute space coordinates
primary_axis_sizing_mode: Option<AxisSizingMode>Whether the primary axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
counter_axis_sizing_mode: Option<AxisSizingMode>Whether the counter axis has a fixed length (determined by the user) or an automatic length (determined by the layout engine). This property is only applicable for auto-layout frames.
primary_axis_align_items: Option<PrimaryAxisAlignItems>Determines how the auto-layout frame’s children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames.
counter_axis_align_items: Option<CounterAxisAlignItems>Determines how the auto-layout frame’s children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames.
item_spacing: Option<f64>The distance between children of the frame. Can be negative. This property is only applicable for auto-layout frames.
layout_positioning: Option<LayoutPositioning>Determines whether a layer’s size and position should be determined by auto-layout settings or manually adjustable.
layout_mode: Option<LayoutMode>Whether this layer uses auto-layout to position its children.
padding_left: Option<f64>The padding between the left border of the frame and its children. This property is only applicable for auto-layout frames.
padding_right: Option<f64>The padding between the right border of the frame and its children. This property is only applicable for auto-layout frames.
padding_top: Option<f64>The padding between the top border of the frame and its children. This property is only applicable for auto-layout frames.
padding_bottom: Option<f64>The padding between the bottom border of the frame and its children. This property is only applicable for auto-layout frames.
effects: Option<Vec<Effect>>An array of effects attached to this node
styles: Option<Styles>A mapping of a StyleType to style ID of styles present on this node. The style ID can be used to look up more information about the style in the top-level styles field.
characters: Option<String>Text contained within a text box
style: Option<TypeStyle>Style of text including font family and weight
constraints: Option<LayoutConstraint>Horizontal and vertical layout contraints for node
layout_align: Option<LayoutAlign>Determines if the layer should stretch along the parent’s counter axis. This property is only provided for direct children of auto-layout frames.
layout_grow: Option<f64>This property is applicable only for direct children of auto-layout frames, ignored otherwise. Determines whether a layer should stretch along the parent’s primary axis. A 0 corresponds to a fixed size and 1 corresponds to stretch