Sign in

    sayoi7799/moon_vegalite/scene does not have a README file

    SceneError

    pub(all) suberror SceneError {
    SceneError(String)
    }

    BoundCtx

    pub struct BoundCtx {
    bounds : Bounds
    rot : Double
    ma : Double
    mb : Double
    mc : Double
    md : Double
    lx : Double
    ly : Double
    }

    vega-scenegraph's boundContext: accumulates the extent of a path, optionally rotated by deg degrees about the origin.

    BoundCtx::arc

    fn BoundCtx::arc(self : BoundCtx, cx : Double, cy : Double, r : Double, sa0 : Double, ea0 : Double, ccw0 : Bool) -> Unit

    BoundCtx::bezier_to

    fn BoundCtx::bezier_to(self : BoundCtx, x1 : Double, y1 : Double, x2 : Double, y2 : Double, x3 : Double, y3 : Double) -> Unit

    BoundCtx::close_path

    fn BoundCtx::close_path(_self : BoundCtx) -> Unit

    BoundCtx::line_to

    fn BoundCtx::line_to(self : BoundCtx, x : Double, y : Double) -> Unit

    BoundCtx::move_to

    fn BoundCtx::move_to(self : BoundCtx, x : Double, y : Double) -> Unit

    BoundCtx::new

    fn BoundCtx::new(bounds : Bounds, deg? : Double) -> BoundCtx

    BoundCtx::quad_to

    fn BoundCtx::quad_to(self : BoundCtx, x1 : Double, y1 : Double, x2 : Double, y2 : Double) -> Unit

    BoundCtx::rect

    fn BoundCtx::rect(self : BoundCtx, x : Double, y : Double, w : Double, h : Double) -> Unit

    Bounds

    pub(all) struct Bounds {
    x1 : Double
    y1 : Double
    x2 : Double
    y2 : Double
    }

    Bounds::add

    fn Bounds::add(self : Bounds, x : Double, y : Double) -> Bounds

    Bounds::clear

    fn Bounds::clear(self : Bounds) -> Bounds

    Bounds::copy

    fn Bounds::copy(self : Bounds) -> Bounds

    Bounds::encloses

    fn Bounds::encloses(self : Bounds, b : Bounds) -> Bool

    Bounds::expand

    fn Bounds::expand(self : Bounds, d : Double) -> Bounds

    Bounds::height

    fn Bounds::height(self : Bounds) -> Double

    Bounds::intersect

    fn Bounds::intersect(self : Bounds, b : Bounds) -> Bounds

    Bounds::is_empty

    fn Bounds::is_empty(self : Bounds) -> Bool

    Bounds::new

    fn Bounds::new() -> Bounds

    An empty box (inverted infinite extent).

    Bounds::rotate

    fn Bounds::rotate(self : Bounds, angle : Double, x : Double, y : Double) -> Bounds

    Bounds::rotated_points

    fn Bounds::rotated_points(self : Bounds, angle : Double, x : Double, y : Double) -> Array[Double]

    The four corners of the box rotated by angle radians about (x, y), as [x, y] pairs flattened into eight numbers.

    Bounds::set

    fn Bounds::set(self : Bounds, x1 : Double, y1 : Double, x2 : Double, y2 : Double) -> Bounds

    Bounds::translate

    fn Bounds::translate(self : Bounds, dx : Double, dy : Double) -> Bounds

    Bounds::union

    fn Bounds::union(self : Bounds, b : Bounds) -> Bounds

    Bounds::width

    fn Bounds::width(self : Bounds) -> Double

    Ctx

    pub enum Ctx {
    Buf(PathBuf)
    Bound(BoundCtx)
    }

    Where a shape draws: SVG path text or a bounding box.

    Ctx::arc

    fn Ctx::arc(self : Ctx, x : Double, y : Double, r : Double, a0 : Double, a1 : Double, ccw : Bool) -> Unit

    Ctx::bezier_to

    fn Ctx::bezier_to(self : Ctx, x1 : Double, y1 : Double, x2 : Double, y2 : Double, x : Double, y : Double) -> Unit

    Ctx::close_path

    fn Ctx::close_path(self : Ctx) -> Unit

    Ctx::line_to

    fn Ctx::line_to(self : Ctx, x : Double, y : Double) -> Unit

    Ctx::move_to

    fn Ctx::move_to(self : Ctx, x : Double, y : Double) -> Unit

    Ctx::quad_to

    fn Ctx::quad_to(self : Ctx, x1 : Double, y1 : Double, x : Double, y : Double) -> Unit

    Ctx::rect

    fn Ctx::rect(self : Ctx, x : Double, y : Double, w : Double, h : Double) -> Unit

    Curve

    pub struct Curve {
    kind : CurveKind
    line : Double
    point : Int
    x0 : Double
    y0 : Double
    x1 : Double
    y1 : Double
    t0 : Double
    t : Double
    }

    Mutable curve state, mirroring d3's curve objects.

    Curve::area_end

    fn Curve::area_end(self : Curve) -> Unit

    Curve::area_start

    fn Curve::area_start(self : Curve) -> Unit

    Curve::line_end

    fn Curve::line_end(self : Curve, ctx : Ctx) -> Unit

    Curve::line_start

    fn Curve::line_start(self : Curve, _ctx : Ctx) -> Unit

    Curve::new

    fn Curve::new(kind : CurveKind) -> Curve

    Curve::point

    fn Curve::point(self : Curve, ctx : Ctx, x0 : Double, y0 : Double) -> Unit

    CurveKind

    pub(all) enum CurveKind {
    Linear
    Step
    StepBefore
    StepAfter
    MonotoneX
    MonotoneY
    }

    Item

    pub(all) struct Item {
    props : Map[String,
    Value
    ]
    bounds : Bounds
    children : Array[Mark]
    }

    Item::get

    fn Item::get(self : Item, key : String) ->
    Value

    Item::has

    fn Item::has(self : Item, key : String) -> Bool

    Item::has_corner_radius

    fn Item::has_corner_radius(self : Item) -> Bool

    Item::new

    Item::num0

    fn Item::num0(self : Item, key : String) -> Double

    item[key] || 0

    Item::num_or

    fn Item::num_or(self : Item, key : String, default : Double) -> Double

    item[key] != null ? +item[key] : default

    Item::opt_num

    fn Item::opt_num(self : Item, key : String) -> Double?

    The value when present and not null, as a number.

    Item::set

    fn Item::set(self : Item, key : String, v :
    Value
    ) -> Unit

    Item::set_num

    fn Item::set_num(self : Item, key : String, x : Double) -> Unit

    Item::set_str

    fn Item::set_str(self : Item, key : String, s : String) -> Unit

    Item::str

    fn Item::str(self : Item, key : String) -> String?

    A string property, None when missing or null.

    Item::truthy

    fn Item::truthy(self : Item, key : String) -> Bool

    JavaScript truthiness of a property.

    Mark

    pub(all) struct Mark {
    marktype : MarkType
    name : String?
    role : String?
    interactive : Bool
    clip : Bool
    zindex : Int?
    aria : Bool
    items : Array[Item]
    bounds : Bounds
    }

    Mark::new

    fn Mark::new(marktype : MarkType, name? : String, role? : String, interactive? : Bool, clip? : Bool, zindex? : Int, aria? : Bool, items? : Array[Item]) -> Mark

    MarkType

    pub(all) enum MarkType {
    Group
    Rect
    Rule
    Text
    Symbol
    Line
    Area
    }

    MarkType::from_name

    fn MarkType::from_name(name : String) -> MarkType?

    MarkType::is_nested

    fn MarkType::is_nested(self : MarkType) -> Bool

    Line and area marks render all their items as one path.

    MarkType::name

    fn MarkType::name(self : MarkType) -> String

    PathBuf

    pub struct PathBuf {
    out : StringBuilder
    digits : Int?
    x0 : Double
    y0 : Double
    x1 : Double
    y1 : Double
    started : Bool
    }

    d3-path's Path: appends SVG path commands; with digits coordinates are rounded to that many decimals (d3-shape's default is 3, vega's own rectangle shape uses full precision).

    PathBuf::arc

    fn PathBuf::arc(self : PathBuf, x : Double, y : Double, r : Double, a0 : Double, a1 : Double, ccw : Bool) -> Unit

    PathBuf::bezier_to

    fn PathBuf::bezier_to(self : PathBuf, x1 : Double, y1 : Double, x2 : Double, y2 : Double, x : Double, y : Double) -> Unit

    PathBuf::close_path

    fn PathBuf::close_path(self : PathBuf) -> Unit

    PathBuf::line_to

    fn PathBuf::line_to(self : PathBuf, x : Double, y : Double) -> Unit

    PathBuf::move_to

    fn PathBuf::move_to(self : PathBuf, x : Double, y : Double) -> Unit

    PathBuf::new

    fn PathBuf::new(digits? : Int) -> PathBuf

    PathBuf::quad_to

    fn PathBuf::quad_to(self : PathBuf, x1 : Double, y1 : Double, x : Double, y : Double) -> Unit

    PathBuf::rect

    fn PathBuf::rect(self : PathBuf, x : Double, y : Double, w : Double, h : Double) -> Unit

    PathBuf::to_string

    fn PathBuf::to_string(self : PathBuf) -> String

    TextLines

    The text content as one value or several lines (vega textLines).

    area_path

    fn area_path(items : Array[Item]) -> String raise SceneError

    baseline_offset

    fn baseline_offset(item : Item) -> Double

    vega offset(item): baseline correction in pixels.

    bound_group

    fn bound_group(bounds : Bounds, group : Item) -> Bounds

    bound_mark

    fn bound_mark(mark : Mark) -> Unit raise SceneError

    Compute bounds bottom-up for a mark and everything below it.

    bound_stroke

    fn bound_stroke(bounds : Bounds, item : Item) -> Bounds

    vega boundStroke: grow by the stroke width when the item is stroked.

    curve_kind

    fn curve_kind(name : String, orient : String) -> CurveKind?

    Look up an interpolation method by its Vega name.

    draw_area

    fn draw_area(ctx : Ctx, items : Array[Item]) -> Unit raise SceneError

    d3-shape area(): vertical areas span y to y + height, horizontal areas span x to x + width.

    draw_item_symbol

    fn draw_item_symbol(ctx : Ctx, item : Item) -> Unit raise SceneError

    The symbol of one item, drawn at the origin (d3-shape symbol() with type(item.shape || 'circle') and size(item.size ?? 64)).

    draw_line

    fn draw_line(ctx : Ctx, items : Array[Item]) -> Unit raise SceneError

    d3-shape line() over the items (x, y, defined).

    draw_rect

    fn draw_rect(ctx : Ctx, item : Item, x0? : Double, y0? : Double) -> Unit

    vega's rectangle shape: a plain rectangle or one with rounded corners.

    draw_symbol

    fn draw_symbol(ctx : Ctx, shape : String, size : Double) -> Unit raise SceneError

    The symbol shapes of vega-scenegraph (path/symbols.js), drawn at the origin.

    font_size

    fn font_size(item : Item) -> Double

    line_height

    fn line_height(item : Item) -> Double

    line_path

    fn line_path(items : Array[Item]) -> String raise SceneError

    mark_from_json

    fn mark_from_json(j : Json) -> Mark raise SceneError

    Build a mark (and everything below it) from JSON.

    mark_to_json

    fn mark_to_json(mark : Mark, with_bounds? : Bool) -> Json

    Serialise a mark. With with_bounds, every mark and item carries its bounding box under bounds.

    multi_line_offset

    fn multi_line_offset(item : Item) -> Double

    vega multiLineOffset(item): the extra height of a multi-line text.

    rect_path

    fn rect_path(item : Item, x? : Double, y? : Double) -> String

    d of a rect item (full precision), optionally offset.

    symbol_path

    fn symbol_path(item : Item) -> String raise SceneError

    d of a symbol item, centred on the origin (3 decimals, as d3-shape).

    text_lines

    fn text_lines(item : Item) -> TextLines

    text_value

    fn text_value(item : Item, line :
    Value
    ) -> String

    vega textValue(item, line): trimmed text, truncated to limit.

    text_width

    fn text_width(item : Item, line :
    Value
    ) -> Double

    Width of a single line, as textMetrics.width (estimate).

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io