hafen / trelliscopejs

TrelliscopeJS R Package
https://hafen.github.io/trelliscopejs
Other
263 stars 36 forks source link

Custom themes, optimizations for trelliscope browser component #41

Closed jmw86069 closed 3 years ago

jmw86069 commented 7 years ago

Is there mechanism to customize the trelliscope framework around the panels? E.g. coloring the panels, sizing the fonts, etc.? I noticed the display renders on mobile devices but the font sizes are out of proportion.

I have a fairly large number of panels, in a browser setting anyway, so anything that could be optimized in terms of the sidebar elements would be helpful. For example, an option not to list all elements of a categorical variable, if that variable may contain hundreds of values. I like that the panels are created upfront and only loaded when needed, but there is definitely a ceiling to the number of elements that can be included overall.

And when using rbokeh panels (which are great by the way!) the rendering is sometimes a bit slow, so anything that avoids rendering the same panels again, e.g. while configuring the sidebar, would be helpful. It would be acceptable for the sidebar to overlap the panels rather than having the panels shrunk down and re-rendered.

Anyway, thanks so much for the tools, these are great! Any tips or insights would be very helpful!

hafen commented 7 years ago

These are all good questions / ideas.

I have some rough work under way to handle a large number of panels. The downside of not pre-rendering the panels is you become dependent on having R run as a server, which can make things more difficult to deploy, but it's just a tradeoff.

As far as customizing the panels, it is completely up to you to specify what gets plotted inside each panel, so you can customize all you want in that regard. Depending on the plotting mechanism you use, the font size thing will be an issue. If you are using ggplot2, since it generates raster images, the font shrinks with the panel size. That doesn't happen with rbokeh but there will be some updates there (a little way off) that should help with this.

For dealing with a lot of categorical values, I believe it does have a limit right now but I'll have to check.

I unfortunately don't know how to speed up rbokeh panel rendering. I've been wanting to look into pre-caching the upcoming pages but I'm not sure if that will result in much of a speedup. Ideally we don't want the panels to have to re-render when getting resized, but there is a quirk with resizing htmlwidgets right now that I haven't been able to work around so I just redraw.

jmw86069 commented 3 years ago

I will close this issue, I appreciate using trelliscopejs as it is :) so no need to keep this enhancement request open. Thanks again for this package!

hafen commented 3 years ago

Thanks! FWIW there may be some developments that will allow me to have some more time to work on this and I have made a note of this as something to consider.