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

scale independent conflicts with height #7075

Closed
krlng opened this issue Dec 1, 2020 · 5 comments · Fixed by #7077
Closed

scale independent conflicts with height #7075

krlng opened this issue Dec 1, 2020 · 5 comments · Fixed by #7077
Labels
Bug 🐛 Need Clarification ❔ Needs clarification before we can proceed.

Comments

@krlng
Copy link

krlng commented Dec 1, 2020

I use altair (see issue) to render a vega_lite Chart with two figures that have independent y-axis and different heights. How ever, the second height does not have an effect. The vega-lite JSON looks like:

{
	"config": {
		"view": {
			"continuousWidth": 400,
			"continuousHeight": 300
		}
	},
	"vconcat": [{
		"layer": [{
			"mark": "line",
			"encoding": {
				"color": {
					"type": "nominal",
					"field": "symbol"
				},
				"y": {
					"type": "quantitative",
					"field": "price"
				}
			},
			"width": 850
		}, {
			"mark": {
				"type": "area",
				"opacity": 0.4
			},
			"encoding": {
				"y": {
					"type": "quantitative",
					"aggregate": "average",
					"field": "price"
				}
			},
			"width": 850
		}],
		"encoding": {
			"x": {
				"type": "temporal",
				"field": "date"
			}
		},
		"height": 260,
		"resolve": {
			"scale": {
				"y": "independent"
			}
		}
	}, {
		"layer": [{
			"mark": "line",
			"encoding": {
				"color": {
					"type": "nominal",
					"field": "symbol"
				},
				"y": {
					"type": "quantitative",
					"field": "price"
				}
			},
			"width": 850
		}, {
			"mark": {
				"type": "area",
				"opacity": 0.4
			},
			"encoding": {
				"y": {
					"type": "quantitative",
					"aggregate": "average",
					"field": "price"
				}
			},
			"width": 850
		}],
		"encoding": {
			"x": {
				"type": "temporal",
				"field": "date"
			}
		},
		"height": 60,
		"resolve": {
			"scale": {
				"y": "independent"
			}
		}
	}],
	"data": {
		"url": "https://vega.github.io/vega-datasets/data/stocks.csv"
	},
	"$schema": "https://vega.github.io/schema/vega-lite/v4.8.1.json"
}
@domoritz
Copy link
Member

domoritz commented Dec 2, 2020

Can you simplify the test case? I don't see a problem in a simpler chart: Open the Chart in the Vega Editor.

@domoritz domoritz added the Need Clarification ❔ Needs clarification before we can proceed. label Dec 2, 2020
@krlng
Copy link
Author

krlng commented Dec 2, 2020

I don't think so. I actually do not know much about vega-lite, the altair example is already as minimal as it can get to produce the error.

The test case is definetly to minimal, since the root of the problem seems to be the vconcat combined with the differing height attributes

@domoritz
Copy link
Member

domoritz commented Dec 2, 2020

Ahh, here: Open the Chart in the Vega Editor.

@krlng
Copy link
Author

krlng commented Dec 2, 2020

Yes, thats the bug

@domoritz
Copy link
Member

domoritz commented Dec 2, 2020

Somehow there is only a single height property. That is definitely wrong.

Screen Shot 2020-12-02 at 14 44 24

I have a fix that I will push in a second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Need Clarification ❔ Needs clarification before we can proceed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants