observablehq/plot

The tip mark should respect the associated scale’s (local) time zone, if present

tx0c opened this issue · 1 comments

tx0c commented

when using x: { type: "time", ... } the a axis ticks are using correct local timezone, but the tip: "x" is still showing with utc timezones,

image

Plot.plot({
  color: { legend:true },
  x: { type: "time", domain: [new Date(Date.UTC(2024,3,8,-8)), new Date] },
  marks: [
    Plot.rectY(
      dataArticlesList,
      Plot.binX({y:"count", fill:"count"}, {x:"created_at", interval: d3.timeHour, tip: "x"})),
    Plot.ruleY([0]),
  ],
  width,
})

You currently need to use the format option to change how the tip mark formats channel values. But yes, perhaps the tip mark could check whether the channel’s associated scale is in local time.