Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunctionSeries and automatic min/max #385

Closed
targos opened this issue Apr 8, 2022 · 3 comments · Fixed by #380
Closed

FunctionSeries and automatic min/max #385

targos opened this issue Apr 8, 2022 · 3 comments · Fixed by #380

Comments

@targos
Copy link
Member

targos commented Apr 8, 2022

The problem now with FunctionSeries after these changes is that we have to specifie max,min of vertical axis too

Implementation detail:
how FunctionSeries work?
it take max/ min from horizantal axis if this latter exist and draw lineSeries in [min, max] domain

to specifie max / min we need to either:

  • axis max, min props
  • or add another series => axis will calculate automatically max, min

=> logically we need just to specifie max /min of horizontal axis to draw it .
but the problem is When Plot is empty

<Plot {...DEFAULT_PLOT_CONFIG}>
      <FunctionSeries
        getY={getY}
      />
      <Axis
        min={0}
        max={20}
        position="bottom"
      />
      <Axis position="left"/>
</Plot>

=> vertical axis domain is not defined => no horizantal axis

image

Originally posted by @wadjih-bencheikh18 in #380 (comment)

@wadjih-bencheikh18
Copy link
Member

The problem now with FunctionSeries after these changes is that we have to specifie max,min of vertical axis too

i specifie that these are the problems after PR changes

in the current situation, the problem is that when we use FunctionSeries with another Series (that define horizantal axis domain)
the domain will start from 0

the domain here must be [4,8]
image

@wadjih-bencheikh18
Copy link
Member

to fix this issue and also #333
i suggest that we add series type in PlotSeriesState (or a boolean) so that when we calculate max/min we don't take functionSeries in consideration

@wadjih-bencheikh18
Copy link
Member

in order to not change PlotSeriesState i added ~ in functionSeries id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants