Skip to content

Commit

Permalink
fixes resize and other minor thigns
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacio82 committed Nov 30, 2023
1 parent efc1748 commit 09df4bb
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
^pkgdown$
^CRAN-RELEASE$
^cran-comments\.md$
^CRAN-SUBMISSION$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.5
Date: 2023-11-29 22:39:01 UTC
SHA: efc1748caa146667abce8b9668f3e62db3e2cf73
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: vizdraws
Title: Visualize Draws from the Prior and Posterior Distributions
Version: 1.5
Date: 2022-02-04
Version: 1.3
Date: 2023-11-30
Authors@R: c(
person("Ignacio", "Martinez", email = "[email protected]", role = c("aut", "cre")),
person("Linus", "Marco", email = "[email protected]", role = "aut"),
Expand Down
7 changes: 2 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# vizdraws 1.5

# vizdraws 1.4

# vizdraws 1.3

* Added a background color and opacity arguments
* Added a background color and opacity arguments.
* Fixes resize method.

# vizdraws 1.2

Expand Down
2 changes: 1 addition & 1 deletion R/dataframeToD3.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dataframeToD3 <- function(df) {
return(list())
}
if (!is.data.frame(df)) {
stop("IMPosterior: the input must be a dataframe", call. = FALSE)
stop("vizdraws: the input must be a dataframe", call. = FALSE)
}

row.names(df) <- NULL
Expand Down
5 changes: 5 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
24 changes: 8 additions & 16 deletions inst/htmlwidgets/lib/vizdraws/vizdraws-general.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,23 +770,15 @@ function factory(el, width, height) {
console.log('resize w, h', newWidth, newHeight);
width = newWidth;
height = newHeight;
// TODO: code to re-render the widget with a new size
/*let svg = d3
.select(el)
.append('svg') // definitely don't think you'll want to append a new
svg .attr('width', dims.width + margin.left + margin.right)
.attr('height', dims.height + margin.top + margin.bottom);
*/
// Set initials to whatever they currently were when graph was last
// changed
options.start_mode = MODE;
options.start_status = STATUS;
options.initial_trans = false;
// if you don't care about animation or transition
// you can just call render
this.renderValue(options);

// or without uncommenting as of now do nothing
// Update the dimensions of the SVG element
let svg = d3.select(el).select('svg');
svg.attr('width', newWidth);
svg.attr('height', newHeight);

// Re-render the plot
this.renderValue(options);
}

};
}

0 comments on commit 09df4bb

Please sign in to comment.