Skip to content

Commit bc92298

Browse files
committed
Add XML comments for TraceStyle.Image and fix some args
1 parent ad4ee4f commit bc92298

2 files changed

Lines changed: 42 additions & 18 deletions

File tree

src/Plotly.NET/ChartAPI/Chart2D.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,8 +2914,6 @@ module Chart2D =
29142914
[<Optional; DefaultParameterValue(null)>] ?ShowLegend: bool,
29152915
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
29162916
[<Optional; DefaultParameterValue(null)>] ?Ids: seq<#IConvertible>,
2917-
[<Optional; DefaultParameterValue(null)>] ?X: seq<#IConvertible>,
2918-
[<Optional; DefaultParameterValue(null)>] ?Y: seq<#IConvertible>,
29192917
[<Optional; DefaultParameterValue(null)>] ?ColorModel: StyleParam.ColorModel,
29202918
[<Optional; DefaultParameterValue(null)>] ?ZMax: StyleParam.ColorComponentBound,
29212919
[<Optional; DefaultParameterValue(null)>] ?ZMin: StyleParam.ColorComponentBound,
@@ -2933,8 +2931,6 @@ module Chart2D =
29332931
?ShowLegend = ShowLegend,
29342932
?Opacity = Opacity,
29352933
?Ids = Ids,
2936-
?X = X,
2937-
?Y = Y,
29382934
?ColorModel = ColorModel,
29392935
?ZMax = ZMax,
29402936
?ZMin = ZMin,
@@ -2951,8 +2947,6 @@ module Chart2D =
29512947
[<Optional; DefaultParameterValue(null)>] ?ShowLegend: bool,
29522948
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
29532949
[<Optional; DefaultParameterValue(null)>] ?Ids: seq<#IConvertible>,
2954-
[<Optional; DefaultParameterValue(null)>] ?X: seq<#IConvertible>,
2955-
[<Optional; DefaultParameterValue(null)>] ?Y: seq<#IConvertible>,
29562950
[<Optional; DefaultParameterValue(null)>] ?ZMax: StyleParam.ColorComponentBound,
29572951
[<Optional; DefaultParameterValue(null)>] ?ZMin: StyleParam.ColorComponentBound,
29582952
[<Optional; DefaultParameterValue(null)>] ?ZSmooth: StyleParam.SmoothAlg,
@@ -2982,8 +2976,6 @@ module Chart2D =
29822976
?ShowLegend = ShowLegend,
29832977
?Opacity = Opacity,
29842978
?Ids = Ids,
2985-
?X = X,
2986-
?Y = Y,
29872979
ColorModel = StyleParam.ColorModel.RGBA,
29882980
?ZMax = ZMax,
29892981
?ZMin = ZMin,

src/Plotly.NET/Traces/Trace2D.fs

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ type Trace2DStyle() =
16941694

16951695

16961696
/// <summary>
1697-
/// Create a function that applies the styles of a 2d histogram contour plot to a Trace object
1697+
/// Create a function that applies the styles of a heatmap to a Trace object
16981698
/// </summary>
16991699
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover.</param>
17001700
/// <param name="Visible">Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).</param>
@@ -1875,7 +1875,40 @@ type Trace2DStyle() =
18751875
// out ->
18761876
heatmap)
18771877

