-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: function plots #27
Conversation
build: add "function-plot" as dep refactor: polish Stream Types refactor: uncollapse Protocol Concepts
a3cdb1d
to
ac63947
Compare
Added the graph functions @PaulRBerg! Let me know if you want me to change something. |
<FunctionPlot | ||
options={{ | ||
data: [ | ||
{ fn: "0", range: [0, 10], color: "orange" }, | ||
{ fn: "10", range: [10, 20], color: "orange" }, | ||
{ fn: "20", range: [20, 30], color: "orange" }, | ||
{ fn: "30", range: [30, 40], color: "orange" }, | ||
{ fn: "40", range: [40, 50], color: "orange" }, | ||
{ fn: "50", range: [50, 60], color: "orange" }, | ||
{ fn: "60", range: [60, 70], color: "orange" }, | ||
{ fn: "70", range: [70, 80], color: "orange" }, | ||
{ fn: "80", range: [80, 90], color: "orange" }, | ||
{ fn: "90", range: [90, 100], color: "orange" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can generate the points programmatically using a script like this:
...Array.from({ length: 10 }, (_, i) => ({
color: "#f77423",
fn: `${i * 10}`,
range: [i * 10, (i + 1) * 10],
})),
<FunctionPlot | ||
options={{ | ||
data: [ | ||
{ fn: "0", range: [0, 50], color: "orange" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use #f77423
(the brand color) instead of the generic orange.
{ fn: "x - 30", range: [50, 100], color: "orange" }, | ||
{ | ||
points: [ | ||
[50, 0], | ||
[50, 20], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use 25 as a point so that the visual representation matches the text (which refers to 1-year-cliff, 4-year-total vesting plans).
Thanks @maxdesalle, super cool work! Made a few refinements, and merging now. |
Context
This PR integrates the function-plot package to plot the streaming curves directly on the docs website rather than redirecting the user to Desmos.
Plots
Preview
This is how it looks for Lockup Linear: