GordonSmith / vscode-ojs

VS Code extension for ObservableHQ notebooks
https://marketplace.visualstudio.com/items?itemName=GordonSmith.observable-js
MIT License
58 stars 5 forks source link

Narrow notebook content width in exported html webpage view #26

Closed RandomFractals closed 3 years ago

RandomFractals commented 3 years ago

Hi Gordon,

I tried your new html export option. I like the styles you added for objects and arrays display.

However, I got very narrow webpage view when opening it in FireFox:

image

and Chrome:

image

I will try other notebooks.

RandomFractals commented 3 years ago

changing #placeholder max-width css property to 1080px fixes it :slightly_smiling_face:

    #placeholder {
        position: absolute;
        left: 8px;
        top: 8px;
        right: 8px;
        bottom: 8px;
        max-width: 1080px;
    }
RandomFractals commented 3 years ago

actually, I removed that max-width css setting completely to see a larger map on a wider screen:

image

Not sure if you want to do the same for all html exports.

Thanks!

GordonSmith commented 3 years ago

FYI those styles simply matched the Observable web site at the time (but not centered) - as you have probably worked out now, the html export is really just a demo, once you see that the "widget" is simply loading the ojs text or omd text then you can create your own web site drived from your own DB server etc.

BTW the export isn't new, its been there from day one pretty much...

GordonSmith commented 3 years ago

Further - I had raised an issue with Mike Bostock re the default width on the website being too narrow and his response was that its harder to read the text when its gets beyond a certain number of words per line...

RandomFractals commented 3 years ago

that's fine. I would just make the change I suggested in your html exports. up to you.

GordonSmith commented 3 years ago

If you want to make the width configurable within the @hpcc-js/observable-md "widget", please open a ticket here: https://github.com/hpcc-systems/Visualization/issues

RandomFractals commented 3 years ago

I am not familiar with what you refer to as widgets and that repo. I know you use it for this extension. Maybe just clip this one there with more info if needed.

GordonSmith commented 3 years ago

Sure. FWIW the Widget in question is what renders the raw text in a web page - normally the widgets adjust to the hosting DIV width and height.