Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line data as Object (no csv or tsv) #53

Closed
rmarronnier opened this issue Sep 23, 2020 · 2 comments
Closed

Line data as Object (no csv or tsv) #53

rmarronnier opened this issue Sep 23, 2020 · 2 comments

Comments

@rmarronnier
Copy link

Hey there !

Thanks for the fantastic work :-)

I'd love to use the RoughViz Line without having to create .csv or .tsv files (getting data directly from a private db).

Is this something that can be easily enabled ?

@Nderim1
Copy link
Contributor

Nderim1 commented Jun 17, 2023

Hi, would love this too.

@jwilber
Copy link
Owner

jwilber commented Oct 1, 2023

Can feed in local data as follows:

const anchor = "#viz0"
const dataLength = 100;
const scatterData = {
  y1: Array.from({ length: dataLength }, () => Math.random() * dataLength),
  y2: Array.from({ length: dataLength }, () => Math.random() * dataLength),
};

 new roughViz.Line({
      element: anchor,
      data: { y: scatterData["y1"], y2: scatterData["y2"] },
      roughness: roughnessValue,
      stroke: strokeVal,
      strokeWidth: strokeWidthValue,
      axisRoughness: axisRoughnessValue,
      circle: false,
    });
  }

@jwilber jwilber closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants