Skip to content

Tooltips for altair charts do not work in fullscreen mode #4642

Open

Description

@mokhin

Describe the bug

When you switch to full-screen mode for altair charts, the tooltips stop working.

Environment

Details
{
  "marimo": "0.13.0",
  "OS": "Darwin",
  "OS Version": "24.1.0",
  "Processor": "arm",
  "Python Version": "3.12.9",
  "Binaries": {
    "Browser": "135.0.7049.96",
    "Node": "v23.11.0"
  },
  "Dependencies": {
    "click": "8.1.8",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.8",
    "narwhals": "1.35.0",
    "packaging": "24.2",
    "psutil": "7.0.0",
    "pygments": "2.19.1",
    "pymdown-extensions": "10.14.3",
    "pyyaml": "6.0.2",
    "ruff": "0.11.5",
    "starlette": "0.46.2",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.13.2",
    "uvicorn": "0.34.1",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {},
  "Experimental Flags": {
    "lsp": true,
    "table_charts": false,
    "inline_ai_tooltip": false
  }
}

Code to reproduce

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "altair==5.5.0",
#     "marimo==0.13.0",
#     "pyarrow==19.0.1",
#     "vega-datasets==0.9.0",
#     "vegafusion==2.0.2",
#     "vl-convert-python==1.7.0",
# ]
# ///

import marimo

__generated_with = "0.13.0"
app = marimo.App(width="medium")


@app.cell
def _():
    import marimo as mo
    import altair as alt
    import vega_datasets
    return alt, mo, vega_datasets


@app.cell
def _(alt, mo, vega_datasets):
    # Load some data
    cars = vega_datasets.data.cars()

    # Create an Altair chart
    chart = alt.Chart(cars).mark_point().encode(
        x='Horsepower', # Encoding along the x-axis
        y='Miles_per_Gallon', # Encoding along the y-axis
        color='Origin', # Category encoding by color
    )

    # Make it reactive ⚡
    chart = mo.ui.altair_chart(chart)
    return (chart,)


@app.cell
def _(chart, mo):
    mo.vstack([chart, chart.value.head()])
    return


if __name__ == "__main__":
    app.run()

Activity

  1. added theissue type on Apr 23, 2025
  2. mscolnick commented on Apr 23, 2025

    @mscolnick
    Contributor

    hey @mokhin, can you file this issue on https://github.com/vega/vega-tooltip/, it looks like it should be handled there.

    They had an issue previously and added a fix, but looking at the code, it doesn't seem to handle when the view changes to fullscreen.

  3. added
    upstreamLikely out of marimo's control. Coming from an upstream dep
    on Apr 23, 2025
  4. matthalstead commented on Aug 1, 2025

    @matthalstead

    Interestingly, if you select Open in Vega Editor where it renders with Vega-lite, then the fullscreen mode there works fine, the tooltips are ok. Is it perhaps fixed in Vega but not pulled through yet into altair?

  5. mscolnick commented on Aug 1, 2025

    @mscolnick
    Contributor

    @matthalstead it is because we render ours in a ShadowDom, however the Vega playground does not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamLikely out of marimo's control. Coming from an upstream dep

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions