Skip to content

Commit f9e14fb

Browse files
committed
plotly.js v2.19.0: Add LabelAlias to various axes(plotly/plotly.js#6481)
1 parent 02614cb commit f9e14fb

File tree

9 files changed

+252
-36
lines changed

9 files changed

+252
-36
lines changed

Diff for: src/Plotly.NET/CommonAbstractions/ColorBar.fs

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type ColorBar() =
1717
/// <param name="BorderWidth">Sets the width (in px) or the border enclosing this color bar.</param>
1818
/// <param name="DTick">Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n"dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. "log" has several special values; "L&lt;f&gt;", where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use "D1" (all digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and "D2". If the axis `type` is "date", then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0. "date" also has special values "M&lt;n&gt;" gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to "2000-01-15" and `dtick` to "M3". To set ticks every 4 years, set `dtick` to "M48"</param>
1919
/// <param name="ExponentFormat">Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B.</param>
20+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
2021
/// <param name="Len">Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.</param>
2122
/// <param name="LenMode">Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in "pixels. Use `len` to set the value.</param>
2223
/// <param name="MinExponent">Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is "SI" or "B".</param>
@@ -61,6 +62,7 @@ type ColorBar() =
6162
[<Optional; DefaultParameterValue(null)>] ?BorderWidth: float,
6263
[<Optional; DefaultParameterValue(null)>] ?DTick: IConvertible,
6364
[<Optional; DefaultParameterValue(null)>] ?ExponentFormat: StyleParam.ExponentFormat,
65+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
6466
[<Optional; DefaultParameterValue(null)>] ?Len: float,
6567
[<Optional; DefaultParameterValue(null)>] ?LenMode: StyleParam.UnitMode,
6668
[<Optional; DefaultParameterValue(null)>] ?MinExponent: float,
@@ -107,6 +109,7 @@ type ColorBar() =
107109
?BorderWidth = BorderWidth,
108110
?DTick = DTick,
109111
?ExponentFormat = ExponentFormat,
112+
?LabelAlias = LabelAlias,
110113
?Len = Len,
111114
?LenMode = LenMode,
112115
?MinExponent = MinExponent,
@@ -156,6 +159,7 @@ type ColorBar() =
156159
/// <param name="BorderWidth">Sets the width (in px) or the border enclosing this color bar.</param>
157160
/// <param name="DTick">Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n"dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. "log" has several special values; "L&lt;f&gt;", where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use "D1" (all digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and "D2". If the axis `type` is "date", then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0. "date" also has special values "M&lt;n&gt;" gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to "2000-01-15" and `dtick` to "M3". To set ticks every 4 years, set `dtick` to "M48"</param>
158161
/// <param name="ExponentFormat">Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B.</param>
162+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
159163
/// <param name="Len">Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.</param>
160164
/// <param name="LenMode">Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in "pixels. Use `len` to set the value.</param>
161165
/// <param name="MinExponent">Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is "SI" or "B".</param>
@@ -200,6 +204,7 @@ type ColorBar() =
200204
[<Optional; DefaultParameterValue(null)>] ?BorderWidth: float,
201205
[<Optional; DefaultParameterValue(null)>] ?DTick: IConvertible,
202206
[<Optional; DefaultParameterValue(null)>] ?ExponentFormat: StyleParam.ExponentFormat,
207+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
203208
[<Optional; DefaultParameterValue(null)>] ?Len: float,
204209
[<Optional; DefaultParameterValue(null)>] ?LenMode: StyleParam.UnitMode,
205210
[<Optional; DefaultParameterValue(null)>] ?MinExponent: float,
@@ -247,6 +252,7 @@ type ColorBar() =
247252
BorderWidth |> DynObj.setValueOpt colorBar "borderwidth"
248253
DTick |> DynObj.setValueOpt colorBar "dtick"
249254
ExponentFormat |> DynObj.setValueOptBy colorBar "exponentformat" StyleParam.ExponentFormat.convert
255+
LabelAlias |> DynObj.setValueOpt colorBar "labelalias"
250256
Len |> DynObj.setValueOpt colorBar "len"
251257
LenMode |> DynObj.setValueOptBy colorBar "lenmode" StyleParam.UnitMode.convert
252258
MinExponent |> DynObj.setValueOpt colorBar "min3xponent"

Diff for: src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs

+15
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type LinearAxis() =
8383
/// <param name="Anchor">If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`.</param>
8484
/// <param name="Side">Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area.</param>
8585
/// <param name="Overlaying">If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible.</param>
86+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
8687
/// <param name="Layer">Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis.</param>
8788
/// <param name="Domain">Sets the domain of this axis (in plot fraction).</param>
8889
/// <param name="Position">Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free".</param>
@@ -167,6 +168,7 @@ type LinearAxis() =
167168
[<Optional; DefaultParameterValue(null)>] ?Anchor: StyleParam.LinearAxisId,
168169
[<Optional; DefaultParameterValue(null)>] ?Side: StyleParam.Side,
169170
[<Optional; DefaultParameterValue(null)>] ?Overlaying: StyleParam.LinearAxisId,
171+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
170172
[<Optional; DefaultParameterValue(null)>] ?Layer: StyleParam.Layer,
171173
[<Optional; DefaultParameterValue(null)>] ?Domain: StyleParam.Range,
172174
[<Optional; DefaultParameterValue(null)>] ?Position: float,
@@ -252,6 +254,7 @@ type LinearAxis() =
252254
?Anchor = Anchor,
253255
?Side = Side,
254256
?Overlaying = Overlaying,
257+
?LabelAlias = LabelAlias,
255258
?Layer = Layer,
256259
?Domain = Domain,
257260
?Position = Position,
@@ -338,6 +341,7 @@ type LinearAxis() =
338341
/// <param name="Anchor">If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`.</param>
339342
/// <param name="Side">Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area.</param>
340343
/// <param name="Overlaying">If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible.</param>
344+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
341345
/// <param name="Layer">Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis.</param>
342346
/// <param name="Domain">Sets the domain of this axis (in plot fraction).</param>
343347
/// <param name="Position">Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free".</param>
@@ -418,6 +422,7 @@ type LinearAxis() =
418422
[<Optional; DefaultParameterValue(null)>] ?Anchor: StyleParam.LinearAxisId,
419423
[<Optional; DefaultParameterValue(null)>] ?Side: StyleParam.Side,
420424
[<Optional; DefaultParameterValue(null)>] ?Overlaying: StyleParam.LinearAxisId,
425+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
421426
[<Optional; DefaultParameterValue(null)>] ?Layer: StyleParam.Layer,
422427
[<Optional; DefaultParameterValue(null)>] ?Domain: StyleParam.Range,
423428
[<Optional; DefaultParameterValue(null)>] ?Position: float,
@@ -500,6 +505,7 @@ type LinearAxis() =
500505
?Anchor = Anchor,
501506
?Side = Side,
502507
?Overlaying = Overlaying,
508+
?LabelAlias = LabelAlias,
503509
?Layer = Layer,
504510
?Domain = Domain,
505511
?Position = Position,
@@ -556,6 +562,7 @@ type LinearAxis() =
556562
/// <param name="EndLine">Determines whether or not a line is drawn at along the final value of this axis. If "true", the end line is drawn on top of the grid lines.</param>
557563
/// <param name="EndLineColor">Sets the line color of the end line.</param>
558564
/// <param name="EndLineWidth">Sets the width (in px) of the end line.</param>
565+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
559566
/// <param name="LabelPadding">Extra padding between label and the axis</param>
560567
/// <param name="LabelPrefix">Sets a axis label prefix.</param>
561568
/// <param name="LabelSuffix">Sets a axis label suffix.</param>
@@ -612,6 +619,7 @@ type LinearAxis() =
612619
[<Optional; DefaultParameterValue(null)>] ?EndLine: bool,
613620
[<Optional; DefaultParameterValue(null)>] ?EndLineColor: Color,
614621
[<Optional; DefaultParameterValue(null)>] ?EndLineWidth: int,
622+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
615623
[<Optional; DefaultParameterValue(null)>] ?LabelPadding: int,
616624
[<Optional; DefaultParameterValue(null)>] ?LabelPrefix: string,
617625
[<Optional; DefaultParameterValue(null)>] ?LabelSuffix: string,
@@ -669,6 +677,7 @@ type LinearAxis() =
669677
?EndLine = EndLine,
670678
?EndLineColor = EndLineColor,
671679
?EndLineWidth = EndLineWidth,
680+
?LabelAlias = LabelAlias,
672681
?LabelPadding = LabelPadding,
673682
?LabelPrefix = LabelPrefix,
674683
?LabelSuffix = LabelSuffix,
@@ -701,6 +710,7 @@ type LinearAxis() =
701710
/// <param name="ShowTickSuffix">Same as `showtickprefix` but for tick suffixes.</param>
702711
/// <param name="TickSuffix">Sets a tick label suffix.</param>
703712
/// <param name="ShowExponent">If "all", all exponents are shown besides their significands. If "first", only the exponent of the first tick is shown. If "last", only the exponent of the last tick is shown. If "none", no exponents appear.</param>
713+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
704714
/// <param name="ExponentFormat">Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B.</param>
705715
/// <param name="MinExponent">Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B".</param>
706716
/// <param name="SeparateThousands">If "true", even 4-digit integers are separated</param>
@@ -713,6 +723,7 @@ type LinearAxis() =
713723
static member initIndicatorGauge
714724
(
715725
[<Optional; DefaultParameterValue(null)>] ?DTick: #IConvertible,
726+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
716727
[<Optional; DefaultParameterValue(null)>] ?ExponentFormat: StyleParam.ExponentFormat,
717728
[<Optional; DefaultParameterValue(null)>] ?MinExponent: float,
718729
[<Optional; DefaultParameterValue(null)>] ?NTicks: int,
@@ -741,6 +752,7 @@ type LinearAxis() =
741752
LinearAxis()
742753
|> LinearAxis.style (
743754
?DTick = DTick,
755+
?LabelAlias = LabelAlias,
744756
?ExponentFormat = ExponentFormat,
745757
?MinExponent = MinExponent,
746758
?NTicks = NTicks,
@@ -841,6 +853,7 @@ type LinearAxis() =
841853
/// <param name="Anchor">If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`.</param>
842854
/// <param name="Side">Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area.</param>
843855
/// <param name="Overlaying">If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible.</param>
856+
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
844857
/// <param name="Layer">Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis.</param>
845858
/// <param name="Domain">Sets the domain of this axis (in plot fraction).</param>
846859
/// <param name="Position">Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free".</param>
@@ -942,6 +955,7 @@ type LinearAxis() =
942955
[<Optional; DefaultParameterValue(null)>] ?Anchor: StyleParam.LinearAxisId,
943956
[<Optional; DefaultParameterValue(null)>] ?Side: StyleParam.Side,
944957
[<Optional; DefaultParameterValue(null)>] ?Overlaying: StyleParam.LinearAxisId,
958+
[<Optional; DefaultParameterValue(null)>] ?LabelAlias: DynamicObj,
945959
[<Optional; DefaultParameterValue(null)>] ?Layer: StyleParam.Layer,
946960
[<Optional; DefaultParameterValue(null)>] ?Domain: StyleParam.Range,
947961
[<Optional; DefaultParameterValue(null)>] ?Position: float,
@@ -1044,6 +1058,7 @@ type LinearAxis() =
10441058
Anchor |> DynObj.setValueOptBy axis "anchor" StyleParam.LinearAxisId.convert
10451059
Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert
10461060
Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.LinearAxisId.convert
1061+
LabelAlias |> DynObj.setValueOpt axis "labelalias"
10471062
Layer |> DynObj.setValueOptBy axis "layer" StyleParam.Layer.convert
10481063
Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert
10491064
Position |> DynObj.setValueOpt axis "position"

0 commit comments

Comments
 (0)