-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix #9623 widgets font customizations #9682
Fix #9623 widgets font customizations #9682
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.
Overall the code is good, just few changes:
- we should remove font color on pie chart because the default behaviour is better. Bu default it uses the contrast color for each slice of the pie
- line and bar chart have the layout section for font called Popup style but it has only effect on the axis. I think the title should be different like Font. It seems there is none font options applied globally to the plolty configuration, is this intentional?
- the font family select is clearable but it we click on the x an error in console shows up
- I think the Noto font family should not be included in the list because it's not considered a web safe font and it related to the default theme of mapstore that could be different in a custom project. My proposal is to remove the Noto Sans from the list and display the
Inherit
label so plolty will use the page font by default
useEffect(() => { | ||
if (selectedTrace?.type === "pie" && tab === "axis") { | ||
setTab("traces"); | ||
} | ||
}, [selectedTrace?.type]); |
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 don't think a useEffect is needed in this case because the current selected tab could be computed directly in the render:
const selectedTab = selectedTrace?.type === "pie" && tab === "axis" ? "traces" : (selectedTrace?.type || "traces");
then use:
{tabContents[selectedTab]}
the selectedTab can be also passed to other components as tab prop
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.
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.
yes, it was like that, I wrote the code in the comment not tested
makes sense
yes I've missed it during refactor
what do you mean exactly by "globally"?
I'll remove clearable
sounds good |
* removed noto sans * extended layout font customizations * added jsdoc to Font comp * removed clearable to font family
@allyoucanmap |
@ElenaGallo please test this fix on dev, thanks |
Description
Now you can customize some properties of the font that will be stored inside layout prop or coutnerOpts
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
Fix #9623
What is the new behavior?
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information