syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

Added functionality that allows you to programmatically create a screenshot #312

Closed dehli closed 8 years ago

dehli commented 8 years ago

For this function, I made a few changes.

  1. First, I made sure all of the CSS styling for the SVG elements were applied inline. This was so that the SVG elements could be merged into a canvas retaining their styling.
  2. Then I created a mergeParcoords function which merges the canvases and the SVG elements together into one canvas.
  3. The merged canvas element can be used by the consumer in whatever way they want. I added a download example which shows how it can be used to download a screenshot of the chart.
  4. I added an example to showcase the functionality.

Let me know your thoughts. Thanks!

Notes:

syntagmatic commented 8 years ago

parallel-coordinate

It looks like the canvas for the screenshot needs to pull in the scale factor for retina displays. On a rMPB the SVG looks good, but the canvas ends up at a different size. https://github.com/syntagmatic/parallel-coordinates/pull/288

dehli commented 8 years ago

Thanks @syntagmatic! I forgot to account for retina displays. I'll make a fix for it.

dehli commented 8 years ago

Hi @syntagmatic, I believe I fixed the issue. I don't have a retina display to test it but I tested it by using the zoom feature in the browser. Let me know what you think!

dehli commented 8 years ago

Hey @syntagmatic, would it be okay with you if I went ahead and merged this PR?

syntagmatic commented 8 years ago

Sorry I was on vacation! Let me do a quick test this evening on my macbook, just to check.

dehli commented 8 years ago

No worries! @syntagmatic I wasn't sure if you had forgotten about this. Hope you had a good vacation!

syntagmatic commented 8 years ago

Works for me! Nice job!