Skip to content

using d3 in anywidget #3740

Answered by cornhundred
cornhundred asked this question in Q&A
Discussion options

You must be logged in to vote

The solution is

import anywidget

class D3Widget(anywidget.AnyWidget):
    _esm = """

    import * as d3 from "https://esm.sh/d3@7";

    export function render({ model, el }) {

    console.log('something')
    console.log(d3)

    }
    """
    _css="""
    """

D3Widget()

from here manzt/anywidget#191

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cornhundred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant