Code Monkey home page Code Monkey logo

data-forge-plot's People

Contributors

ashleydavis avatar btruhand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

data-forge-plot's Issues

Error installing data-forge-render

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

Specifying x-axis timeseries label format

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.

Second y plotted series lines seems have an offset

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.

Capture d’écran, le 2021-02-02 à 14 20 57

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

Plotting large graphs to multiple graphs

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:

  1. The x-axis becomes intelligible
  2. The graph is extremely slow to render

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

X axis min / max or Scale setting ?

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...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.