def _render_to_notebook(chart: RectChart) -> HTML: chart._prepare_render() require_config = utils.produce_require_dict(chart.js_dependencies, chart.js_host) return HTML(RenderEngine().render_chart_to_notebook( template_name="jupyter_notebook.html", charts=(chart, ), config_items=require_config["config_items"], libraries=require_config["libraries"]))
def test_utils_produce_require_dict(): cfg = utils.produce_require_dict(utils.OrderedSet("echarts"), "https://example.com") eq_(cfg["config_items"], ["'echarts':'https://example.comecharts.min'"]) eq_(cfg["libraries"], ["'echarts'"])