Note: if you run this notebook yourself, make sure to mount the complete JFinM_Charts
directory to IJulia
/ Jupyter
, as the notebook will link to the d3 directory in the main project directory.
mount
equals JFinM_Charts
JFinM_Charts
is mounted as directory mount
In [1]:
pwd()
Out[1]:
In general, we need to define paths to the following components:
Thereby only two components are defined relative to the current directory:
All other components are relative to the output file:
except the d3 chart code, which always resides in the package directory and gets completely included into the output file.
The best way to create a chart instance is through the general function chart
, which simultaneously allows further customizations through keyword arguments:
In [2]:
using JFinM_Charts
d3
folder in JFinM_Charts
directory, so we will not use it in this demo, as the notebook charts should be viewable on github-pages and nbviewer also
In [3]:
d3lib = d3SymLink()
Out[3]:
In [4]:
readdir()
Out[4]:
In [5]:
dump(d3lib)
In [6]:
d3lib = JFinM_Charts.D3Lib("../d3")
Out[6]:
In [7]:
treeData = [0 2 2 2 2 2;
1 0 3 3 3 3;
2 2 0 4 4 4;
3 3 3 0 5 5;
4 4 4 4 0 6;
5 5 5 5 5 0]
Out[7]:
In [8]:
trChrt = chart(JFinM_Charts.VineTreeChart, vSpace = 50, width = 80)
Out[8]:
extData
:
In [9]:
dump(trChrt)
In [10]:
embChart = JFinM_Charts.embed(treeData, trChrt, d3lib)
Out[10]:
In [11]:
embChart = JFinM_Charts.embed(treeData, trChrt, d3lib, width = 550, height = 300)
Out[11]:
In [12]:
embChart.absHtmlPath
Out[12]:
In [13]:
dump(embChart)
dataPaths
will show the variable name of the data in Javascript
In [14]:
embChart.dataPaths
Out[14]:
render
In [15]:
render(treeData, trChrt, "./tmp/treeChartTest.html", ["treeArrayDataName"], d3lib)
Out[15]:
In [16]:
readdir("./tmp")
Out[16]:
In [17]:
render(treeData, trChrt, "./tmp/treeChartTest.html", ["treeArrayDataName"])
Out[17]:
In [18]:
using TimeData
In [19]:
chrt = JFinM_Charts.chart(MLineChart)
Out[19]:
In [20]:
dats = [Date(2001,1,1):Date(2001,1,30)]
data = Timematr(rand(30), dats)
data[1:3, :]
Out[20]:
In [25]:
embed(data, chrt, width = 850, height = 600)
Out[25]:
In [27]:
render(data, chrt, "./tmp/linePlot.html")
Out[27]:
In [28]:
render([], chrt, "./tmp/linePlot2.html", ["./tmp/linePlot_data.csv"])
Out[28]: