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

feat: add tick generation options to view options #285

Merged
merged 5 commits into from
Nov 10, 2020

Conversation

TCL735
Copy link
Contributor

@TCL735 TCL735 commented Nov 9, 2020

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:
Screen Shot 2020-11-08 at 6 12 50 PM

@TCL735 TCL735 requested review from a team and hoorayimhelping and removed request for a team November 9, 2020 02:14
Copy link
Contributor

@hoorayimhelping hoorayimhelping left a 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
}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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')) {
Copy link
Contributor

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

@TCL735
Copy link
Contributor Author

TCL735 commented Nov 10, 2020

This also requires changes to make it work properly in the Dashboard page.

@TCL735
Copy link
Contributor Author

TCL735 commented Nov 10, 2020

@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 <AxisTicksGenerator>


if (!isFlagEnabled('axisTicksGenerator')) {
return null
}
Copy link
Contributor

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

@TCL735 TCL735 merged commit db76da8 into master Nov 10, 2020
@TCL735 TCL735 deleted the feat_79_tick_generator branch November 10, 2020 17:35
Cubone21 pushed a commit to bonitoo-io/ui that referenced this pull request Nov 11, 2020
* 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
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 this pull request may close these issues.

Integrate Giraffe tick generation options into View Options
2 participants