Skip to content

Conversation

@tarzzz
Copy link
Contributor

@tarzzz tarzzz commented Sep 6, 2019

Part of https://github.com/plotly/streambed/issues/13458

  • Test different size combinations in an on-prem environment.

The custom size is not working because remote.CreateBrowserWindow expects the height/width to be "non-strings" (ie integers or floats). This fixes the issue.

@tarzzz tarzzz force-pushed the fix-custom-size-arg branch 4 times, most recently from 1c9b6d6 to b002aa3 Compare September 6, 2019 21:32
@tarzzz tarzzz changed the title Ensure that width/height settings are Ints Fix custom pageSize for Dash App Previews Sep 6, 2019
@tarzzz tarzzz force-pushed the fix-custom-size-arg branch from b002aa3 to 9a0cafc Compare September 6, 2019 21:39
@chriddyp
Copy link
Member

chriddyp commented Sep 6, 2019

I think only integers are supported - there's an electron bug with floats: electron/electron#9361 (comment)

@tarzzz
Copy link
Contributor Author

tarzzz commented Sep 6, 2019

In my investigations, I noticed that the pageSize specified in the request body is not being passed to printToPDF call. This fixes the issue.

I think only integers are supported - there's an electron bug with floats:electron/electron#9361 (comment)

We can Math.ceil the incoming values to ensure only integers are passed along. Choosing b/w Math.ceil or Math.floor or Math.round does not matter because it will only change by +- 1 micron.

@tarzzz
Copy link
Contributor Author

tarzzz commented Sep 6, 2019

@antoinerg or @etpinard Please review.. I have checked this in an on-prem environment and custom page sizes work for me.

@joaoalf
Copy link
Contributor

joaoalf commented Sep 9, 2019

@tarzzz Don't we want this for 3.2-release?

@etpinard
Copy link
Contributor

etpinard commented Sep 9, 2019

Looks good to me 💃

That said, are folks ok with providing the page size in microns? Maybe we could change it to pixels, call this a breaking change and bump orca to v2?

@tarzzz
Copy link
Contributor Author

tarzzz commented Sep 9, 2019

are folks ok with providing the page size in microns

It is not a breaking change as the pageSize has always been in microns in the API.

@tarzzz tarzzz changed the base branch from master to 3.2-release September 9, 2019 15:15
@tarzzz tarzzz force-pushed the fix-custom-size-arg branch from a685f6e to 58e5930 Compare September 9, 2019 15:18
@etpinard
Copy link
Contributor

etpinard commented Sep 9, 2019

Correct @tarzzz your PR here does not introduce a breaking change.

But what if we'd like to improve the API (here OR in a future PR), I think making users input page dimensions in pixels would be beneficial.

@tarzzz
Copy link
Contributor Author

tarzzz commented Sep 9, 2019

But what if we'd like to improve the API (here OR in a future PR), I think making users input page dimensions in pixels would be beneficial.

Yes, but this is going to be the part of a maintenance release.. so we should not be introducing breaking change(s) or new features.

If required, We can add the new issue (for dimensions in pixels) as the part of the next release work.

@tarzzz tarzzz merged commit e869f80 into 3.2-release Sep 9, 2019
@antoinerg
Copy link
Collaborator

@tarzzz thanks again for taking on this issue. Could you also make a PR to merge those changes into master?

@tarzzz tarzzz mentioned this pull request Sep 10, 2019
@tarzzz tarzzz deleted the fix-custom-size-arg branch September 10, 2019 13:30
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.

6 participants