|
55 | 55 |
|
56 | 56 | struct Nil <: Gadfly.StatisticElement end
|
57 | 57 |
|
| 58 | +""" |
| 59 | + Stat.Nil |
| 60 | +""" |
58 | 61 | const nil = Nil
|
59 | 62 |
|
60 | 63 | struct Identity <: Gadfly.StatisticElement end
|
@@ -104,11 +107,17 @@ end
|
104 | 107 |
|
105 | 108 | struct RectbinStatistic <: Gadfly.StatisticElement end
|
106 | 109 |
|
107 |
| -const rectbin = RectbinStatistic |
108 |
| - |
109 | 110 | input_aesthetics(stat::RectbinStatistic) = [:x, :y]
|
110 | 111 | output_aesthetics(stat::RectbinStatistic) = [:xmin, :xmax, :ymin, :ymax]
|
111 | 112 |
|
| 113 | +""" |
| 114 | + Stat.rectbin |
| 115 | +
|
| 116 | +Transform $(aes2str(input_aesthetics(rectbin()))) into |
| 117 | +$(aes2str(output_aesthetics(rectbin()))). |
| 118 | +""" |
| 119 | +const rectbin = RectbinStatistic |
| 120 | + |
112 | 121 | function apply_statistic(stat::RectbinStatistic,
|
113 | 122 | scales::Dict{Symbol, Gadfly.ScaleElement},
|
114 | 123 | coord::Gadfly.CoordinateElement,
|
@@ -148,6 +157,12 @@ output_aesthetics(stat::BarStatistic) =
|
148 | 157 | default_scales(stat::BarStatistic) = stat.orientation == :vertical ?
|
149 | 158 | [Gadfly.Scale.y_continuous()] : [Gadfly.Scale.x_continuous()]
|
150 | 159 |
|
| 160 | +""" |
| 161 | + Stat.bar[(; position=:stack, orientation=:vertical)] |
| 162 | +
|
| 163 | +Transform $(aes2str(input_aesthetics(bar()))) into |
| 164 | +$(aes2str(output_aesthetics(bar()))). |
| 165 | +""" |
151 | 166 | const bar = BarStatistic
|
152 | 167 |
|
153 | 168 | function apply_statistic(stat::BarStatistic,
|
@@ -1409,13 +1424,19 @@ struct FunctionStatistic <: Gadfly.StatisticElement
|
1409 | 1424 | end
|
1410 | 1425 | FunctionStatistic(; num_samples=250) = FunctionStatistic(num_samples)
|
1411 | 1426 |
|
| 1427 | +input_aesthetics(::FunctionStatistic) = [:y, :xmin, :xmax] |
| 1428 | +output_aesthetics(::FunctionStatistic) = [:x, :y, :group] |
| 1429 | + |
| 1430 | +""" |
| 1431 | + Stat.func[(; num_samples=250)] |
| 1432 | +
|
| 1433 | +Transform $(aes2str(input_aesthetics(func()))) into |
| 1434 | +$(aes2str(output_aesthetics(func()))). |
| 1435 | +""" |
1412 | 1436 | const func = FunctionStatistic
|
1413 | 1437 |
|
1414 | 1438 | default_scales(::FunctionStatistic) = [Gadfly.Scale.x_continuous(), Gadfly.Scale.y_continuous()]
|
1415 | 1439 |
|
1416 |
| -input_aesthetics(::FunctionStatistic) = [:y, :xmin, :xmax] |
1417 |
| -output_aesthetics(::FunctionStatistic) = [:x, :y, :group] |
1418 |
| - |
1419 | 1440 | function apply_statistic(stat::FunctionStatistic,
|
1420 | 1441 | scales::Dict{Symbol, Gadfly.ScaleElement},
|
1421 | 1442 | coord::Gadfly.CoordinateElement,
|
@@ -1475,6 +1496,12 @@ ContourStatistic(; levels=15, samples=150) = ContourStatistic(levels, samples)
|
1475 | 1496 | input_aesthetics(::ContourStatistic) = [:z, :xmin, :xmax, :ymin, :ymax]
|
1476 | 1497 | output_aesthetics(::ContourStatistic) = [:x, :y, :color, :group]
|
1477 | 1498 |
|
| 1499 | +""" |
| 1500 | + Stat.contour[(; levels=15, samples=150)] |
| 1501 | +
|
| 1502 | +Transform $(aes2str(input_aesthetics(contour()))) into |
| 1503 | +$(aes2str(output_aesthetics(contour()))). |
| 1504 | +""" |
1478 | 1505 | const contour = ContourStatistic
|
1479 | 1506 |
|
1480 | 1507 | default_scales(::ContourStatistic, t::Gadfly.Theme=Gadfly.current_theme()) =
|
@@ -1858,7 +1885,20 @@ function default_scales(stat::EnumerateStatistic)
|
1858 | 1885 | end
|
1859 | 1886 | end
|
1860 | 1887 |
|
| 1888 | +""" |
| 1889 | + Stat.x_enumerate |
| 1890 | +
|
| 1891 | +Transform $(aes2str(input_aesthetics(x_enumerate))) into |
| 1892 | +$(aes2str(output_aesthetics(x_enumerate))). |
| 1893 | +""" |
1861 | 1894 | const x_enumerate = EnumerateStatistic(:x)
|
| 1895 | + |
| 1896 | +""" |
| 1897 | + Stat.y_enumerate |
| 1898 | +
|
| 1899 | +Transform $(aes2str(input_aesthetics(y_enumerate))) into |
| 1900 | +$(aes2str(output_aesthetics(y_enumerate))). |
| 1901 | +""" |
1862 | 1902 | const y_enumerate = EnumerateStatistic(:y)
|
1863 | 1903 |
|
1864 | 1904 | function apply_statistic(stat::EnumerateStatistic,
|
@@ -1891,6 +1931,12 @@ default_scales(stat::VecFieldStatistic, t::Gadfly.Theme=Gadfly.current_theme())
|
1891 | 1931 | [Gadfly.Scale.z_func(), Gadfly.Scale.x_continuous(), Gadfly.Scale.y_continuous(),
|
1892 | 1932 | t.continuous_color_scale ]
|
1893 | 1933 |
|
| 1934 | +""" |
| 1935 | + Stat.vectorfield[(; smoothness=1.0, scale=1.0, samples=20)] |
| 1936 | +
|
| 1937 | +Transform $(aes2str(input_aesthetics(vectorfield()))) into |
| 1938 | +$(aes2str(output_aesthetics(vectorfield()))). |
| 1939 | +""" |
1894 | 1940 | const vectorfield = VecFieldStatistic
|
1895 | 1941 |
|
1896 | 1942 | function apply_statistic(stat::VecFieldStatistic,
|
@@ -1957,6 +2003,12 @@ output_aesthetics(stat::HairStatistic) = [:x, :y, :xend, :yend]
|
1957 | 2003 |
|
1958 | 2004 | default_scales(stat::HairStatistic) = [Gadfly.Scale.x_continuous(), Gadfly.Scale.y_continuous()]
|
1959 | 2005 |
|
| 2006 | +""" |
| 2007 | + Stat.hair[(;intercept=0.0, orientation=:vertical)] |
| 2008 | +
|
| 2009 | +Transform $(aes2str(input_aesthetics(hair()))) into |
| 2010 | +$(aes2str(output_aesthetics(hair()))). |
| 2011 | +""" |
1960 | 2012 | const hair = HairStatistic
|
1961 | 2013 |
|
1962 | 2014 | function apply_statistic(stat::HairStatistic,
|
@@ -1987,10 +2039,16 @@ function EllipseStatistic(;
|
1987 | 2039 | return EllipseStatistic(distribution, levels, nsegments)
|
1988 | 2040 | end
|
1989 | 2041 |
|
1990 |
| -Gadfly.input_aesthetics(stat::EllipseStatistic) = [:x, :y] |
1991 |
| -Gadfly.output_aesthetics(stat::EllipseStatistic) = [:x, :y] |
1992 |
| -Gadfly.default_scales(stat::EllipseStatistic) = [Gadfly.Scale.x_continuous(), Gadfly.Scale.y_continuous()] |
| 2042 | +input_aesthetics(stat::EllipseStatistic) = [:x, :y] |
| 2043 | +output_aesthetics(stat::EllipseStatistic) = [:x, :y] |
| 2044 | +default_scales(stat::EllipseStatistic) = [Gadfly.Scale.x_continuous(), Gadfly.Scale.y_continuous()] |
1993 | 2045 |
|
| 2046 | +""" |
| 2047 | + Stat.ellipse[(; distribution=MvNormal, levels=[0.95], nsegments=51)] |
| 2048 | +
|
| 2049 | +Transform $(aes2str(input_aesthetics(ellipse()))) into |
| 2050 | +$(aes2str(output_aesthetics(ellipse()))). |
| 2051 | +""" |
1994 | 2052 | const ellipse = EllipseStatistic
|
1995 | 2053 |
|
1996 | 2054 | function Gadfly.Stat.apply_statistic(stat::EllipseStatistic,
|
|
0 commit comments