Skip to content

Access network instance from script #463

@cboulanger

Description

@cboulanger

Hi,

I want to manipulate the vis.Network instance in the browser runtime generated by visNetwork from a script that gets injected into the page. The only way to access the object I found in the source was like this:

const container = document.getElementsByClassName("vis-network")[0]
const network = container.parentElement.chart

Isn't there a more elegant way that is not dependend on inspecting the DOM? If not, shouldn't there be one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions