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

Upscaling for canvas #17

Open
3 tasks
freeman-lab opened this issue Jun 20, 2015 · 0 comments
Open
3 tasks

Upscaling for canvas #17

freeman-lab opened this issue Jun 20, 2015 · 0 comments

Comments

@freeman-lab
Copy link
Member

The new canvas-based visualizations need to be upscaled when on retina displays, as discussed here.

Confirmed that the following change to one of the example visualization declarations does the trick:

var canvas = container
    .append('canvas')
    .attr('class', 'force-plot canvas')
    .attr('width', 2 * (width + margin.left + margin.right))
    .attr('height', 2 * (height + margin.top + margin.bottom))
    .style('width', width + margin.left + margin.right + "px")
    .style('height', height + margin.top + margin.bottom + "px")
    .call(zoom)
    .on("click", mouseHandler)
    .on("dblclick.zoom", null)
    .node().getContext("2d")

canvas.scale(2,2)

Need to also add logic to auto-detect a retina display.

Todo:

  • scatter
  • line
  • force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant