From 766f3b272332b9c66669fc9924dac04809181e7d Mon Sep 17 00:00:00 2001 From: zhongl Date: Mon, 9 Sep 2024 14:42:43 +0800 Subject: [PATCH] Fix order. --- src/plotly/SharedAxis.scala | 4 ++-- src/plotly/package.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plotly/SharedAxis.scala b/src/plotly/SharedAxis.scala index 6bf797f..b1821cd 100644 --- a/src/plotly/SharedAxis.scala +++ b/src/plotly/SharedAxis.scala @@ -22,5 +22,5 @@ object SharedAxis: def share(a: Intervals): PartialPlotDataAutobinx => PartialPlotDataAutobinx = val (_, r) = a.foldLeft(0.0 -> List.empty[Meter]): case ((s, t), i) => (i.distance + s) -> (i.distance + s :: t) - r.map(_.round).reverse - _.setX(r.toJSArray) + println(r.reverse) + _.setX(r.reverse.toJSArray) diff --git a/src/plotly/package.scala b/src/plotly/package.scala index b949fc0..455b18f 100644 --- a/src/plotly/package.scala +++ b/src/plotly/package.scala @@ -46,7 +46,7 @@ given history( plotly_click, accept[PlotMouseEvent]: e => val i = e.points(0).curveNumber.intValue - val is = h(i).reverse + val is = h(i) is.render(r).`then`(summon[Listen[Intervals, plotly_legendclick]](is, _)) )