I have a script that is like this:
<div id="foo"></div>
<script>
var foo;
bar()
function bar() {
var config = {
a: "foo",
b: "string",
otherConfig1: ...
otherConfig2: ...
...
}
foo = new NeoVis.default(config)
foo.render();
console.log(foo);
}
</script>
I want to have 8 more pieces of this, with different foo
, bar
and string
. The otherConfig
s are unchanged. I can simply duplicate them, but since the otherConfig
s are very long, I would like to do this smarter. I have read about constructor, but since the function doesn't have any argument, I don't know how to apply this. I also try to move the config
object outside of the function, but it seems that the code wouldn't run.
Neovis is a library. I also ask this on Neovis's Github: How to have multiple divs with different initial Cypher query?