forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 0
Use of the query string in url to control plot properties
Almar Klein edited this page Apr 21, 2016
·
2 revisions
This page is meant to collect ideas, and arguments in favor/against the use of the query string to control plot properties. This feature was introduced to control/override the use of WebGL. We should determine whether the use-cases are strong enough to justify using the feature for other this as well. Related issue: https://github.com/bokeh/bokeh/issues/2591
Everyone should feel free to add their own ideas and visions here.
http://x.y/path/to/page.html?webgl=1
Implementation is not very difficult. E.g. for webgl:
if @mget('webgl') or window.location.search.indexOf('webgl=1') > 0
if window.location.search.indexOf('webgl=0') == -1
@init_webgl()
- Overriding WebGL usage: WebGL is in principal enabled/disabled by the author of a visualization. However, a user may want to turn it on in case there are a lot of data points, or off, e.g. when the GL driver is causing a wrong visualization. (It is also a great feature to use during development of the webgl stuff, but that's hardly an argument to have this as a public feature.)
- Overriding level of detail: following the same arguments (the person writing the visualization does not know on what hardware the plot will be visualized), the person viewing a plot may have legitimate reasons to control parameters related to level of detail.
- [SB] Provide an alternative initial view: If parameters like axis ranges could be controlled this way, users could create links to plots that show a specific region of the data.
- Enable additional tools: a user could use this to enable additional tools. Though you can also argue that the person who writes the visualization should determine what tools are available to interact with the data in the best way.
-
Name clashes: If a plot is used in a web application, then adding query parameters to the url can be problematic for the server. To avoid name clashes and make it easy for the server side to filter out bokeh-specific query parameters, the parameters can (optionally) be prefixed, e.g.
bokeh-webl=1
,bokeh-lod=20
. - It's a bit weird?: I am not a web dev, but AFAIK query parameters are typically consumed by the server, in this case they are picked up by the JS.