Skip to content

Commit eae7a44

Browse files
committed
feat: update chart variable name
1 parent 267ffc0 commit eae7a44

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name = py-vchart
77
description = python visualization sdk for @visactor/vchart
88
author = VisActor
9-
author-email = VisActor
9+
author-email = xuanhun521@126.com
1010
license = mit
1111
long-description = file: README.rst
1212
long-description-content-type = text/x-rst; charset=UTF-8

src/pyvchart/templates/jupyter_lab.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="vis-arco-chart-wrap">
2-
<div id="arco_{{ chart.chart_id }}" style="width: {{chart.width}}; height: {{chart.height}}">
1+
<div class="vis-actor-chart-wrap">
2+
<div id="vis-actor-{{ chart.chart_id }}" style="width: {{chart.width}}; height: {{chart.height}}">
33
</div>
44
<script>
55
// -> 这里代码请使用es5来写
@@ -55,13 +55,12 @@
5555

5656
function render(data_source) {
5757
console.log('data_source', data_source);
58-
let chart = new window.VChart.default("arco_{{chart.chart_id}}", data_source);
59-
let teaColor = {{ chart.colors | safe
60-
}}
61-
chart.setColors(teaColor);
58+
let chart = new window.VChart.default("vis-actor-{{chart.chart_id}}", data_source);
59+
let defaultColor = {{ chart.colors | safe}}
60+
chart.setColors(defaultColor);
6261
chart.renderAsync();
6362
// 移除.jp-RenderedHTMLCommon 对Table的样式, chart 的Tooltip是个Table
64-
let target = document.querySelector("#arco_{{chart.chart_id}}").parentNode.parentNode;
63+
let target = document.querySelector("#vis-actor-{{chart.chart_id}}").parentNode.parentNode;
6564
let classList = target.getAttribute("class");
6665
let ignoreList = ['rendered_html', 'jp-RenderedHTMLCommon'];
6766
let newClassList = classList;
@@ -88,7 +87,7 @@
8887
body > .jp-Notebook-cell.jp-mod-noInput > .jp-Cell-outputWrapper > .jp-Cell-outputArea,
8988
body > .jp-Notebook-cell.jp-mod-noInput > .jp-Cell-outputWrapper > .jp-Cell-outputArea > .jp-OutputArea-child,
9089
body > .jp-Notebook-cell.jp-mod-noInput > .jp-Cell-outputWrapper > .jp-Cell-outputArea > .jp-OutputArea-child > .jp-OutputArea-executeResult,
91-
body > .jp-Notebook-cell.jp-mod-noInput > .jp-Cell-outputWrapper > .jp-Cell-outputArea > .jp-OutputArea-child > .jp-OutputArea-executeResult > .vis-arco-chart-wrap {
90+
body > .jp-Notebook-cell.jp-mod-noInput > .jp-Cell-outputWrapper > .jp-Cell-outputArea > .jp-OutputArea-child > .jp-OutputArea-executeResult > .vis-actor-chart-wrap {
9291
height: 100%;
9392
}
9493
body {

0 commit comments

Comments
 (0)