-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathHeatmap.cs
More file actions
139 lines (136 loc) · 7.03 KB
/
Copy pathHeatmap.cs
File metadata and controls
139 lines (136 loc) · 7.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
using System;
using System.Collections.Generic;
using Plotly.NET;
using Plotly.NET.LayoutObjects;
using Plotly.NET.TraceObjects;
using static Plotly.NET.StyleParam;
namespace Plotly.NET.CSharp;
public static partial class Chart
{
/// <summary>
/// Creates a heatmap.
///
/// A heatmap is a data visualization technique that shows magnitude of a phenomenon as color in two dimensions.
/// </summary>
/// <param name="zData">Sets the 2-dimensional z data, which will be visualized with the color scale.</param>
/// <param name="X">Sets the x coordinates</param>
/// <param name="MultiX">Sets the x coordinates. Use two inner arrays here to plot multicategorial data</param>
/// <param name="Y">Sets the y coordinates</param>
/// <param name="MultiY">Sets the y coordinates. Use two inner arrays here to plot multicategorial data</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover.</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the Opacity otf the trace.</param>
/// <param name="XGap">Sets the horizontal gap (in pixels) between bricks.</param>
/// <param name="YGap">Sets the vertical gap (in pixels) between bricks.</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="ColorBar">Sets the styles of the colorbar for this trace.</param>
/// <param name="ColorScale">Sets the colorscale for this trace.</param>
/// <param name="ShowScale">Whether or not to show the colorscale/colorbar</param>
/// <param name="ReverseScale">Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color.</param>
/// <param name="ZSmooth">Picks a smoothing algorithm use to smooth `z` data.</param>
/// <param name="Transpose">Transposes the z data.</param>
/// <param name="UseWebGL">Whether or not to use WebGL to render this trace</param>
/// <param name="ReverseYAxis">Whether or not to reverse the y axis. If true, (0,0) will lie on the top left and increase downwards.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart Heatmap<ZType, XType, YType, TextType>(
IEnumerable<IEnumerable<ZType>> zData,
Optional<IEnumerable<XType>> X = default,
Optional<IEnumerable<IEnumerable<XType>>> MultiX = default,
Optional<IEnumerable<YType>> Y = default,
Optional<IEnumerable<IEnumerable<YType>>> MultiY = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<int> XGap = default,
Optional<int> YGap = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<ColorBar> ColorBar = default,
Optional<StyleParam.Colorscale> ColorScale = default,
Optional<bool> ShowScale = default,
Optional<bool> ReverseScale = default,
Optional<StyleParam.SmoothAlg> ZSmooth = default,
Optional<bool> Transpose = default,
Optional<bool> UseWebGL = default,
Optional<bool> ReverseYAxis = default,
Optional<bool> UseDefaults = default
)
where ZType : IConvertible
where XType : IConvertible
where YType : IConvertible
where TextType : IConvertible
=>
Plotly.NET.Chart2D_Heatmap.Chart.Heatmap<IEnumerable<ZType>, ZType, XType, YType, TextType>(
zData: zData,
X: X.ToOption(),
MultiX: MultiX.ToOption(),
Y: Y.ToOption(),
MultiY: MultiY.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
XGap: XGap.ToOption(),
YGap: YGap.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
ColorBar: ColorBar.ToOption(),
ColorScale: ColorScale.ToOption(),
ShowScale: ShowScale.ToOption(),
ReverseScale: ReverseScale.ToOption(),
ZSmooth: ZSmooth.ToOption(),
Transpose: Transpose.ToOption(),
UseWebGL: UseWebGL.ToOption(),
ReverseYAxis: ReverseYAxis.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
/// <summary>Creates a heatmap from encoded z data and optional encoded axes.</summary>
/// <param name="zEncoded">Sets the z matrix as an encoded typed array.</param>
/// <param name="xEncoded">Sets the x coordinates as an encoded typed array.</param>
/// <param name="yEncoded">Sets the y coordinates as an encoded typed array.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in <c>Defaults</c></param>
public static GenericChart Heatmap<TextType>(
EncodedTypedArray zEncoded,
Optional<EncodedTypedArray> xEncoded = default,
Optional<EncodedTypedArray> yEncoded = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<int> XGap = default,
Optional<int> YGap = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<ColorBar> ColorBar = default,
Optional<StyleParam.Colorscale> ColorScale = default,
Optional<bool> ShowScale = default,
Optional<bool> ReverseScale = default,
Optional<StyleParam.SmoothAlg> ZSmooth = default,
Optional<bool> Transpose = default,
Optional<bool> UseWebGL = default,
Optional<bool> ReverseYAxis = default,
Optional<bool> UseDefaults = default
)
where TextType : IConvertible
=>
Plotly.NET.Chart2D_Heatmap.Chart.Heatmap(
zEncoded: zEncoded,
xEncoded: xEncoded.ToOption(),
yEncoded: yEncoded.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
XGap: XGap.ToOption(),
YGap: YGap.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
ColorBar: ColorBar.ToOption(),
ColorScale: ColorScale.ToOption(),
ShowScale: ShowScale.ToOption(),
ReverseScale: ReverseScale.ToOption(),
ZSmooth: ZSmooth.ToOption(),
Transpose: Transpose.ToOption(),
UseWebGL: UseWebGL.ToOption(),
ReverseYAxis: ReverseYAxis.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
}