SummerForeverCo / duck-plot

Connecting DuckDB to Observable Plot
https://summerforeverco.github.io/duck-plot/
MIT License
1 stars 0 forks source link

Data order gets lost with unpivoting #62

Open mkfreeman opened 1 week ago

mkfreeman commented 1 week ago

In this examle, the x order gets lost in the pivot to support multiple y columns:

new DuckPlot(ddb)
  .query(
    "SELECT *, monthname(date) as month, month(date) as monthNum from weather ORDER BY monthNum"
  )
  .table("weather")
  .x("month")
  .y(["temp_min", "temp_max"]) // two columns breaks the x order
  .fy("location")
  .options({
    width
  })
  .mark("line")
  .render()