-
Notifications
You must be signed in to change notification settings - Fork 158
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
Svg viewbox is to big #146
Comments
Bumping this. Very annoying and the only reason I am excluding weekdays from my chart. |
@ThisTemba As a workaround you can execute that snippet after your import. import CalendarHeatmap from "react-calendar-heatmap";
CalendarHeatmap.prototype.getHeight = function () {
return this.getWeekWidth() + (this.getMonthLabelSize() - this.props.gutterSize);
}; |
I havent run into that issue, because I use the german lables with only two characters and a point. But that should work. You can also play around with the const WEEKDAYLABEL_LEFT = 5;
CalendarHeatmap.prototype.getTransformForWeekdayLabels = function () {
if (this.props.horizontal) {
return `translate(${WEEKDAYLABEL_LEFT}, ${this.getMonthLabelSize()})`;
}
return null;
} |
@ThisTemba Has that worked? |
It did actually. Currently using this fix in production. |
Ok cool. But this projects seems dead. Hopefully the maintainers fix this. |
Hello,
I think the height is calculated incorrectly here. Because the viewbox is too big, and it interferes with the other components in my app.
what this results in:
I have tested in a codesandbox, and would suggest deleting the
getWeekdayLabelSize()
so that the svg viewbox is only as large as it needs to be. If we remove the+ this.getWeekdayLabelSize()
, the viewbox would only be 90 high.Can I make a pull request for it?
The text was updated successfully, but these errors were encountered: