FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Plotly.NET/src/Plotly.NET/ChartAPI/HTML.fs at dev · plotly/Plotly.NET · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
plotly
/
Plotly.NET
Public
Notifications
You must be signed in to change notification settings
Fork
99
Star
859
Code
Issues
42
Pull requests
3
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Plotly.NET
/
src
/
Plotly.NET
/
ChartAPI
/
HTML.fs
Copy path
More file actions
More file actions
Latest commit
History
History
History
112 lines (101 loc) · 3.44 KB
Breadcrumbs
Plotly.NET
/
src
/
Plotly.NET
/
ChartAPI
/
HTML.fs
Copy path
File metadata and controls
112 lines (101 loc) · 3.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
namespac
e
Plotly.NE
T
open
Giraffe.
ViewEngine
open
System
type
HTML
()
=
static member
CreateChartScript
(
data
:
string
,
layout
:
string
,
config
:
string
,
plotlyReference
:
PlotlyJSReference
,
guid
:
string
)
=
match
plotlyReference
with
|
Require r
->
script
[
_
type
"
text/javascript
"
]
[
rawText
(
Globals.REQUIREJS
_
SCRIPT
_
TEMPLATE
.Replace
(
"
[REQUIRE_SRC]
"
,
r
)
.Replace
(
"
[SCRIPTID]
"
,
guid.Replace
(
"
-
"
,
"
"
))
.Replace
(
"
[ID]
"
,
guid
)
.Replace
(
"
[DATA]
"
,
data
)
.Replace
(
"
[LAYOUT]
"
,
layout
)
.Replace
(
"
[CONFIG]
"
,
config
)
)
]
|
_
->
script
[
_
type
"
text/javascript
"
]
[
rawText
(
Globals.SCRIPT
_
TEMPLATE
.Replace
(
"
[SCRIPTID]
"
,
guid.Replace
(
"
-
"
,
"
"
))
.Replace
(
"
[ID]
"
,
guid
)
.Replace
(
"
[DATA]
"
,
data
)
.Replace
(
"
[LAYOUT]
"
,
layout
)
.Replace
(
"
[CONFIG]
"
,
config
)
)
]
static member
Doc
(
chart
,
documentTitle
:
string
,
documentDescription
:
string
,
documentCharset
:
string
,
documentFavicon
:
XmlNode
,
plotlyReference
:
PlotlyJSReference
,
?
AdditionalHeadTags
,
?
ChartDescription
)
=
let
additionalHeadTags
=
defaultArg AdditionalHeadTags
[]
let
chartDescription
=
defaultArg ChartDescription
[]
let
plotlyScriptRef
=
match
plotlyReference
with
|
CDN cdn
->
script
[
_
src cdn
;
_
charset
"
utf-8
"
]
[]
|
Full
->
script
[
_
type
"
text/javascript
"
;
_
charset
"
utf-8
"
]
[
rawText
(
InternalUtils.getFullPlotlyJS
())
]
|
NoReference
|
Require
_
->
rawText
"
"
html
[]
[
head
[]
[
plotlyScriptRef
title
[]
[
str documentTitle
]
meta
[
_
charset documentCharset
]
meta
[
_
name
"
description
"
_
content documentDescription
]
documentFavicon
yield
!
additionalHeadTags
]
body
[]
[
yield
!
chart
;
yield
!
chartDescription
]
]
static member
CreateChartHTML
(
data
:
string
,
layout
:
string
,
config
:
string
,
plotlyReference
:
PlotlyJSReference
)
=
let
guid
=
Guid.NewGuid
()
.ToString
()
let
chartScript
=
HTML.CreateChartScript
(
data
=
data
,
layout
=
layout
,
config
=
config
,
plotlyReference
=
plotlyReference
,
guid
=
guid
)
[
div
[
_
id guid
]
[
comment
"
Plotly chart will be drawn inside this DIV
"
]
chartScript
]
Back
|
FazBrowse Home
|
New Git URL