-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: make height controllable in other context #505
fix: make height controllable in other context #505
Conversation
Using height: 100% is enough here to always take up all space of the parent. The total height of the entire app can then be specified elsewhere. Part of spacetelescope#503
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 good!
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.
Doesn't break anything at least, but I didn't confirm that it helps in the MAST context. This is only part of solving that problem, right?
@havok2063 Can you confirm that this works for you or at least helps with the issues you were seeing? |
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.
So this seems reasonable to me, however, when I test this in our existing z.mast site, which does not contain any explicit height settings, I get the attached image, where it appears it has rendered with 0 height. Does this change need to be combined with changes from the on-going work in havok2063/standalone_jdaviz#1? (I did manage to get some height rendered using the standalone site digging through some of your changes).
In my head, I feel like the workflow should be something like:
- If a user embeds jdaviz as is with no CSS modifications, the height of jdaviz should be some default, probably the
settings.context.notebook.max_height
. - The user can modify the height of jdaviz by applying a CSS modifcation to the designated application id or class name.
- Jdaviz should always attempt to fill the height 100% of the parent container
If it doesn't already, I feel like jdaviz should have a custom class that contains its entire CSS stylings that can be easily overridden. This makes sense to me especially if we consider jdaviz as a component in a "javascript" library once it gets embedded. If we expand this concept out to the most general case, every piece of jdaviz (e.g. icon, color, shape, size, etc) should be easily overridable by a user when they embed it. This is probably a large scope item but could be a noble goal.
Can you provide an example of how to flexibly change the height of jdaviz?
I'll also add that if this is one step in the process of making it easier for users to change the height, then I'm ok approving and merging this in. The notebooks still render. |
The changes in havok2063/standalone_jdaviz#1 are indeed an example on what's required to make it work in the host site. It's not possible to use the Also, point 1 and 3 are mututally exclusive. To make things worse, some CSS is needed anyway to fix the height of the nested So the site has to contain the CSS of https://github.com/havok2063/standalone_jdaviz/blob/6843a34d1207a5db33f2b2171a17a174ed91404c/example/static/css/jdaviz.css anyway (in which I added the default height of 400px as an example, this could also be 100%) and the user must add the class Come to think of it, we can also set a class on the top jdaviz element, so setting the class |
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.
In the notebook it runs fine, nothing seems to be broken. I can't tell anything about how this runs in the MAST context though, so I am approving with this caveat.
Can we create a default |
So, this got 3 approvals. Is this ready to go in, or does the comment from @havok2063 need addressing first? |
Using height: 100% is enough here to always take up all space of
the parent. The total height of the entire app can then be
specified elsewhere.
Part of #503