Sign in

    Lampese/mathplotlib/drawing does not have a README file

    Drawing

    pub struct Drawing {
    // private fields
    }

    A prepared SVG snapshot with point targets and no UI-framework types.

    Drawing::height

    fn Drawing::height(self : Drawing) -> Int

    Drawing::hit_test

    fn Drawing::hit_test(self : Drawing, x : Double, y : Double, radius? : Double) -> HitPoint?

    Find the nearest finite point in intrinsic drawing units. Equal-distance ties keep the original point-array order.

    Drawing::hit_test_client

    fn Drawing::hit_test_client(self : Drawing, client_x : Double, client_y : Double, left : Double, top : Double, width : Double, height : Double, radius? : Double) -> HitPoint?

    Hit-test client coordinates with a radius measured in CSS pixels.

    Drawing::points

    fn Drawing::points(self : Drawing) -> Array[HitPoint]

    Return a copy; mutating it cannot change this drawing's hit targets.

    Drawing::svg

    fn Drawing::svg(self : Drawing) -> String

    Drawing::viewport_point

    fn Drawing::viewport_point(self : Drawing, client_x : Double, client_y : Double, left : Double, top : Double, width : Double, height : Double) -> (Double, Double)?

    Convert client coordinates for an SVG viewBox="0 0 width height" with preserveAspectRatio="xMidYMid meet". Outside and letterbox hits are absent. The rectangle must be the actual SVG viewport's client rectangle.

    Drawing::width

    fn Drawing::width(self : Drawing) -> Int

    HitPoint

    pub struct HitPoint {
    panel_index : Int
    artist_index : Int
    point_index : Int
    data_x : Double
    data_y : Double
    screen_x : Double
    screen_y : Double
    } derive(Eq,
    Debug
    )

    A data-point anchor and its intrinsic drawing coordinates. Indices identify a point within this frame's panel and artist ordering.

    HitPoint::equal

    fn HitPoint::equal(HitPoint, HitPoint) -> Bool

    HitPoint::not_equal

    fn HitPoint::not_equal(x : HitPoint, y : HitPoint) -> Bool

    HitPoint::to_repr

    drawing

    fn drawing(width : Int, height : Int, svg : String, points : Array[HitPoint]) -> Drawing

    Capture the drawing and an independent copy of its hit-target array.

    hit_point

    fn hit_point(panel_index : Int, artist_index : Int, point_index : Int, data_x : Double, data_y : Double, screen_x : Double, screen_y : Double) -> HitPoint

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io