Torsten Curdt

Results 447 comments of Torsten Curdt

It seems there already is an `YScaleModeAnchored` on the axes - which just isn't exposed. https://github.com/mum4k/termdash/blob/master/widgets/linechart/internal/axes/scale.go#L46 I know it would be a breaking change, but frankly speaking just ``` func...

Hm. Odd. Even this refuses to work. Still expands beyond the min/max. ``` func YAxisCustomScale(min, max float64) Option { return option(func(opts *options) { opts.yAxisCustomScale = &customScale{ min: min, max: max,...

Seems like this also need to change https://github.com/mum4k/termdash/blob/master/widgets/linechart/linechart.go#L174 but then the draw panics ``` panic: container.Draw => error: unable to draw widget *linechart.LineChart: failure for series first[9] on scale YScale{Min:Value{Round(-5)...

This seems to be already covered by the existing tests: ``` --- FAIL: TestLineChartDraws/custom_Y_scale,_negative_and_positive,_values_don't_fit_so_adjusted (0.00s) linechart_test.go:1867: Draw => unexpected error: failure for series first[0] on scale YScale{Min:Value{Round(-200) => -200}, Max:Value{Round(200)...

That's with ``` diff --git a/widgets/linechart/linechart.go b/widgets/linechart/linechart.go index 5880d45..47e670f 100644 --- a/widgets/linechart/linechart.go +++ b/widgets/linechart/linechart.go @@ -172,8 +172,9 @@ func (lc *LineChart) yMinMax() (float64, float64) { } if lc.opts.yAxisCustomScale != nil...

I guess this something I could work around by limiting the input data - not great but a workaround. If I find a way to disallow the zooming via mouse.

Alright - the summary is as follows: - the assignment of `opts.yAxisMode = axes.YScaleModeAdaptive` should be just removed (unfortunately that does not make it just work) - removing (or temporarily...

Ah! OK, well, I think it would be nice to be able to disable zooming - but that's really for another ticket I guess. The idea was just to limit...

I still think [`YAxisCustomScale`](https://github.com/mum4k/termdash/blob/master/widgets/linechart/options.go#L153) is very much mixing concerns with [`YAxisAdaptive`](https://github.com/mum4k/termdash/blob/master/widgets/linechart/options.go#L129). And it seems like [`XAxisUnscaled`](https://github.com/mum4k/termdash/blob/master/widgets/linechart/options.go#L174) would also somehow suggest `YAxisUnscaled`. The zooming already provides a way show a slice/window...

> We can even mark `YAxisCustomScale` as deprecated in documentation and emit a warning when it is used indicating that users should move and we might eventually delete it completely,...