Skip to content

Instantly share code, notes, and snippets.

@domoritz
Last active June 21, 2019 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domoritz/b7ff33c9dd65d186780b8b37b9f8b1e4 to your computer and use it in GitHub Desktop.
Save domoritz/b7ff33c9dd65d186780b8b37b9f8b1e4 to your computer and use it in GitHub Desktop.
Selection bug
license: mit
<!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