-
Notifications
You must be signed in to change notification settings - Fork 630
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
Overwriting heigth and width values in concat operators #9316
Labels
Comments
Not sure if it's related to the same issue but combined a geoshape with the OSM tiles chart returns a blank chart. {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"hconcat": [
{
"width": 300,
"height": 300,
"data": {
"values": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-0.67541641, 47.366634369],
[-0.67541641, 47.530906677],
[-0.431031048, 47.530906677],
[-0.431031048, 47.366634369],
[-0.67541641, 47.366634369]
]
]
},
"properties": {"ID_ZONE": 1}
}
]
},
"projection": {"type": "mercator"},
"mark": {"type": "geoshape"}
},
{
"height": 200,
"width": 200,
"layer": [
{
"data": {
"sequence": {"start": 0, "stop": 4, "as": "a"},
"name": "tile_list"
},
"mark": {
"type": "image",
"clip": true,
"height": {"expr": "256"},
"width": {"expr": "256"}
},
"encoding": {
"url": {"field": "url", "type": "nominal"},
"x": {"field": "x", "scale": null, "type": "quantitative"},
"y": {"field": "y", "scale": null, "type": "quantitative"}
},
"transform": [
{"calculate": "sequence(0, 4)", "as": "b"},
{"flatten": ["b"]},
{
"calculate": "'https://tile.opentopomap.org/' + 17 + '/' + (datum.a + floor((invert('projection', [0, 0])[0] + 180) / 360 * pow(2, 17)) + pow(2, 17)) % pow(2, 17) + '/' + ((datum.b + floor((1 - log(tan(invert('projection', [0, 0])[1] * PI / 180) + 1 / cos(invert('projection', [0, 0])[1] * PI / 180)) / PI) / 2 * (pow(2, 17))))) + '.png'",
"as": "url"
},
{
"calculate": "(datum.a * 256 + round((floor((invert('projection', [0, 0])[0] + 180) / 360 * pow(2, 17)) - (invert('projection', [0, 0])[0] + 180) / 360 * pow(2, 17)) * 256)) + (256 / 2)",
"as": "x"
},
{
"calculate": "(datum.b * 256 + round((floor((1 - log(tan(invert('projection', [0, 0])[1] * PI / 180) + 1 / cos(invert('projection', [0, 0])[1] * PI / 180)) / PI) / 2 * (pow(2, 17)))-(1 - log(tan(invert('projection', [0, 0])[1] * PI / 180) + 1 / cos(invert('projection', [0, 0])[1] * PI / 180)) / PI) / 2 * (pow(2, 17))) * 256 )) + (256 / 2)",
"as": "y"
}
]
},
{
"mark": {"type": "geoshape"},
"projection": {
"center": {"expr": "[-2.079943,47.654317]"},
"rotate": {"expr": "[0, 0, 0]"},
"scale": {"expr": "256 * pow(2, 17) / (2 * PI)"},
"translate": {"expr": "[width / 2, height / 2]"},
"type": "mercator"
}
}
]
}
]
} |
Dear all, any comments or ideas to solve this issue ? Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Manage width/heigth with concatenation operators
It seems that vega doesn't owerwrite the width/heigth properties specificied in the concatenation element.
Bellow a spec to draw OSM tiles.
It returns the expected OSM tiles.
But in the following spec the height and width values do not match the values specified in "layer"
Result :

Expected :

Checklist
The text was updated successfully, but these errors were encountered: