Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Image doesn't get positioned correctly on y axis without a height attribute #8687

Open
john-guerra opened this issue Jan 31, 2023 · 0 comments · May be fixed by #9250
Open

Mark Image doesn't get positioned correctly on y axis without a height attribute #8687

john-guerra opened this issue Jan 31, 2023 · 0 comments · May be fixed by #9250
Labels

Comments

@john-guerra
Copy link
Contributor

When creating an image scatterplot with vega-lite Images were positioned incorrectly. See this layered chart where the points don't match the position of the images

After some exploration, the only way I could get the images to position correctly was by adding the height attribute to the mark

Minimal example to reproduce the bug

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "layer": [
    {
      "mark": {"type": "image" },
      "encoding": {
        "x": {"field": "title", "type": "nominal"},
        "url": {"field": "img", "type": "nominal"},        
        "y": {"field": "score", "type": "quantitative"},
        "tooltip": {"field": "title"}
      }
    },
    {
      "mark": {"type": "point"},
      "encoding": {
        "x": {"field": "title", "type": "nominal"},
        "y": {"field": "score", "type": "quantitative"},
        "tooltip": {"field": "title"}
      }
    }
  ],
  "data": {
    "values": [
      {
        "title": "Minecraft",
        "score": 4.5664163,
        "img": "https://play-lh.googleusercontent.com/yAtZnNL-9Eb5VYSsCaOC7KAsOVIJcY8mpKa0MoF-0HCL6b0OrFcBizURHywpuip-D6Y=w832-h470"
      }
    ]
  },
  "width": 200
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant