|
1 |
| -context("isosurface") |
2 |
| - |
3 |
| -test_that("isosurface works with colorscale", { |
4 |
| - skip_on_cran() |
5 |
| - skip_on_travis() |
6 |
| - |
7 |
| - # get the values/x/y/z from the plotly.js mock this test is based on |
8 |
| - mock <- jsonlite::fromJSON( |
9 |
| - "https://raw.githubusercontent.com/plotly/plotly.js/32738b549dff09eb4e9a095cebc750a3a8ae1ffd/test/image/mocks/gl3d_isosurface_log-axis_slices_surface-fill.json", |
10 |
| - simplifyVector = FALSE |
11 |
| - ) |
12 |
| - |
13 |
| - p <- plot_ly( |
14 |
| - type = "isosurface", |
15 |
| - colorscale = "Rainbow", |
16 |
| - reversescale = FALSE, |
17 |
| - surface = list(show = TRUE, fill = 1), |
18 |
| - spaceframe = list(show = TRUE), |
19 |
| - slices = list( |
20 |
| - x = list( |
21 |
| - show = TRUE, |
22 |
| - fill = 1, |
23 |
| - locations = c(-0.9, -0.6, 0) |
24 |
| - ), |
25 |
| - y = list( |
26 |
| - show = TRUE, |
27 |
| - fill = 1, |
28 |
| - locations = c(-0.9, -0.6, 0) |
29 |
| - ), |
30 |
| - z = list( |
31 |
| - show = TRUE, |
32 |
| - fill = 1, |
33 |
| - locations = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 1) |
34 |
| - ) |
35 |
| - ), |
36 |
| - caps = list( |
37 |
| - x = list(show = FALSE), |
38 |
| - y = list(show = FALSE), |
39 |
| - z = list(show = FALSE) |
40 |
| - ), |
41 |
| - contour = list( |
42 |
| - show = TRUE, |
43 |
| - width = 4 |
44 |
| - ), |
45 |
| - isomin = 200, |
46 |
| - isomax = 500, |
47 |
| - value = mock$data[[1]]$value, |
48 |
| - x = mock$data[[1]]$x, |
49 |
| - y = mock$data[[1]]$y, |
50 |
| - z = mock$data[[1]]$z, |
51 |
| - lighting = list( |
52 |
| - ambient = 0.5, |
53 |
| - diffuse = 1.0, |
54 |
| - specular = 0.75, |
55 |
| - roughness = 1.0, |
56 |
| - fresnel = 0.25 |
57 |
| - ), |
58 |
| - lightposition = list( |
59 |
| - x = 10000, |
60 |
| - y = 10000, |
61 |
| - z = 0 |
62 |
| - ) |
63 |
| - ) |
64 |
| - |
65 |
| - expect_doppelganger(p, "isosurface-simple") |
66 |
| -}) |
| 1 | +# context("isosurface") |
| 2 | +# |
| 3 | +# test_that("isosurface works with colorscale", { |
| 4 | +# skip_on_cran() |
| 5 | +# skip_on_travis() |
| 6 | +# |
| 7 | +# # get the values/x/y/z from the plotly.js mock this test is based on |
| 8 | +# mock <- jsonlite::fromJSON( |
| 9 | +# "https://raw.githubusercontent.com/plotly/plotly.js/32738b549dff09eb4e9a095cebc750a3a8ae1ffd/test/image/mocks/gl3d_isosurface_log-axis_slices_surface-fill.json", |
| 10 | +# simplifyVector = FALSE |
| 11 | +# ) |
| 12 | +# |
| 13 | +# p <- plot_ly( |
| 14 | +# type = "isosurface", |
| 15 | +# colorscale = "Rainbow", |
| 16 | +# reversescale = FALSE, |
| 17 | +# surface = list(show = TRUE, fill = 1), |
| 18 | +# spaceframe = list(show = TRUE), |
| 19 | +# slices = list( |
| 20 | +# x = list( |
| 21 | +# show = TRUE, |
| 22 | +# fill = 1, |
| 23 | +# locations = c(-0.9, -0.6, 0) |
| 24 | +# ), |
| 25 | +# y = list( |
| 26 | +# show = TRUE, |
| 27 | +# fill = 1, |
| 28 | +# locations = c(-0.9, -0.6, 0) |
| 29 | +# ), |
| 30 | +# z = list( |
| 31 | +# show = TRUE, |
| 32 | +# fill = 1, |
| 33 | +# locations = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 1) |
| 34 | +# ) |
| 35 | +# ), |
| 36 | +# caps = list( |
| 37 | +# x = list(show = FALSE), |
| 38 | +# y = list(show = FALSE), |
| 39 | +# z = list(show = FALSE) |
| 40 | +# ), |
| 41 | +# contour = list( |
| 42 | +# show = TRUE, |
| 43 | +# width = 4 |
| 44 | +# ), |
| 45 | +# isomin = 200, |
| 46 | +# isomax = 500, |
| 47 | +# value = mock$data[[1]]$value, |
| 48 | +# x = mock$data[[1]]$x, |
| 49 | +# y = mock$data[[1]]$y, |
| 50 | +# z = mock$data[[1]]$z, |
| 51 | +# lighting = list( |
| 52 | +# ambient = 0.5, |
| 53 | +# diffuse = 1.0, |
| 54 | +# specular = 0.75, |
| 55 | +# roughness = 1.0, |
| 56 | +# fresnel = 0.25 |
| 57 | +# ), |
| 58 | +# lightposition = list( |
| 59 | +# x = 10000, |
| 60 | +# y = 10000, |
| 61 | +# z = 0 |
| 62 | +# ) |
| 63 | +# ) |
| 64 | +# |
| 65 | +# expect_doppelganger(p, "isosurface-simple") |
| 66 | +# }) |
0 commit comments