quarto-dev / quarto-dev/quarto-cli

Altair interactive selection doesn't work well with reveal.js

Open
#2,891 12 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug revealjs third-party
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description
Details

RStudio 2022.07.2+576 "Spotted Wakerobin" Release (e7373ef832b49b2a9b88162cfe7eac5f22c40b34, 2022-09-06) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 12_6_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36

Example

When using interactivity with Altair, the selections are offset from the pointer. This issue only occurs with reveal.js, not HTML reports.

https://user-images.githubusercontent.com/25734232/196245078-568e0b11-f1eb-419f-ab9a-8b826a562d94.mp4

Code
---
title: "altair_selection_bug"
format: revealjs
jupyter: python3
---

```{python}
# From here: https://altair-viz.github.io/gallery/interactive_brush.html

import altair as alt
from vega_datasets import data

source = data.cars()
brush = alt.selection(type='interval')

alt.Chart(source).mark_point().encode(
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q',
    color=alt.condition(brush, 'Cylinders:O', alt.value('grey')),
).add_selection(brush)
```
Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.