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

Fixed group / layer height is buggy and giving "infinite loop in redraw" #108

Closed
callmeteus opened this issue Sep 23, 2019 · 4 comments
Closed
Labels
bug Something isn't working waiting for response

Comments

@callmeteus
Copy link

I'm trying to set a fixed group/layer height.

My current options are

showMajorLabels: false,
editable: true,
height: "calc(45vh - 20px)",
groupHeightMode: "fixed",
showCurrentTime: false,
verticalScroll: true,
horizontalScroll: true,
groupEditable: true

This is the actual working timeline (not fully, it's a wip haha):
http://prntscr.com/p9lh0m

Did some CSS work to make the groups appear 100% height:

/* This class (group) is applied to all groups */
.vis-inner .group {
    height: 100%;
}

.vis-inner {
    width: 100%;
    height: 100%;
    padding: 0 !important;
    overflow: hidden;
}

.vis-labelset > .vis-label {
    display: flex;
    justify-content: center;
    align-items: center;
}

.vis-labelset {
    height: 100%;
}

.vis-content {
    top: 0 !important;
}

.vis-panel {
    box-sizing: content-box;
}

When I zoom the timeline, sometimes the groups get invalid heights and collapse themselves (http://prntscr.com/p9lgtx) and sometimes they just flicker and constantly try to update the height every zoom.

Also, I'm receiving WARNING: infinite loop in redraw? in the console when I use the zoom, and when the timeline gets drawed in the first time, maybe it can be related to #17?

I tried to remove the custom heights from .vis-labelset and .vis-inner, but they also give me the same errors.

Anyways, the only thing that I'm updating is the current time position that I have using timeline.setCustomTime, I'm not even touching the redraw functions :(

@callmeteus callmeteus changed the title Fixed group / layer height Fixed group / layer height is buggy and giving "infinite loop in redraw" Sep 23, 2019
@callmeteus
Copy link
Author

Also, observed that when I try to drag the groups, they have the same behavior, they just contract to buggy heights.

@callmeteus
Copy link
Author

callmeteus commented Sep 23, 2019

Did a workaround for this because it was really annoying me.

I don't really know if the "fixed" group height mode was supposed to set groups to a fixed height, but this is was I did:

/**
 * Calculate group height
 * @return {Number}
 */
Group.prototype._calculateHeight 	= function(margin) {
	// Divide the groups container height by
	// the number of groups to get the desired group height
	// minus the axis margin
	const height 					= (this.dom.label.parentElement.clientHeight / this.dom.label.parentElement.children.length) - margin.axis;

	// Return the fixed height
	return height;
};

This also stopped the warnings in the console.

@yotamberk yotamberk added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Sep 26, 2019
@yotamberk
Copy link
Member

I've submitted a PR solving an issue that is very similar to this one. The PR should also solve this issue.
#174
Please try again with the new version once it's in.

@yotamberk
Copy link
Member

Closing due to inactivity. Please reopen if the issue is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for response
Projects
None yet
Development

No branches or pull requests

2 participants