Skip to content

Difference in rendering overlapping histograms between Observable Plot and SveltePlot #103

Open
@jamesscottbrown

Description

@jamesscottbrown

The ObservablePlot Overlapping histogram example is:

Plot.plot({
  round: true,
  color: {legend: true},
  marks: [
    Plot.rectY(olympians, Plot.binX({y1: "count"}, {x: "weight", fill: "sex", mixBlendMode: "multiply"})),
    Plot.ruleY([0])
  ]
})

The rendered chart is unaffected by changing {y1: "count"} to {y2: "count"} (but changing it to {y: "count"} causes rectY to apply an implicit stackY transform).

The SveltePlot equivalent is:

<Plot y={{ grid: true }} color={{ legend: true }}>
    <RectY
        {...binX(
            { data: olympians, x: 'weight', fill: 'sex' },
            {
                y: 'count'
            }
        )} />
    <RuleY data={[0]} />
</Plot>

which renders like:

Image

Changing to y1: 'count' makes it match the apeparance of the ObservablePlot plot:

Image

I wanted to flag this discrepancy, but my first thought is that what SveltePlot does might be more reasonable.

(this is one of the issues surfaced by #72)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy