altair.Chart()
which outputs fine if I render it directly but if I wrap it in a mo.ui.altair_chart()
then the string x-axis values which are versions of the form "x.y.x" are getting evaluated as datetimes so the graph is exactly the same except the x-values are erroneously shown as datetimes. How can I stop this? See https://imgur.com/a/0wFfaYk. First graph is raw altair graph, second is wrapped graph.import marimo __generated_with = "0.10.9" app = marimo.App(width="medium") @app.cell def _(): import pandas as _pd import altair as _alt _d = _pd.DataFrame({"Version": ["1.1.1", "2.2.2"], "Days": [3, 4]}) ct = _alt.Chart(_d).mark_bar().encode( x='Version', y='Days', ) ct return ct, @app.cell def _(ct): import marimo as _mo _mo.ui.altair_chart(ct) return if __name__ == "__main__": app.run()
chart
, the second image is merely wrapping it in mo.ui.altair_chart(chart)
.