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

[Feature Request] Include imports in the "Final Code" section in the tutorials #1417

Closed
AlexanderZeilmann opened this issue Aug 7, 2024 · 5 comments

Comments

@AlexanderZeilmann
Copy link

What feature or change would you like to see made?

When looking at the tutorials here, I am missing the imports in the "Final code" section. It is not clear to me where the functions createImageIdsAndCacheMetaData, RenderingEngine, ViewportType and similar are coming from.

Why should we prioritize this feature?

Complete docs are always a good idea.

@Ragnar-Oock
Copy link

The "final code" blocks on the doc are supposed to be copy pasted in to the packages/tools/examples/tutorial/index.ts file as pointed out on the doc (here to be precise).
But I agree, having an actual code snippet that works by itself would be nice to have.

As a side note, while I understand the why the tutorial section is written the way it is, it makes it really hard to understand what is actually needed as a minimal setup for cornerstone to display an image because the boilerplate file import so many things that are never explained. The only way to know if something is actually needed for a given use case is to remove it and try to run the code.

@AlexanderZeilmann
Copy link
Author

The "final code" blocks on the doc are supposed to be copy pasted in to the packages/tools/examples/tutorial/index.ts file as pointed out on the doc (here to be precise).

But this information is only on the general overview page. A person arriving at one of the tutorial pages via Google is lost. In my experience tutorials are not read from front to back, but people pick what they need.

As a side note, while I understand the why the tutorial section is written the way it is, it makes it really hard to understand what is actually needed as a minimal setup for cornerstone to display an image because the boilerplate file import so many things that are never explained. The only way to know if something is actually needed for a given use case is to remove it and try to run the code.

Fully agree. Having a minimal example would also be helpful as a template in bug reports.

Ideally, the tutorials run in the setup of the user not in a predefined environment. That means for example that there shouldn't be relative imports like this and it should work with the most common build tools (vite, webpack, ...), but that is a more complicated task.

@qiaozhi-4
Copy link

I also need guidance, and I want to use it in nuxt, but there are a lot of examples I can't find

@qiaozhi-4
Copy link

I also need guidance, and I want to use it in nuxt, but there are a lot of examples I can't find

The relevant documentation can be recommended

@sedghi
Copy link
Member

sedghi commented Oct 29, 2024

Sure i will add it

@sedghi sedghi closed this as completed Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants