Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Image Data Explorer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Jean-Karim Heriche
Image Data Explorer
Commits
2d53905e
Commit
2d53905e
authored
1 year ago
by
Jean-Karim Heriche
Browse files
Options
Downloads
Patches
Plain Diff
Create ide.config object when loading rds settings file. Replace deprecated aes_string() function.
parent
2803d834
No related branches found
No related tags found
No related merge requests found
Pipeline
#45935
passed
1 year ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/datafile.R
+1
-0
1 addition, 0 deletions
R/datafile.R
R/explore_plot.R
+9
-9
9 additions, 9 deletions
R/explore_plot.R
with
10 additions
and
9 deletions
R/datafile.R
+
1
−
0
View file @
2d53905e
...
...
@@ -370,6 +370,7 @@ input_data_server <- function(input, output, session) {
for
(
field
in
inputChoices.params
)
{
rv
$
inputChoices
[[
field
]]
<-
settings
[[
field
]]
}
ide.config
<-
NULL
}
else
if
(
!
is.null
(
input
$
readConfigFile
)
&&
has_extension
(
input
$
readConfigFile
$
datapath
,
'toml'
)
==
TRUE
)
{
# A TOML config file was uploaded
ide.config
<-
read.config
(
file
=
input
$
readConfigFile
$
datapath
)
...
...
This diff is collapsed.
Click to expand it.
R/explore_plot.R
+
9
−
9
View file @
2d53905e
...
...
@@ -81,7 +81,7 @@ plot_server <- function(input, output, session, rv) {
}
if
(
length
(
selectedCols
)
>
0
&&
length
(
selectedCols
)
<=
2
)
{
colours
<-
"grey"
p
<-
ggplot
(
data
=
Dunselected
,
aes
_string
(
x
=
selectedCols
[
1
],
y
=
selectedCols
[
2
],
key
=
"ide.id"
))
+
p
<-
ggplot
(
data
=
Dunselected
,
aes
(
x
=
.data
[[
selectedCols
[
1
]
]]
,
y
=
.data
[[
selectedCols
[
2
]
]]
,
key
=
.data
[[
"ide.id"
]]
))
+
labs
(
x
=
eval
(
selectedCols
[
1
]),
y
=
eval
(
selectedCols
[
2
]))
+
coord_cartesian
(
expand
=
TRUE
)
if
(
!
is.null
(
rv
$
clusters
))
{
...
...
@@ -118,7 +118,7 @@ plot_server <- function(input, output, session, rv) {
if
(
!
is.null
(
rv
$
selectedRows
)
&&
length
(
rv
$
selectedRows
)
>
0
)
{
# Selected points
p
<-
p
+
geom_point
(
data
=
D
[
rv
$
selectedRows
,],
aes
_string
(
x
=
selectedCols
[
1
],
y
=
selectedCols
[
2
],
key
=
"ide.id"
),
aes
(
x
=
.data
[[
selectedCols
[
1
]
]]
,
y
=
.data
[[
selectedCols
[
2
]
]]
,
key
=
.data
[[
"ide.id"
]]
),
colour
=
"black"
)
}
ggplotly
(
p
,
dynamicTicks
=
TRUE
,
tooltip
=
"none"
,
source
=
"scatterPlot"
)
%>%
...
...
@@ -165,7 +165,7 @@ plot_server <- function(input, output, session, rv) {
}
else
{
clusters
<-
NULL
}
p
<-
ggplot
(
data
=
D
,
aes
_string
(
x
=
selectedCols
[
1
],
fill
=
clusters
,
color
=
clusters
))
p
<-
ggplot
(
data
=
D
,
aes
(
x
=
.data
[[
selectedCols
[
1
]
]]
,
fill
=
clusters
,
color
=
clusters
))
# Heuristic to choose binning
if
(
max
(
D
[,
get
(
selectedCols
[
1
])],
na.rm
=
TRUE
)
>
10
)
{
# use binwidth = 1
p
<-
p
+
geom_histogram
(
position
=
"identity"
,
binwidth
=
1
,
aes
(
y
=
after_stat
(
count
)),
alpha
=
0.5
)
+
...
...
@@ -175,7 +175,7 @@ plot_server <- function(input, output, session, rv) {
scale_color_manual
(
name
=
""
,
values
=
colours
)
+
scale_fill_manual
(
name
=
""
,
values
=
colours
)
}
}
else
{
p
<-
ggplot
(
data
=
D
,
aes
_string
(
x
=
selectedCols
[
1
]))
p
<-
ggplot
(
data
=
D
,
aes
(
x
=
.data
[[
selectedCols
[
1
]
]]
))
if
(
max
(
D
[,
get
(
selectedCols
[
1
])],
na.rm
=
TRUE
)
>
10
)
{
# use binwidth = 1
p
<-
p
+
geom_histogram
(
position
=
"identity"
,
binwidth
=
1
,
aes
(
y
=
after_stat
(
count
)),
color
=
colours
,
fill
=
colours
)
}
else
{
# make 30 bins
...
...
@@ -217,11 +217,11 @@ plot_server <- function(input, output, session, rv) {
if
(
any
(
levels
(
clusters
)
==
"N/A"
))
{
clusters
<-
relevel
(
clusters
,
"N/A"
)
# Make N/A first level
}
p
<-
ggplot
(
data
=
D
,
aes
_string
(
x
=
"clusters"
,
y
=
selectedCols
[
1
]))
+
p
<-
ggplot
(
data
=
D
,
aes
(
x
=
.data
[[
"clusters"
]]
,
y
=
.data
[[
selectedCols
[
1
]
]]
))
+
theme
(
axis.text.x
=
element_blank
(),
axis.title.x
=
element_blank
(),
axis.ticks.x
=
element_blank
())
if
(
n.clusters
<=
8
)
{
colours
<-
c
(
"grey"
,
brewer.pal
(
n
=
8
,
name
=
"Set1"
))
p
<-
p
+
geom_boxplot
(
aes
_string
(
fill
=
"clusters"
,
color
=
"clusters"
))
+
p
<-
p
+
geom_boxplot
(
aes
(
fill
=
.data
[[
"clusters"
]]
,
color
=
.data
[[
"clusters"
]]
))
+
scale_fill_manual
(
name
=
""
,
values
=
colours
)
+
scale_color_manual
(
name
=
""
,
values
=
colours
)
}
else
if
(
n.clusters
<=
25
)
{
...
...
@@ -230,16 +230,16 @@ plot_server <- function(input, output, session, rv) {
"#FFCC99"
,
"#94FFB5"
,
"#8F7C00"
,
"#9DCC00"
,
"#C20088"
,
"#003380"
,
"#FFA405"
,
"#FFA8BB"
,
"#426600"
,
"#FF0010"
,
"#5EF1F2"
,
"#00998F"
,
"#E0FF66"
,
"#740AFF"
,
"#990000"
,
"#FFFF80"
,
"#FFE100"
,
"#FF5005"
)
p
<-
p
+
geom_boxplot
(
aes
_string
(
fill
=
"clusters"
,
color
=
"clusters"
))
+
p
<-
p
+
geom_boxplot
(
aes
(
fill
=
.data
[[
"clusters"
]]
,
color
=
.data
[[
"clusters"
]]
))
+
scale_fill_manual
(
name
=
""
,
values
=
colours
)
+
scale_color_manual
(
name
=
""
,
values
=
colours
)
}
else
{
p
<-
p
+
geom_boxplot
(
aes
_string
(
fill
=
"clusters"
,
color
=
"clusters"
))
+
p
<-
p
+
geom_boxplot
(
aes
(
fill
=
.data
[[
"clusters"
]]
,
color
=
.data
[[
"clusters"
]]
))
+
scale_fill_manual
(
name
=
""
,
values
=
rep
(
'#A4A4A4'
,
n.clusters
))
+
scale_color_manual
(
name
=
""
,
values
=
rep
(
'black'
,
n.clusters
))
}
}
else
{
p
<-
ggplot
(
data
=
D
,
aes
_string
(
y
=
selectedCols
[
1
]))
+
p
<-
ggplot
(
data
=
D
,
aes
(
y
=
.data
[[
selectedCols
[
1
]
]]
))
+
geom_boxplot
(
color
=
colours
,
fill
=
colours
)
}
p
<-
p
+
theme
(
plot.title
=
element_blank
(),
legend.title
=
element_blank
())
...
...
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