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

[R/drawings] Drawings id per sheet. closes #126 #127

Merged
merged 5 commits into from
Apr 9, 2022
Merged

Conversation

JanMarvin
Copy link
Owner

This rewrites all drawings and vmlDrawings to match the corresponding worksheet number. This simplifies the code a bit, but needs a bit more testing. Maybe additional rounds of cleanups. The entire thing has a tendency to break Excel a lot (writing xml instead of vml ... grrr, took me a few hours). Duplicated entries in Content_Types (Warning!), missing entries in Content_Types (Warning!), missing entries in rels (Warning!).

(A bunch of the code down there in loadWorkbook looks like it was written for one specific file and makes me wonder if it ever worked anywhere at all.)

@JanMarvin
Copy link
Owner Author

JanMarvin commented Apr 8, 2022

Codecov Report

Merging #127 (6c9a050) into main (93af8de) will decrease coverage by 0.05%.
The diff coverage is 62.50%.

@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   61.40%   61.34%   -0.06%     
==========================================
  Files          38       38              
  Lines        7213     7197      -16     
==========================================
- Hits         4429     4415      -14     
+ Misses       2784     2782       -2     
Impacted Files Coverage Δ
R/class-workbook.R 53.66% <33.33%> (+0.09%) ⬆️
R/class-worksheet.R 66.66% <100.00%> (ø)
R/loadWorkbook.R 94.27% <100.00%> (-0.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93af8de...6c9a050. Read the comment docs.

@JanMarvin
Copy link
Owner Author

Something currently broken. Most likely unrelated to this issue, but you can not add a plot to a sheet with another plot. Need to investigate loadExample and tweak code accordingly:

## Create a new workbook
wb <- wb_workbook("Ayanami")

## Add some worksheets
wb$addWorksheet("Sheet 1")
wb$addWorksheet("Sheet 2")
wb$addWorksheet("Sheet 3")

## Insert images
img <- system.file("extdata", "einstein.jpg", package = "openxlsx2")
img1 <- system.file("extdata", "einstein.jpg", package = "openxlsx2")
img2 <- system.file("extdata", "einstein.jpg", package = "openxlsx2")
insertImage(wb, "Sheet 1", img, startRow = 5, startCol = 3, width = 6, height = 5)
insertImage(wb, 2, img, startRow = 2, startCol = 2)
insertImage(wb, 2, img1, width = 15, height = 12, startRow = 5, startCol = "G", units = "cm")
insertImage(wb, 2, img2, width = 15, height = 12, startRow = 10, startCol = "G", units = "cm")
insertImage(wb, 3, img, width = 15, height = 12, startRow = 3, startCol = "G", units = "cm")

@JanMarvin JanMarvin merged commit c12c347 into main Apr 9, 2022
@JanMarvin JanMarvin deleted the drawId_per_sheet branch April 9, 2022 12:39
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.

None yet

1 participant