-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add type prop to AxisProps #98
Comments
This seems like a good solution: inductive AxisType where
| number | category
deriving FromJson, ToJson
structure AxisProps where
dataKey? : Option Json := none
domain? : Option (Array Json) := none
allowDataOverflow : Bool := false
type : AxisType := .number
-- TODO: There are many more props
deriving FromJson, ToJson
On the other hand, if I can submit a PR if this seems like a good idea. I don't fully understand why this code works, but it seems to in my testing. I copied methods I saw in other parts of the source file. |
Thanks! Yeah, this seems like a reasonable PR to make and we can merge it if it works. However, see also my response in #96. |
On Zulip I'm being advised to base a ProofWidgets PR by creating a branch of Mathlib. Is that the right strategy? Might be a lot for a simple addition, given that I now realize based on #96 that I'm probably not going to use Recharts. |
One of the props missing from
AxisProps
inProofWidgets/Components/Recharts.lean
istype
, with optionsnumber
andcategory
. Thenumber
option causesx
values to be spaced according to numeric distances, but Recharts apparently defaults tocategory
. Thetype=category
default means, for example, that allx
values are treated as categorical--even if they are numeric--and will be evenly spaced. This is illustrated by the following revised version of thePlot
function from `ProofWidgets/Demo/Plot.lean:The key change is that 80 elements in the middle of the
steps
array are removed. Notice that in the plot, the gap between the "0.08" and "0.9" ticks is the same as all of the other gap sizes; it should be much wider, perhaps filled in by other tick marks:The text was updated successfully, but these errors were encountered: