data-forge / data-forge-plot Goto Github PK
View Code? Open in Web Editor NEWAn experimental (work in progress) JavaScript-based plotting API for Data-Forge
License: MIT License
An experimental (work in progress) JavaScript-based plotting API for Data-Forge
License: MIT License
Is it possible to change the font size on one or both axes? I have not been able to discover how, if it is possible. Thanks.
When I try to install data-forge-render, the installation fails with the following errors:
npm install --save data-forge-render
npm ERR! code E404
npm ERR! 404 Not Found: data-forge-render@latest
I am charting a dataframe whose time series ranges over several days, with millisecond granularity. The x-axis label is defaulting to 'HH:mm'. Is there a way to specify x-axis labels with other formats (e.g., 'DD.MM HH:mm')? Thanks in advance.
Hi,
I'm plotting two series using the following plot command in DFN Pro 1.10.3:
display.plot(t, { }, { x: "date", y: "new_confirmed", y2: "avg_new_confirmed_7days" });
The avg_new_confirmed_7days lines has an offset as you can see on joined screen capture.
On December 12 data point, the avg value is : 1508.71... but shows in the 2500-3000 range on the plot.
Is this a problem or did I just forgot to pass some parameters?
A second question, is it possible to mix a line and a bar chart. I went to C3 they have this kind of graph, did try to do the same in DFN. It doesn't seems to work.
Here is my plot command : display.plot(t, { type: 'bar', types: { avg_new_confirmed_7days: 'line'} }, { x: "date", y: "new_confirmed", y2: "avg_new_confirmed_7days" });
Thank you,
Stéphane
Is there a way to plot a set line on the chart? For example like oversold/undersold levels on an RSI indicator.
So I got to try out plotting a bit and I was trying to see whether plotting large graphs works well or not.
I don't have the sample results with me sadly, but I'll try to explain. I was trying to create a line plot with around 1900 points (so 1900 points across the x-axis), in a normal 2d plane (x-y only). What I noticed is that:
I was wondering whether an in-built support to ease large graphs creation is possible. What am thinking is for an API that enables a large graph to be nicely split up across multiple graphs.
I'm aware that you can use DataForge's skip and take
or window
to create chunks of your data and then plot each of them, but the advantage of having the API on data-forge-plot
is sticking to the separation of concerns (that normal data-forge
is for data manipulation and data-forge-plot
is for plotting).
One last thing is that at least for the HTML plots, a large graph can be divided into different tabs and each graph gets lazily rendered. This way the whole divided plot artifacts remain under one resource
Hey, is there a way to set the X axis min / max or have it auto scale? (Awesome library btw!)
I'm plotting motion data versus time with an input CSV file in the form of:
time, accel, velocity, displacement
0, 0, 0, 0
0.01, 0.2, 0.02, 0.002
... etc
I'm processing the data with the following code:
let df = dataForge.fromCSV(this.csvData, { dynamicTyping: true }).dropSeries("time");
let plot = df.plot( { width: 2000, height: 1000 });
fse.emptyDirSync(this.outputPath);
await plot.exportWeb(path.join(this.outputPath, "web"), { overwrite: true, openBrowser: true });
The above code plots all Y values (accel, velocity, displacement) correctly. The X values (time) are wrong though and just incrementing sample integers, as expected, as we dropped the time series.
However, if I set the dataFrame index to "time" I'd expect the X values to now be the given time values .
i.e.
let df = dataForge.fromCSV(this.csvData, { dynamicTyping: true }).setIndex("time").dropSeries("time");
The plot that is generated keeps the same wrong axis labels (incrementing integers from 1 to the total number of sample points) but plots all my Y values seemingly on the first tick of the chart.
I believe this is a X axis scaling issue, as all of my time values are below 1.0, and if I look at the chart-def.json
file the index values are indeed my time values. It's just in the display that is broken.
If I multiply all of my index values by 100, it produces a better chart (because we have X values greater than 1), but the X axis labels and scaling are still set as though I didn't change my Index.
i.e. If I could set the X axis to only display between 0.0 and 1.0 I'd believe I could see the entire chart.
Any Ideas?
Thanks again for creating this awesome tool!
P.S. To get the exportWeb()
function to work correctly I had to firstly modify the generated index.js
file and change all references of inputChartDef
in the function formatChartDef(inputChartDef){ }
to inputChartDef.chartDef
before my chart would open in the browser correctly (MS Edge)
This may or may not be related...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.