Skip to content

Commit

Permalink
plotlyjs v2.12.0: add griddash axis property to cartesian, polar, smi…
Browse files Browse the repository at this point in the history
…th, ternary and geo subplots and add griddash and minorgriddash to carpet trace (plotly/plotly.js#6144), adapt StyleParam.DrawingStyle accordingly
  • Loading branch information
kMutagene committed Feb 3, 2023
1 parent d183457 commit 6711ecf
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ module GenericChartExtensions =
let append =
Option.defaultValue true AppendTags

this |> Chart.withMathTex (AppendTags = append)
this |> Chart.withMathTex (AppendTags = append, ?MathJaxVersion = MathJaxVersion)


/// Save chart as html single page
Expand Down
6 changes: 6 additions & 0 deletions src/Plotly.NET/ChartAPI/Chart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ type Chart =
/// <param name="LineColor">Sets the axis line color.</param>
/// <param name="ShowGrid">Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark.</param>
/// <param name="GridColor">Sets the color of the grid lines.</param>
/// <param name="GridDash">Sets the dash style of lines. Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").</param>
/// <param name="ZeroLine">Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines.</param>
/// <param name="ZeroLineColor">Sets the line color of the zero line.</param>
/// <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>
Expand Down Expand Up @@ -1112,6 +1113,7 @@ type Chart =
[<Optional; DefaultParameterValue(null)>] ?LineColor: Color,
[<Optional; DefaultParameterValue(null)>] ?ShowGrid: bool,
[<Optional; DefaultParameterValue(null)>] ?GridColor: Color,
[<Optional; DefaultParameterValue(null)>] ?GridDash: StyleParam.DrawingStyle,
[<Optional; DefaultParameterValue(null)>] ?ZeroLine: bool,
[<Optional; DefaultParameterValue(null)>] ?ZeroLineColor: Color,
[<Optional; DefaultParameterValue(null)>] ?Anchor: StyleParam.LinearAxisId,
Expand Down Expand Up @@ -1153,6 +1155,7 @@ type Chart =
?LineColor = LineColor,
?ShowGrid = ShowGrid,
?GridColor = GridColor,
?GridDash = GridDash,
?ZeroLine = ZeroLine,
?ZeroLineColor = ZeroLineColor,
?Anchor = Anchor,
Expand Down Expand Up @@ -1218,6 +1221,7 @@ type Chart =
/// <param name="LineColor">Sets the axis line color.</param>
/// <param name="ShowGrid">Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark.</param>
/// <param name="GridColor">Sets the color of the grid lines.</param>
/// <param name="GridDash">Sets the dash style of lines. Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").</param>
/// <param name="ZeroLine">Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines.</param>
/// <param name="ZeroLineColor">Sets the line color of the zero line.</param>
/// <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>
Expand Down Expand Up @@ -1250,6 +1254,7 @@ type Chart =
[<Optional; DefaultParameterValue(null)>] ?LineColor: Color,
[<Optional; DefaultParameterValue(null)>] ?ShowGrid: bool,
[<Optional; DefaultParameterValue(null)>] ?GridColor: Color,
[<Optional; DefaultParameterValue(null)>] ?GridDash: StyleParam.DrawingStyle,
[<Optional; DefaultParameterValue(null)>] ?ZeroLine: bool,
[<Optional; DefaultParameterValue(null)>] ?ZeroLineColor: Color,
[<Optional; DefaultParameterValue(null)>] ?Anchor: StyleParam.LinearAxisId,
Expand Down Expand Up @@ -1291,6 +1296,7 @@ type Chart =
?LineColor = LineColor,
?ShowGrid = ShowGrid,
?GridColor = GridColor,
?GridDash = GridDash,
?ZeroLine = ZeroLine,
?ZeroLineColor = ZeroLineColor,
?Anchor = Anchor,
Expand Down
4 changes: 2 additions & 2 deletions src/Plotly.NET/ChartAPI/GenericChart.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module HTML =
<head>
<!-- Plotly.js -->
<meta http-equiv="X-UA-Compatible" content="IE=11" >
<script src="https://cdn.plot.ly/plotly-2.11.1.min.js"></script>
<script src="https://cdn.plot.ly/plotly-2.12.1.min.js"></script>
[ADDITIONAL_HEAD_TAGS]
<style>
.container {
Expand Down Expand Up @@ -58,7 +58,7 @@ module HTML =
newScript.AppendLine(
@"
var renderPlotly_[SCRIPTID] = function() {
var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.11.1.min'}}) || require;
var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.12.1.min'}}) || require;
fsharpPlotlyRequire(['plotly'], function(Plotly) {"
)
|> ignore
Expand Down
8 changes: 6 additions & 2 deletions src/Plotly.NET/CommonAbstractions/StyleParams.fs
Original file line number Diff line number Diff line change
Expand Up @@ -973,14 +973,18 @@ module StyleParam =
| Dash
| Dot
| DashDot
| User of int
| LongDash
| LongDashDot
| User of seq<int>
static member toString =
function
| Solid -> "solid"
| Dash -> "dash"
| Dot -> "dot"
| DashDot -> "dashdot"
| User px -> px.ToString()
| LongDash -> "longdash"
| LongDashDot -> "longdashdot"
| User px -> px |> Seq.map (fun px -> $"{px}px") |> String.concat ","

static member convert = DrawingStyle.toString >> box
override this.ToString() = this |> DrawingStyle.toString
Expand Down
Loading

0 comments on commit 6711ecf

Please sign in to comment.