wcl_wdoc 0.11.1-alpha

WCL documentation format — build structured docs with WCL, render to HTML
    export let widget_uml_actor = (b) => {
        let w = attr_or(b, "width", 60)
        let h = attr_or(b, "height", 100)
        let name = attr_or(b, "label", "Actor")
        let color = attr_or(b, "color", "currentColor")
        let stroke = attr_or(b, "border_stroke", color)
        let label_fill = attr_or(b, "label_fill", "currentColor")
        let cx = w / 2
        let hr = h * 0.12
        let bt = hr * 2 + 2
        let bm = h * 0.5
        let ay = bt + (bm - bt) * 0.3
        let ly = h * 0.78
        [
            { kind = "circle", x = cx - hr, y = 0, r = hr,
              fill = "none", stroke = stroke, stroke_width = 2 },
            { kind = "line", x1 = cx, y1 = bt, x2 = cx, y2 = bm, stroke = stroke, stroke_width = 2 },
            { kind = "line", x1 = cx - w * 0.3, y1 = ay, x2 = cx + w * 0.3, y2 = ay,
              stroke = stroke, stroke_width = 2 },
            { kind = "line", x1 = cx, y1 = bm, x2 = cx - w * 0.25, y2 = ly,
              stroke = stroke, stroke_width = 2 },
            { kind = "line", x1 = cx, y1 = bm, x2 = cx + w * 0.25, y2 = ly,
              stroke = stroke, stroke_width = 2 },
            { kind = "text", x = 0, y = h * 0.82, width = w, height = h * 0.18,
              content = name, font_size = 11, fill = label_fill }
        ]
    }