Skip to content

Upscaling for canvas #17

Open
Open
@freeman-lab

Description

@freeman-lab

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions