Last active
April 25, 2021 16:58
-
-
Save imgVOID/38e12ee7e22deb93444bcbd18bd7b208 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Установка ссылки на библиотеку D3: | |
d3_lib_url = "https://d3js.org/d3.v3.min.js" | |
# Определение JavaScript-функции при помощи Python-строки: | |
js_string = “”” | |
function draw_circle(div_id, data){ | |
d3.select(div_id) | |
.append("div") | |
.style("width", "50px") | |
.style("height", "50px") | |
.style("background-color", data.color) | |
.style("border-radius", "50px") | |
} | |
“”” | |
# Исполнение кода с использованием notebookjs: | |
from notebookjs import execute_js | |
execute_js([d3_lib_url, draw_circle_lib], "draw_circle", {"color": "#4682B4"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment