Skip to content

Commit 99d635a

Browse files
committed
plotlyjs v2.14: Add support for sankey links with arrows (plotly/plotly.js#6276)
1 parent 28de52f commit 99d635a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Plotly.NET/ChartAPI/GenericChart.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module HTML =
1515
<head>
1616
<!-- Plotly.js -->
1717
<meta http-equiv="X-UA-Compatible" content="IE=11" >
18-
<script src="https://cdn.plot.ly/plotly-2.13.3.min.js"></script>
18+
<script src="https://cdn.plot.ly/plotly-2.14.0.min.js"></script>
1919
[ADDITIONAL_HEAD_TAGS]
2020
<style>
2121
.container {
@@ -58,7 +58,7 @@ module HTML =
5858
newScript.AppendLine(
5959
@"
6060
var renderPlotly_[SCRIPTID] = function() {
61-
var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.13.3.min'}}) || require;
61+
var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.14.0.min'}}) || require;
6262
fsharpPlotlyRequire(['plotly'], function(Plotly) {"
6363
)
6464
|> ignore

src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs

+4
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ type SankeyLinks() =
127127

128128
static member init
129129
(
130+
[<Optional; DefaultParameterValue(null)>] ?ArrowLen: int,
130131
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
131132
[<Optional; DefaultParameterValue(null)>] ?ColorScales: seq<SankeyLinkColorscale>,
132133
[<Optional; DefaultParameterValue(null)>] ?CustomData: seq<#IConvertible>,
@@ -143,6 +144,7 @@ type SankeyLinks() =
143144

144145
SankeyLinks()
145146
|> SankeyLinks.style (
147+
?ArrowLen = ArrowLen,
146148
?Color = Color,
147149
?ColorScales = ColorScales,
148150
?CustomData = CustomData,
@@ -160,6 +162,7 @@ type SankeyLinks() =
160162

161163
static member style
162164
(
165+
[<Optional; DefaultParameterValue(null)>] ?ArrowLen: int,
163166
[<Optional; DefaultParameterValue(null)>] ?Color: Color,
164167
[<Optional; DefaultParameterValue(null)>] ?ColorScales: seq<SankeyLinkColorscale>,
165168
[<Optional; DefaultParameterValue(null)>] ?CustomData: seq<#IConvertible>,
@@ -175,6 +178,7 @@ type SankeyLinks() =
175178
) =
176179
(fun (sankeyLinks: SankeyLinks) ->
177180

181+
ArrowLen |> DynObj.setValueOpt sankeyLinks "arrowlen"
178182
Color |> DynObj.setValueOpt sankeyLinks "color"
179183
ColorScales |> DynObj.setValueOpt sankeyLinks "colorscales"
180184
CustomData |> DynObj.setValueOpt sankeyLinks "customdata"

tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let simpleChart =
2020
let ``Html layout tests`` =
2121
testList "SimpleTests.Simple tests" [
2222
testCase "Expecting plotly js" ( fun () ->
23-
"https://cdn.plot.ly/plotly-2.13.3.min"
23+
"https://cdn.plot.ly/plotly-2.14.0.min"
2424
|> chartGeneratedContains simpleChart
2525
);
2626
testCase "Expecting data" ( fun () ->
@@ -36,7 +36,7 @@ let ``Html layout tests`` =
3636
|> chartGeneratedContains simpleChart
3737
);
3838
testCase "Expecting require config" (fun () ->
39-
"var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.13.3.min'}}) || require;"
39+
"var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.14.0.min'}}) || require;"
4040
|> chartGeneratedContains simpleChart
4141
);
4242
testCase "Expecting html tags in embedded page only" (fun () ->

0 commit comments

Comments
 (0)