Skip to content

Commit 90434e6

Browse files
committed
feat: drop geom_hpline_interactive
1 parent 05489e7 commit 90434e6

File tree

7 files changed

+100
-340
lines changed

7 files changed

+100
-340
lines changed

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: ggiraph
33
Title: Make 'ggplot2' Graphics Interactive
4-
Version: 0.9.0.002
4+
Version: 0.9.0.003
55
Authors@R: c(
66
person("David", "Gohel", , "david.gohel@ardata.fr", role = c("aut", "cre")),
77
person("Panagiotis", "Skintzos", , "sigmapi@posteo.net", role = "aut"),
@@ -95,7 +95,6 @@ Collate:
9595
'geom_hex_interactive.R'
9696
'geom_histogram_interactive.R'
9797
'geom_hline_interactive.R'
98-
'geom_hpline.R'
9998
'geom_jitter_interactive.R'
10099
'geom_label_interactive.R'
101100
'geom_linerange_interactive.R'

NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ S3method(makeContext,interactive_dotstack_grob)
2020
S3method(merge_element,interactive_element)
2121
export(FacetInteractiveGrid)
2222
export(FacetInteractiveWrap)
23-
export(GeomHpline)
2423
export(GeomInteractiveAbline)
2524
export(GeomInteractiveArea)
2625
export(GeomInteractiveBar)
@@ -38,7 +37,6 @@ export(GeomInteractiveErrorbar)
3837
export(GeomInteractiveErrorbarh)
3938
export(GeomInteractiveHex)
4039
export(GeomInteractiveHline)
41-
export(GeomInteractiveHpline)
4240
export(GeomInteractiveLabel)
4341
export(GeomInteractiveLine)
4442
export(GeomInteractiveLinerange)
@@ -100,8 +98,6 @@ export(geom_freqpoly_interactive)
10098
export(geom_hex_interactive)
10199
export(geom_histogram_interactive)
102100
export(geom_hline_interactive)
103-
export(geom_hpline)
104-
export(geom_hpline_interactive)
105101
export(geom_jitter_interactive)
106102
export(geom_label_interactive)
107103
export(geom_label_repel_interactive)

NEWS.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# ggiraph 0.9.0
22

3-
## Feature
4-
5-
- New function `geom_hpline_interactive()` that uses a copy of `ungeviz::geom_hpline()`
6-
written by Claus O. Wilke.
73

84

95
# ggiraph 0.8.13

R/geom_hpline.R

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,63 @@
11
library(ggplot2)
22
library(ggiraph)
33

4-
counts <- as.data.frame(table(x = rpois(100,5)))
5-
counts$x <- as.numeric( as.character(counts$x) )
6-
counts$xlab <- paste0("bar",as.character(counts$x) )
7-
8-
gg_segment_1 <- ggplot(data = counts, aes(x = x, y = Freq,
9-
yend = 0, xend = x, tooltip = xlab ) ) +
10-
geom_segment_interactive( size = I(10))
4+
counts <- as.data.frame(table(x = rpois(100, 5)))
5+
counts$x <- as.numeric(as.character(counts$x))
6+
counts$xlab <- paste0("bar", as.character(counts$x))
7+
8+
gg_segment_1 <- ggplot(
9+
data = counts,
10+
aes(x = x, y = Freq, yend = 0, xend = x, tooltip = xlab)
11+
) +
12+
geom_segment_interactive(size = I(10))
1113
x <- girafe(ggobj = gg_segment_1)
12-
if( interactive() ) print(x)
13-
14-
dataset = data.frame(x=c(1,2,5,6,8),
15-
y=c(3,6,2,8,7),
16-
vx=c(1,1.5,0.8,0.5,1.3),
17-
vy=c(0.2,1.3,1.7,0.8,1.4),
18-
labs = paste0("Lab", 1:5))
19-
dataset$clickjs = paste0("alert(\"",dataset$labs, "\")" )
14+
if (interactive()) {
15+
print(x)
16+
}
17+
18+
dataset = data.frame(
19+
x = c(1, 2, 5, 6, 8),
20+
y = c(3, 6, 2, 8, 7),
21+
vx = c(1, 1.5, 0.8, 0.5, 1.3),
22+
vy = c(0.2, 1.3, 1.7, 0.8, 1.4),
23+
labs = paste0("Lab", 1:5)
24+
)
25+
dataset$clickjs = paste0("alert(\"", dataset$labs, "\")")
2026

2127
gg_segment_2 = ggplot() +
22-
geom_segment_interactive(data=dataset, mapping=aes(x=x, y=y,
23-
xend=x+vx, yend=y+vy, tooltip = labs, onclick=clickjs ),
24-
arrow=grid::arrow(length = grid::unit(0.03, "npc")),
25-
size=2, color="blue") +
26-
geom_point(data=dataset, mapping=aes(x=x, y=y),
27-
size=4, shape=21, fill="white")
28+
geom_segment_interactive(
29+
data = dataset,
30+
mapping = aes(
31+
x = x,
32+
y = y,
33+
xend = x + vx,
34+
yend = y + vy,
35+
tooltip = labs,
36+
onclick = clickjs
37+
),
38+
arrow = grid::arrow(length = grid::unit(0.03, "npc")),
39+
size = 2,
40+
color = "blue"
41+
) +
42+
geom_point(
43+
data = dataset,
44+
mapping = aes(x = x, y = y),
45+
size = 4,
46+
shape = 21,
47+
fill = "white"
48+
)
2849

2950
x <- girafe(ggobj = gg_segment_2)
30-
if( interactive() ) print(x)
51+
if (interactive()) {
52+
print(x)
53+
}
3154

3255
df <- data.frame(x1 = 2.62, x2 = 3.57, y1 = 21.0, y2 = 15.0)
3356
p <- ggplot(df, aes(x = x1, y = y1, xend = x2, yend = y2)) +
34-
geom_curve_interactive(aes(colour = "curve", tooltip=I("curve"))) +
35-
geom_segment_interactive(aes(colour = "segment", tooltip=I("segment")))
36-
37-
x <- girafe(ggobj = p)
38-
if( interactive() ) print(x)
39-
40-
41-
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
42-
geom_point(color = "grey50", alpha = 0.3, size = 2) +
43-
geom_hpline_interactive(data = iris[1:5,], mapping = aes(tooltip = Species)) +
44-
theme_bw()
57+
geom_curve_interactive(aes(colour = "curve", tooltip = I("curve"))) +
58+
geom_segment_interactive(aes(colour = "segment", tooltip = I("segment")))
4559

4660
x <- girafe(ggobj = p)
47-
if( interactive() ) print(x)
48-
49-
50-
51-
61+
if (interactive()) {
62+
print(x)
63+
}

0 commit comments

Comments
 (0)