Closed juba closed 1 year ago
Faceting now works correctly, but still generates a warning sign when used at top level. Mark level faceting is fine.
On the JS side, we test strict equality (===
) between the facet data and the mark's data; in other words they must be the same reference, not only the same contents. (Not sure this comment helps much…)
I managed to solve issue for the "main" mark, but I still get warnings for axis and ticks. For example, with the following code:
import polars as pl
from pyobsplot import Obsplot, Plot
pl.read_csv("https://github.com/juba/pyobsplot/raw/main/doc/data/penguins.csv")
op = Obsplot()
op({
"grid": True,
"facet": {"data": penguins, "x": "sex"},
"marks": [
Plot.dot(penguins, {"x": "culmen_depth_mm", "y": "body_mass_g"}),
Plot.frame()
]
})
In the JavaScript console I don't get warnings for the dot
mark, but I get them for frame
, fx-axis tick labels
, y-grid
, y-axis tick
, etc. Not sure how to avoid this (if this is possible).
If I replace top level faceting by mark-level faceting the warnings disappear.
Is there a debug mode, a way to see what exactly is sent to Plot?
Debug mode is now available with the widget renderer by adding debug=True
when creating the plot generator object. It outputs the plot JavaScript structure in the browser console:
op = Obsplot(debug=True)
Regarding this issue, it is reproducible in Plot outside of pyobsplot
.
Should be fixed in Observable Plot 0.6.6.
Same data sources are seen as distinct, generating warning and disabling faceting by default.
Example: