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

Improve rendering of scattergl, splom and parcoords by implementing plotGlPixelRatio for those traces #5500

Merged
merged 39 commits into from Jul 12, 2021

Conversation

jonmmease
Copy link
Contributor

@jonmmease jonmmease commented Feb 12, 2021

This PR updates the scattergl and parcoords traces to honor the config.plotGlPixelRatio parameter. Increasing the plotGlPixelRatio value now increases the resolution of the WebGL rendered content of these plots, both live and when exported to static images.

Closes #5497, and is the first step of addressing plotly/Kaleido#58.

Also closes #5500.

Already working:

  • 3D plots
  • scatterploargl
  • heatmapgl

Fixed:

  • scattergl
  • parcoords
  • splom

TODO:

  • Review and update baselines

cc #5395

Examples

Here are some before and after examples. All of these are exported to png images with a scale of 3 and plotGlPixelRatio of 6.

Open both images in a new tab to get the full effect.

Scattergl

Before

before_scattergl

After

after_scattergl

SPLOM

Before

(Note, there was some marker size distortion before)
before_splom

After

after_splom

Parcoords

Before

before_parcoords

After

Note that parcoords lines are thinner because the linewidth must remain at width 1, due to webgl line limitations, instead of increasing in width with GlPixelRatio the way that scattergl can.

gl2d_parcoords_blocks_after

Other Change: parcoords text shadow color

(Moved to #5506)

cc @archmoj @nicolaskruchten @alexcjohnson on parcoords style change

@jonmmease jonmmease changed the title Add support for plotGlPixelRatio in scattergl and parcoords traces Add support for plotGlPixelRatio in scattergl/parcoords/splom traces Feb 13, 2021
@jonmmease
Copy link
Contributor Author

Here are a two images comparing the interactive appearance of parcoords before and after

Before:
parcoords_before

After:
parcoords_after

Note that the lines look thinner in this PR because gl lines are fixed at width 1, and the rendering is now performed at twine the resolution (4x more pixels).
cc @nicolaskruchten

@PeterDeWeirdt
Copy link

This looks like an awesome improvement! Any idea for when we can expect these changes to be merged?

@nicolaskruchten
Copy link
Member

nicolaskruchten commented Apr 15, 2021

I think we decided that this is a bugfix that we could do after 2.0 i.e. in 2.1.

also re parcoords: if there is a parcoords trace in the figure, ration back to 1 for all the regl-based traces.

@archmoj archmoj marked this pull request as ready for review June 26, 2021 17:09
@archmoj
Copy link
Contributor

archmoj commented Jun 26, 2021

Resolved conflicts and added to v2.3.0 milestone.

@archmoj archmoj added this to the v2.3.0 milestone Jun 26, 2021
@archmoj
Copy link
Contributor

archmoj commented Jul 9, 2021

Thanks @jonmmease for the 💪 PR 🎖️
💃 💃

@archmoj
Copy link
Contributor

archmoj commented Jul 12, 2021

Awaiting merge :)

@nicolaskruchten
Copy link
Member

You can merge it @archmoj

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

Successfully merging this pull request may close these issues.

plotGlPixelRatio has no effect on scattergl
5 participants