Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2dash
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
loosolab
software
i2dash
Commits
65cbb1b6
Commit
65cbb1b6
authored
5 years ago
by
arsenij.ustjanzew
Browse files
Options
Downloads
Patches
Plain Diff
removed default value and added warning if the package name could not be determined.
parent
890c8657
No related branches found
No related tags found
1 merge request
!18
Generic htm lwidget
Pipeline
#129954
canceled
5 years ago
Stage: build
Stage: check
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/vis_objects.R
+5
-3
5 additions, 3 deletions
R/vis_objects.R
with
5 additions
and
3 deletions
R/vis_objects.R
+
5
−
3
View file @
65cbb1b6
...
...
@@ -5,7 +5,7 @@
#' @param package The name of the R package that defines the class(object).
#' @param page The name of the page to add the object to.
#' @param title An optional component title.
add_vis_object
<-
function
(
dashboard
,
object
,
package
=
NULL
,
page
=
"default"
,
title
=
NULL
,
...
){
add_vis_object
<-
function
(
dashboard
,
object
,
package
,
page
=
"default"
,
title
=
NULL
,
...
){
sanitised_page
<-
i2dash
:::
.create_page_name
(
page
)
if
(
!
(
sanitised_page
%in%
names
(
dashboard
@
pages
)))
{
warning
(
sprintf
(
"i2dashboard does not contain a page named '%s'"
,
sanitised_page
))
...
...
@@ -17,8 +17,6 @@ add_vis_object <- function(dashboard, object, package = NULL, page = "default",
return
(
dashboard
)
}
if
(
is.null
(
package
))
package
<-
"unknown package name"
# Create random component for RDS filename
component_id
<-
paste0
(
"obj_"
,
stringi
::
stri_rand_strings
(
1
,
6
))
...
...
@@ -71,5 +69,9 @@ setMethod("add_component",
return
(
dashboard
)
}
package
<-
packageSlot
(
component
)
if
(
is.null
(
package
))
{
warning
(
"The package name of this HTML widget could not be determined. The component was not added to the dashboard."
)
return
(
dashboard
)
}
add_vis_object
(
dashboard
,
component
,
package
,
page
,
title
,
...
)
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment