├── .gitattributes
├── .github
└── ISSUE_TEMPLATE.md
├── .gitignore
├── .paket
├── paket.bootstrapper.exe
├── paket.exe
└── paket.targets
├── .travis.yml
├── FnuPlot.sln
├── LICENSE.md
├── README.md
├── RELEASE_NOTES.md
├── appveyor.yml
├── build.cmd
├── build.fsx
├── build.sh
├── docs
├── content
│ ├── index.fsx
│ ├── tutorial.fsx
│ ├── worldbank.fsx
│ └── worldbank.xml
├── files
│ └── img
│ │ ├── logo-template.pdn
│ │ ├── logo.png
│ │ ├── tutorial-1.png
│ │ ├── tutorial-10.png
│ │ ├── tutorial-2.png
│ │ ├── tutorial-3.png
│ │ ├── tutorial-4.png
│ │ ├── tutorial-5.png
│ │ ├── tutorial-6.png
│ │ ├── tutorial-7.png
│ │ ├── tutorial-8.png
│ │ ├── tutorial-9.png
│ │ └── worldbank.png
└── tools
│ ├── generate.fsx
│ └── templates
│ └── template.cshtml
├── nuget
└── FnuPlot.nuspec
├── paket.dependencies
├── paket.lock
├── src
└── FnuPlot
│ ├── AssemblyInfo.fs
│ ├── FnuPlot.fs
│ ├── FnuPlot.fsproj
│ └── paket.references
└── tests
└── FnuPlot.Tests
├── FnuPlot.Tests.fsproj
├── Tests.fs
└── paket.references
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp text=auto eol=lf
6 | *.fs diff=csharp text=auto eol=lf
7 | *.fsi diff=csharp text=auto eol=lf
8 | *.fsx diff=csharp text=auto eol=lf
9 | *.sln text eol=crlf merge=union
10 | *.csproj merge=union
11 | *.vbproj merge=union
12 | *.fsproj merge=union
13 | *.dbproj merge=union
14 |
15 | # Standard to msysgit
16 | *.doc diff=astextplain
17 | *.DOC diff=astextplain
18 | *.docx diff=astextplain
19 | *.DOCX diff=astextplain
20 | *.dot diff=astextplain
21 | *.DOT diff=astextplain
22 | *.pdf diff=astextplain
23 | *.PDF diff=astextplain
24 | *.rtf diff=astextplain
25 | *.RTF diff=astextplain
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description
2 |
3 | Please provide a succinct description of your issue.
4 |
5 | ### Repro steps
6 |
7 | Please provide the steps required to reproduce the problem
8 |
9 | 1. Step A
10 |
11 | 2. Step B
12 |
13 | ### Expected behavior
14 |
15 | Please provide a description of the behavior you expect.
16 |
17 | ### Actual behavior
18 |
19 | Please provide a description of the actual behavior you observe.
20 |
21 | ### Known workarounds
22 |
23 | Please provide a description of any known workarounds.
24 |
25 | ### Related information
26 |
27 | * Operating system
28 | * Branch
29 | * .NET Runtime, CoreCLR or Mono Version
30 | * Performance information, links to performance testing scripts
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Xamarin Studio / monodevelop user-specific
10 | *.userprefs
11 |
12 | # Build results
13 |
14 | [Dd]ebug/
15 | [Rr]elease/
16 | x64/
17 | build/
18 | [Bb]in/
19 | [Oo]bj/
20 |
21 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
22 | !packages/*/build/
23 |
24 | # MSTest test Results
25 | [Tt]est[Rr]esult*/
26 | [Bb]uild[Ll]og.*
27 |
28 | *_i.c
29 | *_p.c
30 | *.ilk
31 | *.meta
32 | *.obj
33 | *.pch
34 | *.pdb
35 | *.pgc
36 | *.pgd
37 | *.rsp
38 | *.sbr
39 | *.tlb
40 | *.tli
41 | *.tlh
42 | *.tmp
43 | *.tmp_proj
44 | *.log
45 | *.vspscc
46 | *.vssscc
47 | .builds
48 | *.pidb
49 | *.log
50 | *.scc
51 |
52 | # Visual C++ cache files
53 | ipch/
54 | *.aps
55 | *.ncb
56 | *.opensdf
57 | *.sdf
58 | *.cachefile
59 |
60 | # Visual Studio profiler
61 | *.psess
62 | *.vsp
63 | *.vspx
64 |
65 | # Guidance Automation Toolkit
66 | *.gpState
67 |
68 | # ReSharper is a .NET coding add-in
69 | _ReSharper*/
70 | *.[Rr]e[Ss]harper
71 |
72 | # TeamCity is a build add-in
73 | _TeamCity*
74 |
75 | # DotCover is a Code Coverage Tool
76 | *.dotCover
77 |
78 | # NCrunch
79 | *.ncrunch*
80 | .*crunch*.local.xml
81 |
82 | # Installshield output folder
83 | [Ee]xpress/
84 |
85 | # DocProject is a documentation generator add-in
86 | DocProject/buildhelp/
87 | DocProject/Help/*.HxT
88 | DocProject/Help/*.HxC
89 | DocProject/Help/*.hhc
90 | DocProject/Help/*.hhk
91 | DocProject/Help/*.hhp
92 | DocProject/Help/Html2
93 | DocProject/Help/html
94 |
95 | # Click-Once directory
96 | publish/
97 |
98 | # Publish Web Output
99 | *.Publish.xml
100 |
101 | # Enable nuget.exe in the .nuget folder (though normally executables are not tracked)
102 | !.nuget/NuGet.exe
103 |
104 | # Windows Azure Build Output
105 | csx
106 | *.build.csdef
107 |
108 | # Windows Store app package directory
109 | AppPackages/
110 |
111 | # Others
112 | sql/
113 | *.Cache
114 | ClientBin/
115 | [Ss]tyle[Cc]op.*
116 | ~$*
117 | *~
118 | *.dbmdl
119 | *.[Pp]ublish.xml
120 | *.pfx
121 | *.publishsettings
122 |
123 | # RIA/Silverlight projects
124 | Generated_Code/
125 |
126 | # Backup & report files from converting an old project file to a newer
127 | # Visual Studio version. Backup files are not needed, because we have git ;-)
128 | _UpgradeReport_Files/
129 | Backup*/
130 | UpgradeLog*.XML
131 | UpgradeLog*.htm
132 |
133 | # SQL Server files
134 | App_Data/*.mdf
135 | App_Data/*.ldf
136 |
137 |
138 | #LightSwitch generated files
139 | GeneratedArtifacts/
140 | _Pvt_Extensions/
141 | ModelManifest.xml
142 |
143 | # =========================
144 | # Windows detritus
145 | # =========================
146 |
147 | # Windows image file caches
148 | Thumbs.db
149 | ehthumbs.db
150 |
151 | # Folder config file
152 | Desktop.ini
153 |
154 | # Recycle Bin used on file shares
155 | $RECYCLE.BIN/
156 |
157 | # Mac desktop service store files
158 | .DS_Store
159 |
160 | # ===================================================
161 | # Exclude F# project specific directories and files
162 | # ===================================================
163 |
164 | # NuGet Packages Directory
165 | packages/
166 |
167 | # Generated documentation folder
168 | docs/output/
169 |
170 | # Temp folder used for publishing docs
171 | temp/
172 |
173 | # Test results produced by build
174 | TestResults.xml
175 |
176 | # Nuget outputs
177 | nuget/*.nupkg
178 | release.cmd
179 | release.sh
180 | localpackages/
181 | paket-files
182 | *.orig
183 | .paket/paket.exe
184 | docs/content/license.md
185 | docs/content/release-notes.md
186 |
--------------------------------------------------------------------------------
/.paket/paket.bootstrapper.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/.paket/paket.bootstrapper.exe
--------------------------------------------------------------------------------
/.paket/paket.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/.paket/paket.exe
--------------------------------------------------------------------------------
/.paket/paket.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | true
6 |
7 | true
8 | $(MSBuildThisFileDirectory)
9 | $(MSBuildThisFileDirectory)..\
10 |
11 |
12 |
13 | $(PaketToolsPath)paket.exe
14 | $(PaketToolsPath)paket.bootstrapper.exe
15 | "$(PaketExePath)"
16 | mono --runtime=v4.0.30319 $(PaketExePath)
17 | "$(PaketBootStrapperExePath)"
18 | mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)
19 |
20 | $(PaketCommand) restore
21 | $(PaketBootStrapperCommand)
22 |
23 | RestorePackages; $(BuildDependsOn);
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 | sudo: required
3 | dist: trusty
4 | dotnet : 2.1.4
5 |
6 | mono:
7 | - 5.0.1
8 |
9 | script:
10 | - ./build.sh All
11 |
--------------------------------------------------------------------------------
/FnuPlot.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 2013
3 | VisualStudioVersion = 12.0.21005.1
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}"
6 | ProjectSection(SolutionItems) = preProject
7 | paket.dependencies = paket.dependencies
8 | paket.lock = paket.lock
9 | EndProjectSection
10 | EndProject
11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}"
12 | EndProject
13 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FnuPlot", "src\FnuPlot\FnuPlot.fsproj", "{7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}"
14 | EndProject
15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}"
16 | ProjectSection(SolutionItems) = preProject
17 | build.fsx = build.fsx
18 | nuget\FnuPlot.nuspec = nuget\FnuPlot.nuspec
19 | README.md = README.md
20 | RELEASE_NOTES.md = RELEASE_NOTES.md
21 | EndProjectSection
22 | EndProject
23 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{83F16175-43B1-4C90-A1EE-8E351C33435D}"
24 | ProjectSection(SolutionItems) = preProject
25 | docs\tools\generate.fsx = docs\tools\generate.fsx
26 | docs\tools\templates\template.cshtml = docs\tools\templates\template.cshtml
27 | EndProjectSection
28 | EndProject
29 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D5255-776D-4B61-85F9-73C37AA1FB9A}"
30 | ProjectSection(SolutionItems) = preProject
31 | docs\content\index.fsx = docs\content\index.fsx
32 | docs\content\tutorial.fsx = docs\content\tutorial.fsx
33 | docs\content\worldbank.fsx = docs\content\worldbank.fsx
34 | EndProjectSection
35 | EndProject
36 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ED8079DD-2B06-4030-9F0F-DC548F98E1C4}"
37 | EndProject
38 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FnuPlot.Tests", "tests\FnuPlot.Tests\FnuPlot.Tests.fsproj", "{E789C72A-5CFD-436B-8EF1-61AA2852A89F}"
39 | EndProject
40 | Global
41 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
42 | Debug|Any CPU = Debug|Any CPU
43 | Release|Any CPU = Release|Any CPU
44 | EndGlobalSection
45 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
46 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
49 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Release|Any CPU.Build.0 = Release|Any CPU
50 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.Build.0 = Debug|Any CPU
52 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.ActiveCfg = Release|Any CPU
53 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.Build.0 = Release|Any CPU
54 | EndGlobalSection
55 | GlobalSection(SolutionProperties) = preSolution
56 | HideSolutionNode = FALSE
57 | EndGlobalSection
58 | GlobalSection(NestedProjects) = preSolution
59 | {83F16175-43B1-4C90-A1EE-8E351C33435D} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}
60 | {8E6D5255-776D-4B61-85F9-73C37AA1FB9A} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}
61 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4}
62 | EndGlobalSection
63 | EndGlobal
64 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright 2011-2014, Tomas Petricek and contributors
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
15 | ------------------------------------------------------------
16 |
17 | Apache License, Version 2.0
18 | ===========================
19 |
20 | Apache License
21 | Version 2.0, January 2004
22 | http://www.apache.org/licenses/
23 |
24 | ### TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
25 |
26 |
27 | **1. Definitions.**
28 |
29 | - "License" shall mean the terms and conditions for use, reproduction,
30 | and distribution as defined by Sections 1 through 9 of this document.
31 |
32 | - "Licensor" shall mean the copyright owner or entity authorized by
33 | the copyright owner that is granting the License.
34 |
35 | - "Legal Entity" shall mean the union of the acting entity and all
36 | other entities that control, are controlled by, or are under common
37 | control with that entity. For the purposes of this definition,
38 | "control" means (i) the power, direct or indirect, to cause the
39 | direction or management of such entity, whether by contract or
40 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
41 | outstanding shares, or (iii) beneficial ownership of such entity.
42 |
43 | - "You" (or "Your") shall mean an individual or Legal Entity
44 | exercising permissions granted by this License.
45 |
46 | - "Source" form shall mean the preferred form for making modifications,
47 | including but not limited to software source code, documentation
48 | source, and configuration files.
49 |
50 | - "Object" form shall mean any form resulting from mechanical
51 | transformation or translation of a Source form, including but
52 | not limited to compiled object code, generated documentation,
53 | and conversions to other media types.
54 |
55 | - "Work" shall mean the work of authorship, whether in Source or
56 | Object form, made available under the License, as indicated by a
57 | copyright notice that is included in or attached to the work
58 | (an example is provided in the Appendix below).
59 |
60 | - "Derivative Works" shall mean any work, whether in Source or Object
61 | form, that is based on (or derived from) the Work and for which the
62 | editorial revisions, annotations, elaborations, or other modifications
63 | represent, as a whole, an original work of authorship. For the purposes
64 | of this License, Derivative Works shall not include works that remain
65 | separable from, or merely link (or bind by name) to the interfaces of,
66 | the Work and Derivative Works thereof.
67 |
68 | - "Contribution" shall mean any work of authorship, including
69 | the original version of the Work and any modifications or additions
70 | to that Work or Derivative Works thereof, that is intentionally
71 | submitted to Licensor for inclusion in the Work by the copyright owner
72 | or by an individual or Legal Entity authorized to submit on behalf of
73 | the copyright owner. For the purposes of this definition, "submitted"
74 | means any form of electronic, verbal, or written communication sent
75 | to the Licensor or its representatives, including but not limited to
76 | communication on electronic mailing lists, source code control systems,
77 | and issue tracking systems that are managed by, or on behalf of, the
78 | Licensor for the purpose of discussing and improving the Work, but
79 | excluding communication that is conspicuously marked or otherwise
80 | designated in writing by the copyright owner as "Not a Contribution."
81 |
82 | - "Contributor" shall mean Licensor and any individual or Legal Entity
83 | on behalf of whom a Contribution has been received by Licensor and
84 | subsequently incorporated within the Work.
85 |
86 | **2. Grant of Copyright License.**
87 | Subject to the terms and conditions of
88 | this License, each Contributor hereby grants to You a perpetual,
89 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
90 | copyright license to reproduce, prepare Derivative Works of,
91 | publicly display, publicly perform, sublicense, and distribute the
92 | Work and such Derivative Works in Source or Object form.
93 |
94 | **3. Grant of Patent License.**
95 | Subject to the terms and conditions of
96 | this License, each Contributor hereby grants to You a perpetual,
97 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
98 | (except as stated in this section) patent license to make, have made,
99 | use, offer to sell, sell, import, and otherwise transfer the Work,
100 | where such license applies only to those patent claims licensable
101 | by such Contributor that are necessarily infringed by their
102 | Contribution(s) alone or by combination of their Contribution(s)
103 | with the Work to which such Contribution(s) was submitted. If You
104 | institute patent litigation against any entity (including a
105 | cross-claim or counterclaim in a lawsuit) alleging that the Work
106 | or a Contribution incorporated within the Work constitutes direct
107 | or contributory patent infringement, then any patent licenses
108 | granted to You under this License for that Work shall terminate
109 | as of the date such litigation is filed.
110 |
111 | **4. Redistribution.**
112 | You may reproduce and distribute copies of the
113 | Work or Derivative Works thereof in any medium, with or without
114 | modifications, and in Source or Object form, provided that You
115 | meet the following conditions:
116 |
117 | - You must give any other recipients of the Work or
118 | Derivative Works a copy of this License; and
119 |
120 | - You must cause any modified files to carry prominent notices
121 | stating that You changed the files; and
122 |
123 | - You must retain, in the Source form of any Derivative Works
124 | that You distribute, all copyright, patent, trademark, and
125 | attribution notices from the Source form of the Work,
126 | excluding those notices that do not pertain to any part of
127 | the Derivative Works; and
128 |
129 | - If the Work includes a "NOTICE" text file as part of its
130 | distribution, then any Derivative Works that You distribute must
131 | include a readable copy of the attribution notices contained
132 | within such NOTICE file, excluding those notices that do not
133 | pertain to any part of the Derivative Works, in at least one
134 | of the following places: within a NOTICE text file distributed
135 | as part of the Derivative Works; within the Source form or
136 | documentation, if provided along with the Derivative Works; or,
137 | within a display generated by the Derivative Works, if and
138 | wherever such third-party notices normally appear. The contents
139 | of the NOTICE file are for informational purposes only and
140 | do not modify the License. You may add Your own attribution
141 | notices within Derivative Works that You distribute, alongside
142 | or as an addendum to the NOTICE text from the Work, provided
143 | that such additional attribution notices cannot be construed
144 | as modifying the License.
145 |
146 | You may add Your own copyright statement to Your modifications and
147 | may provide additional or different license terms and conditions
148 | for use, reproduction, or distribution of Your modifications, or
149 | for any such Derivative Works as a whole, provided Your use,
150 | reproduction, and distribution of the Work otherwise complies with
151 | the conditions stated in this License.
152 |
153 | **5. Submission of Contributions.**
154 | Unless You explicitly state otherwise,
155 | any Contribution intentionally submitted for inclusion in the Work
156 | by You to the Licensor shall be under the terms and conditions of
157 | this License, without any additional terms or conditions.
158 | Notwithstanding the above, nothing herein shall supersede or modify
159 | the terms of any separate license agreement you may have executed
160 | with Licensor regarding such Contributions.
161 |
162 | **6. Trademarks.**
163 | This License does not grant permission to use the trade
164 | names, trademarks, service marks, or product names of the Licensor,
165 | except as required for reasonable and customary use in describing the
166 | origin of the Work and reproducing the content of the NOTICE file.
167 |
168 | **7. Disclaimer of Warranty.**
169 | Unless required by applicable law or
170 | agreed to in writing, Licensor provides the Work (and each
171 | Contributor provides its Contributions) on an "AS IS" BASIS,
172 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
173 | implied, including, without limitation, any warranties or conditions
174 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
175 | PARTICULAR PURPOSE. You are solely responsible for determining the
176 | appropriateness of using or redistributing the Work and assume any
177 | risks associated with Your exercise of permissions under this License.
178 |
179 | **8. Limitation of Liability.**
180 | In no event and under no legal theory,
181 | whether in tort (including negligence), contract, or otherwise,
182 | unless required by applicable law (such as deliberate and grossly
183 | negligent acts) or agreed to in writing, shall any Contributor be
184 | liable to You for damages, including any direct, indirect, special,
185 | incidental, or consequential damages of any character arising as a
186 | result of this License or out of the use or inability to use the
187 | Work (including but not limited to damages for loss of goodwill,
188 | work stoppage, computer failure or malfunction, or any and all
189 | other commercial damages or losses), even if such Contributor
190 | has been advised of the possibility of such damages.
191 |
192 | **9. Accepting Warranty or Additional Liability.**
193 | While redistributing
194 | the Work or Derivative Works thereof, You may choose to offer,
195 | and charge a fee for, acceptance of support, warranty, indemnity,
196 | or other liability obligations and/or rights consistent with this
197 | License. However, in accepting such obligations, You may act only
198 | on Your own behalf and on Your sole responsibility, not on behalf
199 | of any other Contributor, and only if You agree to indemnify,
200 | defend, and hold each Contributor harmless for any liability
201 | incurred by, or claims asserted against, such Contributor by reason
202 | of your accepting any such warranty or additional liability.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | *Note: I am no longer maintaining this project or using F#. If someone out there would like take over maintaining it, let me know. -Luke*
2 |
3 | Lightweight F# wrapper for gnuplot
4 | ===================================
5 |
6 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and
7 | visualization library. Since gnuplot is cross-platform (works on Mac, Linux and Windows),
8 | you can use Fnuplot on all of those platforms.
9 |
10 | FnuPlot provides two features on top of gnuplot. First, it hides the gnuplot process, so you
11 | do not have to start and control the process; you can use the `GnuPlot` type and call it using
12 | `SendCommand`. Second, FnuPlot implements a simple domain-specific language for building a
13 | number of common chart types.
14 |
15 | [](https://travis-ci.org/fsprojects/FnuPlot)
16 | [](https://www.nuget.org/packages/FnuPlot/)
17 | [](http://issuestats.com/github/fsprojects/FnuPlot)
18 | [](http://issuestats.com/github/fsprojects/FnuPlot)
19 |
20 | More information
21 | ----------------
22 |
23 | * See the [Getting started tutorial](http://fsprojects.github.io/FnuPlot/tutorial.html) for usage examples.
24 |
25 | * [API Reference](http://fsprojects.github.io/FnuPlot/reference/index.html) contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.
26 |
27 |
28 | Maintainer(s)
29 | ----------------
30 |
31 | - [@LukeAllen](https://github.com/LukeAllen)
32 | - [@tpetricek](https://github.com/tpetricek)
33 |
34 | The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
35 |
--------------------------------------------------------------------------------
/RELEASE_NOTES.md:
--------------------------------------------------------------------------------
1 | #### 0.1.1-beta - February 20, 2015
2 | * Bug fix for mono (suppresses a meaningless error when calling Dispose())
3 |
4 | #### 0.1.0-beta - February 4, 2015
5 | * Replaced Series.Lines, Series.XY, Series.TimeY, and Series.Function with a single overloaded Series.Lines which accepts any of the above data types. **Important note:** This will break code which used the old constructors. To fix your legacy code, simply replace all usages of the above constructors with Series.Lines
6 | * Added Series.Points and Series.Impulses constructors. These work exactly like Series.Lines, but instead of plotting a continuous line they plot the datapoints as isolated points or isolated thin bars, respectively.
7 |
8 | #### 0.0.5-beta - December 22, 2014
9 | * Adding more documentation, minor code refactoring
10 |
11 | #### 0.0.4-beta - December 18, 2014
12 | * Adding tutorial content
13 |
14 | #### 0.0.3-beta - December 16, 2014
15 | * Publish documentation
16 |
17 | #### 0.0.2-beta - December 16, 2014
18 | * Fixing remaining build issues and releasing
19 |
20 | #### 0.0.1-beta - December 16, 2014
21 | * Using project scaffold and initial NuGet release
22 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | init:
2 | - git config --global core.autocrlf input
3 | build_script:
4 | - cmd: build.cmd
5 | test: off
6 | version: 0.0.1.{build}
7 | artifacts:
8 | - path: bin
9 | name: bin
10 |
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | cls
3 |
4 | .paket\paket.bootstrapper.exe
5 | if errorlevel 1 (
6 | exit /b %errorlevel%
7 | )
8 |
9 | .paket\paket.exe restore
10 | if errorlevel 1 (
11 | exit /b %errorlevel%
12 | )
13 |
14 | IF NOT EXIST build.fsx (
15 | .paket\paket.exe update
16 | packages\FAKE\tools\FAKE.exe init.fsx
17 | )
18 | packages\FAKE\tools\FAKE.exe build.fsx %*
19 |
--------------------------------------------------------------------------------
/build.fsx:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------
2 | // FAKE build script
3 | // --------------------------------------------------------------------------------------
4 |
5 | #r @"packages/FAKE/tools/FakeLib.dll"
6 |
7 | open Fake
8 | open Fake.Git
9 | open Fake.AssemblyInfoFile
10 | open Fake.ReleaseNotesHelper
11 | open Fake.Testing.NUnit3
12 | open System
13 | open System.IO
14 | #if MONO
15 | #else
16 | #load "packages/SourceLink.Fake/tools/Fake.fsx"
17 | open SourceLink
18 | #endif
19 |
20 | // --------------------------------------------------------------------------------------
21 | // START TODO: Provide project-specific details below
22 | // --------------------------------------------------------------------------------------
23 |
24 | // Information about the project are used
25 | // - for version and project name in generated AssemblyInfo file
26 | // - by the generated NuGet package
27 | // - to run tests and to publish documentation on GitHub gh-pages
28 | // - for documentation, you also need to edit info in "docs/tools/generate.fsx"
29 |
30 | // The name of the project
31 | // (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src')
32 | let project = "FnuPlot"
33 |
34 | // Short summary of the project
35 | // (used as description in AssemblyInfo and as a short summary for NuGet package)
36 | let summary = "An F# wrapper for the gnuplot charting library"
37 |
38 | // Longer description of the project
39 | // (used as a description for NuGet package; line breaks are automatically cleaned up)
40 | let description = "FnuPlot is a simple F# wrapper for the gnuplot charting library. It is cross-platform (Mac, Linux and Windows) and lets you create publication-quality charts"
41 |
42 | // List of author names (for NuGet package)
43 | let authors = [ "Tomas Petricek" ]
44 |
45 | // Tags for your project (for NuGet package)
46 | let tags = "gnuplot fsharp f# charting chart"
47 |
48 | // File system information
49 | let solutionFile = "FnuPlot.sln"
50 |
51 | // Pattern specifying assemblies to be tested using NUnit
52 | let testAssemblies = "tests/**/bin/Release/*Tests*.dll"
53 |
54 | // Git configuration (used for publishing documentation in gh-pages branch)
55 | // The profile where the project is posted
56 | let gitOwner = "fsprojects"
57 | let gitHome = "https://github.com/" + gitOwner
58 |
59 | // The name of the project on GitHub
60 | let gitName = "FnuPlot"
61 |
62 | // The url for the raw files hosted
63 | let gitRaw = environVarOrDefault "gitRaw" "https://raw.github.com/fsprojects"
64 |
65 | // --------------------------------------------------------------------------------------
66 | // END TODO: The rest of the file includes standard build steps
67 | // --------------------------------------------------------------------------------------
68 |
69 | // Read additional information from the release notes document
70 | let release = LoadReleaseNotes "RELEASE_NOTES.md"
71 |
72 | let genFSAssemblyInfo (projectPath) =
73 | let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
74 | let basePath = "src/" + projectName
75 | let fileName = basePath + "/AssemblyInfo.fs"
76 | CreateFSharpAssemblyInfo fileName
77 | [ Attribute.Title (projectName)
78 | Attribute.Product project
79 | Attribute.Description summary
80 | Attribute.Version release.AssemblyVersion
81 | Attribute.FileVersion release.AssemblyVersion ]
82 |
83 | let genCSAssemblyInfo (projectPath) =
84 | let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
85 | let basePath = "src/" + projectName + "/Properties"
86 | let fileName = basePath + "/AssemblyInfo.cs"
87 | CreateCSharpAssemblyInfo fileName
88 | [ Attribute.Title (projectName)
89 | Attribute.Product project
90 | Attribute.Description summary
91 | Attribute.Version release.AssemblyVersion
92 | Attribute.FileVersion release.AssemblyVersion ]
93 |
94 | // Generate assembly info files with the right version & up-to-date information
95 | Target "AssemblyInfo" (fun _ ->
96 | let fsProjs = !! "src/**/*.fsproj"
97 | let csProjs = !! "src/**/*.csproj"
98 | fsProjs |> Seq.iter genFSAssemblyInfo
99 | csProjs |> Seq.iter genCSAssemblyInfo
100 | )
101 |
102 | // --------------------------------------------------------------------------------------
103 | // Clean build results
104 |
105 | Target "Clean" (fun _ ->
106 | CleanDirs ["bin"; "temp"]
107 | )
108 |
109 | Target "CleanDocs" (fun _ ->
110 | CleanDirs ["docs/output"]
111 | )
112 |
113 | // --------------------------------------------------------------------------------------
114 | // Build library & test project
115 |
116 | Target "Build" (fun _ ->
117 | !! solutionFile
118 | |> MSBuildRelease "" "Rebuild"
119 | |> ignore
120 | )
121 |
122 | // --------------------------------------------------------------------------------------
123 | // Run the unit tests using test runner
124 |
125 | Target "RunTests" (fun _ ->
126 | !! testAssemblies
127 | |> NUnit3 (fun p ->
128 | { p with
129 | TimeOut = TimeSpan.FromMinutes 20. })
130 | )
131 |
132 | #if MONO
133 | #else
134 | // --------------------------------------------------------------------------------------
135 | // SourceLink allows Source Indexing on the PDB generated by the compiler, this allows
136 | // the ability to step through the source code of external libraries https://github.com/ctaggart/SourceLink
137 |
138 | Target "SourceLink" (fun _ ->
139 | let baseUrl = sprintf "%s/%s/{0}/%%var2%%" gitRaw (project.ToLower())
140 | use repo = new GitRepo(__SOURCE_DIRECTORY__)
141 | !! "src/**/*.fsproj"
142 | |> Seq.iter (fun f ->
143 | let proj = VsProj.LoadRelease f
144 | logfn "source linking %s" proj.OutputFilePdb
145 | let files = proj.Compiles -- "**/AssemblyInfo.fs"
146 | repo.VerifyChecksums files
147 | proj.VerifyPdbChecksums files
148 | proj.CreateSrcSrv baseUrl repo.Revision (repo.Paths files)
149 | Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv
150 | )
151 | )
152 | #endif
153 |
154 | // --------------------------------------------------------------------------------------
155 | // Build a NuGet package
156 |
157 | Target "NuGet" (fun _ ->
158 | NuGet (fun p ->
159 | { p with
160 | Authors = authors
161 | Project = project
162 | Summary = summary
163 | Description = description
164 | Version = release.NugetVersion
165 | ReleaseNotes = String.Join(Environment.NewLine, release.Notes)
166 | Tags = tags
167 | OutputPath = "bin"
168 | AccessKey = getBuildParamOrDefault "nugetkey" ""
169 | Publish = hasBuildParam "nugetkey"
170 | Dependencies = [] })
171 | ("nuget/" + project + ".nuspec")
172 | )
173 |
174 | // --------------------------------------------------------------------------------------
175 | // Generate the documentation
176 |
177 | Target "GenerateReferenceDocs" (fun _ ->
178 | if not <| executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then
179 | failwith "generating reference documentation failed"
180 | )
181 |
182 | let generateHelp' fail debug =
183 | let args =
184 | if debug then ["--define:HELP"]
185 | else ["--define:RELEASE"; "--define:HELP"]
186 | if executeFSIWithArgs "docs/tools" "generate.fsx" args [] then
187 | traceImportant "Help generated"
188 | else
189 | if fail then
190 | failwith "generating help documentation failed"
191 | else
192 | traceImportant "generating help documentation failed"
193 |
194 | let generateHelp fail =
195 | generateHelp' fail false
196 |
197 | Target "GenerateHelp" (fun _ ->
198 | DeleteFile "docs/content/release-notes.md"
199 | CopyFile "docs/content/" "RELEASE_NOTES.md"
200 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md"
201 |
202 | DeleteFile "docs/content/license.md"
203 | CopyFile "docs/content/" "LICENSE.md"
204 |
205 | generateHelp true
206 | )
207 |
208 | Target "GenerateHelpDebug" (fun _ ->
209 | DeleteFile "docs/content/release-notes.md"
210 | CopyFile "docs/content/" "RELEASE_NOTES.md"
211 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md"
212 |
213 | DeleteFile "docs/content/license.md"
214 | CopyFile "docs/content/" "LICENSE.txt"
215 | Rename "docs/content/license.md" "docs/content/LICENSE.txt"
216 |
217 | generateHelp' true true
218 | )
219 |
220 | Target "KeepRunning" (fun _ ->
221 | use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName,"*.*")
222 | watcher.EnableRaisingEvents <- true
223 | watcher.Changed.Add(fun e -> generateHelp false)
224 | watcher.Created.Add(fun e -> generateHelp false)
225 | watcher.Renamed.Add(fun e -> generateHelp false)
226 | watcher.Deleted.Add(fun e -> generateHelp false)
227 |
228 | traceImportant "Waiting for help edits. Press any key to stop."
229 |
230 | System.Console.ReadKey() |> ignore
231 |
232 | watcher.EnableRaisingEvents <- false
233 | watcher.Dispose()
234 | )
235 |
236 | Target "GenerateDocs" DoNothing
237 |
238 | let createIndexFsx lang =
239 | let content = """(*** hide ***)
240 | // This block of code is omitted in the generated HTML documentation. Use
241 | // it to define helpers that you do not want to show in the documentation.
242 | #I "../../../bin"
243 |
244 | (**
245 | F# Project Scaffold ({0})
246 | =========================
247 | *)
248 | """
249 | let targetDir = "docs/content" @@ lang
250 | let targetFile = targetDir @@ "index.fsx"
251 | ensureDirectory targetDir
252 | System.IO.File.WriteAllText(targetFile, System.String.Format(content, lang))
253 |
254 | Target "AddLangDocs" (fun _ ->
255 | let args = System.Environment.GetCommandLineArgs()
256 | if args.Length < 4 then
257 | failwith "Language not specified."
258 |
259 | args.[3..]
260 | |> Seq.iter (fun lang ->
261 | if lang.Length <> 2 && lang.Length <> 3 then
262 | failwithf "Language must be 2 or 3 characters (ex. 'de', 'fr', 'ja', 'gsw', etc.): %s" lang
263 |
264 | let templateFileName = "template.cshtml"
265 | let templateDir = "docs/tools/templates"
266 | let langTemplateDir = templateDir @@ lang
267 | let langTemplateFileName = langTemplateDir @@ templateFileName
268 |
269 | if System.IO.File.Exists(langTemplateFileName) then
270 | failwithf "Documents for specified language '%s' have already been added." lang
271 |
272 | ensureDirectory langTemplateDir
273 | Copy langTemplateDir [ templateDir @@ templateFileName ]
274 |
275 | createIndexFsx lang)
276 | )
277 |
278 | // --------------------------------------------------------------------------------------
279 | // Release Scripts
280 |
281 | Target "ReleaseDocs" (fun _ ->
282 | let tempDocsDir = "temp/gh-pages"
283 | CleanDir tempDocsDir
284 | Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir
285 |
286 | fullclean tempDocsDir
287 | CopyRecursive "docs/output" tempDocsDir true |> tracefn "%A"
288 | StageAll tempDocsDir
289 | Git.Commit.Commit tempDocsDir (sprintf "Update generated documentation for version %s" release.NugetVersion)
290 | Branches.push tempDocsDir
291 | )
292 |
293 | #load "paket-files/fsharp/FAKE/modules/Octokit/Octokit.fsx"
294 | open Octokit
295 |
296 | Target "Release" (fun _ ->
297 | StageAll ""
298 | Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion)
299 | Branches.push ""
300 |
301 | Branches.tag "" release.NugetVersion
302 | Branches.pushTag "" "origin" release.NugetVersion
303 |
304 | // release on github
305 | // createClient (getBuildParamOrDefault "github-user" "") (getBuildParamOrDefault "github-pw" "")
306 | // |> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
307 | // TODO: |> uploadFile "PATH_TO_FILE"
308 | // |> releaseDraft
309 | // |> Async.RunSynchronously
310 | )
311 |
312 | Target "BuildPackage" DoNothing
313 |
314 | // --------------------------------------------------------------------------------------
315 | // Run all targets by default. Invoke 'build ' to override
316 |
317 | Target "All" DoNothing
318 |
319 | "Clean"
320 | ==> "AssemblyInfo"
321 | ==> "Build"
322 | ==> "RunTests"
323 | =?> ("GenerateReferenceDocs",isLocalBuild && not isMono)
324 | =?> ("GenerateDocs",isLocalBuild && not isMono)
325 | ==> "All"
326 | =?> ("ReleaseDocs",isLocalBuild && not isMono)
327 |
328 | "All"
329 | #if MONO
330 | #else
331 | =?> ("SourceLink", Pdbstr.tryFind().IsSome )
332 | #endif
333 | ==> "NuGet"
334 | ==> "BuildPackage"
335 |
336 | "CleanDocs"
337 | ==> "GenerateHelp"
338 | ==> "GenerateReferenceDocs"
339 | ==> "GenerateDocs"
340 |
341 | "CleanDocs"
342 | ==> "GenerateHelpDebug"
343 |
344 | "GenerateHelp"
345 | ==> "KeepRunning"
346 |
347 | "ReleaseDocs"
348 | ==> "Release"
349 |
350 | "BuildPackage"
351 | ==> "Release"
352 |
353 | RunTargetOrDefault "All"
354 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if test "$OS" = "Windows_NT"
3 | then
4 | # use .Net
5 |
6 | .paket/paket.bootstrapper.exe
7 | exit_code=$?
8 | if [ $exit_code -ne 0 ]; then
9 | exit $exit_code
10 | fi
11 |
12 | .paket/paket.exe restore
13 | exit_code=$?
14 | if [ $exit_code -ne 0 ]; then
15 | exit $exit_code
16 | fi
17 |
18 | [ ! -e build.fsx ] && .paket/paket.exe update
19 | [ ! -e build.fsx ] && packages/FAKE/tools/FAKE.exe init.fsx
20 | packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
21 | else
22 | # use mono
23 | mono .paket/paket.bootstrapper.exe
24 | exit_code=$?
25 | if [ $exit_code -ne 0 ]; then
26 | exit $exit_code
27 | fi
28 |
29 | mono .paket/paket.exe restore
30 | exit_code=$?
31 | if [ $exit_code -ne 0 ]; then
32 | exit $exit_code
33 | fi
34 |
35 | [ ! -e build.fsx ] && mono .paket/paket.exe update
36 | [ ! -e build.fsx ] && mono packages/FAKE/tools/FAKE.exe init.fsx
37 | mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
38 | fi
39 |
--------------------------------------------------------------------------------
/docs/content/index.fsx:
--------------------------------------------------------------------------------
1 | (*** hide ***)
2 | // This block of code is omitted in the generated HTML documentation. Use
3 | // it to define helpers that you do not want to show in the documentation.
4 | #I "../../bin"
5 | let names = []
6 | let stats = []
7 | (**
8 | Lightweight F# wrapper for gnuplot
9 | ==================================
10 |
11 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and
12 | visualization library, which lets you create cross-platform, publication-quality charts
13 | on Mac, Linux and Windows. FnuPlot provides two features on top of gnuplot:
14 |
15 | - First, it hides the gnuplot process, so you do not have to start and control the process.
16 | You can easily starts `gnuplot` in the background just by creating a new instance of the
17 | `GnuPlot` type. Then you can send commands to `gnuplot` easily using the `SendCommand` method.
18 |
19 | - Second, FnuPlot implements a simple domain-specific language for building a number of common
20 | chart types. This means that you can use `gp.Plot` to plot charts for functions, line charts,
21 | histograms and a few other charts and you can use `gp.Set` to configure `gnuplot`.
22 |
23 | Visualizing population of the world
24 | -----------------------------------
25 |
26 | To give see a quick example of the DSL for building `gnuplot` charts, have a look at the following
27 | example from the [visualizing population using WorldBank data] tutorial. The tutorial downloads
28 | data from the WorldBank and then uses FnuPlot to create a single chart combining three histograms
29 | for three different years:
30 | *)
31 | // Starts 'gnuplot' process interactively
32 | #r "FnuPlot.dll"
33 | open FnuPlot
34 | let gp = new GnuPlot()
35 |
36 | // Configure chart style, ranges and titles
37 | gp.Set
38 | ( style = Style(Solid),
39 | range = RangeY.[ 5e8 .. 75e8 ],
40 | titles = Titles(x = names, xrotate = -90) )
41 |
42 | // Create a chart combining several histograms
43 | [ for year, values, color in stats ->
44 | Series.Histogram
45 | ( data = values, title = string year,
46 | lineColor = color) ]
47 | |> gp.Plot
48 | (**
49 |
50 | The example first creates `GnuPlot` (assuming that the executable is in your `PATH`). Then it calls
51 | `gp.Set` to configure the chart, setting the Y axis range and titles. Then it creates a sequence of
52 | histograms (with different line colours) that are then passed to `gp.Plot` to display the plot. The
53 | resulting chart looks as follows:
54 |
55 |
56 |
57 | How to get FnuPlot
58 | ------------------
59 |
60 | * The library is available as [FnuPlot on NuGet](https://www.nuget.org/packages/FnuPlot). To get the
61 | code also, [get the code from GitHub](https://github.com/fsprojects/FnuPlot/).
62 |
63 | * All of the FnuPlot functionality is currently implemented in a single file, and so you can also copy the
64 | `FnuPlot.fs` file to your project. The recommended way to do this is to use [Paket](http://fsprojects.github.io/Paket/)
65 | for managing your references and use [GitHub reference](http://fsprojects.github.io/Paket/github-dependencies.html)
66 | specified in your `paket.dependencies` file using `github fsprojects/FnuPlot src/FnuPlot/FnuPlot.fs`.
67 |
68 | Samples & documentation
69 | -----------------------
70 |
71 | The FnuPlot library comes with a documentation that is automatically generated from `*.fsx` files in
72 | [the content folder][content]. This means that you can also open the code in your favourite F# editor
73 | and run it interactively.
74 |
75 | * Read the [Getting started tutorial](tutorial.html), which contains more detailed description of
76 | different charts supported by the library. The [Visualizing population using WorldBank](worldbank.html)
77 | tutorial shows how to create the chart above.
78 |
79 | * [API Reference](reference/index.html) contains automatically generated documentation for all types,
80 | modules and functions in the library. This includes additional brief samples on using most of the
81 | functions.
82 |
83 | Contributing and copyright
84 | --------------------------
85 |
86 | The project is hosted on [GitHub][gh] where you can [report issues][issues], fork
87 | the project and submit pull requests. If you're adding a new public API, please also
88 | consider adding [samples][content] that can be turned into a documentation.
89 |
90 | The library is available under Apache 2.0 license, which allows modification and
91 | redistribution for both commercial and non-commercial purposes. For more information see the
92 | [License file][license] in the GitHub repository.
93 |
94 | [content]: https://github.com/fsprojects/FnuPlot/tree/master/docs/content
95 | [gh]: https://github.com/fsprojects/FnuPlot
96 | [issues]: https://github.com/fsprojects/FnuPlot/issues
97 | [readme]: https://github.com/fsprojects/FnuPlot/blob/master/README.md
98 | [license]: https://github.com/fsprojects/FnuPlot/blob/master/LICENSE.md
99 | *)
100 |
--------------------------------------------------------------------------------
/docs/content/tutorial.fsx:
--------------------------------------------------------------------------------
1 | (*** hide ***)
2 | #I "../../bin"
3 | let pathOpt =
4 | [ // MAINTAINERS: Feel free to add other paths where Gnuplot lives on your machine..
5 | @"C:\Programs\Data\gnuplot\bin\gnuplot.exe"
6 | @"C:\Program Files (x86)\gnuplot\bin\gnuplot.exe"]
7 | |> Seq.tryFind System.IO.File.Exists
8 | let path = defaultArg pathOpt "gnuplot"
9 | (**
10 | Getting started with FnuPlot
11 | ============================
12 |
13 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and
14 | visualization library. Since gnuplot is cross-platform (works on Mac, Linux and Windows),
15 | you can use this library on all of the platforms mentioned above.
16 |
17 | FnuPlot provides two features on top of gnuplot. First, it hides the gnuplot process, so you
18 | do not have to start and control the process; you can use the `GnuPlot` type and call it using
19 | `SendCommand`. Second, FnuPlot implements a simple domain-specific language for building a
20 | number of common chart types.
21 |
22 | Installing and configuring FnuPlot
23 | ----------------------------------
24 | * [Install gnuplot](http://sourceforge.net/projects/gnuplot/files/) if you haven't already.
25 |
26 | * The library is available as [FnuPlot on NuGet](https://www.nuget.org/packages/FnuPlot). To get the
27 | code also, [get the code from GitHub](https://github.com/fsprojects/FnuPlot/).
28 |
29 | * Alternatively: Because FnuPlot is implemented in a single source file, you can instead just copy the
30 | `FnuPlot.fs` file into your project. A robust way to do this is to use [Paket](http://fsprojects.github.io/Paket/)
31 | for managing your references and use [GitHub reference](http://fsprojects.github.io/Paket/github-dependencies.html)
32 | specified in your `paket.dependencies` file using `github fsprojects/FnuPlot src/FnuPlot/FnuPlot.fs`.
33 |
34 | * Once you have the reference, you can either add `FnuPlot.dll` to your reference (when using
35 | a compiled project) or use `#load "FnuPlot.fs"` to load the FnuPlot file obtained using
36 | Paket. Alternatively, you can use `#r` if you're referencing FnuPlot using NuGet package:
37 | *)
38 | #r "FnuPlot.dll"
39 | open FnuPlot
40 | open System
41 | open System.Drawing
42 | (**
43 | The access to gnuplot is managed through the `GnuPlot` type. When creating an instance, you
44 | can specify the path to the `gnuplot` executable. If you do not pass a path explicitly, then
45 | FnuPlot assumes that you have gnuplot in your `PATH` variable:
46 | *)
47 | let gp_default = new GnuPlot()
48 | let gp = new GnuPlot(path)
49 | (**
50 | The `Set` method on the `GnuPlot` object provides a way to configure `gnuplot`. Here, we specify
51 | that plots should appear in a new window (using X11) and we also specify the default font:
52 | *)
53 | gp.Set(output = Output(X11, font="arial"))
54 | (**
55 |
56 | Plotting functions and line charts
57 | ----------------------------------
58 |
59 | The `Plot` method provided by `GnuPlot` has a number of overloads. You can specify a function
60 | to be drawn (as a string), you can specify a single data series or you can specify multiple
61 | series (which can also use different chart types).
62 |
63 | The following shows how to call `Plot` with a function specified as a string:
64 | *)
65 | gp.Plot(Series.Lines "sin(x)")
66 | (**
67 |
68 |
69 | This creates a chart with a single series, created (implicitly) by specifying the function
70 | as a string. If you want to create other kinds of series, you need to use the `Series` type.
71 | The following uses `Series.Lines` to create a single line chart from a specified list of
72 | data points:
73 | *)
74 | gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0])
75 | (**
76 |
77 |
78 | The `Series.Lines` method takes a number of optional parameters that you can use to specify
79 | the title, colour and other properties of the line chart. You can also make the call using
80 | the pipelining operator:
81 | *)
82 | Series.Lines
83 | ( title="Some plot", lineColor = Color.OliveDrab,
84 | weight = 3, data = [2.0; 1.0; 2.0; 5.0])
85 | |> gp.Plot
86 | (**
87 |
88 |
89 | When creating a line series from data points consisting of both X and Y values, you can also use
90 | the `Series.Lines` method with a series of that type (note that FnuPlot also supports time-series data sets, which are
91 | discussed below).
92 | *)
93 | Series.Lines( [0.0,1.0; 0.2,2.0; 2.0,1.5; 2.1,3.0] , title = "Some xy plot")
94 | |> gp.Plot
95 | (**
96 |
97 | *)
98 | (**
99 | Plotting histograms and time-series
100 | -----------------------------------
101 |
102 | Another kind of chart for which FnuPlot provides an easy-to-use wrapper is histogram. This can
103 | be created using the `Series.Histogram` function. Again, we can specify additional properties
104 | using a number of optional parameters:
105 | *)
106 | Series.Histogram
107 | ( [2.0; 5.0; 2.0; 1.0], title = "Some plot", fill = Solid,
108 | lineColor = Color.SteelBlue, weight = 3)
109 | |> gp.Plot
110 | (**
111 |
112 |
113 | As already mentioned, FnuPlot also supports time-series charts. These can be created by passing
114 | values as pairs of `DateTime` and `float`:
115 | *)
116 | let values =
117 | [ DateTime(2014,1,1), 1.0
118 | DateTime(2014,1,5), 3.0
119 | DateTime(2014,2,1), 1.5 ]
120 |
121 | Series.Lines(values, title = "Some time series" )
122 | |> gp.Plot
123 | (**
124 |
125 |
126 | Combining multiple chart series
127 | -------------------------------
128 |
129 | As mentioned earlier, the `Plot` function has a number of overloads. We have already
130 | seen an overload that takes a string (to plot a specified function) and an overload that
131 | takes a single series. However, you can also call `Plot` with a collection of series.
132 | In that case, gnuplot will render multiple series into a single chart.
133 |
134 | The following (slightly silly) demo combines the `sin(x*3)+3)` function specified as
135 | a string together with line chart and histogram created from values:
136 | *)
137 | [ Series.Lines
138 | ( "sin(x*3) + 3", title = "Sinus",
139 | lineColor = Color.Goldenrod, weight = 3)
140 | Series.Lines
141 | ( [2.0; 1.0; 2.0; 5.0], title = "Line",
142 | lineColor = Color.OliveDrab, weight = 3)
143 | Series.Histogram
144 | ( [2.0; 5.0; 2.0; 1.0], title = "Hist", fill = Solid,
145 | lineColor = Color.SteelBlue, weight = 3) ]
146 | |> gp.Plot
147 | (**
148 |
149 |
150 | Configuring ranges and styles
151 | -----------------------------
152 |
153 | So far, we always specified properties of individual chart series locally using optional
154 | parameters of a `Series.` method. However, the `gp.Plot` method also takes a number
155 | of additional parameters that can be used to specify properties of the whole chart. Most
156 | importantly, you can use these to specify ranges:
157 | *)
158 | gp.Plot(
159 | range = RangeY.[-10.0 .. 10.0 ],
160 | data = Series.Lines [2.0; 1.0; 2.0; 5.0])
161 | (**
162 |
163 |
164 | To specify a range, you can use `RangeY` (as shown in the code snippet) or `RangeX` to set
165 | the range for one of the two axes. If you want to configure both ranges, you can use the
166 | `Range` type. For example, to specify X axis range from -10 to 10 and Y axis range from
167 | -1 to 1, you can write `Range.[-10.0 .. 10.0, -1.0 .. 1.0]`.
168 |
169 | The next example shows how to specify fill style for the whole chart, so that you do not have
170 | to repeat this for every single histogram that is being combined:
171 | *)
172 | gp.Plot(
173 | style = Style(fill=Solid),
174 | range = Range.[-0.5 .. 3.7, 0.0 .. 6.0],
175 | data =
176 | [ Series.Histogram([2.0; 1.0; 2.0; 5.0], lineColor = Color.OliveDrab)
177 | Series.Histogram([1.5; 2.0; 2.5; 4.5], lineColor = Color.SteelBlue) ])
178 | (**
179 |
180 |
181 | Saving charts to a file
182 | -----------------------
183 | At the beginning of the tutorial, we used the `gp.Set` method to specify the output kind for
184 | gnuplot. We used `Output(X11, font="arial")` to use the X11 server, which means that all
185 | charts are created in a gnuplot window.
186 |
187 | If you want to save charts to a file, then you can use the `Png` output. The following
188 | (slightly longer) example also demonstrates other optional parameters of the `gp.Set`
189 | method. This gives you another way to specify the range and style - this time, the configuration
190 | will apply to all created charts:
191 | *)
192 | // Set global properties using the 'Set' method
193 | gp.Set(style = Style(fill = Solid), range = Range.[-0.5 .. 3.7, 0.0 .. 6.0])
194 | // Specify the 'Png' output kind
195 | gp.Set(output = Output(Png("/home/tomas/Temp/test1.png")))
196 |
197 | // Create a plot (which will be saved to a file)
198 | gp.Plot
199 | [ Series.Histogram([2.0; 1.0; 2.0; 5.0], lineColor = Color.OliveDrab)
200 | Series.Histogram([1.5; 2.0; 2.5; 4.5], lineColor = Color.SteelBlue) ]
201 |
202 | // Reset the configuration back to X11 plots
203 | gp.Set(output = Output(X11, font="arial"))
204 |
205 | (**
206 |
207 | Impulses and Points
208 | -------------------
209 | Using the `Series.Impulses` and `Series.Points` methods we can plot impulses and points.
210 | *)
211 |
212 | [ Series.Impulses( "besj0(x)*0.12e1", title = "Plot as Impulses")
213 | Series.Points( "(x**besj0(x))-2.5", title = "Plot as Points")]
214 | |> gp.Plot
215 |
216 | (**
217 |
218 | *)
219 |
--------------------------------------------------------------------------------
/docs/content/worldbank.fsx:
--------------------------------------------------------------------------------
1 | (*** hide ***)
2 | #I "../../bin/"
3 | #I "../../packages/FSharp.Data/lib/net40"
4 | let pathOpt =
5 | [ // MAINTAINERS: Feel free to add other paths where Gnuplot lives on your machine..
6 | "C:/Programs/Data/gnuplot/bin/gnuplot.exe"
7 | "/usr/local/bin/gnuplot"
8 | "C:/Program Files (x86)/gnuplot/bin/gnuplot.exe"]
9 | |> Seq.tryFind System.IO.File.Exists
10 | let path = defaultArg pathOpt "gnuplot"
11 | (**
12 | Visualizing population using WorldBank
13 | =====================================
14 |
15 | In this walkthrough, we look at a larger example of data analysis that uses FnuPlot to
16 | visualize the results. We use the [WorldBank](http://data.worldbank.org) as the data source
17 | and we plot how the total population in the countries of the world changed between 1990 and 2005. The
18 | example is inspired by the [Asynchrnous and data-driven programming chapter](http://manning.com/petricek)
19 | from Real-World Functional Programming.
20 |
21 | Downloading data from the WorldBank
22 | -----------------------------------
23 |
24 | In the chapter used as the inspiration, the data download is done using the LINQ to XML library
25 | and the `XDocument` type. Here, we use F# type providers instead. We use XML type provider to
26 | parse the data and WorldBank type provider to find the ID of the required indicator.
27 |
28 | First, we connect to the WorldBank to get the ID and write a function that sends HTTP request
29 | to download one page of data for the specified indicator:
30 | *)
31 | #r "FSharp.Data.dll"
32 | open FSharp.Data
33 |
34 | // Get indicator code from WorldBank
35 | let wb = WorldBankData.GetDataContext()
36 | let indCode = wb.Countries.World.Indicators.``Population, total``.IndicatorCode
37 | let root = "http://api.worldbank.org/countries/indicators/"
38 | let key = "hq8byg8k7t2fxc6hp7jmbx26"
39 |
40 | /// Asynchronously downloads the population
41 | /// data for the specified year & page
42 | let asyncGetPage year page =
43 | let range = sprintf "%d:%d" year year
44 | Http.AsyncRequestString
45 | ( root + indCode,
46 | query=[ "api_key", key; "per_page", "100";
47 | "date", range; "page", string page ] )
48 | (**
49 | Now, we want to save a sample response to a local file and use the XML type provider
50 | to parse the response. The easiest way to do this is to use `File.WriteAllText` to
51 | save a sample result, say for `asyncGetPage 2000 1` to a local file. Here, we use
52 | `worldbank.xml` in the current folder, so we can load the type provider as follows:
53 | *)
54 | #r "System.Xml.Linq.dll"
55 | type WB = XmlProvider<"worldbank.xml">
56 | (**
57 | The generated type `WB` lets us parse the responses returned by `asyncGetPage`. To
58 | download all data, we first need to request the first page, so that we know how many
59 | pages in total are there. Then we can download the rest of the pages in parallel. This
60 | is done in the following `async` function:
61 | *)
62 | let asyncGetPopulation year = async {
63 | // Download the first page & get total no. of pages
64 | let! first = asyncGetPage year 1
65 | let parsed = WB.Parse(first)
66 |
67 | // Download the remaining pages in parallel
68 | let! rest =
69 | [ for pg in 2 .. parsed.Pages -> async {
70 | let! response = asyncGetPage year pg
71 | return WB.Parse(response) } ]
72 | |> Async.Parallel
73 | // Return all pages
74 | return Seq.append [parsed] rest }
75 | (**
76 | The return type of `asyncGetPopulation` is `Async>`, which means that it
77 | _asynchronously_ returns a collection of `` elements from the XML document. Now,
78 | we use `Async.Parallel` again to download data for 3 different years:
79 | *)
80 | let allData =
81 | [ for y in [ 1990; 2000; 2005 ] ->
82 | asyncGetPopulation y ]
83 | |> Async.Parallel
84 | |> Async.RunSynchronously
85 | |> Seq.concat
86 | (**
87 | The operation creates a list of asynchronous operations, composes them so that they are
88 | performed asynchronously, runs them and then it concatenates the results, so that we get
89 | just a single collection of `` nodes.
90 |
91 | Processing downloaded data
92 | --------------------------
93 |
94 | Before we can do the visualization, we need to find the countries for which we have all
95 | the data. To do that, we build two lookup tables. One that maps country code and year to
96 | a value and another, which maps country code to a country name.
97 | *)
98 | // Lookup table mapping IDs to country names
99 | let idToName =
100 | [ for d in allData do
101 | for item in d.Datas do
102 | yield item.Country.Id, item.Country.Value ]
103 | |> dict
104 |
105 | // Lookup table mapping ID and Year to a value
106 | let idAndYearToValue =
107 | [ for d in allData do
108 | for item in d.Datas do
109 | if item.Value.IsSome then
110 | yield (item.Country.Id, item.Date), item.Value.Value ]
111 | |> dict
112 |
113 | (**
114 | Now that we have the two dictionaries, we can create collections of numbers in a format
115 | that can be passed to `gnuplot`. First of all, we want to display data only for some of
116 | the countries. We choose countries and regions that have data for all 3 years and have
117 | population over 500 million. This will give us large countries and aggregated regions that
118 | WorldBank monitors as a whole.
119 |
120 | Next, we need to pick the names of the regions/countries (for axis labels) and a list of
121 | collections with numerical values for each year:
122 | *)
123 |
124 | /// Returns true if data is available for all 3 monitored years
125 | /// and the country or region has over 500 million
126 | let isVisibleCountry id =
127 | [1990; 2000; 2005] |> Seq.forall (fun y ->
128 | match idAndYearToValue.TryGetValue( (id, y) ) with
129 | | true, v -> v > int64 5e8
130 | | _ -> false )
131 |
132 | /// Names of visible countries/regions for axis labels
133 | let names =
134 | [ for KeyValue(id, name) in idToName do
135 | if isVisibleCountry id then yield name ]
136 |
137 | /// List of tuples consisting of a year and data for the year
138 | let stats =
139 | [ for y in [1990; 2000; 2005] do
140 | let data =
141 | [ for KeyValue(id, name) in idToName do
142 | if isVisibleCountry id then
143 | yield float (idAndYearToValue.[id, y]) ]
144 | yield y, data ]
145 | (**
146 | Visualizing data with gnuplot
147 | -----------------------------
148 |
149 | To create a plot using `gnuplot`, we first need to reference the `FnuPlot.dll`
150 | library, open the required namespace and create `GnuPlot` instance. Here, we pass
151 | the path to the `gnuplot` executable as an argument. If it is available directly in
152 | your path, you can just call `new GnuPlot()` without parameters:
153 | *)
154 | #r "FnuPlot.dll"
155 | open FnuPlot
156 | open System.Drawing
157 |
158 | let gp = new GnuPlot(path)
159 | (**
160 | To make the chart nicer, we configure a number of options first. We specify the output
161 | type to X11 (to create chart in a window) and a font. Then we also set the range and
162 | the style of histogram bars (filled). Finally, we add titles and specify that the chart
163 | should be rotated (from the bottom to the top):
164 | *)
165 | gp.Set
166 | ( output = Output(X11, font = "arial"),
167 | style = Style(Solid),
168 | range = RangeY.[ 5e8 .. 75e8 ],
169 | titles = Titles(x = names, xrotate = -90) )
170 | (**
171 | We want to create histogram using custom colors, so we'll zip the data with the following
172 | list of colors:
173 | *)
174 | let colors = [ Color.OliveDrab; Color.SteelBlue; Color.Goldenrod ]
175 | (**
176 | Now we have all we need to create the chart. We use `gp.Plot` to display the plot. As an
177 | argument, we give it a collection of series created using `Series.Histogram`. When
178 | createing a series, we specify the `lineColor` parameter to get the required color (one
179 | color for each year):
180 | *)
181 | gp.Plot
182 | [ for (y, values), clr in Seq.zip stats colors ->
183 | Series.Histogram
184 | ( data = values, title = string y, lineColor = clr) ]
185 | (**
186 |
187 | *)
188 |
--------------------------------------------------------------------------------
/docs/content/worldbank.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Population, total
5 | Arab World
6 | 2000
7 | 277561423
8 | 0
9 |
10 |
11 | Population, total
12 | Caribbean small states
13 | 2000
14 | 6431380
15 | 0
16 |
17 |
18 | Population, total
19 | Central Europe and the Baltics
20 | 2000
21 | 108405522
22 | 0
23 |
24 |
25 | Population, total
26 | East Asia & Pacific (all income levels)
27 | 2000
28 | 2043379556
29 | 0
30 |
31 |
32 | Population, total
33 | East Asia & Pacific (developing only)
34 | 2000
35 | 1812175348
36 | 0
37 |
38 |
39 | Population, total
40 | Euro area
41 | 2000
42 | 317608111
43 | 0
44 |
45 |
46 | Population, total
47 | Europe & Central Asia (all income levels)
48 | 2000
49 | 862094365
50 | 0
51 |
52 |
53 | Population, total
54 | Europe & Central Asia (developing only)
55 | 2000
56 | 256285094
57 | 0
58 |
59 |
60 | Population, total
61 | European Union
62 | 2000
63 | 487975692
64 | 0
65 |
66 |
67 | Population, total
68 | Fragile and conflict affected situations
69 | 2000
70 | 330080933
71 | 0
72 |
73 |
74 | Population, total
75 | Heavily indebted poor countries (HIPC)
76 | 2000
77 | 472726491
78 | 0
79 |
80 |
81 | Population, total
82 | High income
83 | 2000
84 | 1210722389
85 | 0
86 |
87 |
88 | Population, total
89 | High income: nonOECD
90 | 2000
91 | 231667801
92 | 0
93 |
94 |
95 | Population, total
96 | High income: OECD
97 | 2000
98 | 979054588
99 | 0
100 |
101 |
102 | Population, total
103 | Latin America & Caribbean (all income levels)
104 | 2000
105 | 525299778
106 | 0
107 |
108 |
109 | Population, total
110 | Latin America & Caribbean (developing only)
111 | 2000
112 | 500304988
113 | 0
114 |
115 |
116 | Population, total
117 | Least developed countries: UN classification
118 | 2000
119 | 663076857
120 | 0
121 |
122 |
123 | Population, total
124 | Low & middle income
125 | 2000
126 | 4891279561
127 | 0
128 |
129 |
130 | Population, total
131 | Low income
132 | 2000
133 | 636658396
134 | 0
135 |
136 |
137 | Population, total
138 | Lower middle income
139 | 2000
140 | 2089438289
141 | 0
142 |
143 |
144 | Population, total
145 | Middle East & North Africa (all income levels)
146 | 2000
147 | 311791217
148 | 0
149 |
150 |
151 | Population, total
152 | Middle East & North Africa (developing only)
153 | 2000
154 | 276589220
155 | 0
156 |
157 |
158 | Population, total
159 | Middle income
160 | 2000
161 | 4254621165
162 | 0
163 |
164 |
165 | Population, total
166 | North America
167 | 2000
168 | 312993944
169 | 0
170 |
171 |
172 | Population, total
173 | Not classified
174 | 2000
175 |
176 | 0
177 |
178 |
179 | Population, total
180 | OECD members
181 | 2000
182 | 1156313649
183 | 0
184 |
185 |
186 | Population, total
187 | Other small states
188 | 2000
189 | 16222082
190 | 0
191 |
192 |
193 | Population, total
194 | Pacific island small states
195 | 2000
196 | 1952589
197 | 0
198 |
199 |
200 | Population, total
201 | Small states
202 | 2000
203 | 24606051
204 | 0
205 |
206 |
207 | Population, total
208 | South Asia
209 | 2000
210 | 1382195669
211 | 0
212 |
213 |
214 | Population, total
215 | Sub-Saharan Africa (all income levels)
216 | 2000
217 | 664247421
218 | 0
219 |
220 |
221 | Population, total
222 | Sub-Saharan Africa (developing only)
223 | 2000
224 | 663729242
225 | 0
226 |
227 |
228 | Population, total
229 | Upper middle income
230 | 2000
231 | 2165182876
232 | 0
233 |
234 |
235 | Population, total
236 | World
237 | 2000
238 | 6102001950
239 | 0
240 |
241 |
242 | Population, total
243 | Afghanistan
244 | 2000
245 | 20595360
246 | 0
247 |
248 |
249 | Population, total
250 | Albania
251 | 2000
252 | 3089027
253 | 0
254 |
255 |
256 | Population, total
257 | Algeria
258 | 2000
259 | 31719449
260 | 0
261 |
262 |
263 | Population, total
264 | American Samoa
265 | 2000
266 | 57522
267 | 0
268 |
269 |
270 | Population, total
271 | Andorra
272 | 2000
273 | 65399
274 | 0
275 |
276 |
277 | Population, total
278 | Angola
279 | 2000
280 | 13924930
281 | 0
282 |
283 |
284 | Population, total
285 | Antigua and Barbuda
286 | 2000
287 | 77648
288 | 0
289 |
290 |
291 | Population, total
292 | Argentina
293 | 2000
294 | 36903067
295 | 0
296 |
297 |
298 | Population, total
299 | Armenia
300 | 2000
301 | 3076098
302 | 0
303 |
304 |
305 | Population, total
306 | Aruba
307 | 2000
308 | 90858
309 | 0
310 |
311 |
312 | Population, total
313 | Australia
314 | 2000
315 | 19153000
316 | 0
317 |
318 |
319 | Population, total
320 | Austria
321 | 2000
322 | 8011566
323 | 0
324 |
325 |
326 | Population, total
327 | Azerbaijan
328 | 2000
329 | 8048600
330 | 0
331 |
332 |
333 | Population, total
334 | Bahamas, The
335 | 2000
336 | 297759
337 | 0
338 |
339 |
340 | Population, total
341 | Bahrain
342 | 2000
343 | 668239
344 | 0
345 |
346 |
347 | Population, total
348 | Bangladesh
349 | 2000
350 | 132383265
351 | 0
352 |
353 |
354 | Population, total
355 | Barbados
356 | 2000
357 | 267190
358 | 0
359 |
360 |
361 | Population, total
362 | Belarus
363 | 2000
364 | 10005000
365 | 0
366 |
367 |
368 | Population, total
369 | Belgium
370 | 2000
371 | 10251250
372 | 0
373 |
374 |
375 | Population, total
376 | Belize
377 | 2000
378 | 238586
379 | 0
380 |
381 |
382 | Population, total
383 | Benin
384 | 2000
385 | 6949366
386 | 0
387 |
388 |
389 | Population, total
390 | Bermuda
391 | 2000
392 | 61833
393 | 0
394 |
395 |
396 | Population, total
397 | Bhutan
398 | 2000
399 | 564350
400 | 0
401 |
402 |
403 | Population, total
404 | Bolivia
405 | 2000
406 | 8495271
407 | 0
408 |
409 |
410 | Population, total
411 | Bosnia and Herzegovina
412 | 2000
413 | 3834364
414 | 0
415 |
416 |
417 | Population, total
418 | Botswana
419 | 2000
420 | 1755375
421 | 0
422 |
423 |
424 | Population, total
425 | Brazil
426 | 2000
427 | 174504898
428 | 0
429 |
430 |
431 | Population, total
432 | Brunei Darussalam
433 | 2000
434 | 331801
435 | 0
436 |
437 |
438 | Population, total
439 | Bulgaria
440 | 2000
441 | 8170172
442 | 0
443 |
444 |
445 | Population, total
446 | Burkina Faso
447 | 2000
448 | 11607944
449 | 0
450 |
451 |
452 | Population, total
453 | Burundi
454 | 2000
455 | 6674286
456 | 0
457 |
458 |
459 | Population, total
460 | Cabo Verde
461 | 2000
462 | 442426
463 | 0
464 |
465 |
466 | Population, total
467 | Cambodia
468 | 2000
469 | 12222871
470 | 0
471 |
472 |
473 | Population, total
474 | Cameroon
475 | 2000
476 | 15927713
477 | 0
478 |
479 |
480 | Population, total
481 | Canada
482 | 2000
483 | 30769700
484 | 0
485 |
486 |
487 | Population, total
488 | Cayman Islands
489 | 2000
490 | 41685
491 | 0
492 |
493 |
494 | Population, total
495 | Central African Republic
496 | 2000
497 | 3638316
498 | 0
499 |
500 |
501 | Population, total
502 | Chad
503 | 2000
504 | 8301151
505 | 0
506 |
507 |
508 | Population, total
509 | Channel Islands
510 | 2000
511 | 148725
512 | 0
513 |
514 |
515 | Population, total
516 | Chile
517 | 2000
518 | 15454402
519 | 0
520 |
521 |
522 | Population, total
523 | China
524 | 2000
525 | 1262645000
526 | 0
527 |
528 |
529 | Population, total
530 | Colombia
531 | 2000
532 | 39897984
533 | 0
534 |
535 |
536 | Population, total
537 | Comoros
538 | 2000
539 | 528312
540 | 0
541 |
542 |
543 | Population, total
544 | Congo, Dem. Rep.
545 | 2000
546 | 46949244
547 | 0
548 |
549 |
550 | Population, total
551 | Congo, Rep.
552 | 2000
553 | 3126204
554 | 0
555 |
556 |
557 | Population, total
558 | Costa Rica
559 | 2000
560 | 3929588
561 | 0
562 |
563 |
564 | Population, total
565 | Cote d'Ivoire
566 | 2000
567 | 16131332
568 | 0
569 |
570 |
571 | Population, total
572 | Croatia
573 | 2000
574 | 4426000
575 | 0
576 |
577 |
578 | Population, total
579 | Cuba
580 | 2000
581 | 11138416
582 | 0
583 |
584 |
585 | Population, total
586 | Curacao
587 | 2000
588 | 133860
589 | 0
590 |
591 |
592 | Population, total
593 | Cyprus
594 | 2000
595 | 943287
596 | 0
597 |
598 |
599 | Population, total
600 | Czech Republic
601 | 2000
602 | 10255063
603 | 0
604 |
605 |
606 | Population, total
607 | Denmark
608 | 2000
609 | 5339616
610 | 0
611 |
612 |
613 | Population, total
614 | Djibouti
615 | 2000
616 | 722887
617 | 0
618 |
619 |
620 | Population, total
621 | Dominica
622 | 2000
623 | 69679
624 | 0
625 |
626 |
627 | Population, total
628 | Dominican Republic
629 | 2000
630 | 8663421
631 | 0
632 |
633 |
634 | Population, total
635 | Ecuador
636 | 2000
637 | 12533087
638 | 0
639 |
640 |
641 | Population, total
642 | Egypt, Arab Rep.
643 | 2000
644 | 66136590
645 | 0
646 |
647 |
648 | Population, total
649 | El Salvador
650 | 2000
651 | 5958794
652 | 0
653 |
654 |
655 | Population, total
656 | Equatorial Guinea
657 | 2000
658 | 518179
659 | 0
660 |
661 |
662 | Population, total
663 | Eritrea
664 | 2000
665 | 3939348
666 | 0
667 |
668 |
669 | Population, total
670 | Estonia
671 | 2000
672 | 1396985
673 | 0
674 |
675 |
676 | Population, total
677 | Ethiopia
678 | 2000
679 | 66024199
680 | 0
681 |
682 |
683 | Population, total
684 | Faeroe Islands
685 | 2000
686 | 46491
687 | 0
688 |
689 |
690 | Population, total
691 | Fiji
692 | 2000
693 | 811647
694 | 0
695 |
696 |
697 | Population, total
698 | Finland
699 | 2000
700 | 5176209
701 | 0
702 |
703 |
--------------------------------------------------------------------------------
/docs/files/img/logo-template.pdn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/logo-template.pdn
--------------------------------------------------------------------------------
/docs/files/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/logo.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-1.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-10.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-2.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-3.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-4.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-5.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-6.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-7.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-8.png
--------------------------------------------------------------------------------
/docs/files/img/tutorial-9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-9.png
--------------------------------------------------------------------------------
/docs/files/img/worldbank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/worldbank.png
--------------------------------------------------------------------------------
/docs/tools/generate.fsx:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------
2 | // Builds the documentation from `.fsx` and `.md` files in the 'docs/content' directory
3 | // (the generated documentation is stored in the 'docs/output' directory)
4 | // --------------------------------------------------------------------------------------
5 |
6 | // Binaries that have XML documentation (in a corresponding generated XML file)
7 | let referenceBinaries = [ "FnuPlot.dll" ]
8 | // Web site location for the generated documentation
9 | let website = "/FnuPlot"
10 |
11 | let githubLink = "http://github.com/fsprojects/FnuPlot"
12 |
13 | // Specify more information about your project
14 | let info =
15 | [ "project-name", "FnuPlot"
16 | "project-author", "Tomas Petricek"
17 | "project-summary", "An F# wrapper for the gnuplot charting library"
18 | "project-github", githubLink
19 | "project-nuget", "http://nuget.org/packages/FnuPlot" ]
20 |
21 | // --------------------------------------------------------------------------------------
22 | // For typical project, no changes are needed below
23 | // --------------------------------------------------------------------------------------
24 |
25 | #I "../../packages/FSharp.Formatting/lib/net40"
26 | #I "../../packages/RazorEngine/lib/net40"
27 | #I "../../packages/FSharp.Compiler.Service/lib/net40"
28 | #r "../../packages/Microsoft.AspNet.Razor/lib/net40/System.Web.Razor.dll"
29 | #r "../../packages/FAKE/tools/NuGet.Core.dll"
30 | #r "../../packages/FAKE/tools/FakeLib.dll"
31 | #r "RazorEngine.dll"
32 | #r "FSharp.Literate.dll"
33 | #r "FSharp.CodeFormat.dll"
34 | #r "FSharp.MetadataFormat.dll"
35 | open Fake
36 | open System.IO
37 | open Fake.FileHelper
38 | open FSharp.Literate
39 | open FSharp.MetadataFormat
40 |
41 | // When called from 'build.fsx', use the public project URL as
42 | // otherwise, use the current 'output' directory.
43 | #if RELEASE
44 | let root = website
45 | #else
46 | let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../output")
47 | #endif
48 |
49 | // Paths with template/source/output locations
50 | let bin = __SOURCE_DIRECTORY__ @@ "../../bin"
51 | let content = __SOURCE_DIRECTORY__ @@ "../content"
52 | let output = __SOURCE_DIRECTORY__ @@ "../output"
53 | let files = __SOURCE_DIRECTORY__ @@ "../files"
54 | let templates = __SOURCE_DIRECTORY__ @@ "templates"
55 | let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/"
56 | let docTemplate = formatting @@ "templates/docpage.cshtml"
57 |
58 | // Where to look for *.csproj templates (in this order)
59 | let layoutRootsAll = new System.Collections.Generic.Dictionary()
60 | layoutRootsAll.Add("en",[ templates; formatting @@ "templates"
61 | formatting @@ "templates/reference" ])
62 | subDirectories (directoryInfo templates)
63 | |> Seq.iter (fun d ->
64 | let name = d.Name
65 | if name.Length = 2 || name.Length = 3 then
66 | layoutRootsAll.Add(
67 | name, [templates @@ name
68 | formatting @@ "templates"
69 | formatting @@ "templates/reference" ]))
70 |
71 | // Copy static files and CSS + JS from F# Formatting
72 | let copyFiles () =
73 | CopyRecursive files output true |> Log "Copying file: "
74 | ensureDirectory (output @@ "content")
75 | CopyRecursive (formatting @@ "styles") (output @@ "content") true
76 | |> Log "Copying styles and scripts: "
77 |
78 | // Build API reference from XML comments
79 | let buildReference () =
80 | CleanDir (output @@ "reference")
81 | let binaries =
82 | referenceBinaries
83 | |> List.map (fun lib-> bin @@ lib)
84 | MetadataFormat.Generate
85 | ( binaries, output @@ "reference", layoutRootsAll.["en"],
86 | parameters = ("root", root)::info,
87 | sourceRepo = githubLink @@ "tree/master",
88 | sourceFolder = __SOURCE_DIRECTORY__ @@ ".." @@ "..",
89 | publicOnly = true, libDirs = [bin] )
90 |
91 | // Build documentation from `fsx` and `md` files in `docs/content`
92 | let buildDocumentation () =
93 | let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.AllDirectories)
94 | for dir in Seq.append [content] subdirs do
95 | let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "."
96 | let langSpecificPath(lang, path:string) =
97 | path.Split([|'/'; '\\'|], System.StringSplitOptions.RemoveEmptyEntries)
98 | |> Array.exists(fun i -> i = lang)
99 | let layoutRoots =
100 | let key = layoutRootsAll.Keys |> Seq.tryFind (fun i -> langSpecificPath(i, dir))
101 | match key with
102 | | Some lang -> layoutRootsAll.[lang]
103 | | None -> layoutRootsAll.["en"] // "en" is the default language
104 | Literate.ProcessDirectory
105 | ( dir, docTemplate, output @@ sub, replacements = ("root", root)::info,
106 | layoutRoots = layoutRoots, generateAnchors = true )
107 |
108 | // Generate
109 | copyFiles()
110 | #if HELP
111 | buildDocumentation()
112 | #endif
113 | #if REFERENCE
114 | buildReference()
115 | #endif
116 |
--------------------------------------------------------------------------------
/docs/tools/templates/template.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @Title
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |