netjsongraph.js icon indicating copy to clipboard operation
netjsongraph.js copied to clipboard

menu/anchor's for configuring graph

Open bittorf opened this issue 10 years ago • 2 comments

because there is no "perfect fit for everybody" we should make sure, that all the settings can be configured via the URL, e.g.

.../netjson.html#show_labels=true&linestyle=spline

AND also have a menu (e.g. via show_menu=true) where one can play with the values.

bittorf avatar Aug 27 '15 07:08 bittorf

Basti, the idea is great, but configuring params of a JS library via URLs is quite unusual :-)

I would like to keep netjsongraph.js configurable via parameters and JS functions. In the future me or somebody else might develop a simple webapp based on netjsongraph.js which might be customized in other ways (via a webinterface for example).. what do you think?

nemesifier avatar Aug 27 '15 14:08 nemesifier

hmmm, maybe it's unusual - but i cannot say the reason why:

http://stackoverflow.com/questions/11582512/how-to-get-url-parameters-with-javascript/11582513#11582513

function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/+/g, '%20'))||null }

myvar = getURLParameter('myvar');

this is cool, is'nt it? (and it avoid updating the files on the webserver over and over again...)

bittorf avatar Aug 27 '15 14:08 bittorf