working on bulid
This commit is contained in:
@@ -48,7 +48,7 @@ var trace1 = {
|
||||
|
||||
The `{}` create a list, the `[]` an Array (or vector, as it does with `Julia`), the `name:` are keys. The above is simply translated via:
|
||||
|
||||
```julia
|
||||
```julia;
|
||||
Config(x = [1,2,3,4],
|
||||
y = [10, 15, 13, 17],
|
||||
mode = "markers",
|
||||
@@ -58,7 +58,7 @@ Config(x = [1,2,3,4],
|
||||
|
||||
The `Config` constructor (from the `EasyConfig` package loaded with `PlotlyLight`) is an interface for a dictionary whose keys are symbols, which are produced by the named arguments passed to `Config`. By nesting `Config` statements, nested `JavaScript` structures can be built up. As well, these can be built on the fly using `.` notation, as in:
|
||||
|
||||
```julia
|
||||
```julia; hold=true
|
||||
cfg = Config()
|
||||
cfg.key1.key2.key3 = "value"
|
||||
cfg
|
||||
@@ -159,7 +159,7 @@ p # to display the plot
|
||||
|
||||
The values for `a` and `b` are used to generate the ``x``- and ``y``-values. These can also be gathered from the existing plot object. Here is one way, where for each trace with an `x` key, the extrema are consulted to update a list of left and right ranges.
|
||||
|
||||
```julia
|
||||
```julia; hold=true
|
||||
xs, ys = PlotUtils.adapted_grid(x -> x^5 - x - 1, (0, 2)) # answer is (0,2)
|
||||
p = Plot([Config(x=xs, y=ys, name="Polynomial"),
|
||||
Config(x=xs, y=0 .* ys, name="x-axis", mode="lines", line=Config(width=5))]
|
||||
@@ -223,7 +223,7 @@ values between ``0`` and ``1``.) A string with this content can be
|
||||
specified. Otherwise, something like the following can be used to
|
||||
avoid the type piracy:
|
||||
|
||||
```julia
|
||||
```julia;
|
||||
struct rgb
|
||||
r
|
||||
g
|
||||
@@ -398,7 +398,7 @@ Plot(data, layout)
|
||||
```
|
||||
|
||||
|
||||
The following example is more complicated use of the elements previously described. It comes from an image from [Wikipedia](https://en.wikipedia.org/wiki/List_of_trigonometric_identities) for trigonometric identities. The use of ``\LaTeX`` does not seem to be supported through the `JavaScript` interface; unicode symbols are used instead. The `xanchor` and `yanchor` keys are used to position annotations away from the default. The `textangle` key is used to rotate text, as desired.
|
||||
The following example is more complicated use of the elements previously described. It comes mimics an image from [Wikipedia](https://en.wikipedia.org/wiki/List_of_trigonometric_identities) for trigonometric identities. The use of ``\LaTeX`` does not seem to be supported through the `JavaScript` interface; unicode symbols are used instead. The `xanchor` and `yanchor` keys are used to position annotations away from the default. The `textangle` key is used to rotate text, as desired.
|
||||
|
||||
```julia, hold=true
|
||||
alpha = pi/6
|
||||
@@ -541,7 +541,7 @@ helix(t) = [cos(t), sin(t), t]
|
||||
helix′(t) = [-sin(t), cos(t), 1]
|
||||
ts = range(0, 4pi, length=200)
|
||||
xs, ys, zs = unzip(helix.(ts))
|
||||
helix_trace = Config(;NamedTuple(zip((:x,:y,:z), unzip(helix.(ts))))...,
|
||||
helix_trace = Config(; NamedTuple(zip((:x,:y,:z), unzip(helix.(ts))))...,
|
||||
type = "scatter3d", # <<- note the 3d
|
||||
mode = "lines",
|
||||
line=(width=2,
|
||||
|
||||
Reference in New Issue
Block a user