1878-
// Applies the styles of heatmap to TraceObjects
1878+
/// <summary>
1879+
/// Create a function that applies the styles of a Image plot to a Trace object
1880+
/// </summary>
1881+
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover.</param>
1882+
/// <param name="Visible">Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).</param>
1883+
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
1884+
/// <param name="LegendRank">Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with `"reversed" `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items.</param>
1885+
/// <param name="LegendGroup">Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.</param>
1886+
/// <param name="LegendGroupTitle">Sets the legend group title for this trace.</param>
1887+
/// <param name="Opacity">Sets the opacity of the trace.</param>
1888+
/// <param name="Ids">Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.</param>
1889+
/// <param name="X0">Set the image's x position.</param>
1890+
/// <param name="DX">Set the pixel's horizontal size.</param>
1891+
/// <param name="Y0">Set the image's y position.</param>
1892+
/// <param name="DY">Set the pixel's vertical size</param>
1893+
/// <param name="Z">A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color.</param>
1894+
/// <param name="Source">Specifies the data URI of the image to be visualized. The URI consists of "data:image/[&lt;media subtype&gt;][;base64],&lt;data&gt;"</param>
1895+
/// <param name="Text">Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.</param>
1896+
/// <param name="MultiText">Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels.</param>
1897+
/// <param name="HoverText">Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag.</param>
1898+
/// <param name="MultiHoverText">Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag.</param>
1899+
/// <param name="HoverInfo">Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.</param>
1900+
/// <param name="HoverTemplate">Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `&lt;extra&gt;` is displayed in the secondary box, for example "&lt;extra&gt;{fullData.name}&lt;/extra&gt;". To hide the secondary box completely, use an empty tag `&lt;extra&gt;&lt;/extra&gt;`.</param>
1901+
/// <param name="MultiHoverTemplate">Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `&lt;extra&gt;` is displayed in the secondary box, for example "&lt;extra&gt;{fullData.name}&lt;/extra&gt;". To hide the secondary box completely, use an empty tag `&lt;extra&gt;&lt;/extra&gt;`.</param>
1902+
/// <param name="Meta">Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index.</param>
1903+
/// <param name="CustomData">Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements</param>
1904+
/// <param name="XAxis">Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If "x" (the default value), the x coordinates refer to `layout.xaxis`. If "x2", the x coordinates refer to `layout.xaxis2`, and so on.</param>
1905+
/// <param name="YAxis">Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If "y" (the default value), the y coordinates refer to `layout.yaxis`. If "y2", the y coordinates refer to `layout.yaxis2`, and so on.</param>
1906+
/// <param name="ColorModel">Color model used to map the numerical color components described in `z` into colors. If `source` is specified, this attribute will be set to `rgba256` otherwise it defaults to `rgb`.</param>
1907+
/// <param name="ZMax">Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well.</param>
1908+
/// <param name="ZMin">Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well.</param>
1909+
/// <param name="ZSmooth">Picks a smoothing algorithm use to smooth `z` data.</param>
1910+
/// <param name="HoverLabel">Sets the style of the hoverlabels of this trace.</param>
1911+
/// <param name="UIRevision">Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves.</param>
18791912
static member Image
18801913
(
18811914
[<Optional; DefaultParameterValue(null)>] ?Name: string,
@@ -1886,18 +1919,19 @@ type Trace2DStyle() =
18861919
[<Optional; DefaultParameterValue(null)>] ?LegendGroupTitle: Title,
18871920
[<Optional; DefaultParameterValue(null)>] ?Opacity: float,
18881921
[<Optional; DefaultParameterValue(null)>] ?Ids: seq<#IConvertible>,
1889-
[<Optional; DefaultParameterValue(null)>] ?X: seq<#IConvertible>,
18901922
[<Optional; DefaultParameterValue(null)>] ?X0: #IConvertible,
18911923
[<Optional; DefaultParameterValue(null)>] ?DX: #IConvertible,
1892-
[<Optional; DefaultParameterValue(null)>] ?Y: seq<#IConvertible>,
18931924
[<Optional; DefaultParameterValue(null)>] ?Y0: #IConvertible,
18941925
[<Optional; DefaultParameterValue(null)>] ?DY: #IConvertible,
18951926
[<Optional; DefaultParameterValue(null)>] ?Z: #seq<#seq<#seq<int>>>,
18961927
[<Optional; DefaultParameterValue(null)>] ?Source: string,
1897-
[<Optional; DefaultParameterValue(null)>] ?Text: seq<#IConvertible>,
1928+
[<Optional; DefaultParameterValue(null)>] ?Text: #IConvertible,
1929+
[<Optional; DefaultParameterValue(null)>] ?MultiText: seq<#IConvertible>,
18981930
[<Optional; DefaultParameterValue(null)>] ?HoverText: string,
1931+
[<Optional; DefaultParameterValue(null)>] ?MultiHoverText: seq<string>,
18991932
[<Optional; DefaultParameterValue(null)>] ?HoverInfo: StyleParam.HoverInfo,
19001933
[<Optional; DefaultParameterValue(null)>] ?HoverTemplate: string,
1934+
[<Optional; DefaultParameterValue(null)>] ?MultiHoverTemplate: seq<string>,
19011935
[<Optional; DefaultParameterValue(null)>] ?Meta: string,
19021936
[<Optional; DefaultParameterValue(null)>] ?CustomData: seq<#IConvertible>,
19031937
[<Optional; DefaultParameterValue(null)>] ?XAxis: StyleParam.LinearAxisId,
@@ -1919,18 +1953,16 @@ type Trace2DStyle() =
19191953
LegendGroupTitle |> DynObj.setValueOpt image "legendgrouptitle"
19201954
Opacity |> DynObj.setValueOpt image "opacity"
19211955
Ids |> DynObj.setValueOpt image "ids"
1922-
X |> DynObj.setValueOpt image "x"
19231956
X0 |> DynObj.setValueOpt image "x0"
19241957
DX |> DynObj.setValueOpt image "dx"
1925-
Y |> DynObj.setValueOpt image "y"
19261958
Y0 |> DynObj.setValueOpt image "y0"
19271959
DY |> DynObj.setValueOpt image "dy"
19281960
Z |> DynObj.setValueOpt image "z"
19291961
Source |> DynObj.setValueOpt image "source"
1930-
Text |> DynObj.setValueOpt image "text"
1931-
HoverText |> DynObj.setValueOpt image "hovertext"
1962+
(Text, MultiText) |> DynObj.setSingleOrMultiOpt image "text"
1963+
(HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt image "hovertext"
19321964
HoverInfo |> DynObj.setValueOptBy image "hoverinfo" StyleParam.HoverInfo.convert
1933-
HoverTemplate |> DynObj.setValueOpt image "hovertemplate"
1965+
(HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt image "hovertemplate"
19341966
Meta |> DynObj.setValueOpt image "meta"
19351967
CustomData |> DynObj.setValueOpt image "customdata"
19361968
XAxis |> DynObj.setValueOptBy image "xaxis" StyleParam.LinearAxisId.convert

0 commit comments

Comments
 (0)