-
Notifications
You must be signed in to change notification settings - Fork 44
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: add tick generation options to view options #285
Conversation
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.
Great work! have a few suggestions / questions
|
||
if (!isFlagEnabled('axisTicksGenerator')) { | ||
return null | ||
} |
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.
i think this should be moved to the very top of the function. This should be the first thing checked. If we don't have the flag on, don't do any work reducing
and forEaching
, and setStateing
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 is about as high as it can be. It needs to come after all hooks, as early return is not allowed with hooks.
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.
i can move it above isTimeColumn
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 needs to come after all hooks, as early return is not allowed with hooks.
🤦 thanks, didn't know this
yTickStep, | ||
}) => | ||
useMemo(() => { | ||
if (!isFlagEnabled('axisTicksGenerator')) { |
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 have to be very careful about how this is deployed if this is done through config cat. the way isFlagEnabled
is written, you can't be sure that the results will be correct, depending on when the function is called in request's lifecycle
This also requires changes to make it work properly in the Dashboard page. |
@hoorayimhelping in addition to addressing the review comments, i also added another commit to fix dashboard cells. Now, they correctly display the user's selected values from the |
|
||
if (!isFlagEnabled('axisTicksGenerator')) { | ||
return null | ||
} |
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 needs to come after all hooks, as early return is not allowed with hooks.
🤦 thanks, didn't know this
* feat: add tick generation options in view options * feat: update time tick view options * feat: add tick options to Line, Band, Heatmap, Scatter, and Mosaic * refactor: address review comments * fix: display axis ticks correctly for dashboard cells
Closes #238
Adds options to View Options to allow user to create ticks on each axis for Line, Band, Heatmap, and Scatter plots. Mosaic plot gets x-axis only.
The options are total ticks, tick start, and tick step. They may be used in any combination. The options look like this:
