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

Use SVG images for Chapter 7 figures 1 and 2 #551

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DocOtak
Copy link
Member

@DocOtak DocOtak commented Oct 20, 2024

This was inspired by the awesome work in #522

I've converted the two remaining png figured into svgs from the PDFs using svg2pdf from the cairo library. This saves about 300kb from the html build and about 100kb in the pdf builds. All while higher quality.

This is actually my first PR to the actual conventions repository, my change is just technical and I feel it does not need the addition of my name to the authors list.

See issue #XXX for discussion of these changes.

Release checklist

  • Authors updated in cf-conventions.adoc? Add in two places: on line 3 and under .Additional Authors in About the authors.
  • Next version in cf-conventions.adoc up to date? Versioning inspired by SemVer.
  • history.adoc up to date?
  • Conformance document up to date?

For maintainers

After the merge remember to delete the source branch.
Tags are set at the conclusion of the annual meeting; until then, main always is a draft for the next version.

@neumannd
Copy link
Contributor

@DocOtak I could re-created the figures directly as svg files (I created these figures in the first place).

@DocOtak
Copy link
Member Author

DocOtak commented Oct 21, 2024

@neumannd How did you create the figures in the first place? It might it be worth adding the "source" to this repository. The pdf2svg tool does a pretty good job when the input is already a vector of some sort and these PDFs were.

@neumannd
Copy link
Contributor

@DocOtak

How did you create the figures in the first place?

I created them with a small R script.

It might it be worth adding the "source" to this repository.

Sure. Sounds reasonable. To which location should I copy/push the code? Or just as a comment into the document?

The pdf2svg tool does a pretty good job when the input is already a vector of some sort and these PDFs were.

OK. Then, I won't re-create them as SVG.

@DocOtak
Copy link
Member Author

DocOtak commented Oct 21, 2024

We should open an issue/discussion to ask how and where the sources should be added. Did you make any other figures than these two?

If it is easy to do, I'd like to know if the direct SVG output is smaller/more efficient than this conversion. The SVG output from this is about 60kb each, where the PDFs are 5kb each.

@neumannd
Copy link
Contributor

We should open an issue/discussion to ask how and where the sources should be added. Did you make any other figures than these two?

Only these two -- as far as I remember.

If it is easy to do, I'd like to know if the direct SVG output is smaller/more efficient than this conversion. The SVG output from this is about 60kb each, where the PDFs are 5kb each.

The SVGs are slightly large than the PDFs but not 10x as large:

$ ls -la
...   5554 21. Okt 12:21 order_horizontal_bounds__1D_coord_variables.svg
... 110084 21. Okt 12:21 order_horizontal_bounds__1D_coord_variables.png
...   4751 21. Okt 12:21 order_horizontal_bounds__1D_coord_variables.pdf
...   5107 21. Okt 12:23 order_horizontal_bounds__2D_coord_variables.pdf
...   8944 21. Okt 12:23 order_horizontal_bounds__2D_coord_variables.svg
... 228137 21. Okt 12:23 order_horizontal_bounds__2D_coord_variables.png

I attached them.

order_horizontal_bounds__1D_coord_variables
order_horizontal_bounds__2D_coord_variables

@cofinoa
Copy link
Contributor

cofinoa commented Oct 21, 2024

@neumannd, while we decide what to do with the original scripts, could you please add both R scripts to the images directory and name them as follows:

order_horizontal_bounds__1D_coord_variables.R
order_horizontal_bounds__2D_coord_variables.R

Additionally, could you include a comment or header in each script indicating the R version and any dependencies, if applicable?

Deletes the unused PDF versions
@neumannd
Copy link
Contributor

@DocOtak OK. I'll do so tomorrow or later today. As an extra PR refering to this on?

@neumannd
Copy link
Contributor

@DocOtak I created a pull request to your branch DocOtak:svg_figures. Then, we have everything in this on PR to the cf-conventions. I added version requirements to the top of the R code. I am not sure whether the way I did conforms to any standard or not. Maybe, it works with lower version as well.

@DocOtak
Copy link
Member Author

DocOtak commented Oct 21, 2024

@neumannd merged, it should update this PR automatically

@DocOtak DocOtak requested a review from cofinoa October 21, 2024 23:59
@neumannd
Copy link
Contributor

@DocOtak Worked. But, I forgot to update paths in the code => new PR to your branch. Sorry for that.

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

Successfully merging this pull request may close these issues.

3 participants