Built with blockbuilder.org
Last active
June 21, 2019 04:09
-
-
Save domoritz/b7ff33c9dd65d186780b8b37b9f8b1e4 to your computer and use it in GitHub Desktop.
Selection bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@3"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@4"></script> | |
</head> | |
<body> | |
<div id="vis"></div> | |
<script> | |
vegaEmbed('#vis', { | |
mark: 'point', | |
encoding: { | |
x: {field: 'a', type: 'quantitative'}, | |
y: {field: 'b', type: 'quantitative'} | |
}, | |
selection: { | |
grid: { | |
type: 'interval', | |
bind: 'scales' | |
} | |
} | |
}) | |
.then(result => { | |
result.view.insert( | |
'source', | |
[{a: 1, b: 2}, {a: 3, b: 2}, {a: 3, b: 1}] | |
) | |
}) | |
.catch(console.warn); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment