You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are pulled out from #9. Didn't want it holding up the issue.
May want to look at parity with #6, #36. Haven't started on this yet, maybe a bit of a duplicate effort.
Some additional steps to make creating a new wbStyle object quicker and easier to handle. These changes would also move a lot of the checks outside of the initialize() function and into the specs, which should make it a bit more clear what needs to be checked. It could also give us some template to extract styles from existing workbooks and make sure we have roundtrip styles.
Todos
create wb_font_specs() to simplify including fontId, fontName, fontColour, fontSize, fontFamily, fontScheme, fontDecoration
create wb_border_specs() to simplify including borderTop, borderLeft, borderRight, borderBottom, borderTopColour, borderLeftColour, borderRightColour, borderBottomColour, borderDiagonal, borderdiagonalColour, borderDiagonalUp, borderDiagonalDown
simplify bgFill and fgFill to c(back = ..., fore = ...) (or background and forgound
simplify halign and valign to c(horizontal = "left", vertical = "top") (h and v
create
Is wbStyle$as.list() needed? Could we just use R6:::as.list.R6()? Not sure there's much we're gaining
Pseuocode
Thinking about something like this:
wb_style(
font= wb_font_spec(),
borders= wb_border_spec(),
fill= wb_fill_spec(),
...
)
# specs are essentially custom classes that manage default values and checking# these can then be applied to a worksheet cell range# use "default" values, or getOptions()wb_font_spec<-function(id, name, colour, family, scheme, decoration) {
# make some checks for clean up...# return as a wb_*_spec class
structure(
list(id, name, colour, family, scheme, decoration),
names= c("id", "name", "colour", "family", "scheme", "decoration")
class="wb_font_spec"
)
}
wb_border_spec<-function(positions="none", color="none") {
# make some checks for clean up...# check for border positions...# return as a wb_*_spec class
structure(
list(id, name, colour, family, scheme, decoration),
names= c("id", "name", "colour", "family", "scheme", "decoration")
class="wb_border_spec"
)
}
# these could be the same
wb_border_spec(positions= c("left", "right"), color= c("red", "black"))
wb_border_spec(positions= c("left", "right"), color= c(right="black", left="red"))
wb_border_spec(list(left="red", right="black"))
The text was updated successfully, but these errors were encountered:
These are pulled out from #9. Didn't want it holding up the issue.
May want to look at parity with #6, #36. Haven't started on this yet, maybe a bit of a duplicate effort.
Some additional steps to make creating a new
wbStyle
object quicker and easier to handle. These changes would also move a lot of the checks outside of theinitialize()
function and into the specs, which should make it a bit more clear what needs to be checked. It could also give us some template to extract styles from existing workbooks and make sure we have roundtrip styles.Todos
wb_font_specs()
to simplify includingfontId
,fontName
,fontColour
,fontSize
,fontFamily
,fontScheme
,fontDecoration
wb_border_specs()
to simplify includingborderTop
,borderLeft
,borderRight
,borderBottom
,borderTopColour
,borderLeftColour
,borderRightColour
,borderBottomColour
,borderDiagonal
,borderdiagonalColour
,borderDiagonalUp
,borderDiagonalDown
bgFill
andfgFill
toc(back = ..., fore = ...)
(orbackground
andforgound
halign
andvalign
toc(horizontal = "left", vertical = "top")
(h
andv
wbStyle$as.list()
needed? Could we just useR6:::as.list.R6()
? Not sure there's much we're gainingPseuocode
Thinking about something like this:
The text was updated successfully, but these errors were encountered: