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

Replace visRatio and layout props with aspect prop #1284

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Replace visRatio and layout props with aspect prop #1284

merged 1 commit into from
Nov 16, 2022

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Nov 15, 2022

Fix #1275

⚠️ Significant breaking changes

  • [VisCanvas] Prop visRatio is replaced with prop aspect, which follows matplotlib:
    • 'auto' is equivalent to no visRatio (i.e. the heatmap's 'fill' layout);
    • 'equal' is equivalent to computing visRatio from the axis domains to obtain an orthonormal basis (i.e. the heatmap's cover layout) -- so now, this ratio computation is performed internally by VisCanvas ;
    • and if aspect is a number, then it is used as the ratio directly (this is not used by the viewer; it's just for flexibility of the lib and consistency with matplotlib).
  • [HeatmapVis, RgbVis] Prop layout is replaced with prop aspect, which is given sane defaults ('equal') and forwarded to VisCanvas.

I've also replaced the layout property in the config stores and toolbars with a keepRatio property, since it is all we care about in the viewer.

@axelboc axelboc requested a review from loichuder November 15, 2022 15:36
Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the change !

packages/lib/src/vis/heatmap/HeatmapVis.tsx Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

[VisCanvas] Replace ratio props
2 participants