changxin commited on
Commit
30b56d3
·
1 Parent(s): 9be8409

Create new file

Browse files
Files changed (1) hide show
  1. templates/nb_jupyter_globe.html +46 -0
templates/nb_jupyter_globe.html ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script>
2
+ require.config({
3
+ paths: {
4
+ {{ config_items | join(', ') }}
5
+ }
6
+ });
7
+ </script>
8
+
9
+ {% for chart in charts %}
10
+ <div id="{{ chart.chart_id }}" style="width:{{ chart.width }}; height:{{ chart.height }};"></div>
11
+ {% endfor %}
12
+
13
+
14
+ <script>
15
+ require([{{ libraries | join(', ') }}], function(echarts) {
16
+ {% for c in charts %}
17
+ var canvas_{{ c.chart_id }} = document.createElement('canvas');
18
+ var mapChart_{{ c.chart_id }} = echarts.init(
19
+ canvas_{{ c.chart_id }}, '{{ c.theme }}', {width: 4096, height: 2048, renderer: '{{ c.renderer }}'});
20
+ var mapOption_{{ c.chart_id }} = {{ c.json_contents }};
21
+ mapChart_{{ c.chart_id }}.setOption(mapOption_{{ c.chart_id }});
22
+ var chart_{{ c.chart_id }} = echarts.init(
23
+ document.getElementById('{{ c.chart_id }}'), '{{ c.theme }}', {renderer: '{{ c.renderer }}'});
24
+ {% for js in c.js_functions.items %}
25
+ {{ js }}
26
+ {% endfor %}
27
+ var option_{{ c.chart_id }} = {
28
+ "globe": {
29
+ "show": true,
30
+ "baseTexture": mapChart_{{ c.chart_id }},
31
+ shading: 'lambert',
32
+ light: {
33
+ ambient: {
34
+ intensity: 0.6
35
+ },
36
+ main: {
37
+ intensity: 0.2
38
+ }
39
+ }
40
+
41
+ }};
42
+ chart_{{ c.chart_id }}.setOption(option_{{ c.chart_id }});
43
+ {% endfor %}
44
+ });
45
+ </script>
46
+ Footer