Responsive width with fixed height

I’m using Bokeh to plot Gantt charts on a web page. I’m using a categorical axis on the y axis and a timeseries on the x axis. My charts are always one day long but they have varying amount of categorical variables (let’s say between 5 and 100). I’m manually setting the plot height at an optimal height that makes the categorical variable labels and glyph readable while keeping the chart as short in height as possible. I want the plot to be responsive and take the full width of the window but keep the height I set. I’m currently using responsive = True but that maintains aspect ratio and resizes the height. On a narrow window, the categorical variable get too close to each other and on a large window, the plot takes too much height.

From what I could understand in the discussion here (API - Name the responsive modes. · Issue #4396 · bokeh/bokeh · GitHub), this would be called stretch_width and is not currently supported. Is it planned to add this in a future version soon ? Until then, does anyone have a workaround to share ? I’m thinking that there must be a way in javascript to set the plot fixed, listen to window resize events and manually resize the plot width and keep the height fixed.

Hi,

This definitely won't be in 0.12.5 but it might be possible for a 0.12.6 release. One reason it probably has not been done is that I don't actually see any issues for following up and implementing those missing modes. Can you make a GH issue for this feature request?

  Issues · bokeh/bokeh · GitHub

Thanks,

Bryan

···

On Feb 23, 2017, at 22:56, [email protected] wrote:

I'm using Bokeh to plot Gantt charts on a web page. I'm using a categorical axis on the y axis and a timeseries on the x axis. My charts are always one day long but they have varying amount of categorical variables (let's say between 5 and 100). I'm manually setting the plot height at an optimal height that makes the categorical variable labels and glyph readable while keeping the chart as short in height as possible. I want the plot to be responsive and take the full width of the window but keep the height I set. I'm currently using responsive = True but that maintains aspect ratio and resizes the height. On a narrow window, the categorical variable get too close to each other and on a large window, the plot takes too much height.

From what I could understand in the discussion here (Issues · bokeh/bokeh · GitHub), this would be called stretch_width and is not currently supported. Is it planned to add this in a future version soon ? Until then, does anyone have a workaround to share ? I'm thinking that there must be a way in javascript to set the plot fixed, listen to window resize events and manually resize the plot width and keep the height fixed.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/58d5169a-9d15-48f5-8346-06cef9baa2eb%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.