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
Home page update, take 2 #102
Conversation
docs/index.md
Outdated
```python | ||
from skimage import data | ||
from skimage.data import cells3d | ||
import napari | ||
|
||
viewer = napari.view_image(data.astronaut(), rgb=True) | ||
napari.run() # start the event loop and show viewer | ||
viewer, layers = napari.imshow(cells3d(), channel_axis=1) | ||
``` |
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.
Why leave here the code sample without any comment?
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 agree, comments in the code could be nice, but also at least 1 line of lead in between napari
and the code block would be good for me.
Also, this code doesn't make that image 🤣
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.
@Czaki I was inspired by matplotlib.org which shows a (much tinier) code snippet together with a plot type.
However I acknowledge that the effect here is awkward because of the size of the code snippet! 😅 When I showed the matplotlib inspiration in the docs meeting @psobolewskiPhD said, "Ok but that is way cooler!" 😂 and he's not wrong 😂
Perhaps I reduce it to:
Just
import napari viewer, layer = napari.imshow(cells, channel_axis=1)
to get:
[video]
Alternatively, I can try to fit a caption under the image (need to check how to do that in myst):
[video/image]
viewer, layer = napari.imshow(cells, channel_axis=1)
But, I like "import napari" as a thing that people see early. 😊
Thoughts?
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 equivalent of matplotlib will be:
napari.imshow(cells, channel_axis=1)
As we can see also matplotlib omits an important part of the code.
Also, on video, it will be nice to show something more than just an image, but also other types of data.
I love the idea of redesigning, I love the tiles. Also, I think |
I kinda disagree on this — installation is a thing you do once then ~very rarely (and rarely need instructions again), while everything else you check all the time. So, it should be easily accessible, but it doesn't need to take up top-bar navigation space in every page... At any rate I don't want to update the navbar in this PR, only the home page, so maybe we continue this discussion in a later issue.
Yup, will fix, see inline discussion.
Maybe raise an issue for this? I think this requires a lot of infrastructure development that should follow this PR. |
I agree that the snippet + image is not the best as is. If the goal is "people should be able to copy pase this and try it", then I don't see the point of having it before the installation (since the target audience would anyways be people who didn't know napari yet). So I lean more toward either having no snippet at all, or a simple line like @Czaki suggested. However, the reason why the matplotlib one is cool is because it shows a specific function that's generally useful, and otherwise hard to replicate without a plotting library like matplotlib. I don't think "imview" has the same impact for me :P Would be nice to rather have a 2-3 liner (still without imports and embellishments) that also does some annotation, for example. |
It is possible (by js) to overwrite copy content. So you could have part of the code visible and the whole code will be copied on copy action. |
Ok before this conversation goes completely off the rails, I want to reiterate:
My plan here is to:
Ultimately, time has shown that we can spend approximately infinite amount debating what exactly goes in the home page, and in the meantime the homepage remains the readme from like 3 years ago. So I suggest we merge a slightly tweaked version of the above, then iterate. Especially while #86 remains open, so the home page is not actually going to get updated, only the dev version is. btw @brisvag
clearly you forget the world before napari. ;) Looking at a 3D+ image in Python used to be friggin annoying. And I suspect still is for a substantial portion of the scipy population. |
You need to get people to understand why they want to install something before they will read the installation instructions. My main thesis is that too many Python-y people find the home page and think this is a heavyweight application, not a viewer they can use from Python in their existing workflows. |
but if you add labels and points with dynamic disabling and enabling on video will be much more impressing. |
There is a balance between impressiveness and complexity. If the video is too complicated people might think that the tool is too complex for their simple use case. I think the carousel is the solution for this (start simple, increasing complexity). |
I wonder what the traffic is like between GitHub and napari.org |
Ok, color me convinced :) Then I vote for a 1-liner: napari.imshow(cells, channel_axis=1) |
Maybe with |
Not if the video starts in 2D slicing mode :) |
I still kinda hate it 😬 |
Yup, agree on this! As for the rest, I also agree it's generally a bit empty, but as pointed out by @jni, we will never merge anything if we keep stopping because something else could be improved :P Let's focus on getting a good scientific image at the top, then we can discuss the rest in a followup. |
I prefer to remove the left empty column from the front page. Partially it is out of this PR scope but will impact the shape of the main page. |
I mean I get that, but I think if we're redesigning—which is what is happening here, it's not just a question of the figure (which we already use on napari.org)—then using the side space better should be considered part of it. In fact, I'd say deciding the layout is more important than the contents and copy. Edit: didn't see @Czaki post, sorry, but I'm in agreement. |
Fixing the home page layout is a theme issue, not a docs issue, so indeed, out of scope for this PR. I'm sadly ill-qualified to deal with that. I have been investigating the mpl home page source, see here and here, and hopefully we can move to that soon. In the meantime I still think this change is worthwhile.
Unfortunately, the choices given the current theme are, big-ass code block above the image, or tiny code below it. I mean, I can have just the tiny code in a code block, but imho that looks worse. So, to clarify, I guess we want:
or:
Or...? But, again, to be clear, the overall layout is a much bigger lift that I think we should tackle separately. It will need a different build mechanism, maybe a different repo, and theme updates. I don't think we should wait to get all those ducks in a row to update our readme-style page. |
As a starting point, if you folks want to just get rid of the empty sidebar in the homepage, there is a way to do that from the
This however also removes the search bar from the home page, which I'm not sure we want. For the formatting of the caption, if you prefer you can always use the
and format directly (or create a new element in the EDIT: I think this could only work outside of the figure caption, though. So this works:
|
I think this is 100% a big improvement over the current home page. I agree that we want the "A multidimensional viewer for python" bit above the image. I would probably just add it to the main heading unless we can do a nice tagline. I think we should format the caption as per Melissa's suggestions above, and yes we should definitely have a video not just a static image. I agree we shouldn't get hung up on changing the layout in this PR. |
This explains it indeed. I expect that the issue is that it's a movie and not an image and then different rules apply. Let's see if I can fix it with raw html... |
omg I tried to make it 1 grid with 6 elements instead of 2 grids of 3 elements each and the results are cursed 😂: Screen.Recording.2023-03-01.at.10.48.23.pm.mov |
Here we go, using html5, providing videos in webm, mp4, and with a fallback jpg: Can people please test on their mobile browsers? 😊 Given my comment above, I suggest we punt on the mobile column layout. PS: @isabela-pf, indeed it turns out videos can't have alt-text 🤦, which explains why the formatting changed completely — there was no way to hide it in the video tag. |
@jni in the downloaded artifact I don't see the tribolium files in |
Oh dang! It's because I'm not doing a clean build locally 🤦. Sphinx was putting the webm in there when I was using sphinx, but not now that it's raw html. But my code found it because the webm was there from a previous build. Gah. @melissawm do you have any idea how I could mark files to get added to the build _images directory independent of them being referenced in a sphinx element? |
@jni I think it may work if you use |
_static is the ticket! Just checked with local clean build. 😊 Thank you! |
Works good on desktop and mobile Safari on my end. |
I absolutely love the idea of having a video showing up on the home page. I would like to suggest that we use some colormap other than grey so it would show up even better. |
@jni We discussed this PR in the docs working group. Maybe we can merge this and iterate on the theme issues? Need to find someone comfortable with handling the PR to the theme. |
@psobolewskiPhD it would be a big relief for me to get this merged (especially before 0.4.18), so if people are ok with it I think we should merge and then deal with colormap in future PRs. 🙏 |
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.
@jni I'm going to approve.
In the CircleCI preview the gallery is broken, but the zip artifact is fine.
Would like @melissawm to take one more look to make sure her mobile issue is also resolved.
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
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.
Works and looks great on Firefox/Linux and Android, you did it @jni!
Bravo!
…On Wed, Jun 21, 2023 at 2:29 PM Peter Sobolewski ***@***.***> wrote:
Merged #102 <#102> into main.
—
Reply to this email directly, view it on GitHub
<#102 (comment)>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3CMNTGX7WXPE2ETCAMBI2DXMNDSNANCNFSM6AAAAAAUNT5G5U>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Nadalyn Miller
214-906-5489 personal cell
|
A more minimal update to the home page. Rather than my previous attempt which basically required a full infrastructure update 😅, I decided to start from a more minimal template. The goal is to keep things minimal, get it merged, and then iterate.
Current layout is:
That's it!
Some points I want to make:
Edit: another point:
Anyway, without further ado, here's what this looks like on my machine:
Bedtime for me! See you all at the docs working group meeting in ~8h! 😅