Sign in

    sayoi7799/moon_vegalite/scale does not have a README file

    Band

    pub struct Band {
    is_point : Bool
    keys : Array[String]
    range : (Double, Double)
    padding_inner : Double
    padding_outer : Double
    align : Double
    round : Bool
    step : Double
    bandwidth : Double
    positions : Array[Double]
    }

    Band and point scales. A point scale is a band scale with an inner padding of 1 whose padding only changes the outer padding.

    Band::band

    fn Band::band() -> Band

    Band::map

    fn Band::map(self : Band, v :
    Value
    ) -> Double?

    Start position of the band for a domain value, None if not in the domain.

    Band::point

    fn Band::point() -> Band

    Band::set_align

    fn Band::set_align(self : Band, a : Double) -> Unit

    Band::set_domain

    fn Band::set_domain(self : Band, values : Array[
    Value
    ]) -> Unit

    Set the domain (duplicates are ignored, first occurrence wins).

    Band::set_padding

    fn Band::set_padding(self : Band, p : Double) -> Unit

    Band::set_padding_inner

    fn Band::set_padding_inner(self : Band, p : Double) -> Unit

    Band::set_padding_outer

    fn Band::set_padding_outer(self : Band, p : Double) -> Unit

    Band::set_range

    fn Band::set_range(self : Band, r0 : Double, r1 : Double) -> Unit

    Band::set_range_round

    fn Band::set_range_round(self : Band, r0 : Double, r1 : Double) -> Unit

    rangeRound: set the range and round positions and sizes to integers.

    Band::set_round

    fn Band::set_round(self : Band, round : Bool) -> Unit

    Continuous

    pub(all) struct Continuous {
    kind : ScaleKind
    domain : Array[Double]
    range : Array[Double]
    clamp : Bool
    round : Bool
    }

    Continuous::map

    fn Continuous::map(self : Continuous, x : Double) -> Double?

    Map a domain value to the range; None for NaN input (d3's unknown).

    Continuous::new

    fn Continuous::new(kind : ScaleKind) -> Continuous

    Continuous::nice

    fn Continuous::nice(self : Continuous, count? : Double) -> Unit

    d3 scale.nice(count): widen the domain to round values.

    Continuous::ticks

    fn Continuous::ticks(self : Continuous, count? : Double) -> Array[Double]

    Approximately count nice tick values (d3 scale.ticks).

    Ordinal

    pub struct Ordinal {
    keys : Array[String]
    range : Array[
    Value
    ]
    }

    An ordinal scale: domain values are matched by value_key and the range repeats when it is shorter than the domain.

    Ordinal::map

    The range value for a domain value; None if unknown (or the range is empty).

    Ordinal::new

    fn Ordinal::new() -> Ordinal

    Ordinal::set_domain

    fn Ordinal::set_domain(self : Ordinal, values : Array[
    Value
    ]) -> Unit

    Ordinal::set_range

    fn Ordinal::set_range(self : Ordinal, range : Array[
    Value
    ]) -> Unit

    Rgb

    pub struct Rgb {
    r : Double
    g : Double
    b : Double
    opacity : Double
    }

    An sRGB colour with fractional channels, as d3-color's Rgb.

    Rgb::format_rgb

    fn Rgb::format_rgb(self : Rgb) -> String

    rgb(r, g, b) (or rgba(r, g, b, a)), channels rounded and clamped, as d3-color's formatRgb.

    ScaleKind

    pub(all) enum ScaleKind {
    Linear
    Pow(Double)
    Log(Double)
    }

    ScaleKind::sqrt

    fn ScaleKind::sqrt() -> ScaleKind

    Scheme

    pub enum Scheme {
    Discrete(Array[String])
    Interpolating((Double) -> String)
    }

    A named colour scheme: a list of colours for ordinal scales, or an interpolator over [0, 1] for continuous ones.

    Sequential

    pub(all) struct Sequential {
    scale : Continuous
    interpolator : (Double) -> String
    }

    A sequential colour scale: a continuous domain mapped to [0, 1] and then through a colour interpolator (d3 scaleSequential).

    Sequential::map

    fn Sequential::map(self : Sequential, x : Double) -> String?

    Sequential::new

    fn Sequential::new(kind : ScaleKind, interpolator : (Double) -> String) -> Sequential

    band_space

    fn band_space(count : Double, padding_inner : Double, padding_outer : Double) -> Double

    vega-scale's bandSpace(count, paddingInner, paddingOuter).

    interpolate_colors

    fn interpolate_colors(colors : Array[String]) -> ((Double) -> String)

    d3's piecewise(interpolateRgb, colors) as built by vega-scale's interpolateColors: spreads the colours evenly over t in [0, 1].

    interpolate_range

    fn interpolate_range(interpolator : (Double) -> String, lo : Double, hi : Double) -> ((Double) -> String)

    vega-scale's interpolateRange(interpolator, [lo, hi]): restricts an interpolator to a sub-range of [0, 1] (reversed when lo > hi).

    interpolate_rgb

    fn interpolate_rgb(a : String, b : String) -> ((Double) -> String)

    d3's interpolateRgb(a, b) (gamma 1): a function from t in [0, 1] to an rgb(...) string. Unparsable colours interpolate as NaN channels.

    parse_color

    fn parse_color(text : String) -> Rgb?

    Parse a CSS colour: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(r, g, b), rgba(r, g, b, a) (integers or percentages) and the CSS colour keywords.

    quantize_interpolator

    fn quantize_interpolator(interpolator : (Double) -> String, count : Int) -> Array[String]

    vega-scale's quantizeInterpolator(interpolator, count).

    scheme

    fn scheme(name : String) -> Scheme?

    Look up a scheme (names are case-insensitive).

    scheme_interpolator

    fn scheme_interpolator(name : String) -> (Double) -> String?

    The continuous interpolator of a named scheme (vega's scheme(name) for sequential scales), when the scheme has one.

    value_key

    fn value_key(v :
    Value
    ) -> String

    A key identifying a domain value the way d3's InternMap does: values of different types never collide (the number 1 and the string "1" differ).

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io