Skip to content

Element.Paths

Generates a <path> element

DaxLib.SVG.Element.Paths( d, attributes, transforms )
Name Type Required Description
d STRING The path data string (e.g., "M10 10 L90 90")
attributes STRING Direct SVG attributes to apply (e.g., "pathLength='100' fill-rule='evenodd'"), can generate with DaxLib.SVG.Attr.*or manually
transforms STRING Transformation to apply (can be generated with DaxLib.SVG.Transforms)

STRING <path> element

DaxLib.SVG.SVG(
    500,                // width
    100,                // height
    "0 0 100 20",       // viewbox
    DaxLib.SVG.Element.Paths(
        "M10 10 L30 5 C50 0 70 20 90 15 L100 0", // d
        DaxLib.SVG.Attr.Shapes(
            "none",     // fill
            BLANK(),    // fillOpacity
            BLANK(),    // fillRule
            DaxLib.SVG.Colour.Theme(
                "Power BI",
                25
            ),          // stroke
            2,          // strokeWidth
            BLANK(),    // strokeOpacity
            BLANK()     // opacity
        ),              // attributes
        BLANK()         // transforms
    ),                  // contents
    BLANK()             // sortValue
)
function 'DaxLib.SVG.Element.Paths' =
    (
        d: STRING,
        attributes: STRING,
        transforms: STRING
    ) =>

        "<path d='" & d & "'" &
        IF( NOT ISBLANK( attributes ), " " & attributes & " " ) &
        IF( NOT ISBLANK( transforms ), " transform='" & transforms & "'" ) & 
        "/>"

Comments