-
Notifications
You must be signed in to change notification settings - Fork 240
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: card height in grid #1199
Open
akloeckner
wants to merge
2
commits into
kalkih:dev
Choose a base branch
from
akloeckner:fix/grid
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: card height in grid #1199
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Check these examples:
1st card - default
2nd - added
height: 100%
for:host
3rd - my PR
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, the 100% on host were not enough. But maybe the first 100% needs to go where you put it in your PR... I'll check this. This is what a horizontal stack looks like with a scaled graph:
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.
Looks nice imho. Better than a tiny one. I will continue a review soon.
Also, we should check how a
height
option affects...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.
FYI: by default any card inside horiz stack gets
display: block
; insidegrid
-display: inline
(automatically) - unless it is changed by a card's creator.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.
The height option sets the graph height in masonry. But if the height is already fixed by the view (grid, sections, horizontal stack), then the height option only affects the squishing of the stroke.
Wherever we continue with this, we should have selvalt in the loop. They had some idea to counter the squishing and started the discussion on this feature. I am afraid, I diluted the discussion a bit now...
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.
The thing is that we should not change
display
like it was done long time ago (that time grid card was not invented yet).To keep a proper behaviour - we need to use default values (i.e. not overwrite them).
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.
What I see is
because of
preserveAspectRatio='none'
.SVG is elongated.
We need to think 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.
We probably need to set this "0 0 500 100" thing dynamically dependently on an available height:
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.
Note that if the
height
option is set (to 1000 for example) - it is accounted in that SVG size:Means - we may LEAVE to a user to define how the card will look if stretched))))
Anyway, assume we found a way to stretch a graph properly. Then a user comes and asks "WTH 'height' option is not accounted?"
The funniest part: seems that in this case your PR will be same as my PR ))) and it will be 3rd concurrent PR with same code for "height")
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.
(Tagging @selvalt7 to have them in this discussion on the desired looks of the stretched card in grid/sections view.)
Yes. It can be fixed for the lines, as selvalt pointed out. Points are more difficult. But there is a suggestion in #1139, at which I couldn't look closer yet.
That is what selvalt proposed. But it recalculates the entire graph each time the window is resized. (Basically, because the number of rows is only available after the Graph is initialized.) I think it will be more natural and efficient to leave such resizing to CSS.
That might make sense, actually... It would also make the change much easier. It will just not look pretty by default. :-/
It is not accounted correctly currently either: the width is set to 500 and the height to whatever is in the option. Then, the graph is scaled (preserving aspect ratio) to fit the card's width. This changes the height. By the way, this also changes line widths, which can be set in the options, but are thus not respected correctly either. So, these dimensions are a sensible first guess, in the best case. And completely useless in the worst case. :-P Based on this observation, I would even consider to remove this option... Then again, there would be no way to set a height in default masonry view.
I have no problem to close mine. I just wanted to create something focused and testable to discuss the stretched approach.
In summary, I think, we should
So, I think, the questions are:
I will thus have a look at the de-squishing of points @selvalt7 proposed and see how far I get with question no. 2.
But, please, let me know, if you think differently on the preferred way of sizing the card! That could save me some work. ;-)