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

Doc: Tracking Issue for Graphics #18501

Open
MarsBarLee opened this issue Feb 26, 2021 · 11 comments
Open

Doc: Tracking Issue for Graphics #18501

MarsBarLee opened this issue Feb 26, 2021 · 11 comments

Comments

@MarsBarLee
Copy link
Contributor

MarsBarLee commented Feb 26, 2021

Hi all, this is a tracking issue for adding and updating the graphics in the Numpy documentation. If you see any graphics you think deserve an update, let us know here!

Graphical elements that need an update:

  • Outdated information, such as deprecated functions
  • Hard-to-read text, such as small, blurry or handwritten text
  • Cluttered or messy elements

Here's an example of a graphic we think deserve an update.
A flowchart for Array types for scalars
Untitled (1)
It does the job right now, but some text is cut off and some content is outdated.

If you're working on a documentation contribution, consider adding graphics! You can post here with your issue or PR. @melissawm and I can suggest new diagrams or digitize your existing hand-drawn diagram. We can also add diagrams after merging if you prefer that workflow.

Here's an example of an update I did with a contributor's PR.
circuit diagram update 2

We are also looking to standardize the file format and style of the graphics to make it more accessible for readers and easier for contributors to edit in the future.
Let us know if you have any thoughts or suggestions!

File format: SVG (scalable vector graphics)

  • Small, scalable and text can be edited without needing graphic software.
  • SVG text can also be read by screen-readers, unlike PNG or JPG

Design principle: Material Design

  • Clean, easy to understand, and fits with rest of the Numpy website design

Editing SVGs:

@melissawm
Copy link
Member

Thanks, @MarsBarLee !

I'd like to add #17517 as a relevant issue.

@8bitmp3
Copy link
Contributor

8bitmp3 commented Mar 1, 2021

Here's an example of an update I did with a contributor's PR.

This is great @MarsBarLee

@MarsBarLee
Copy link
Contributor Author

Based on the discussion in the recent Numpy Documentation, I'll add GIMP as an open-source SVG editor.

Graphviz was also recommended for people who want to programmatically create graphics instead of starting with graphic software. I'm just not sure if and where we keep its file format .gv for future use, or if we only keep the exported SVG.

@8bitmp3 brought up color accessibility, which is something I'll look into.

@cooperrc
Copy link
Member

cooperrc commented Mar 3, 2021

Based on the discussion in the recent Numpy Documentation, I'll add GIMP as an open-source SVG editor.

Gimp is great, but it is for bitmap editing. I like the idea of using Inkscape. Inkscape supports Python scripting. @rossbar mentioned it would be nice to have reproducible/customizable figures (I was assuming script-generated) when possible. Inkscape might provide a middle ground in the respect.

Blender is another svg editor with a full Python environment, but the files are binary and the outputs are usually bitmaps (without customizing too much).

Graphviz was also recommended for people who want to programmatically create graphics instead of starting with graphic software. I'm just not sure if and where we keep its file format .gv for future use, or if we only keep the exported SVG.

Cool, I hadn't seen this one before. It looks great for flow charts. It might be good to have a "image-source" location to store files like *.gv, but keep the docs in a consistent *.svg format in an "images" folder. The *.xml format for svg does support comments and metadata. If there are build files, maybe we could add them in a consistent metadata location for the xml file.

@MarsBarLee
Copy link
Contributor Author

MarsBarLee commented Mar 4, 2021

Gimp is great, but it is for bitmap editing

@cooperrc
It is, but looking briefly at its documentation for SVGs it says that if the Path tool is used, GIMP can export these Paths as an SVG. Other tools like Paintbrush are for bitmap editing.

If an SVG file is imported, it will appear as Paths and can be edited.

But Inkscape or other vector software is recommended for further editing. But maybe GIMP can work for basic changes for someone most familiar with GIMP?

But I haven't used GIMP for this yet, this is based on my experience in SVGs and Paths in Photoshop, another bitmap editor.

There's also many more resources for making vectors in Inkscape than GIMP, so I think we should encourage Inkscape anyway.

@cooperrc
Copy link
Member

cooperrc commented Mar 4, 2021

It is, but looking briefly at its documentation for SVGs it says that if the Path tool is used, GIMP can export these Paths as an SVG. Other tools like Paintbrush are for bitmap editing.

Cool, thanks for the link! I use and recommend Inkscape for everything, so I guess I haven't explored Gimp enough.

@rossbar
Copy link
Contributor

rossbar commented Mar 4, 2021

It might be good to have a "image-source" location to store files like *.gv, but keep the docs in a consistent *.svg format in an "images" folder.

I think keeping just the outputs is fine. Storing "source" and "output" files without actually using the source to generate the output is a maintenance burden, as changes to either the graphic or the source require changes to be made to the other. Of course, it would be relatively straightforward to generate figures from graphviz during the build process (via pygraphviz for sphinx or graphviz itself for hugo, for example), but that would be a wishlist item, and shouldn't be a blocker to improving the graphics!

@Mukulikaa
Copy link
Contributor

SVGs are not supported by the Latex build yet, causing problems for the PDF build of the documentation (see #20690 (comment)). Note that only the User and Reference guides are built as PDFs so I think we'll only need to figure out what to do about images in them.

@MarsBarLee
Copy link
Contributor Author

Thanks @Mukulikaa for replacing the SVGs with PNG! I'm not sure if latex cannot handle any SVGs or only handle SVGs with bounding boxes. If the latter, we can add a section to the future graphics guidelines to save SVGs with bounding boxes.

@Mukulikaa
Copy link
Contributor

Hi @MarsBarLee, according to the Sphinx docs, the Latex builder doesn't support SVGs at all. @rossbar suggested trying out sphinx.ext.imgconverter. This requires Imagemagick to be installed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants