Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class LinearProgressBar

    A progress bar is essentially two rectangles, one inside the other, with the inner one changing length to represent a percentage value. The outer container and inner value boxes can be fully styled with the embedded DrawingStyle properties. This class inherits from StyledRectangle which is used for the outer container box, and holds additional properties to control the inner value part. Any corner radius set on the outer container box will also be applied to the inner value part (after some adjustments for size).

    Hierarchy (View Summary)

    Implements

    • ILayerElement
    • IValuedElement
    • IColorElement
    Index

    Accessors

    • get isEmpty(): boolean

      Returns true if there is nothing to draw: size is empty, colors are blank or transparent, or there is no fill and stroke width is zero

      Returns boolean

    • get radii(): PointType[]

      radii value is like css border-radius, an array of 1-4 "point-like" objects ({x,y}) starting at top left corner, etc. Empty array for no radius. Values can be in either percent of overall size (like CSS border-radius %) or in absolute pixels, depending on the radiusIsRelative property. Radius values cannot be negative.

      See radii param at https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect#syntax

      Returns PointType[]

    • set radii(radii: number | (number | PointType)[]): void

      The radii can be set using an array of 1-4 numbers or PointType {x,y} objects, or a single numeric value (for all 4 corners).

      Parameters

      Returns void

    • get align(): string

      Alignment value as two string values, first for vertical and second for horizontal. Eg. "top left" or "center middle". Setting the property can be done with either a single direction or both (separated by space or comma) in either order.

      Returns string

    • set align(value: string | Alignment): void

      Parameters

      Returns void

    Constructors

    Methods

    • Sets current LinearProgressBar#value property using an evaluated string.

      Parameters

      • value: string

      Returns void

    • Clears the generated & cached Path2D object (if any). Some Path subclasses my not use the cache. Typically the cache management is handled automatically when relevant properties are modified.

      Returns void

    • Sets element width and height property values with optional unit type specifier to use for both dimensions. If unit is undefined then the current unit types for each dimension remain unchanged.

      Parameters

      • size: SizeType
      • Optionalunit: string
      • OptionalunitY: string

      Returns void

    • Returns actual pixel width of this element, either scaled to viewWidth if width unit is % or actual width value if it is in pixels already. If this element's width value is zero then return viewWidth.

      Parameters

      • viewWidth: number

      Returns number

    • Returns actual pixel height of this element, either scaled to viewHeight if height unit is % or actual height value if it is in pixels already. If this element's height value is zero then return viewHeight.

      Parameters

      • viewHeight: number

      Returns number

    • Validates the value types in given array and that none of the values are < 0; Turns all single numeric values into {x,y} PointType objects. Modifies the input array if needed. Any array members which are neither numeric nor {x,y} objects are replaced with a zero value.

      Parameters

      Returns asserts radii is PointType[]

    Properties

    orientation: Orientation = Orientation.H
    direction: DrawDirection = DrawDirection.Normal
    valueStyle: DrawingStyle

    Styling properties for the inner value part of the progress bar. The outer container is styled by the parent's StyledRectangle#style property.

    value: number = 0

    Progress bar value in percent, 0-100.

    padding: SizeType = ...

    Padding controls how much space to leave around the outside of the progress bar relative to the total drawing area. It determines the final size of the progress bar based on orientation. With width value determines padding along the long edges of the bar, and height sets the padding around the endpoints (short edges).

    operation: PathBoolOperation = PathBoolOperation.None

    Boolean operation to perform with previous path, if any. May be used by subclasses in their IPathProducer#getPath method to automatically combine with other paths.

    radiusIsRelative: boolean = true

    true if radius values in radii array are given in percentages, or false if they represent absolute pixels. Default is true.

    width: UnitValue = ...

    A zero width/height (default) indicates to draw into the full available image area (eg. passed to render() in rect argument). Negative values are not allowed.

    height: UnitValue = ...
    alignment: Alignment = Alignment.CENTER

    How to align within drawing area if/when width/height doesn't fill it completely.

    offset: Vect2d = ...

    Extra position offset to apply after alignment. Expressed as a percentage of overall drawing area size.

    Fill and stroke style to apply when drawing this element.

    adjustSizeForShadow: boolean = true

    Whether to adjust (reduce) the overall drawing area size to account for shadow offset/blur.